Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion autoload.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

require_once dirname(__FILE__).'/lib/autoload/sfCoreAutoload.class.php';
require_once __DIR__.'/lib/autoload/sfCoreAutoload.class.php';

sfCoreAutoload::register();
2 changes: 1 addition & 1 deletion data/bin/changelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @version SVN: $Id$
*/
require_once dirname(__FILE__).'/../../lib/task/sfFilesystem.class.php';
require_once __DIR__.'/../../lib/task/sfFilesystem.class.php';

if (!isset($argv[1]))
{
Expand Down
8 changes: 4 additions & 4 deletions data/bin/release.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @version SVN: $Id$
*/
require_once(dirname(__FILE__).'/../../lib/exception/sfException.class.php');
require_once(dirname(__FILE__).'/../../lib/task/sfFilesystem.class.php');
require_once(dirname(__FILE__).'/../../lib/util/sfFinder.class.php');
require_once(dirname(__FILE__).'/../../lib/vendor/lime/lime.php');
require_once(__DIR__.'/../../lib/exception/sfException.class.php');
require_once(__DIR__.'/../../lib/task/sfFilesystem.class.php');
require_once(__DIR__.'/../../lib/util/sfFinder.class.php');
require_once(__DIR__.'/../../lib/vendor/lime/lime.php');

if (!isset($argv[1]))
{
Expand Down
6 changes: 3 additions & 3 deletions data/bin/sandbox_installer.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

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

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

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

$this->logSection('install', 'default to sqlite');
$this->runTask('configure:database', sprintf("'sqlite:%s/sandbox.db'", sfConfig::get('sf_data_dir')));
Expand Down
4 changes: 2 additions & 2 deletions data/bin/symfony
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ if (file_exists('config/ProjectConfiguration.class.php'))
}
else
{
if (is_readable(dirname(__FILE__).'/../../lib/autoload/sfCoreAutoload.class.php'))
if (is_readable(__DIR__.'/../../lib/autoload/sfCoreAutoload.class.php'))
{
// SVN
$dir = realpath(dirname(__FILE__).'/../../lib');
$dir = realpath(__DIR__.'/../../lib');
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions lib/autoload/sfCoreAutoload.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class sfCoreAutoload

protected function __construct()
{
$this->baseDir = realpath(dirname(__FILE__).'/..');
$this->baseDir = realpath(__DIR__.'/..');
}

/**
Expand Down Expand Up @@ -141,7 +141,7 @@ public function getBaseDir()
*/
static public function make()
{
$libDir = str_replace(DIRECTORY_SEPARATOR, '/', realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'..'));
$libDir = str_replace(DIRECTORY_SEPARATOR, '/', realpath(__DIR__.DIRECTORY_SEPARATOR.'..'));
require_once $libDir.'/util/sfFinder.class.php';

$files = sfFinder::type('file')
Expand Down
2 changes: 1 addition & 1 deletion lib/cache/sfCache.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function initialize($options = array())
$this->options = array_merge(array(
'automatic_cleaning_factor' => 1000,
'lifetime' => 86400,
'prefix' => md5(dirname(__FILE__)),
'prefix' => md5(__DIR__),
), $options);

$this->options['prefix'] .= self::SEPARATOR;
Expand Down
8 changes: 4 additions & 4 deletions lib/command/cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
*/

// Try autoloading using composer if available.
if (!file_exists($autoload = dirname(__FILE__).'/../../../../autoload.php'))
if (!file_exists($autoload = __DIR__.'/../../../../autoload.php'))
{
$autoload = dirname(__FILE__).'/../../autoload.php';
$autoload = __DIR__.'/../../autoload.php';
}

// Fall back to classic Symfony loading
if (!file_exists($autoload))
{
require_once(dirname(__FILE__).'/../autoload/sfCoreAutoload.class.php');
require_once(__DIR__.'/../autoload/sfCoreAutoload.class.php');
sfCoreAutoload::register();
}
else
Expand All @@ -30,7 +30,7 @@
$dispatcher = new sfEventDispatcher();
$logger = new sfCommandLogger($dispatcher);

$application = new sfSymfonyCommandApplication($dispatcher, null, array('symfony_lib_dir' => realpath(dirname(__FILE__).'/..')));
$application = new sfSymfonyCommandApplication($dispatcher, null, array('symfony_lib_dir' => realpath(__DIR__.'/..')));
$statusCode = $application->run();
}
catch (Exception $e)
Expand Down
2 changes: 1 addition & 1 deletion lib/config/sfProjectConfiguration.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct($rootDir = null, sfEventDispatcher $dispatcher = nul
}

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

ini_set('magic_quotes_runtime', 'off');
Expand Down
2 changes: 1 addition & 1 deletion lib/controller/default/templates/disabledSuccess.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php decorate_with(dirname(__FILE__).'/defaultLayout.php') ?>
<?php decorate_with(__DIR__.'/defaultLayout.php') ?>

<div class="sfTMessageContainer sfTAlert">
<?php echo image_tag('/sf/sf_default/images/icons/disabled48.png', array('alt' => 'module disabled', 'class' => 'sfTMessageIcon', 'size' => '48x48')) ?>
Expand Down
2 changes: 1 addition & 1 deletion lib/controller/default/templates/error404Success.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php decorate_with(dirname(__FILE__).'/defaultLayout.php') ?>
<?php decorate_with(__DIR__.'/defaultLayout.php') ?>

<div class="sfTMessageContainer sfTAlert">
<?php echo image_tag('/sf/sf_default/images/icons/cancel48.png', array('alt' => 'page not found', 'class' => 'sfTMessageIcon', 'size' => '48x48')) ?>
Expand Down
2 changes: 1 addition & 1 deletion lib/controller/default/templates/indexSuccess.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php decorate_with(dirname(__FILE__).'/defaultLayout.php') ?>
<?php decorate_with(__DIR__.'/defaultLayout.php') ?>

<div class="sfTMessageContainer sfTMessage">
<?php echo image_tag('/sf/sf_default/images/icons/ok48.png', array('alt' => 'ok', 'class' => 'sfTMessageIcon', 'size' => '48x48')) ?>
Expand Down
2 changes: 1 addition & 1 deletion lib/controller/default/templates/loginSuccess.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php decorate_with(dirname(__FILE__).'/defaultLayout.php') ?>
<?php decorate_with(__DIR__.'/defaultLayout.php') ?>

<div class="sfTMessageContainer sfTLock">
<?php echo image_tag('/sf/sf_default/images/icons/lock48.png', array('alt' => 'login required', 'class' => 'sfTMessageIcon', 'size' => '48x48')) ?>
Expand Down
2 changes: 1 addition & 1 deletion lib/controller/default/templates/moduleSuccess.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php decorate_with(dirname(__FILE__).'/defaultLayout.php') ?>
<?php decorate_with(__DIR__.'/defaultLayout.php') ?>

<div class="sfTMessageContainer sfTMessage">
<?php echo image_tag('/sf/sf_default/images/icons/ok48.png', array('alt' => 'module created', 'class' => 'sfTMessageIcon', 'size' => '48x48')) ?>
Expand Down
2 changes: 1 addition & 1 deletion lib/controller/default/templates/secureSuccess.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php decorate_with(dirname(__FILE__).'/defaultLayout.php') ?>
<?php decorate_with(__DIR__.'/defaultLayout.php') ?>

<div class="sfTMessageContainer sfTLock">
<?php echo image_tag('/sf/sf_default/images/icons/lock48.png', array('alt' => 'credentials required', 'class' => 'sfTMessageIcon', 'size' => '48x48')) ?>
Expand Down
2 changes: 1 addition & 1 deletion lib/exception/sfException.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ static public function getTemplatePathForError($format, $debug)
$templatePaths = array(
sfConfig::get('sf_app_config_dir').'/error',
sfConfig::get('sf_config_dir').'/error',
dirname(__FILE__).'/data',
__DIR__.'/data',
);

$template = sprintf('%s.%s.php', $debug ? 'exception' : 'error', $format);
Expand Down
2 changes: 1 addition & 1 deletion lib/helper/DateHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function distance_of_time_in_words($from_time, $to_time = null, $include_seconds

if (sfConfig::get('sf_i18n'))
{
require_once dirname(__FILE__).'/I18NHelper.php';
require_once __DIR__.'/I18NHelper.php';

return __($string, $parameters);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/i18n/Gettext/MO.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @license PHP License
*/

require_once dirname(__FILE__).'/TGettext.class.php';
require_once __DIR__.'/TGettext.class.php';

/**
* File_Gettext_MO
Expand Down Expand Up @@ -334,4 +334,4 @@ function save($file = null)
@fclose($this->_handle);
return true;
}
}
}
4 changes: 2 additions & 2 deletions lib/i18n/Gettext/PO.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @license PHP License
*/

require_once dirname(__FILE__).'/TGettext.class.php';
require_once __DIR__.'/TGettext.class.php';

/**
* File_Gettext_PO
Expand Down Expand Up @@ -140,4 +140,4 @@ function save($file = null)
@fclose($fh);
return true;
}
}
}
10 changes: 5 additions & 5 deletions lib/i18n/Gettext/TGettext.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class TGettext
static function factory($format, $file = '')
{
$format = strToUpper($format);
$filename = dirname(__FILE__).'/'.$format.'.php';
$filename = __DIR__.'/'.$format.'.php';
if (is_file($filename) == false)
throw new Exception ("Class file $file not found");

Expand Down Expand Up @@ -112,7 +112,7 @@ function poFile2moFile($pofile, $mofile)
throw new Exception("File $pofile doesn't exist.");
}

include_once dirname(__FILE__).'/PO.php';
include_once __DIR__.'/PO.php';

$PO = new TGettext_PO($pofile);
if (true !== ($e = $PO->load())) {
Expand Down Expand Up @@ -248,7 +248,7 @@ function fromArray($array)
*/
function toMO()
{
include_once dirname(__FILE__).'/MO.php';
include_once __DIR__.'/MO.php';
$MO = new TGettext_MO;
$MO->fromArray($this->toArray());
return $MO;
Expand All @@ -262,9 +262,9 @@ function toMO()
*/
function toPO()
{
include_once dirname(__FILE__).'/PO.php';
include_once __DIR__.'/PO.php';
$PO = new TGettext_PO;
$PO->fromArray($this->toArray());
return $PO;
}
}
}
2 changes: 1 addition & 1 deletion lib/i18n/sfCultureInfo.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public function __construct($culture = 'en')
*/
protected static function dataDir()
{
return dirname(__FILE__).'/data/';
return __DIR__.'/data/';
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/task/generator/sfGenerateAppTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

require_once(dirname(__FILE__).'/sfGeneratorBaseTask.class.php');
require_once(__DIR__.'/sfGeneratorBaseTask.class.php');

/**
* Generates a new application.
Expand Down Expand Up @@ -101,7 +101,7 @@ protected function execute($arguments = array(), $options = array())
}
else
{
$skeletonDir = dirname(__FILE__).'/skeleton/app';
$skeletonDir = __DIR__.'/skeleton/app';
}

// Create basic application structure
Expand Down
4 changes: 2 additions & 2 deletions lib/task/generator/sfGenerateModuleTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

require_once(dirname(__FILE__).'/sfGeneratorBaseTask.class.php');
require_once(__DIR__.'/sfGeneratorBaseTask.class.php');

/**
* Generates a new module.
Expand Down Expand Up @@ -96,7 +96,7 @@ protected function execute($arguments = array(), $options = array())
}
else
{
$skeletonDir = dirname(__FILE__).'/skeleton/module';
$skeletonDir = __DIR__.'/skeleton/module';
}

// create basic application structure
Expand Down
8 changes: 4 additions & 4 deletions lib/task/generator/sfGenerateProjectTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

require_once(dirname(__FILE__).'/sfGeneratorBaseTask.class.php');
require_once(__DIR__.'/sfGeneratorBaseTask.class.php');

/**
* Generates a new project.
Expand Down Expand Up @@ -104,11 +104,11 @@ protected function execute($arguments = array(), $options = array())
$this->options = $options;

// create basic project structure
$this->installDir(dirname(__FILE__).'/skeleton/project');
$this->installDir(__DIR__.'/skeleton/project');

// update ProjectConfiguration class (use a relative path when the symfony core is nested within the project)
$symfonyCoreAutoload = 0 === strpos(sfConfig::get('sf_symfony_lib_dir'), sfConfig::get('sf_root_dir')) ?
sprintf('dirname(__FILE__).\'/..%s/autoload/sfCoreAutoload.class.php\'', str_replace(sfConfig::get('sf_root_dir'), '', sfConfig::get('sf_symfony_lib_dir'))) :
sprintf('__DIR__.\'/..%s/autoload/sfCoreAutoload.class.php\'', str_replace(sfConfig::get('sf_root_dir'), '', sfConfig::get('sf_symfony_lib_dir'))) :
var_export(sfConfig::get('sf_symfony_lib_dir').'/autoload/sfCoreAutoload.class.php', true);

$this->replaceTokens(array(sfConfig::get('sf_config_dir')), array('SYMFONY_CORE_AUTOLOAD' => str_replace('\\', '/', $symfonyCoreAutoload)));
Expand All @@ -125,7 +125,7 @@ protected function execute($arguments = array(), $options = array())
// execute the choosen ORM installer script
if (in_array($options['orm'], array('Doctrine')))
{
include dirname(__FILE__).'/../../plugins/sf'.$options['orm'].'Plugin/config/installer.php';
include __DIR__.'/../../plugins/sf'.$options['orm'].'Plugin/config/installer.php';
}

// execute a custom installer
Expand Down
2 changes: 1 addition & 1 deletion lib/task/generator/skeleton/app/web/index.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

##IP_CHECK##
require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');
require_once(__DIR__.'/../config/ProjectConfiguration.class.php');

$configuration = ProjectConfiguration::getApplicationConfiguration('##APP_NAME##', '##ENVIRONMENT##', ##IS_DEBUG##);
sfContext::createInstance($configuration)->dispatch();
2 changes: 1 addition & 1 deletion lib/task/generator/skeleton/module/test/actionsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

include(dirname(__FILE__).'/../../bootstrap/functional.php');
include(__DIR__.'/../../bootstrap/functional.php');

$browser = new sfTestFunctional(new sfBrowser());

Expand Down
4 changes: 2 additions & 2 deletions lib/task/generator/skeleton/project/symfony
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
* file that was distributed with this source code.
*/

chdir(dirname(__FILE__));
require_once(dirname(__FILE__).'/config/ProjectConfiguration.class.php');
chdir(__DIR__);
require_once(__DIR__.'/config/ProjectConfiguration.class.php');
include(sfCoreAutoload::getInstance()->getBaseDir().'/command/cli.php');
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
$app = array_pop($dirPieces);
}

require_once dirname(__FILE__).'/../../config/ProjectConfiguration.class.php';
require_once __DIR__.'/../../config/ProjectConfiguration.class.php';
$configuration = ProjectConfiguration::getApplicationConfiguration($app, 'test', isset($debug) ? $debug : true);
sfContext::createInstance($configuration);

Expand Down
4 changes: 2 additions & 2 deletions lib/task/generator/skeleton/project/test/bootstrap/unit.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
* file that was distributed with this source code.
*/

$_test_dir = realpath(dirname(__FILE__).'/..');
$_test_dir = realpath(__DIR__.'/..');

// configuration
require_once dirname(__FILE__).'/../../config/ProjectConfiguration.class.php';
require_once __DIR__.'/../../config/ProjectConfiguration.class.php';
$configuration = ProjectConfiguration::hasActive() ? ProjectConfiguration::getActive() : new ProjectConfiguration(realpath($_test_dir.'/..'));

// autoloader
Expand Down
2 changes: 1 addition & 1 deletion lib/task/plugin/sfPluginAddChannelTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

require_once(dirname(__FILE__).'/sfPluginBaseTask.class.php');
require_once(__DIR__.'/sfPluginBaseTask.class.php');

/**
* Installs a plugin.
Expand Down
2 changes: 1 addition & 1 deletion lib/task/plugin/sfPluginInstallTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

require_once(dirname(__FILE__).'/sfPluginBaseTask.class.php');
require_once(__DIR__.'/sfPluginBaseTask.class.php');

/**
* Installs a plugin.
Expand Down
Loading