Changeset 7322
- Timestamp:
- 02/04/08 12:30:06 (8 months ago)
- Files:
-
- branches/1.1/UPGRADE (modified) (18 diffs)
- branches/1.1/data/bin/symfony (modified) (4 diffs)
- branches/1.1/lib/autoload/sfCoreAutoload.class.php (modified) (3 diffs)
- branches/1.1/lib/command/cli.php (moved) (moved from branches/1.1/data/bin/symfony.php) (3 diffs)
- branches/1.1/lib/command/sfSymfonyCommandApplication.class.php (modified) (4 diffs)
- branches/1.1/lib/debug/sfWebDebug.class.php (modified) (1 diff)
- branches/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/apps/frontend/config/config.php (modified) (1 diff)
- branches/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/config/config.php (modified) (1 diff)
- branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/backend/config/config.php (modified) (1 diff)
- branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/crud/config/config.php (modified) (1 diff)
- branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/config/config.php (modified) (1 diff)
- branches/1.1/lib/task/generator/sfGenerateProjectTask.class.php (modified) (1 diff)
- branches/1.1/lib/task/generator/skeleton/app/app/config/config.php (modified) (1 diff)
- branches/1.1/lib/task/generator/skeleton/project/config/config.php (modified) (1 diff)
- branches/1.1/lib/task/generator/skeleton/project/symfony (modified) (2 diffs)
- branches/1.1/lib/task/project/sfProjectFreezeTask.class.php (modified) (5 diffs)
- branches/1.1/lib/task/project/sfProjectUnfreezeTask.class.php (modified) (4 diffs)
- branches/1.1/lib/task/project/upgrade1.1/sfConfigUpgrade.class.php (added)
- branches/1.1/lib/util/sfCore.class.php (modified) (3 diffs)
- branches/1.1/test/bootstrap/task.php (modified) (1 diff)
- branches/1.1/test/bootstrap/unit.php (modified) (1 diff)
- branches/1.1/test/functional/fixtures/project/apps/cache/config/config.php (modified) (1 diff)
- branches/1.1/test/functional/fixtures/project/apps/frontend/config/config.php (modified) (1 diff)
- branches/1.1/test/functional/fixtures/project/apps/i18n/config/config.php (modified) (1 diff)
- branches/1.1/test/functional/fixtures/project/config/config.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/UPGRADE
r6824 r7322 10 10 --------------- 11 11 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 12 To 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 42 53 43 54 The remaining sections explains backward incompatible changes. … … 48 59 Flash attributes are now managed directly by `sfUser`. New usage: 49 60 50 [php]51 // action52 $this->getUser()->setFlash('notice', 'foo');53 $notice = $this->getUser()->getFlash('notice');54 55 // template56 <?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; ?> 59 70 60 71 The `flash` entry in `filters.yml` must be removed too as the `sfFlashFilter` … … 73 84 They are accessible from `sfController`: 74 85 75 [php]76 // action77 $this->getController()->getPresentationFor(...);86 [php] 87 // action 88 $this->getController()->getPresentationFor(...); 78 89 79 90 The `project:upgrade1.1` task makes all those changes for you. … … 88 99 available from `sfContext`: 89 100 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() 94 105 95 106 Routing … … 98 109 Here is the default configuration for the routing in `factories.yml`: 99 110 100 routing: 101 class: sfPatternRouting 102 param: 103 load_configuration: true 111 [yml] 112 routing: 113 class: sfPatternRouting 114 param: 115 load_configuration: true 104 116 105 117 The `project:upgrade1.1` task makes all the changes for you. … … 110 122 Here is the default configuration for logging in `factories.yml`: 111 123 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 126 139 127 140 The `logging.yml` configuration file is not used anymore. … … 131 144 your application `factories.yml`: 132 145 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: ~ 139 153 140 154 There is also a new `logging_enabled` setting in `settings.yml`. 141 155 This can be used to prevent logging in the production environment altogether: 142 156 143 prod: 144 .settings: 145 logging_enabled: off 157 [yml] 158 prod: 159 .settings: 160 logging_enabled: off 146 161 147 162 The `project:upgrade1.1` task makes all those changes for you. … … 152 167 Here is the default configuration for i18n in `factories.yml`: 153 168 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% 168 184 169 185 The `i18n.yml` configuration file is not used anymore. 170 186 Instead, you can configure i18n in `factories.yml`. 171 187 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:188 The only exception is the `default_culture` setting which is now configurable 189 in `settings.yml` and do not depend on the i18n framework anymore: 174 190 175 191 default_culture: en 176 192 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. 193 If your project has some specific settings, you must move your current 194 configuration from the `i18n.yml` to the `factories.yml` and add the default 195 culture in `settings.yml` as shown above. 179 196 180 197 Cache Framework … … 199 216 Here is the new default `config.php`: 200 217 201 [php]202 <?php203 204 // include project configuration205 include(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');206 207 // symfony bootstraping208 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 here212 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 the219 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 235 Thanks to the new `sfAutoload::autoloadAgain()` method, you won't need to clear 236 the cache when you add or move classes in your project. This method will 237 automatically find the changes and flush the autoloading cache. 221 238 222 239 The `project:upgrade1.1` task makes all those changes for you. … … 225 242 ------- 226 243 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.244 The lib/VERSION file has been removed. If you want to get the current symfony 245 version, you can use the `sfCore::VERSION` constant. 229 246 230 247 Routing 231 248 ------- 232 249 233 To inject default route parameters, you can now use the `->setDefaultParameter()` method234 instead of using the `sf_routing_defaults` setting:235 236 [php]237 $this->context->getRouting()->setDefaultParameter($key, $value);250 To inject default route parameters, you can now use the `->setDefaultParameter()` 251 method instead of using the `sf_routing_defaults` setting: 252 253 [php] 254 $this->context->getRouting()->setDefaultParameter($key, $value); 238 255 239 256 I18N … … 242 259 symfony core classes don't return internationalized strings anymore: 243 260 244 [php]245 <?php echo __($sf_request->getError('foo')) ?>261 [php] 262 <?php echo __($sf_request->getError('foo')) ?> 246 263 247 264 This behavior has changed for the following methods and functions: 248 265 249 [php]250 sfWebRequest::getError()251 sfWebResponse::addMeta()266 [php] 267 sfWebRequest::getError() 268 sfWebResponse::addMeta() 252 269 253 270 The following helpers (in sfCompat10Plugin) still return internationalized data: 254 271 255 [php]256 form_error()257 include_metas()258 259 The `getGlobalMessageSource()` and `getGlobalMessageFormat()` methods has been removed260 from the sfI18N class. They are now equivalent to `getMessageSource()`272 [php] 273 form_error() 274 include_metas() 275 276 The `getGlobalMessageSource()` and `getGlobalMessageFormat()` methods has been 277 removed from the sfI18N class. They are now equivalent to `getMessageSource()` 261 278 and `getMessageFormat()`. 262 279 … … 266 283 Logger priorities are now constants: 267 284 268 [php]269 sfLogger::INFO285 [php] 286 sfLogger::INFO 270 287 271 288 The `project:upgrade1.1` task makes all those changes for you. … … 326 343 ------------------------ 327 344 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. 345 Most symfony core classes are initialized thanks to a `->initialize()` method. 346 As of symfony 1.1, this method is automatically called by `__construct()`, 347 so, there is no need to call it by yourself. 330 348 331 349 Configuration files loading … … 334 352 Some core classes can be configured with a `.yml` file: 335 353 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 368 In symfony 1.1, the loading of the configuration file for ''independant'' 369 sub-frameworks has been moved to a `loadConfiguration()` method to ease 370 decoupling and reuse them without needing the whole framework: 352 371 353 372 * `sfDatabaseManager` … … 355 374 * `sfPatternRouting` 356 375 357 So, for example, if you need a database manager in your batch script, you will have to change from: 376 So, for example, if you need a database manager in your batch script, 377 you will have to change from: 358 378 359 379 [php] … … 373 393 374 394 The `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. 395 has been removed. The web debug toolbar is now injected in the response thanks 396 to a listener. 376 397 377 398 The `project:upgrade1.1` task makes all those changes for you. … … 380 401 --------------- 381 402 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 403 The `sf_timeout` setting is not used anymore. To change the session timeout, 404 you now have to edit the `factories.yml` instead if the `settings.yml`, 405 and change the parameters of the `user` factory: 406 407 [yml] 385 408 all: 386 409 user: … … 394 417 The `php.yml` configuration file has been removed. 395 418 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. 419 The only setting you will have to check by hand is `log_errors`, which was set 420 to `on` by `php.yml`. 421 422 `php.yml` is replaced by the `check_configuration.php` utility you can find 423 in `data/bin`. It checks your environment against symfony requirements. 424 You can launch it from anywhere: 425 426 $ php /path/to/symfony/data/bin/check_configuration.php 427 428 Even if you can use this utility from the command line, it's strongly recommended 429 to launch it from the web by copying it under your web root directory as PHP can 430 use different php.ini configuration files for the CLI and the web. 431 432 `$sf_symfony_data_dir` removal 433 ------------------------------ 434 435 In symfony 1.1, `$sf_symfony_data_dir` has been removed. All relevant files and 436 directories from the symfony `data` directory have been moved to the `lib` 437 directory: 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 448 The symfony core has been upgraded to take these changes into account. branches/1.1/data/bin/symfony
r4550 r7322 4 4 /* 5 5 * This file is part of the symfony package. 6 * (c) 2004-2006Fabien Potencier <fabien.potencier@symfony-project.com>6 * (c) Fabien Potencier <fabien.potencier@symfony-project.com> 7 7 * 8 8 * For the full copyright and license information, please view the LICENSE … … 18 18 if (!isset($sf_symfony_lib_dir)) 19 19 { 20 if (is_readable(dirname(__FILE__).'/../../lib/ util/sfCore.class.php'))20 if (is_readable(dirname(__FILE__).'/../../lib/autoload/sfCoreAutoload.class.php')) 21 21 { 22 22 // SVN 23 23 $sf_symfony_lib_dir = realpath(dirname(__FILE__).'/../../lib'); 24 $sf_symfony_data_dir = realpath(dirname(__FILE__).'/..');25 24 } 26 25 else … … 28 27 // PEAR 29 28 $sf_symfony_lib_dir = '@PEAR-DIR@/symfony'; 30 $sf_symfony_data_dir = '@DATA-DIR@/symfony';31 29 32 30 if (!is_dir($sf_symfony_lib_dir)) … … 37 35 } 38 36 39 include($sf_symfony_ data_dir.'/bin/symfony.php');37 include($sf_symfony_lib_dir.'/command/cli.php'); branches/1.1/lib/autoload/sfCoreAutoload.class.php
r7302 r7322 290 290 'sfGenerateProjectTask' => 'task/generator', 291 291 'sfGeneratorBaseTask' => 'task/generator', 292 'sfCommandApplicationTask' => 'task/help',293 292 'sfHelpTask' => 'task/help', 294 293 'sfListTask' => 'task/help', … … 313 312 'sfAutoloadingUpgrade' => 'task/project/upgrade1.1', 314 313 'sfComponentUpgrade' => 'task/project/upgrade1.1', 314 'sfConfigUpgrade' => 'task/project/upgrade1.1', 315 315 'sfEnvironmentUpgrade' => 'task/project/upgrade1.1', 316 316 'sfFactoriesUpgrade' => 'task/project/upgrade1.1', … … 322 322 'sfWebDebugUpgrade' => 'task/project/upgrade1.1', 323 323 'sfBaseTask' => 'task', 324 'sfCommandApplicationTask' => 'task', 324 325 'sfFilesystem' => 'task', 325 326 'sfTask' => 'task', branches/1.1/lib/command/cli.php
r7292 r7322 3 3 /* 4 4 * This file is part of the symfony package. 5 * (c) 2004-2006Fabien Potencier <fabien.potencier@symfony-project.com>5 * (c) Fabien Potencier <fabien.potencier@symfony-project.com> 6 6 * 7 7 * For the full copyright and license information, please view the LICENSE … … 9 9 */ 10 10 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'); 11 require_once(dirname(__FILE__).'/../autoload/sfCoreAutoload.class.php'); 17 12 sfCoreAutoload::register(); 18 13 … … 21 16 $dispatcher = new sfEventDispatcher(); 22 17 $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__).'/..')); 27 19 28 20 $application = new sfSymfonyCommandApplication($dispatcher, new sfAnsiColorFormatter(), $options); branches/1.1/lib/command/sfSymfonyCommandApplication.class.php
r7247 r7322 23 23 * 24 24 * @param string The symfony lib directory 25 * @param string The symfony data directory26 25 */ 27 26 public function configure() … … 30 29 { 31 30 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.');37 31 } 38 32 … … 45 39 $this->setVersion(sfCore::VERSION); 46 40 47 $this->initializeEnvironment($this->options['symfony_lib_dir'] , $this->options['symfony_data_dir']);41 $this->initializeEnvironment($this->options['symfony_lib_dir']); 48 42 $this->initializeAutoloader(); 49 43 $this->initializeTasks(); … … 84 78 * 85 79 * @param string The symfony lib directory 86 * @param string The symfony data directory87 80 */ 88 protected function initializeEnvironment($symfonyLibDir , $symfonyDataDir)81 protected function initializeEnvironment($symfonyLibDir) 89 82 { 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); 94 84 95 85 // directory layout branches/1.1/lib/debug/sfWebDebug.class.php
r6509 r7322 82 82 if (!$constants) 83 83 { 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) 85 85 { 86 86 $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 6 6 // symfony bootstraping 7 7 require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 8 sfCore::bootstrap($sf_symfony_lib_dir , $sf_symfony_data_dir);8 sfCore::bootstrap($sf_symfony_lib_dir); 9 9 10 10 // insert your own autoloading callables here branches/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/config/config.php
r5320 r7322 1 1 <?php 2 2 3 // symfony director ies3 // symfony directory 4 4 $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 6 6 // symfony bootstraping 7 7 require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 8 sfCore::bootstrap($sf_symfony_lib_dir , $sf_symfony_data_dir);8 sfCore::bootstrap($sf_symfony_lib_dir); 9 9 10 10 // insert your own autoloading callables here branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/crud/config/config.php
r6365 r7322 6 6 // symfony bootstraping 7 7 require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 8 sfCore::bootstrap($sf_symfony_lib_dir , $sf_symfony_data_dir);8 sfCore::bootstrap($sf_symfony_lib_dir); 9 9 10 10 // insert your own autoloading callables here branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/config/config.php
r5316 r7322 1 1 <?php 2 2 3 // symfony director ies3 // symfony directory 4 4 $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 79 79 $this->filesystem->replaceTokens(sfConfig::get('sf_config_dir').'/config.php', '##', '##', array( 80 80 'SYMFONY_LIB_DIR' => sfConfig::get('sf_symfony_lib_dir'), 81 'SYMFONY_DATA_DIR' => sfConfig::get('sf_symfony_data_dir'),82 81 )); 83 82 branches/1.1/lib/task/generator/skeleton/app/app/config/config.php
r5231 r7322 6 6 // symfony bootstraping 7 7 require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 8 sfCore::bootstrap($sf_symfony_lib_dir , $sf_symfony_data_dir);8 sfCore::bootstrap($sf_symfony_lib_dir); 9 9 10 10 // insert your own autoloading callables here branches/1.1/lib/task/generator/skeleton/project/config/config.php
r2369 r7322 1 1 <?php 2 2 3 // symfony director ies3 // symfony directory 4 4 $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 4 4 /* 5 5 * This file is part of the symfony package. 6 * (c) 2004-2006Fabien Potencier <fabien.potencier@symfony-project.com>6 * (c) Fabien Potencier <fabien.potencier@symfony-project.com> 7 7 * 8 8 * For the full copyright and license information, please view the LICENSE … … 12 12 chdir(dirname(__FILE__)); 13 13 include('config/config.php'); 14 include($sf_symfony_ data_dir.'/bin/symfony.php');14 include($sf_symfony_lib_dir.'/command/cli.php'); branches/1.1/lib/task/project/sfProjectFreezeTask.class.php
r6931 r7322 17 17 * @version SVN: $Id$ 18 18 */ 19 class sfProjectFreezeTask extends sf BaseTask19 class sfProjectFreezeTask extends sfCommandApplicationTask 20 20 { 21 21 /** … … 24 24 protected function configure() 25 25 { 26 $this->addArguments(array( 27 new sfCommandArgument('symfony_data_dir', sfCommandArgument::REQUIRED, 'The symfony data directory'), 28 )); 29 26 30 $this->aliases = array('freeze'); 27 31 $this->namespace = 'project'; … … 45 49 protected function execute($arguments = array(), $options = array()) 46 50 { 47 // Check that the symfony librairies are not already freeze for this project51 // check that the symfony librairies are not already freeze for this project 48 52 if (is_readable(sfConfig::get('sf_lib_dir').'/symfony')) 49 53 { … … 67 71 68 72 $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']; 70 74 71 75 $this->dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('freeze', 'freezing lib found in "'.$symfony_lib_dir.'"')))); … … 81 85 $this->filesystem->rename(sfConfig::get('sf_data_dir').'/symfony/web/sf', sfConfig::get('sf_web_dir').'/sf'); 82 86 83 // Change symfony paths in config/config.php84 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'"); 86 90 87 // Install the command line91 // install the command line 88 92 $this->filesystem->copy($symfony_data_dir.'/bin/symfony.php', 'symfony.php'); 89 93 } 90 94 91 protected function changeSymfonyDirs($symfony_lib_dir , $symfony_data_dir)95 protected function changeSymfonyDirs($symfony_lib_dir) 92 96 { 93 97 $content = file_get_contents('config/config.php'); 94 98 $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);96 99 file_put_contents('config/config.php', $content); 97 100 } branches/1.1/lib/task/project/sfProjectUnfreezeTask.class.php
r6931 r7322 17 17 * @version SVN: $Id$ 18 18 */ 19 class sfProjectUnfreezeTask extends sf BaseTask19 class sfProjectUnfreezeTask extends sfCommandApplicationTask 20 20 { 21 21 /** … … 45 45 protected function execute($arguments = array(), $options = array()) 46 46 { 47 // Remove lib/symfony and data/symfony directories47 // remove lib/symfony and data/symfony directories 48 48 if (!is_dir('lib/symfony')) 49 49 { … … 51 51 } 52 52 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')."'"); 55 54 56 55 $finder = sfFinder::type('any'); … … 64 63 } 65 64 66 protected function changeSymfonyDirs($symfony_lib_dir , $symfony_data_dir)65 protected function changeSymfonyDirs($symfony_lib_dir) 67 66 { 68 67 $content = file_get_contents('config/config.php'); 69 68 $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);71 69 file_put_contents('config/config.php', $content); 72 70 } branches/1.1/lib/util/sfCore.class.php
r7305 r7322 28 28 * 29 29 * @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) 35 34 { 36 35 try 37 36 { 38 sfCore::initConfiguration($sf_symfony_lib_dir , $sf_symfony_data_dir);37 sfCore::initConfiguration($sf_symfony_lib_dir); 39 38 40 39 sfCore::initIncludePath(); … … 117 116 * @return void 118 117 */ 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) 120 119 { 121 120 require_once($sf_symfony_lib_dir.'/autoload/sfCoreAutoload.class.php'); … … 132 131 'sf_debug' => SF_DEBUG, 133 132 'sf_symfony_lib_dir' => $sf_symfony_lib_dir, 134 'sf_symfony_data_dir' => $sf_symfony_data_dir,135 133 'sf_test' => $test, 136 134 )); branches/1.1/test/bootstrap/task.php
r6859 r7322 20 20 $application = new sfSymfonyCommandApplication(new sfEventDispatcher(), new sfFormatter(), array( 21 21 'symfony_lib_dir' => sfConfig::get('sf_symfony_lib_dir'), 22 'symfony_data_dir' => sfConfig::get('sf_symfony_data_dir'),23 22 )); 24 23 branches/1.1/test/bootstrap/unit.php
r7247 r7322 21 21 require_once($_test_dir.'/../lib/config/sfConfig.class.php'); 22 22 sfConfig::set('sf_symfony_lib_dir', realpath($_test_dir.'/../lib')); 23 sfConfig::set('sf_symfony_data_dir', realpath($_test_dir.'/../data'));24 23 25 24 require_once(dirname(__FILE__).'/../../lib/autoload/sfSimpleAutoload.class.php'); branches/1.1/test/functional/fixtures/project/apps/cache/config/config.php
r6365 r7322 6 6 // symfony bootstraping 7 7 require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 8 sfCore::bootstrap($sf_symfony_lib_dir , $sf_symfony_data_dir);8 sfCore::bootstrap($sf_symfony_lib_dir); 9 9 10 10 // insert your own autoloading callables here branches/1.1/test/functional/fixtures/project/apps/frontend/config/config.php
r6365 r7322 6 6 // symfony bootstraping 7 7 require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 8 sfCore::bootstrap($sf_symfony_lib_dir , $sf_symfony_data_dir);8 sfCore::bootstrap($sf_symfony_lib_dir); 9 9 10 10 // insert your own autoloading callables here branches/1.1/test/functional/fixtures/project/apps/i18n/config/config.php
r6365 r7322 6 6 // symfony bootstraping 7 7 require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 8 sfCore::bootstrap($sf_symfony_lib_dir , $sf_symfony_data_dir);8 sfCore::bootstrap($sf_symfony_lib_dir); 9 9 10 10 // insert your own autoloading callables here branches/1.1/test/functional/fixtures/project/config/config.php
r2369