Development

Changeset 7322

You must first sign up to be able to contribute.

Changeset 7322

Show
Ignore:
Timestamp:
02/04/08 12:30:06 (8 months ago)
Author:
fabien
Message:

removed sf_symfony_data_dir variable

  • a symfony project only need to know sf_symfony_lib_dir to work
  • sf_symfony_data_dir has been removed from the main config/config.php
  • the main cli script has been moved to lib/command/cli.php (was data/bin/symfony.php)
  • added an upgrade task to upgrade sfCore::bootstrap() signature
  • updated UPGRADE file

This commit is really a transition towards sfConfiguration. Everything works but
more changes will be done in the coming days.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/UPGRADE

    r6824 r7322  
    1010--------------- 
    1111 
    12 To upgrade a project, you first need to upgrade symfony via PEAR or 
    13 change your `config/config.php` to update the symfony directory. 
    14  
    15 Then, you can launch the following task from your project directory to 
    16 perform an automatic upgrade: 
    17  
    18   ./symfony project:upgrade1.1 
    19  
    20 This task can be launched several times without any side effect. Each time 
    21 you upgrade to a new symfony 1.1 beta / RC or the final symfony 1.1, you 
    22 need to launch this task. 
    23  
    24 If you don't plan to upgrade the validation system or all your helpers to 
    25 the new system, you must enable the compatibility mode in `settings.yml`: 
    26  
    27   [yml] 
    28   all: 
    29     .settings: 
    30       compat_10: on 
    31  
    32 Here is a list of the things that will be enabled when switching to the 
    33 compatibility mode (see the bundled `sfCompat10Plugin` plugin for 
    34 more information): 
    35  
    36   * Zend Framework and ezComponents bridges 
    37   * sfProcessCache 
    38   * validation system (validate.yml, validator classes, ...) 
    39   * fill in filter 
    40   * helpers 
    41   * sfMail with phpmailer 
     12To upgrade a project: 
     13 
     14  * Upgrade symfony via PEAR or change your `config/config.php` 
     15    to update the symfony directory. 
     16 
     17  * Update the `symfony` file located in the project root directory 
     18    by changing the line: 
     19 
     20        include($sf_symfony_data_dir.'/bin/symfony.php'); 
     21 
     22    to 
     23 
     24        include($sf_symfony_lib_dir.'/command/cli.php'); 
     25 
     26  * Launch the `project:upgrade1.1` task from your project directory 
     27    to perform an automatic upgrade: 
     28 
     29        $ ./symfony project:upgrade1.1 
     30 
     31    This task can be launched several times without any side effect. Each time 
     32    you upgrade to a new symfony 1.1 beta / RC or the final symfony 1.1, you 
     33    need to launch this task. 
     34 
     35  * If you don't plan to upgrade the validation system or all your helpers to 
     36    the new system, you must enable the compatibility mode in `settings.yml`: 
     37 
     38        [yml] 
     39        all: 
     40          .settings: 
     41            compat_10: on 
     42 
     43    Here is a list of the things that will be enabled when switching to the 
     44    compatibility mode (see the bundled `sfCompat10Plugin` plugin for 
     45    more information): 
     46 
     47      * Zend Framework and ezComponents bridges 
     48      * sfProcessCache 
     49      * validation system (validate.yml, validator classes, ...) 
     50      * fill in filter 
     51      * helpers 
     52      * sfMail with phpmailer 
    4253 
    4354The remaining sections explains backward incompatible changes. 
     
    4859Flash attributes are now managed directly by `sfUser`. New usage: 
    4960 
    50   [php] 
    51   // action 
    52   $this->getUser()->setFlash('notice', 'foo'); 
    53   $notice = $this->getUser()->getFlash('notice'); 
    54  
    55   // template 
    56   <?php $sf_user->hasFlash('notice'): ?> 
    57     <?php echo $sf_user->getFlash('notice') ?> 
    58   <?php endif; ?> 
     61    [php] 
     62    // action 
     63    $this->getUser()->setFlash('notice', 'foo'); 
     64    $notice = $this->getUser()->getFlash('notice'); 
     65 
     66    // template 
     67    <?php $sf_user->hasFlash('notice'): ?> 
     68      <?php echo $sf_user->getFlash('notice') ?> 
     69    <?php endif; ?> 
    5970 
    6071The `flash` entry in `filters.yml` must be removed too as the `sfFlashFilter` 
     
    7384They are accessible from `sfController`: 
    7485 
    75   [php] 
    76   // action 
    77   $this->getController()->getPresentationFor(...); 
     86    [php] 
     87    // action 
     88    $this->getController()->getPresentationFor(...); 
    7889 
    7990The `project:upgrade1.1` task makes all those changes for you. 
     
    8899available from `sfContext`: 
    89100 
    90   [php] 
    91   sfContext::getInstance()->getI18N() 
    92   sfContext::getInstance()->getRouting() 
    93   sfContext::getInstance()->getLogger() 
     101    [php] 
     102    sfContext::getInstance()->getI18N() 
     103    sfContext::getInstance()->getRouting() 
     104    sfContext::getInstance()->getLogger() 
    94105 
    95106Routing 
     
    98109Here is the default configuration for the routing in `factories.yml`: 
    99110 
    100   routing: 
    101     class: sfPatternRouting 
    102     param: 
    103       load_configuration: true 
     111    [yml] 
     112    routing: 
     113      class: sfPatternRouting 
     114      param: 
     115        load_configuration: true 
    104116 
    105117The `project:upgrade1.1` task makes all the changes for you. 
     
    110122Here is the default configuration for logging in `factories.yml`: 
    111123 
    112   logger: 
    113     class: sfAggregateLogger 
    114     param: 
    115       level: debug 
    116       loggers: 
    117         sf_web_debug: 
    118           class: sfWebDebugLogger 
    119           param: 
    120             condition: %SF_WEB_DEBUG% 
    121             xdebug_logging: true 
    122         sf_file_debug: 
    123           class: sfFileLogger 
    124           param: 
    125             file: %SF_LOG_DIR%/%SF_APP%_%SF_ENVIRONMENT%.log 
     124    [yml] 
     125    logger: 
     126      class: sfAggregateLogger 
     127      param: 
     128        level: debug 
     129        loggers: 
     130          sf_web_debug: 
     131            class: sfWebDebugLogger 
     132            param: 
     133              condition: %SF_WEB_DEBUG% 
     134              xdebug_logging: true 
     135          sf_file_debug: 
     136            class: sfFileLogger 
     137            param: 
     138              file: %SF_LOG_DIR%/%SF_APP%_%SF_ENVIRONMENT%.log 
    126139 
    127140The `logging.yml` configuration file is not used anymore. 
     
    131144your application `factories.yml`: 
    132145 
    133   prod: 
    134     logger: 
    135       class:   sfNoLogger 
    136       param: 
    137         level:   err 
    138         loggers: ~ 
     146    [yml] 
     147    prod: 
     148      logger: 
     149        class:   sfNoLogger 
     150        param: 
     151          level:   err 
     152          loggers: ~ 
    139153 
    140154There is also a new `logging_enabled` setting in `settings.yml`. 
    141155This can be used to prevent logging in the production environment altogether: 
    142156 
    143   prod: 
    144     .settings: 
    145       logging_enabled: off 
     157    [yml] 
     158    prod: 
     159      .settings: 
     160        logging_enabled: off 
    146161 
    147162The `project:upgrade1.1` task makes all those changes for you. 
     
    152167Here is the default configuration for i18n in `factories.yml`: 
    153168 
    154   i18n: 
    155     class: sfI18N 
    156     param: 
    157       source:              XLIFF 
    158       debug:               off 
    159       untranslated_prefix: "[T]" 
    160       untranslated_suffix: "[/T]" 
    161       cache: 
    162         class: sfFileCache 
    163         param: 
    164           automatic_cleaning_factor: 0 
    165           cache_dir:                 %SF_I18N_CACHE_DIR% 
    166           lifetime:                  86400 
    167           prefix:                    %SF_APP_DIR% 
     169    [yml] 
     170    i18n: 
     171      class: sfI18N 
     172      param: 
     173        source:              XLIFF 
     174        debug:               off 
     175        untranslated_prefix: "[T]" 
     176        untranslated_suffix: "[/T]" 
     177        cache: 
     178          class: sfFileCache 
     179          param: 
     180            automatic_cleaning_factor: 0 
     181            cache_dir:                 %SF_I18N_CACHE_DIR% 
     182            lifetime:                  86400 
     183            prefix:                    %SF_APP_DIR% 
    168184 
    169185The `i18n.yml` configuration file is not used anymore. 
    170186Instead, you can configure i18n in `factories.yml`. 
    171187 
    172 The only exception is the `default_culture` setting which is now configurable in `settings.yml` 
    173 and do not depend on the i18n framework anymore: 
     188The only exception is the `default_culture` setting which is now configurable 
     189in `settings.yml` and do not depend on the i18n framework anymore: 
    174190 
    175191  default_culture: en 
    176192 
    177 If your project has some specific settings, you must move your current configuration from the `i18n.yml` to 
    178 the `factories.yml` and add the default culture in `settings.yml` as shown above. 
     193If your project has some specific settings, you must move your current 
     194configuration from the `i18n.yml` to the `factories.yml` and add the default 
     195culture in `settings.yml` as shown above. 
    179196 
    180197Cache Framework 
     
    199216Here is the new default `config.php`: 
    200217 
    201   [php] 
    202   <?php 
    203  
    204   // include project configuration 
    205   include(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php'); 
    206  
    207   // symfony bootstraping 
    208   require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 
    209   sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir); 
    210  
    211   // insert your own autoloading callables here 
    212  
    213   if (sfConfig::get('sf_debug')) 
    214  
    215     spl_autoload_register(array('sfAutoload', 'autoloadAgain')); 
    216  
    217  
    218 Thanks to the new `sfAutoload::autoloadAgain()` method, you won't need to clear the 
    219 cache when you add or move classes in your project. This method will automatically 
    220 find the changes and flush the autoloading cache. 
     218    [php] 
     219    <?php 
     220     
     221    // include project configuration 
     222    include(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php'); 
     223     
     224    // symfony bootstraping 
     225    require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 
     226    sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir); 
     227     
     228    // insert your own autoloading callables here 
     229     
     230    if (sfConfig::get('sf_debug')) 
     231   
     232      spl_autoload_register(array('sfAutoload', 'autoloadAgain')); 
     233   
     234 
     235Thanks to the new `sfAutoload::autoloadAgain()` method, you won't need to clear 
     236the cache when you add or move classes in your project. This method will 
     237automatically find the changes and flush the autoloading cache. 
    221238 
    222239The `project:upgrade1.1` task makes all those changes for you. 
     
    225242------- 
    226243 
    227 The lib/VERSION file has been removed. If you want to get the current symfony version, 
    228 you can use the `sfCore::VERSION` constant. 
     244The lib/VERSION file has been removed. If you want to get the current symfony 
     245version, you can use the `sfCore::VERSION` constant. 
    229246 
    230247Routing 
    231248------- 
    232249 
    233 To inject default route parameters, you can now use the `->setDefaultParameter()` method 
    234 instead of using the `sf_routing_defaults` setting: 
    235  
    236   [php] 
    237   $this->context->getRouting()->setDefaultParameter($key, $value); 
     250To inject default route parameters, you can now use the `->setDefaultParameter()` 
     251method instead of using the `sf_routing_defaults` setting: 
     252 
     253    [php] 
     254    $this->context->getRouting()->setDefaultParameter($key, $value); 
    238255 
    239256I18N 
     
    242259symfony core classes don't return internationalized strings anymore: 
    243260 
    244   [php] 
    245   <?php echo __($sf_request->getError('foo')) ?> 
     261    [php] 
     262    <?php echo __($sf_request->getError('foo')) ?> 
    246263 
    247264This behavior has changed for the following methods and functions: 
    248265 
    249   [php] 
    250   sfWebRequest::getError() 
    251   sfWebResponse::addMeta() 
     266    [php] 
     267    sfWebRequest::getError() 
     268    sfWebResponse::addMeta() 
    252269 
    253270The following helpers (in sfCompat10Plugin) still return internationalized data: 
    254271 
    255   [php] 
    256   form_error() 
    257   include_metas() 
    258  
    259 The `getGlobalMessageSource()` and `getGlobalMessageFormat()` methods has been removed 
    260 from the sfI18N class. They are now equivalent to `getMessageSource()`  
     272    [php] 
     273    form_error() 
     274    include_metas() 
     275 
     276The `getGlobalMessageSource()` and `getGlobalMessageFormat()` methods has been 
     277removed from the sfI18N class. They are now equivalent to `getMessageSource()`  
    261278and `getMessageFormat()`. 
    262279 
     
    266283Logger priorities are now constants: 
    267284 
    268   [php] 
    269   sfLogger::INFO 
     285    [php] 
     286    sfLogger::INFO 
    270287 
    271288The `project:upgrade1.1` task makes all those changes for you. 
     
    326343------------------------ 
    327344 
    328 Most symfony core classes are initialized thanks to a `->initialize()` method. As of symfony 1.1, 
    329 this method is automatically called by `__construct()`, so, there is no need to call it by yourself. 
     345Most symfony core classes are initialized thanks to a `->initialize()` method. 
     346As of symfony 1.1, this method is automatically called by `__construct()`, 
     347so, there is no need to call it by yourself. 
    330348 
    331349Configuration files loading 
     
    334352Some core classes can be configured with a `.yml` file: 
    335353 
    336 || '''Class'''          || '''Configuration file'''         || 
    337 ||                      ||                                  || 
    338 || `sfAction`           || `security.yml`                   || 
    339 || `sfAutoload`         || `autoload.yml`                   || 
    340 || `sfConfigCache`      || `config_handlers.yml`            || 
    341 || `sfContext`          || `factories.yml`                  || 
    342 || `sfController`       || `generator.yml` and `module.yml` || 
    343 || `sfDatabaseManager`  || `databases.yml`                  || 
    344 || `sfFilterChain`      || `filters.yml`                    || 
    345 || `sfI18N`             || `i18n.yml`                       || 
    346 || `sfPatternRouting`   || `routing.yml`                    || 
    347 || `sfPHPView`          || `view.yml`                       || 
    348 || `sfViewCacheManager` || `cache.yml`                      || 
    349  
    350 In symfony 1.1, the loading of the configuration file for ''independant'' sub-frameworks has been 
    351 moved to a `loadConfiguration()` method to ease decoupling and reuse them without needing the whole framework: 
     354 *Class*              | *Configuration file* 
     355 -------------------- | -------------------------------- 
     356 `sfAction`           | `security.yml` 
     357 `sfAutoload`         | `autoload.yml` 
     358 `sfConfigCache`      | `config_handlers.yml` 
     359 `sfContext`          | `factories.yml` 
     360 `sfController`       | `generator.yml` and `module.yml` 
     361 `sfDatabaseManager`  | `databases.yml` 
     362 `sfFilterChain`      | `filters.yml` 
     363 `sfI18N`             | `i18n.yml` 
     364 `sfPatternRouting`   | `routing.yml` 
     365 `sfPHPView`          | `view.yml` 
     366 `sfViewCacheManager` | `cache.yml` 
     367 
     368In symfony 1.1, the loading of the configuration file for ''independant'' 
     369sub-frameworks has been moved to a `loadConfiguration()` method to ease 
     370decoupling and reuse them without needing the whole framework: 
    352371 
    353372  * `sfDatabaseManager` 
     
    355374  * `sfPatternRouting` 
    356375 
    357 So, for example, if you need a database manager in your batch script, you will have to change from: 
     376So, for example, if you need a database manager in your batch script, 
     377you will have to change from: 
    358378 
    359379    [php] 
     
    373393 
    374394The `web_debug` entry in `filters.yml` must be removed as the `sfWebDebugFilter` 
    375 has been removed. The web debug toolbar is now injected in the response thanks to a listener. 
     395has been removed. The web debug toolbar is now injected in the response thanks 
     396to a listener. 
    376397 
    377398The `project:upgrade1.1` task makes all those changes for you. 
     
    380401--------------- 
    381402 
    382 The `sf_timeout` setting is not used anymore. To change the session timeout, you now have to edit the 
    383 `factories.yml` instead if the `settings.yml`, and change the parameters of the `user` factory: 
    384  
     403The `sf_timeout` setting is not used anymore. To change the session timeout, 
     404you now have to edit the `factories.yml` instead if the `settings.yml`, 
     405and change the parameters of the `user` factory: 
     406 
     407    [yml] 
    385408    all: 
    386409      user: 
     
    394417The `php.yml` configuration file has been removed. 
    395418 
    396 The only setting you will have to check by hand is `log_errors`, which was set to `on` by `php.yml`. 
    397  
    398 `php.yml` is replaced by the `check_configuration.php` utility you can find in `data/bin`. 
    399 It checks your environment against symfony requirements. You can launch it from anywhere: 
    400  
    401    $ php /path/to/symfony/data/bin/check_configuration.php 
    402  
    403 Even if you can use this utility from the command line, it's strongly recommended to launch it 
    404 from the web by copying it under your web root directory as PHP can use different php.ini configuration 
    405 files for the CLI and the web. 
     419The only setting you will have to check by hand is `log_errors`, which was set 
     420to `on` by `php.yml`. 
     421 
     422`php.yml` is replaced by the `check_configuration.php` utility you can find 
     423in `data/bin`. It checks your environment against symfony requirements. 
     424You can launch it from anywhere: 
     425 
     426    $ php /path/to/symfony/data/bin/check_configuration.php 
     427 
     428Even if you can use this utility from the command line, it's strongly recommended 
     429to launch it from the web by copying it under your web root directory as PHP can 
     430use different php.ini configuration files for the CLI and the web. 
     431 
     432`$sf_symfony_data_dir` removal 
     433------------------------------ 
     434 
     435In symfony 1.1, `$sf_symfony_data_dir` has been removed. All relevant files and 
     436directories from the symfony `data` directory have been moved to the `lib` 
     437directory: 
     438 
     439 *Old Location*         | *New Location* 
     440 ---------------------- | ----------------------------- 
     441 `data/config`          | `lib/config/config` 
     442 `data/i18n`            | `lib/i18n/data` 
     443 `data/skeleton`        | `lib/task/generator/skeleton` 
     444 `data/modules/default` | `lib/controller/default` 
     445 `data/web/errors`      | `lib/exception/data` 
     446 `data/exception.*`     | `lib/exception/data` 
     447 
     448The symfony core has been upgraded to take these changes into account. 
  • branches/1.1/data/bin/symfony

    r4550 r7322  
    44/* 
    55 * This file is part of the symfony package. 
    6  * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> 
     6 * (c) Fabien Potencier <fabien.potencier@symfony-project.com> 
    77 *  
    88 * For the full copyright and license information, please view the LICENSE 
     
    1818if (!isset($sf_symfony_lib_dir)) 
    1919{ 
    20   if (is_readable(dirname(__FILE__).'/../../lib/util/sfCore.class.php')) 
     20  if (is_readable(dirname(__FILE__).'/../../lib/autoload/sfCoreAutoload.class.php')) 
    2121  { 
    2222    // SVN 
    2323    $sf_symfony_lib_dir  = realpath(dirname(__FILE__).'/../../lib'); 
    24     $sf_symfony_data_dir = realpath(dirname(__FILE__).'/..'); 
    2524  } 
    2625  else 
     
    2827    // PEAR 
    2928    $sf_symfony_lib_dir  = '@PEAR-DIR@/symfony'; 
    30     $sf_symfony_data_dir = '@DATA-DIR@/symfony'; 
    3129 
    3230    if (!is_dir($sf_symfony_lib_dir)) 
     
    3735} 
    3836 
    39 include($sf_symfony_data_dir.'/bin/symfony.php'); 
     37include($sf_symfony_lib_dir.'/command/cli.php'); 
  • branches/1.1/lib/autoload/sfCoreAutoload.class.php

    r7302 r7322  
    290290  'sfGenerateProjectTask' => 'task/generator', 
    291291  'sfGeneratorBaseTask' => 'task/generator', 
    292   'sfCommandApplicationTask' => 'task/help', 
    293292  'sfHelpTask' => 'task/help', 
    294293  'sfListTask' => 'task/help', 
     
    313312  'sfAutoloadingUpgrade' => 'task/project/upgrade1.1', 
    314313  'sfComponentUpgrade' => 'task/project/upgrade1.1', 
     314  'sfConfigUpgrade' => 'task/project/upgrade1.1', 
    315315  'sfEnvironmentUpgrade' => 'task/project/upgrade1.1', 
    316316  'sfFactoriesUpgrade' => 'task/project/upgrade1.1', 
     
    322322  'sfWebDebugUpgrade' => 'task/project/upgrade1.1', 
    323323  'sfBaseTask' => 'task', 
     324  'sfCommandApplicationTask' => 'task', 
    324325  'sfFilesystem' => 'task', 
    325326  'sfTask' => 'task', 
  • branches/1.1/lib/command/cli.php

    r7292 r7322  
    33/* 
    44 * This file is part of the symfony package. 
    5  * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> 
     5 * (c) Fabien Potencier <fabien.potencier@symfony-project.com> 
    66 *  
    77 * For the full copyright and license information, please view the LICENSE 
     
    99 */ 
    1010 
    11 if (!isset($sf_symfony_lib_dir)) 
    12 
    13   die("You must launch symfony command line with the symfony script\n"); 
    14 
    15  
    16 require_once($sf_symfony_lib_dir.'/autoload/sfCoreAutoload.class.php'); 
     11require_once(dirname(__FILE__).'/../autoload/sfCoreAutoload.class.php'); 
    1712sfCoreAutoload::register(); 
    1813 
     
    2116  $dispatcher = new sfEventDispatcher(); 
    2217  $logger = new sfCommandLogger($dispatcher); 
    23   $options = array( 
    24     'symfony_lib_dir' => $sf_symfony_lib_dir, 
    25     'symfony_data_dir' => $sf_symfony_data_dir, 
    26   ); 
     18  $options = array('symfony_lib_dir' => realpath(dirname(__FILE__).'/..')); 
    2719 
    2820  $application = new sfSymfonyCommandApplication($dispatcher, new sfAnsiColorFormatter(), $options); 
  • branches/1.1/lib/command/sfSymfonyCommandApplication.class.php

    r7247 r7322  
    2323   * 
    2424   * @param string The symfony lib directory 
    25    * @param string The symfony data directory 
    2625   */ 
    2726  public function configure() 
     
    3029    { 
    3130      throw new sfInitializationException('You must pass a "symfony_lib_dir" option.'); 
    32     } 
    33  
    34     if (!isset($this->options['symfony_data_dir'])) 
    35     { 
    36       throw new sfInitializationException('You must pass a "symfony_data_dir" option.'); 
    3731    } 
    3832 
     
    4539    $this->setVersion(sfCore::VERSION); 
    4640 
    47     $this->initializeEnvironment($this->options['symfony_lib_dir'], $this->options['symfony_data_dir']); 
     41    $this->initializeEnvironment($this->options['symfony_lib_dir']); 
    4842    $this->initializeAutoloader(); 
    4943    $this->initializeTasks(); 
     
    8478   * 
    8579   * @param string The symfony lib directory 
    86    * @param string The symfony data directory 
    8780   */ 
    88   protected function initializeEnvironment($symfonyLibDir, $symfonyDataDir
     81  protected function initializeEnvironment($symfonyLibDir
    8982  { 
    90     sfConfig::add(array( 
    91       'sf_symfony_lib_dir'  => $symfonyLibDir, 
    92       'sf_symfony_data_dir' => $symfonyDataDir, 
    93     )); 
     83    sfConfig::set('sf_symfony_lib_dir', $symfonyLibDir); 
    9484 
    9585    // directory layout 
  • branches/1.1/lib/debug/sfWebDebug.class.php

    r6509 r7322  
    8282    if (!$constants) 
    8383    { 
    84       foreach (array('sf_app_dir', 'sf_root_dir', 'sf_symfony_lib_dir', 'sf_symfony_data_dir') as $constant) 
     84      foreach (array('sf_app_dir', 'sf_root_dir', 'sf_symfony_lib_dir') as $constant) 
    8585      { 
    8686        $constants[realpath(sfConfig::get($constant)).DIRECTORY_SEPARATOR] = $constant.DIRECTORY_SEPARATOR; 
  • branches/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/apps/frontend/config/config.php

    r6508 r7322  
    66// symfony bootstraping 
    77require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 
    8 sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir); 
     8sfCore::bootstrap($sf_symfony_lib_dir); 
    99 
    1010// insert your own autoloading callables here 
  • branches/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/config/config.php

    r5320 r7322  
    11<?php 
    22 
    3 // symfony directories 
     3// symfony directory 
    44$sf_symfony_lib_dir  = realpath(dirname(__FILE__).'/../../../../../../'); 
    5 $sf_symfony_data_dir = realpath(dirname(__FILE__).'/../../../../../../../data'); 
  • branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/backend/config/config.php

    r6365 r7322  
    66// symfony bootstraping 
    77require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 
    8 sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir); 
     8sfCore::bootstrap($sf_symfony_lib_dir); 
    99 
    1010// insert your own autoloading callables here 
  • branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/crud/config/config.php

    r6365 r7322  
    66// symfony bootstraping 
    77require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 
    8 sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir); 
     8sfCore::bootstrap($sf_symfony_lib_dir); 
    99 
    1010// insert your own autoloading callables here 
  • branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/config/config.php

    r5316 r7322  
    11<?php 
    22 
    3 // symfony directories 
     3// symfony directory 
    44$sf_symfony_lib_dir  = realpath(dirname(__FILE__).'/../../../../../../'); 
    5 $sf_symfony_data_dir = realpath(dirname(__FILE__).'/../../../../../../../data'); 
  • branches/1.1/lib/task/generator/sfGenerateProjectTask.class.php

    r7296 r7322  
    7979    $this->filesystem->replaceTokens(sfConfig::get('sf_config_dir').'/config.php', '##', '##', array( 
    8080      'SYMFONY_LIB_DIR'  => sfConfig::get('sf_symfony_lib_dir'), 
    81       'SYMFONY_DATA_DIR' => sfConfig::get('sf_symfony_data_dir'), 
    8281    )); 
    8382 
  • branches/1.1/lib/task/generator/skeleton/app/app/config/config.php

    r5231 r7322  
    66// symfony bootstraping 
    77require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 
    8 sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir); 
     8sfCore::bootstrap($sf_symfony_lib_dir); 
    99 
    1010// insert your own autoloading callables here 
  • branches/1.1/lib/task/generator/skeleton/project/config/config.php

    r2369 r7322  
    11<?php 
    22 
    3 // symfony directories 
     3// symfony directory 
    44$sf_symfony_lib_dir  = '##SYMFONY_LIB_DIR##'; 
    5 $sf_symfony_data_dir = '##SYMFONY_DATA_DIR##'; 
  • branches/1.1/lib/task/generator/skeleton/project/symfony

    r2403 r7322  
    44/* 
    55 * This file is part of the symfony package. 
    6  * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> 
     6 * (c) Fabien Potencier <fabien.potencier@symfony-project.com> 
    77 *  
    88 * For the full copyright and license information, please view the LICENSE 
     
    1212chdir(dirname(__FILE__)); 
    1313include('config/config.php'); 
    14 include($sf_symfony_data_dir.'/bin/symfony.php'); 
     14include($sf_symfony_lib_dir.'/command/cli.php'); 
  • branches/1.1/lib/task/project/sfProjectFreezeTask.class.php

    r6931 r7322  
    1717 * @version    SVN: $Id$ 
    1818 */ 
    19 class sfProjectFreezeTask extends sfBaseTask 
     19class sfProjectFreezeTask extends sfCommandApplicationTask 
    2020{ 
    2121  /** 
     
    2424  protected function configure() 
    2525  { 
     26    $this->addArguments(array( 
     27      new sfCommandArgument('symfony_data_dir', sfCommandArgument::REQUIRED, 'The symfony data directory'), 
     28    )); 
     29 
    2630    $this->aliases = array('freeze'); 
    2731    $this->namespace = 'project'; 
     
    4549  protected function execute($arguments = array(), $options = array()) 
    4650  { 
    47     // Check that the symfony librairies are not already freeze for this project 
     51    // check that the symfony librairies are not already freeze for this project 
    4852    if (is_readable(sfConfig::get('sf_lib_dir').'/symfony')) 
    4953    { 
     
    6771 
    6872    $symfony_lib_dir  = sfConfig::get('sf_symfony_lib_dir'); 
    69     $symfony_data_dir = sfConfig::get('sf_symfony_data_dir')
     73    $symfony_data_dir = $arguments['symfony_data_dir']
    7074 
    7175    $this->dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('freeze', 'freezing lib found in "'.$symfony_lib_dir.'"')))); 
     
    8185    $this->filesystem->rename(sfConfig::get('sf_data_dir').'/symfony/web/sf', sfConfig::get('sf_web_dir').'/sf'); 
    8286 
    83     // Change symfony paths in config/config.php 
    84     file_put_contents('config/config.php.bak', "$symfony_lib_dir#$symfony_data_dir"); 
    85     $this->changeSymfonyDirs("dirname(__FILE__).'/../lib/symfony'", "dirname(__FILE__).'/../data/symfony'"); 
     87    // change symfony paths in config/config.php 
     88    file_put_contents('config/config.php.bak', $symfony_lib_dir); 
     89    $this->changeSymfonyDirs("dirname(__FILE__).'/../lib/symfony'"); 
    8690 
    87     // Install the command line 
     91    // install the command line 
    8892    $this->filesystem->copy($symfony_data_dir.'/bin/symfony.php', 'symfony.php'); 
    8993  } 
    9094 
    91   protected function changeSymfonyDirs($symfony_lib_dir, $symfony_data_dir
     95  protected function changeSymfonyDirs($symfony_lib_dir
    9296  { 
    9397    $content = file_get_contents('config/config.php'); 
    9498    $content = preg_replace("/^(\s*.sf_symfony_lib_dir\s*=\s*).+?;/m", "$1$symfony_lib_dir;", $content); 
    95     $content = preg_replace("/^(\s*.sf_symfony_data_dir\s*=\s*).+?;/m", "$1$symfony_data_dir;", $content); 
    9699    file_put_contents('config/config.php', $content); 
    97100  } 
  • branches/1.1/lib/task/project/sfProjectUnfreezeTask.class.php

    r6931 r7322  
    1717 * @version    SVN: $Id$ 
    1818 */ 
    19 class sfProjectUnfreezeTask extends sfBaseTask 
     19class sfProjectUnfreezeTask extends sfCommandApplicationTask 
    2020{ 
    2121  /** 
     
    4545  protected function execute($arguments = array(), $options = array()) 
    4646  { 
    47     // Remove lib/symfony and data/symfony directories 
     47    // remove lib/symfony and data/symfony directories 
    4848    if (!is_dir('lib/symfony')) 
    4949    { 
     
    5151    } 
    5252 
    53     $dirs = explode('#', file_get_contents('config/config.php.bak')); 
    54     $this->changeSymfonyDirs('\''.$dirs[0].'\'', '\''.$dirs[1].'\''); 
     53    $this->changeSymfonyDirs("'".file_get_contents('config/config.php.bak')."'"); 
    5554 
    5655    $finder = sfFinder::type('any'); 
     
    6463   } 
    6564 
    66   protected function changeSymfonyDirs($symfony_lib_dir, $symfony_data_dir
     65  protected function changeSymfonyDirs($symfony_lib_dir
    6766  { 
    6867    $content = file_get_contents('config/config.php'); 
    6968    $content = preg_replace("/^(\s*.sf_symfony_lib_dir\s*=\s*).+?;/m", "$1$symfony_lib_dir;", $content); 
    70     $content = preg_replace("/^(\s*.sf_symfony_data_dir\s*=\s*).+?;/m", "$1$symfony_data_dir;", $content); 
    7169    file_put_contents('config/config.php', $content); 
    7270  } 
  • branches/1.1/lib/util/sfCore.class.php

    r7305 r7322  
    2828   * 
    2929   * @param  string The path to the project directory. 
    30    * @param  mixed  The application name or null. 
    31    * 
    32    * @return void 
    33    */ 
    34   static public function bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir) 
     30   * 
     31   * @return void 
     32   */ 
     33  static public function bootstrap($sf_symfony_lib_dir) 
    3534  { 
    3635    try 
    3736    { 
    38       sfCore::initConfiguration($sf_symfony_lib_dir, $sf_symfony_data_dir); 
     37      sfCore::initConfiguration($sf_symfony_lib_dir); 
    3938 
    4039      sfCore::initIncludePath(); 
     
    117116   * @return void 
    118117   */ 
    119   static public function initConfiguration($sf_symfony_lib_dir, $sf_symfony_data_dir, $test = false) 
     118  static public function initConfiguration($sf_symfony_lib_dir, $test = false) 
    120119  { 
    121120    require_once($sf_symfony_lib_dir.'/autoload/sfCoreAutoload.class.php'); 
     
    132131      'sf_debug'            => SF_DEBUG, 
    133132      'sf_symfony_lib_dir'  => $sf_symfony_lib_dir, 
    134       'sf_symfony_data_dir' => $sf_symfony_data_dir, 
    135133      'sf_test'             => $test, 
    136134    )); 
  • branches/1.1/test/bootstrap/task.php

    r6859 r7322  
    2020$application = new sfSymfonyCommandApplication(new sfEventDispatcher(), new sfFormatter(), array( 
    2121  'symfony_lib_dir' => sfConfig::get('sf_symfony_lib_dir'), 
    22   'symfony_data_dir' => sfConfig::get('sf_symfony_data_dir'), 
    2322)); 
    2423 
  • branches/1.1/test/bootstrap/unit.php

    r7247 r7322  
    2121require_once($_test_dir.'/../lib/config/sfConfig.class.php'); 
    2222sfConfig::set('sf_symfony_lib_dir', realpath($_test_dir.'/../lib')); 
    23 sfConfig::set('sf_symfony_data_dir', realpath($_test_dir.'/../data')); 
    2423 
    2524require_once(dirname(__FILE__).'/../../lib/autoload/sfSimpleAutoload.class.php'); 
  • branches/1.1/test/functional/fixtures/project/apps/cache/config/config.php

    r6365 r7322  
    66// symfony bootstraping 
    77require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 
    8 sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir); 
     8sfCore::bootstrap($sf_symfony_lib_dir); 
    99 
    1010// insert your own autoloading callables here 
  • branches/1.1/test/functional/fixtures/project/apps/frontend/config/config.php

    r6365 r7322  
    66// symfony bootstraping 
    77require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 
    8 sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir); 
     8sfCore::bootstrap($sf_symfony_lib_dir); 
    99 
    1010// insert your own autoloading callables here 
  • branches/1.1/test/functional/fixtures/project/apps/i18n/config/config.php

    r6365 r7322  
    66// symfony bootstraping 
    77require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 
    8 sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir); 
     8sfCore::bootstrap($sf_symfony_lib_dir); 
    99 
    1010// insert your own autoloading callables here 
  • branches/1.1/test/functional/fixtures/project/config/config.php

    r2369