Changeset 7989
- Timestamp:
- 03/19/08 21:05:40 (7 months ago)
- Files:
-
- branches/dwhittle/1.0/lib/filter/sfCacheFilter.class.php (modified) (1 diff)
- branches/dwhittle/1.0/lib/util/sfToolkit.class.php (modified) (1 diff)
- branches/dwhittle/1.0/lib/view/sfViewCacheManager.class.php (modified) (1 diff)
- branches/dwhittle/1.1/UPGRADE (modified) (6 diffs)
- branches/dwhittle/1.1/lib/config/sfApplicationConfiguration.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/config/sfProjectConfiguration.class.php (modified) (2 diffs)
- branches/dwhittle/1.1/lib/controller/sfWebController.class.php (modified) (2 diffs)
- branches/dwhittle/1.1/lib/debug/sfDebug.class.php (modified) (3 diffs)
- branches/dwhittle/1.1/lib/debug/sfWebDebug.class.php (modified) (3 diffs)
- branches/dwhittle/1.1/lib/filter/sfCacheFilter.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/i18n/sfI18N.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/i18n/sfMessageSource_File.class.php (modified) (5 diffs)
- branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/test/bootstrap/functional.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/apps/frontend/config/frontendConfiguration.class.php (copied) (copied from branches/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/apps/frontend/config/frontendConfiguration.class.php)
- branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/config/ProjectConfiguration.class.php (copied) (copied from branches/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/config/ProjectConfiguration.class.php)
- branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/lib/ProjectConfiguration.class.php (deleted)
- branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/lib/frontendConfiguration.class.php (deleted)
- branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/test/bootstrap/functional.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/test/bootstrap/unit.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/web/frontend_dev.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/web/index.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/lib/propel/validator/sfPropelUniqueValidator.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelBuildAllLoadTask.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelDataDumpTask.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelDataLoadTask.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/om/php5/PHP5ObjectBuilder.php (modified) (5 diffs)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/test/bootstrap/functional.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/test/functional/crud/crudBrowser.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/backend/config/backendConfiguration.class.php (copied) (copied from branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/backend/config/backendConfiguration.class.php)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/crud/config/crudConfiguration.class.php (copied) (copied from branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/crud/config/crudConfiguration.class.php)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/config/ProjectConfiguration.class.php (copied) (copied from branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/config/ProjectConfiguration.class.php)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/ProjectConfiguration.class.php (deleted)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/backendConfiguration.class.php (deleted)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/crudConfiguration.class.php (deleted)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/test/bootstrap/functional.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/test/bootstrap/unit.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/web/backend_dev.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/web/crud.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/web/crud_dev.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/web/index.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/response/sfResponse.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/response/sfWebResponse.class.php (modified) (2 diffs)
- branches/dwhittle/1.1/lib/storage/sfDatabaseSessionStorage.class.php (modified) (3 diffs)
- branches/dwhittle/1.1/lib/storage/sfMySQLSessionStorage.class.php (modified) (4 diffs)
- branches/dwhittle/1.1/lib/storage/sfPDOSessionStorage.class.php (modified) (4 diffs)
- branches/dwhittle/1.1/lib/storage/sfPostgreSQLSessionStorage.class.php (modified) (4 diffs)
- branches/dwhittle/1.1/lib/storage/sfSessionStorage.class.php (modified) (3 diffs)
- branches/dwhittle/1.1/lib/storage/sfSessionTestStorage.class.php (modified) (3 diffs)
- branches/dwhittle/1.1/lib/storage/sfStorage.class.php (modified) (5 diffs)
- branches/dwhittle/1.1/lib/task/cache/sfCacheClearTask.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/task/generator/sfGenerateAppTask.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/task/generator/sfGenerateProjectTask.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/task/generator/skeleton/app/app/config/ApplicationConfiguration.class.php (copied) (copied from branches/1.1/lib/task/generator/skeleton/app/app/config/ApplicationConfiguration.class.php)
- branches/dwhittle/1.1/lib/task/generator/skeleton/app/lib/ApplicationConfiguration.class.php (deleted)
- branches/dwhittle/1.1/lib/task/generator/skeleton/app/web/index.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/task/generator/skeleton/project/config/ProjectConfiguration.class.php (copied) (copied from branches/1.1/lib/task/generator/skeleton/project/config/ProjectConfiguration.class.php)
- branches/dwhittle/1.1/lib/task/generator/skeleton/project/lib/ProjectConfiguration.class.php (deleted)
- branches/dwhittle/1.1/lib/task/generator/skeleton/project/symfony (modified) (1 diff)
- branches/dwhittle/1.1/lib/task/generator/skeleton/project/test/bootstrap/functional.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/task/generator/skeleton/project/test/bootstrap/unit.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/task/i18n/sfI18nExtractTask.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/task/project/sfProjectFreezeTask.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/task/project/sfProjectUnfreezeTask.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/task/project/upgrade1.1/sfConfigUpgrade.class.php (modified) (2 diffs)
- branches/dwhittle/1.1/lib/task/project/upgrade1.1/sfTestUpgrade.class.php (modified) (2 diffs)
- branches/dwhittle/1.1/lib/task/sfBaseTask.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/user/sfBasicSecurityUser.class.php (modified) (5 diffs)
- branches/dwhittle/1.1/lib/user/sfUser.class.php (modified) (11 diffs)
- branches/dwhittle/1.1/lib/util/sfToolkit.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/util/sfYamlInline.class.php (modified) (3 diffs)
- branches/dwhittle/1.1/lib/view/sfPHPView.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/view/sfViewCacheManager.class.php (modified) (1 diff)
- branches/dwhittle/1.1/test/bootstrap/functional.php (modified) (1 diff)
- branches/dwhittle/1.1/test/functional/fixtures/project/apps/cache/config/cacheConfiguration.class.php (copied) (copied from branches/1.1/test/functional/fixtures/project/apps/cache/config/cacheConfiguration.class.php)
- branches/dwhittle/1.1/test/functional/fixtures/project/apps/frontend/config/frontendConfiguration.class.php (copied) (copied from branches/1.1/test/functional/fixtures/project/apps/frontend/config/frontendConfiguration.class.php)
- branches/dwhittle/1.1/test/functional/fixtures/project/apps/i18n/config/i18nConfiguration.class.php (copied) (copied from branches/1.1/test/functional/fixtures/project/apps/i18n/config/i18nConfiguration.class.php)
- branches/dwhittle/1.1/test/functional/fixtures/project/apps/routing/config/routingConfiguration.class.php (moved) (moved from branches/dwhittle/1.1/test/functional/fixtures/project/lib/routingConfiguration.class.php) (1 diff)
- branches/dwhittle/1.1/test/functional/fixtures/project/config/ProjectConfiguration.class.php (copied) (copied from branches/1.1/test/functional/fixtures/project/config/ProjectConfiguration.class.php)
- branches/dwhittle/1.1/test/functional/fixtures/project/lib/ProjectConfiguration.class.php (deleted)
- branches/dwhittle/1.1/test/functional/fixtures/project/lib/cacheConfiguration.class.php (deleted)
- branches/dwhittle/1.1/test/functional/fixtures/project/lib/frontendConfiguration.class.php (deleted)
- branches/dwhittle/1.1/test/functional/fixtures/project/lib/i18nConfiguration.class.php (deleted)
- branches/dwhittle/1.1/test/functional/fixtures/project/test/bootstrap/functional.php (modified) (1 diff)
- branches/dwhittle/1.1/test/functional/fixtures/project/test/bootstrap/unit.php (modified) (1 diff)
- branches/dwhittle/1.1/test/functional/fixtures/project/web/cache.php (modified) (1 diff)
- branches/dwhittle/1.1/test/functional/fixtures/project/web/cache_dev.php (modified) (1 diff)
- branches/dwhittle/1.1/test/functional/fixtures/project/web/dimensions.php (deleted)
- branches/dwhittle/1.1/test/functional/fixtures/project/web/dimensions_dev.php (deleted)
- branches/dwhittle/1.1/test/functional/fixtures/project/web/frontend_dev.php (modified) (1 diff)
- branches/dwhittle/1.1/test/functional/fixtures/project/web/i18n.php (modified) (1 diff)
- branches/dwhittle/1.1/test/functional/fixtures/project/web/i18n_dev.php (modified) (1 diff)
- branches/dwhittle/1.1/test/functional/fixtures/project/web/index.php (modified) (1 diff)
- branches/dwhittle/1.1/test/functional/fixtures/project/web/routing.php (modified) (1 diff)
- branches/dwhittle/1.1/test/functional/fixtures/project/web/routing_dev.php (modified) (1 diff)
- branches/dwhittle/1.1/test/other/tasksTest.php (modified) (1 diff)
- branches/dwhittle/1.1/test/unit/storage/sfStorageTest.php (modified) (2 diffs)
- branches/dwhittle/1.1/test/unit/task/cache/sfCacheClearTaskTest.php (modified) (1 diff)
- branches/dwhittle/1.1/test/unit/user/sfUserTest.php (modified) (3 diffs)
- branches/dwhittle/1.1/test/unit/util/fixtures/yaml/index.yml (modified) (1 diff)
- branches/dwhittle/1.1/test/unit/util/fixtures/yaml/sfObjects.yml (copied) (copied from branches/1.1/test/unit/util/fixtures/yaml/sfObjects.yml)
- branches/dwhittle/1.1/test/unit/util/sfYamlDumperTest.php (modified) (2 diffs)
- branches/dwhittle/1.1/test/unit/util/sfYamlParserTest.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/dwhittle/1.0/lib/filter/sfCacheFilter.class.php
r7772 r7989 119 119 { 120 120 // set some headers that deals with cache 121 $lifetime = $this->cacheManager->getClientLifeTime($uri, 'page'); 122 $this->response->setHttpHeader('Last-Modified', $this->response->getDate(time()), false); 123 $this->response->setHttpHeader('Expires', $this->response->getDate(time() + $lifetime), false); 124 $this->response->addCacheControlHttpHeader('max-age', $lifetime); 121 if ($lifetime = $this->cacheManager->getClientLifeTime($uri, 'page')) 122 { 123 $this->response->setHttpHeader('Last-Modified', $this->response->getDate(time()), false); 124 $this->response->setHttpHeader('Expires', $this->response->getDate(time() + $lifetime), false); 125 $this->response->addCacheControlHttpHeader('max-age', $lifetime); 126 } 125 127 126 128 // set Vary headers branches/dwhittle/1.0/lib/util/sfToolkit.class.php
r7797 r7989 177 177 public static function stripComments($source) 178 178 { 179 if (!sfConfig::get('sf_strip_comments', true)) 180 { 181 return $source; 182 } 183 184 // tokenizer available? 185 if (!function_exists('token_get_all')) 186 { 187 $source = sfToolkit::pregtr($source, array('#/\*((?!\*/)[\d\D\s])*\*/#' => '', // remove /* ... */ 188 '#^\s*//.*$#m' => '')); // remove // ... 189 179 if (!sfConfig::get('sf_strip_comments', true) || !function_exists('token_get_all')) 180 { 190 181 return $source; 191 182 } branches/dwhittle/1.0/lib/view/sfViewCacheManager.class.php
r6598 r7989 170 170 'withLayout' => isset($options['withLayout']) ? $options['withLayout'] : false, 171 171 'lifeTime' => $options['lifeTime'], 172 'clientLifeTime' => isset($options['clientLifeTime']) && $options['clientLifeTime']? $options['clientLifeTime'] : $options['lifeTime'],172 'clientLifeTime' => isset($options['clientLifeTime']) ? $options['clientLifeTime'] : $options['lifeTime'], 173 173 'contextual' => isset($options['contextual']) ? $options['contextual'] : false, 174 174 'vary' => isset($options['vary']) ? $options['vary'] : array(), branches/dwhittle/1.1/UPGRADE
r7918 r7989 30 30 [php] 31 31 chdir(dirname(__FILE__)); 32 require_once(dirname(__FILE__).'/ lib/ProjectConfiguration.class.php');32 require_once(dirname(__FILE__).'/config/ProjectConfiguration.class.php'); 33 33 $configuration = new ProjectConfiguration(); 34 34 include($configuration->getSymfonyLibDir().'/command/cli.php'); … … 38 38 $ cp /path/to/symfony/lib/task/generator/skeleton/project/symfony symfony 39 39 40 * Create a ` lib/ProjectConfiguration.class.php` file with the following content:40 * Create a `config/ProjectConfiguration.class.php` file with the following content: 41 41 42 42 [php] … … 59 59 You can also copy the skeleton file from the symfony project skeleton directly: 60 60 61 $ cp /path/to/symfony/lib/task/generator/skeleton/project/ lib/ProjectConfiguration.class.php lib/ProjectConfiguration.class.php61 $ cp /path/to/symfony/lib/task/generator/skeleton/project/config/ProjectConfiguration.class.php config/ProjectConfiguration.class.php 62 62 63 63 * Launch the `project:upgrade1.1` task from your project directory … … 426 426 427 427 [php] 428 $databaseManager = new sfDatabaseManager(); 428 $configuration = ProjectConfiguration::getApplicationConfiguration($application, $env, true); 429 $databaseManager = new sfDatabaseManager($configuration); 429 430 $databaseManager->loadConfiguration(); 430 431 … … 583 584 ---------- 584 585 585 The `sfViewCacheManager::removePattern()` and `sfToolkit::clearGlob()` don't work anymore for removing several cache parts at once. But the `sfViewCacheManager::remove()` now accepts internal URIs with wildcards. So you can replace: 586 The `sfViewCacheManager::removePattern()` and `sfToolkit::clearGlob()` don't work anymore 587 for removing several cache parts at once. But the `sfViewCacheManager::remove()` now 588 accepts internal URIs with wildcards. So you can replace: 586 589 587 590 $cacheManager->removePattern('*/all/user/show/id/*'); … … 599 602 $cacheManager->remove('@sf_cache_partial?module=user&action=_my_partial&sf_cache_key=*'); 600 603 601 And the biggets benefit is that it allows you to clear 'glob' URIs in *any* cache factory, noy only the `sfFileCache`. 604 And the biggets benefit is that it allows you to clear 'glob' URIs in *any* cache 605 factory, not only the `sfFileCache`. 606 607 NOTE to early adopters 608 ---------------------- 609 610 If you have upgraded your project and have a `lib/Projectconfiguratioun.class.php` file, 611 then you need to upgrade your project manually before being able to launch the 612 `project:upgrade1.1` task. 613 614 Here is how: 615 616 * Move `lib/ProjectConfiguration.class.php` to `config/ProjectConfiguration.class.php` 617 618 * Change the path to symfony in `config/ProjectConfiguration.class.php` if needed. 619 620 * Move all your application configuration classes (`lib/$APP_NAME$Configuration.class.php`) 621 to their respective `apps/$APP_NAME$/config/` directory. 622 623 * Remove the `require_once dirname(__FILE__).'/ProjectConfiguration.class.php';` in all 624 the application configuration classes. 625 626 * Change the location of `ProjectConfiguration.class.php` in the main `symfony` script to `config/` 627 628 * Change your front controllers so they look like this: 629 630 {{{ 631 <?php 632 633 require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php'); 634 635 $configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'dev', true); 636 sfContext::createInstance($configuration)->dispatch(); 637 }}} 638 639 You can now launch the `project:upgrade1.1` script to finish the upgrade. branches/dwhittle/1.1/lib/config/sfApplicationConfiguration.class.php
r7853 r7989 76 76 77 77 /** 78 * Returns a sfApplicationConfiguration configuration for a given application.79 *80 * @param string An application name81 * @param string The environment name82 * @param Boolean true to enable debug mode83 * @param string The project root directory84 *85 * @return sfApplicationConfiguration A sfApplicationConfiguration instance86 */87 static public function getForApplication($application, $environment, $debug, $rootDir = null)88 {89 $class = $application.'Configuration';90 91 return new $class($environment, $debug, $rootDir);92 }93 94 /**95 78 * @see sfProjectConfiguration 96 79 */ branches/dwhittle/1.1/lib/config/sfProjectConfiguration.class.php
r7697 r7989 33 33 sfProjectConfiguration::$active = $this; 34 34 35 if (is_null($rootDir)) 36 { 37 $r = new ReflectionObject($this); 38 39 $this->rootDir = realpath(dirname($r->getFileName()).'/..'); 40 } 41 else 42 { 43 $this->rootDir = realpath($rootDir); 44 } 35 $this->rootDir = is_null($rootDir) ? self::guessRootDir() : realpath($rootDir); 45 36 46 37 $this->symfonyLibDir = realpath(dirname(__FILE__).'/..'); … … 262 253 return sfProjectConfiguration::$active; 263 254 } 255 256 static public function guessRootDir() 257 { 258 $r = new ReflectionClass('ProjectConfiguration'); 259 260 return realpath(dirname($r->getFileName()).'/..'); 261 } 262 263 /** 264 * Returns a sfApplicationConfiguration configuration for a given application. 265 * 266 * @param string An application name 267 * @param string The environment name 268 * @param Boolean true to enable debug mode 269 * @param string The project root directory 270 * 271 * @return sfApplicationConfiguration A sfApplicationConfiguration instance 272 */ 273 static public function getApplicationConfiguration($application, $environment, $debug, $rootDir = null) 274 { 275 $class = $application.'Configuration'; 276 277 if (is_null(sfProjectConfiguration::$active)) 278 { 279 // force initialization of sf_apps_dir config setting 280 new ProjectConfiguration(); 281 } 282 283 require_once sfConfig::get('sf_apps_dir').'/'.$application.'/config/'.$class.'.class.php'; 284 285 if (is_null($rootDir)) 286 { 287 $rootDir = self::guessRootDir(); 288 } 289 290 return new $class($environment, $debug, $rootDir); 291 } 264 292 } branches/dwhittle/1.1/lib/controller/sfWebController.class.php
r7918 r7989 113 113 public function convertUrlStringToParameters($url) 114 114 { 115 $givenUrl = $url; 116 115 117 $params = array(); 116 118 $query_string = ''; … … 146 148 $route_name = substr($url, 1); 147 149 } 150 else if (false !== strpos($url, '/')) 151 { 152 list($params['module'], $params['action']) = explode('/', $url); 153 } 148 154 else 149 155 { 150 list($params['module'], $params['action']) = explode('/', $url);156 throw new InvalidArgumentException(sprintf('An internal URI must contain a module and an action (module/action) ("%s" given).', $givenUrl)); 151 157 } 152 158 branches/dwhittle/1.1/lib/debug/sfDebug.class.php
r7879 r7989 106 106 * @return array The request parameter holders 107 107 */ 108 public static function requestAsArray( $request)108 public static function requestAsArray(sfRequest $request) 109 109 { 110 110 if (!$request) … … 126 126 * @return array The response parameters 127 127 */ 128 public static function responseAsArray( $response)128 public static function responseAsArray(sfResponse $response) 129 129 { 130 130 if (!$response) … … 145 145 146 146 /** 147 * Returns user parameters as an array. 148 * 149 * @param sfUser A sfUser instance 150 * 151 * @return array The user parameters 152 */ 153 public static function userAsArray(sfUser $user) 154 { 155 if (!$user) 156 { 157 return array(); 158 } 159 160 return array( 161 'options' => $user->getOptions(), 162 'attributeHolder' => self::flattenParameterHolder($user->getAttributeHolder()), 163 'culture' => $user->getCulture(), 164 ); 165 } 166 167 /** 147 168 * Returns a parameter holder as an array. 148 169 * branches/dwhittle/1.1/lib/debug/sfWebDebug.class.php
r7918 r7989 312 312 'xdebug' => (sfConfig::get('sf_xdebug', true) && extension_loaded('xdebug')) ? 'on' : 'off', 313 313 'syck' => extension_loaded('syck') ? 'on' : 'off', 314 'tokenizer' => function_exists('token_get_all') ? 'on' : 'off', 314 315 'apc' => extension_loaded('apc') && ini_get('apc.enabled') ? 'on' : 'off', 315 316 'memcache' => extension_loaded('memcache') ? 'on' : 'off', … … 333 334 $result .= $this->formatArrayAsHtml('request', sfDebug::requestAsArray($context->getRequest())); 334 335 $result .= $this->formatArrayAsHtml('response', sfDebug::responseAsArray($context->getResponse())); 336 $result .= $this->formatArrayAsHtml('user', sfDebug::userAsArray($context->getUser())); 335 337 $result .= $this->formatArrayAsHtml('settings', sfDebug::settingsAsArray()); 336 338 $result .= $this->formatArrayAsHtml('globals', sfDebug::globalsAsArray()); … … 354 356 $content = ' 355 357 <h2>'.$id.' <a href="#" onclick="sfWebDebugToggle(\'sfWebDebug'.$id.'\'); return false;">'.image_tag(sfConfig::get('sf_web_debug_web_dir').'/images/toggle.gif').'</a></h2> 356 <div id="sfWebDebug'.$id.'" style="display: none"><pre>'.htmlspecialchars( @sfYaml::dump($values), ENT_QUOTES, sfConfig::get('sf_charset')).'</pre></div>358 <div id="sfWebDebug'.$id.'" style="display: none"><pre>'.htmlspecialchars(sfYaml::dump($values), ENT_QUOTES, sfConfig::get('sf_charset')).'</pre></div> 357 359 '; 358 360 branches/dwhittle/1.1/lib/filter/sfCacheFilter.class.php
r7772 r7989 112 112 { 113 113 // set some headers that deals with cache 114 $lifetime = $this->cacheManager->getClientLifeTime($uri, 'page'); 115 $this->response->setHttpHeader('Last-Modified', $this->response->getDate(time()), false); 116 $this->response->setHttpHeader('Expires', $this->response->getDate(time() + $lifetime), false); 117 $this->response->addCacheControlHttpHeader('max-age', $lifetime); 114 if ($lifetime = $this->cacheManager->getClientLifeTime($uri, 'page')) 115 { 116 $this->response->setHttpHeader('Last-Modified', $this->response->getDate(time()), false); 117 $this->response->setHttpHeader('Expires', $this->response->getDate(time() + $lifetime), false); 118 $this->response->addCacheControlHttpHeader('max-age', $lifetime); 119 } 118 120 119 121 // set Vary headers branches/dwhittle/1.1/lib/i18n/sfI18N.class.php
r7942 r7989 41 41 * Initializes this class. 42 42 * 43 * Available options: 44 * 45 * * culture: The culture 46 * * source: The i18n source (XLIFF by default) 47 * * debug: Whether to enable debug or not (false by default) 48 * * database: The database name (default by default) 49 * * untranslated_prefix: The prefix to use when a message is not translated 50 * * untranslated_suffix: The suffix to use when a message is not translated 51 * 43 52 * @param sfApplicationConfiguration A sfApplicationConfiguration instance 44 53 * @param sfCache A sfCache instance branches/dwhittle/1.1/lib/i18n/sfMessageSource_File.class.php
r6812 r7989 33 33 /** 34 34 * Separator between culture name and source. 35 * @var string 35 * @var string 36 36 */ 37 37 protected $dataSeparator = '.'; … … 86 86 * 87 87 * @param string catalogue name 88 * @return array list of all variants for this catalogue. 88 * @return array list of all variants for this catalogue. 89 89 */ 90 90 public function getCatalogueList($catalogue) … … 117 117 * 118 118 * @param string a particular catalogue. 119 * @return array a list of catalogues. 119 * @return array a list of catalogues. 120 120 * @see getCatalogueList() 121 121 */ … … 143 143 * E.g. array('messages', 'en_AU') 144 144 * 145 * @return array list of catalogues 145 * @return array list of catalogues 146 146 * @see getCatalogues() 147 147 */ … … 156 156 * E.g. array('messages', 'en_AU') 157 157 * 158 * @return array list of catalogues 158 * @return array list of catalogues 159 159 */ 160 160 protected function getCatalogues($dir = null, $variant = null) 161 161 { 162 $dir = $dir ? $dir : $this-> source;162 $dir = $dir ? $dir : $this->getSource($variant); 163 163 $files = scandir($dir); 164 164 branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/test/bootstrap/functional.php
r7730 r7989 14 14 } 15 15 16 $class = $app.'Configuration'; 17 require $root_dir.'/lib/'.$class.'.class.php'; 18 $configuration = new $class('test', isset($debug) ? $debug : true, $root_dir); 16 17 require_once $root_dir.'/config/ProjectConfiguration.class.php'; 18 $configuration = ProjectConfiguration::getApplicationConfiguration($app, 'test', isset($debug) ? $debug : true); 19 19 20 sfContext::createInstance($configuration); 20 21 branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/test/bootstrap/functional.php
r7618 r7989 19 19 } 20 20 21 $class = $app.'Configuration'; 22 require_once(dirname(__FILE__).'/../../lib/'.$class.'.class.php'); 23 24 $configuration = new $class('test', true); 21 require_once dirname(__FILE__).'/../../config/ProjectConfiguration.class.php'; 22 $configuration = ProjectConfiguration::getApplicationConfiguration($app, 'test', isset($debug) ? $debug : true); 25 23 sfContext::createInstance($configuration); 26 24 branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/test/bootstrap/unit.php
r7618 r7989 11 11 $_test_dir = realpath(dirname(__FILE__).'/..'); 12 12 13 require_once(dirname(__FILE__).'/../../ lib/ProjectConfiguration.class.php');13 require_once(dirname(__FILE__).'/../../config/ProjectConfiguration.class.php'); 14 14 $configuration = new ProjectConfiguration(realpath($_test_dir.'/..')); 15 15 include($configuration->getSymfonyLibDir().'/vendor/lime/lime.php'); branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/web/frontend_dev.php
r7618 r7989 1 1 <?php 2 2 3 require_once(dirname(__FILE__).'/../ lib/frontendConfiguration.class.php');3 require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php'); 4 4 5 $configuration = new frontendConfiguration('dev', true);5 $configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'dev', true); 6 6 sfContext::createInstance($configuration)->dispatch(); branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/test/functional/fixtures/web/index.php
r7618 r7989 1 1 <?php 2 2 3 require_once(dirname(__FILE__).'/../ lib/frontendConfiguration.class.php');3 require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php'); 4 4 5 $configuration = new frontendConfiguration('prod', false);5 $configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'prod', false); 6 6 sfContext::createInstance($configuration)->dispatch(); branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/lib/propel/validator/sfPropelUniqueValidator.class.php
r6707 r7989 30 30 * @version SVN: $Id$ 31 31 */ 32 class sfPropelUniqueValidator extends sfValidator Base32 class sfPropelUniqueValidator extends sfValidator 33 33 { 34 34 public function execute(&$value, &$error) branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelBuildAllLoadTask.class.php
r7680 r7989 61 61 { 62 62 // load Propel configuration before Phing 63 $configuration = sfApplicationConfiguration::getForApplication($arguments['application'], $options['env'], true);63 $configuration = ProjectConfiguration::getApplicationConfiguration($arguments['application'], $options['env'], true); 64 64 $databaseManager = new sfDatabaseManager($configuration); 65 65 branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelDataDumpTask.class.php
r7918 r7989 69 69 protected function execute($arguments = array(), $options = array()) 70 70 { 71 $configuration = sfApplicationConfiguration::getForApplication($arguments['application'], $options['env'], true);71 $configuration = ProjectConfiguration::getApplicationConfiguration($arguments['application'], $options['env'], true); 72 72 73 73 $databaseManager = new sfDatabaseManager($configuration); branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelDataLoadTask.class.php
r7618 r7989 84 84 } 85 85 86 $configuration = sfApplicationConfiguration::getForApplication($arguments['application'], $options['env'], true);86 $configuration = ProjectConfiguration::getApplicationConfiguration($arguments['application'], $options['env'], true); 87 87 88 88 $databaseManager = new sfDatabaseManager($configuration); branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/om/php5/PHP5ObjectBuilder.php
r7955 r7989 2 2 3 3 /* 4 * $Id: PHP5ObjectBuilder.php 100 5 2008-03-18 15:10:29Z hans $4 * $Id: PHP5ObjectBuilder.php 1006 2008-03-19 15:30:19Z hans $ 5 5 * 6 6 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS … … 2173 2173 $colFK = $tblFK->getColumn($colFKName); 2174 2174 if ($colFK === null) { 2175 $e = new Exception("Column $colFKName not found in " . $tblFK->getName()); 2176 print $e; 2177 throw $e; 2175 throw new EngineException("Column $colFKName not found in " . $tblFK->getName()); 2178 2176 } 2177 $clo = strtolower($column->getName()); 2179 2178 $script .= " 2180 \$criteria->add(".$fkPeerBuilder->getColumnConstant($colFK).", \$this-> get".$column->getPhpName()."());2179 \$criteria->add(".$fkPeerBuilder->getColumnConstant($colFK).", \$this->$clo); 2181 2180 "; 2182 2181 } // end foreach ($fk->getForeignColumns() … … 2195 2194 $colFKName = $flMap[$columnName]; 2196 2195 $colFK = $tblFK->getColumn($colFKName); 2196 $clo = strtolower($column->getName()); 2197 2197 $script .= " 2198 \$criteria->add(".$fkPeerBuilder->getColumnConstant($colFK).", \$this-> get".$column->getPhpName()."());2198 \$criteria->add(".$fkPeerBuilder->getColumnConstant($colFK).", \$this->$clo); 2199 2199 "; 2200 2200 } /* end foreach ($fk->getForeignColumns() */ … … 2588 2588 "; 2589 2589 $script .= " 2590 if (\$this->$varName === null && !\$this->isNew()) { 2591 "; 2590 if (\$this->$varName === null && !\$this->isNew()) {"; 2592 2591 2593 2592 $lfmap = $refFK->getLocalForeignMapping(); … … 2605 2604 foreach ($tblFK->getPrimaryKey() as $col) { 2606 2605 $localColumn = $table->getColumn($lfmap[$col->getName()]); 2607 $params[] = "\$this->get".$localColumn->getPhpName()."()"; 2606 $clo = strtolower($localColumn->getName()); 2607 $params[] = "\$this->$clo"; 2608 2608 } 2609 2609 2610 2610 $script .= " 2611 2611 \$this->$varName = ".$joinedTableObjectBuilder->getPeerClassname()."::retrieveByPK(".implode(", ", $params).", \$con); 2612 } // if (\$this->$varName === null)2612 } 2613 2613 2614 2614 return \$this->$varName; branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/test/bootstrap/functional.php
r7721 r7989 20 20 } 21 21 22 $class = $app.'Configuration'; 23 require $root_dir.'/lib/'.$class.'.class.php'; 24 $configuration = new $class('test', isset($debug) ? $debug : true); 22 require_once $root_dir.'/config/ProjectConfiguration.class.php'; 23 $configuration = ProjectConfiguration::getApplicationConfiguration($app, 'test', isset($debug) ? $debug : true); 25 24 sfContext::createInstance($configuration); 26 25 branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/test/functional/crud/crudBrowser.class.php
r7699 r7989 25 25 $task->run(array('crud', 'article', 'Article'), $options); 26