Skip to content

Commit d29d360

Browse files
committed
Merge pull request #57 from mentalstring/master
Replace `dirname(__FILE__)` by `__DIR__` since PHP 5.3.4 is required
2 parents d66b253 + 0db6172 commit d29d360

File tree

269 files changed

+448
-448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

269 files changed

+448
-448
lines changed

autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
22

3-
require_once dirname(__FILE__).'/lib/autoload/sfCoreAutoload.class.php';
3+
require_once __DIR__.'/lib/autoload/sfCoreAutoload.class.php';
44

55
sfCoreAutoload::register();

data/bin/changelog.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
1818
* @version SVN: $Id$
1919
*/
20-
require_once dirname(__FILE__).'/../../lib/task/sfFilesystem.class.php';
20+
require_once __DIR__.'/../../lib/task/sfFilesystem.class.php';
2121

2222
if (!isset($argv[1]))
2323
{

data/bin/release.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
1818
* @version SVN: $Id$
1919
*/
20-
require_once(dirname(__FILE__).'/../../lib/exception/sfException.class.php');
21-
require_once(dirname(__FILE__).'/../../lib/task/sfFilesystem.class.php');
22-
require_once(dirname(__FILE__).'/../../lib/util/sfFinder.class.php');
23-
require_once(dirname(__FILE__).'/../../lib/vendor/lime/lime.php');
20+
require_once(__DIR__.'/../../lib/exception/sfException.class.php');
21+
require_once(__DIR__.'/../../lib/task/sfFilesystem.class.php');
22+
require_once(__DIR__.'/../../lib/util/sfFinder.class.php');
23+
require_once(__DIR__.'/../../lib/vendor/lime/lime.php');
2424

2525
if (!isset($argv[1]))
2626
{

data/bin/sandbox_installer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

3-
$this->installDir(dirname(__FILE__).'/sandbox_skeleton');
3+
$this->installDir(__DIR__.'/sandbox_skeleton');
44

55
$this->logSection('install', 'add symfony CLI for Windows users');
6-
$this->getFilesystem()->copy(dirname(__FILE__).'/symfony.bat', sfConfig::get('sf_root_dir').'/symfony.bat');
6+
$this->getFilesystem()->copy(__DIR__.'/symfony.bat', sfConfig::get('sf_root_dir').'/symfony.bat');
77

88
$this->logSection('install', 'add LICENSE');
9-
$this->getFilesystem()->copy(dirname(__FILE__).'/../../LICENSE', sfConfig::get('sf_root_dir').'/LICENSE');
9+
$this->getFilesystem()->copy(__DIR__.'/../../LICENSE', sfConfig::get('sf_root_dir').'/LICENSE');
1010

1111
$this->logSection('install', 'default to sqlite');
1212
$this->runTask('configure:database', sprintf("'sqlite:%s/sandbox.db'", sfConfig::get('sf_data_dir')));

data/bin/symfony

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ if (file_exists('config/ProjectConfiguration.class.php'))
1717
}
1818
else
1919
{
20-
if (is_readable(dirname(__FILE__).'/../../lib/autoload/sfCoreAutoload.class.php'))
20+
if (is_readable(__DIR__.'/../../lib/autoload/sfCoreAutoload.class.php'))
2121
{
2222
// SVN
23-
$dir = realpath(dirname(__FILE__).'/../../lib');
23+
$dir = realpath(__DIR__.'/../../lib');
2424
}
2525
else
2626
{

lib/autoload/sfCoreAutoload.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class sfCoreAutoload
3636

3737
protected function __construct()
3838
{
39-
$this->baseDir = realpath(dirname(__FILE__).'/..');
39+
$this->baseDir = realpath(__DIR__.'/..');
4040
}
4141

4242
/**
@@ -141,7 +141,7 @@ public function getBaseDir()
141141
*/
142142
static public function make()
143143
{
144-
$libDir = str_replace(DIRECTORY_SEPARATOR, '/', realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'..'));
144+
$libDir = str_replace(DIRECTORY_SEPARATOR, '/', realpath(__DIR__.DIRECTORY_SEPARATOR.'..'));
145145
require_once $libDir.'/util/sfFinder.class.php';
146146

147147
$files = sfFinder::type('file')

lib/cache/sfCache.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function initialize($options = array())
5757
$this->options = array_merge(array(
5858
'automatic_cleaning_factor' => 1000,
5959
'lifetime' => 86400,
60-
'prefix' => md5(dirname(__FILE__)),
60+
'prefix' => md5(__DIR__),
6161
), $options);
6262

6363
$this->options['prefix'] .= self::SEPARATOR;

lib/command/cli.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
*/
1010

1111
// Try autoloading using composer if available.
12-
if (!file_exists($autoload = dirname(__FILE__).'/../../../../autoload.php'))
12+
if (!file_exists($autoload = __DIR__.'/../../../../autoload.php'))
1313
{
14-
$autoload = dirname(__FILE__).'/../../autoload.php';
14+
$autoload = __DIR__.'/../../autoload.php';
1515
}
1616

1717
// Fall back to classic Symfony loading
1818
if (!file_exists($autoload))
1919
{
20-
require_once(dirname(__FILE__).'/../autoload/sfCoreAutoload.class.php');
20+
require_once(__DIR__.'/../autoload/sfCoreAutoload.class.php');
2121
sfCoreAutoload::register();
2222
}
2323
else
@@ -30,7 +30,7 @@
3030
$dispatcher = new sfEventDispatcher();
3131
$logger = new sfCommandLogger($dispatcher);
3232

33-
$application = new sfSymfonyCommandApplication($dispatcher, null, array('symfony_lib_dir' => realpath(dirname(__FILE__).'/..')));
33+
$application = new sfSymfonyCommandApplication($dispatcher, null, array('symfony_lib_dir' => realpath(__DIR__.'/..')));
3434
$statusCode = $application->run();
3535
}
3636
catch (Exception $e)

lib/config/sfProjectConfiguration.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct($rootDir = null, sfEventDispatcher $dispatcher = nul
4545
}
4646

4747
$this->rootDir = null === $rootDir ? self::guessRootDir() : realpath($rootDir);
48-
$this->symfonyLibDir = realpath(dirname(__FILE__).'/..');
48+
$this->symfonyLibDir = realpath(__DIR__.'/..');
4949
$this->dispatcher = null === $dispatcher ? new sfEventDispatcher() : $dispatcher;
5050

5151
ini_set('magic_quotes_runtime', 'off');

lib/controller/default/templates/disabledSuccess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php decorate_with(dirname(__FILE__).'/defaultLayout.php') ?>
1+
<?php decorate_with(__DIR__.'/defaultLayout.php') ?>
22

33
<div class="sfTMessageContainer sfTAlert">
44
<?php echo image_tag('/sf/sf_default/images/icons/disabled48.png', array('alt' => 'module disabled', 'class' => 'sfTMessageIcon', 'size' => '48x48')) ?>

0 commit comments

Comments
 (0)