Development

Changeset 6365

You must first sign up to be able to contribute.

Changeset 6365

Show
Ignore:
Timestamp:
12/07/07 17:03:14 (10 months ago)
Author:
fabien
Message:

refactored cache framework

  • renamed some options to underscore convention
    • automaticCleaningFactor -> automatic_cleaning_factor
    • cacheDir -> cache_dir
  • prefix is now a global option for all cache classes (defaults to SF_APP_DIR)
  • upgraded all functional tests
  • fixed upgrade task for autoloading (closes #2468)
  • updated UPDATE file
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/UPGRADE

    r5493 r6365  
    101101        class: sfFileCache 
    102102        param: 
    103           automaticCleaningFactor: 0 
    104           cacheDir:                %SF_I18N_CACHE_DIR% 
    105           lifetime:                86400 
     103          automatic_cleaning_factor: 0 
     104          cache_dir:                 %SF_I18N_CACHE_DIR% 
     105          lifetime:                  86400 
     106          prefix:                    %SF_APP_DIR% 
    106107 
    107108  routing: 
     
    146147The `project:upgrade1.1` task makes all those changes for you. 
    147148 
    148 sfFunctionCache 
     149Cache Framework 
    149150--------------- 
    150151 
    151 The sfFunctionCache object does not extend sfFileCache anymore. 
     152The `sfFunctionCache` class does not extend `sfFileCache` anymore. 
    152153You must now pass a cache object to the constructor. 
    153154The first argument to ->call() must now be a PHP callable. 
     155 
     156Some `sfCache` configuration parameter have changed their named to underscore names: 
     157 
     158  * automaticCleaningFactor -> automatic_cleaning_factor 
     159  * cacheDir -> cache_dir 
     160 
     161The `project:upgrade1.1` task makes all those changes for you. 
    154162 
    155163Autoloading 
     
    261269If you use the symfony 1.0 interface for validation, your custom validators must 
    262270now extend the `sfValidatorBase` class. 
     271 
  • trunk/data/config/factories.yml

    r5844 r6365  
    2020    class: sfFileCache 
    2121    param: 
    22       automaticCleaningFactor: 0 
    23       cacheDir:                %SF_TEMPLATE_CACHE_DIR% 
    24       lifetime:                86400 
     22      automatic_cleaning_factor: 0 
     23      cache_dir:                 %SF_TEMPLATE_CACHE_DIR% 
     24      lifetime:                  86400 
     25      prefix:                    %SF_APP_DIR% 
    2526 
    2627  i18n: 
     
    3031        class: sfFileCache 
    3132        param: 
    32           automaticCleaningFactor: 0 
    33           cacheDir:                %SF_I18N_CACHE_DIR% 
    34           lifetime:                86400 
     33          automatic_cleaning_factor: 0 
     34          cache_dir:                 %SF_I18N_CACHE_DIR% 
     35          lifetime:                  86400 
     36          prefix:                    %SF_APP_DIR% 
    3537 
    3638  routing: 
  • trunk/data/skeleton/app/app/config/factories.yml

    r4890 r6365  
    4141#    class: sfFileCache 
    4242#    param: 
    43 #      automaticCleaningFactor: 0 
    44 #      cacheDir:                %SF_TEMPLATE_CACHE_DIR% 
    45 #      lifetime:                86400 
     43#      automatic_cleaning_factor: 0 
     44#      cache_dir:                 %SF_TEMPLATE_CACHE_DIR% 
     45#      lifetime:                  86400 
     46#      prefix:                    %SF_APP_DIR% 
    4647# 
    4748#  i18n: 
     
    5152#        class: sfFileCache 
    5253#        param: 
    53 #          automaticCleaningFactor: 0 
    54 #          cacheDir:                %SF_I18N_CACHE_DIR% 
    55 #          lifetime:                86400 
     54#          automatic_cleaning_factor: 0 
     55#          cache_dir:                 %SF_I18N_CACHE_DIR% 
     56#          lifetime:                  86400 
     57#          prefix:                    %SF_APP_DIR% 
    5658# 
    5759#  routing: 
  • trunk/lib/cache/sfAPCCache.class.php

    r6363 r6365  
    1919class sfAPCCache extends sfCache 
    2020{ 
    21   protected $prefix = ''; 
    22  
    2321  /** 
    2422   * Initializes this sfCache instance. 
     
    3836      throw new sfInitializationException('You must have APC installed and enabled to use sfAPCCache class.'); 
    3937    } 
    40  
    41     $this->prefix = md5(sfConfig::get('sf_app_dir')).self::SEPARATOR; 
    4238  } 
    4339 
     
    4743  public function get($key, $default = null) 
    4844  { 
    49     $value = apc_fetch($this->prefix.$key); 
     45    $value = apc_fetch($this->getOption('prefix').$key); 
    5046 
    5147    return false === $value ? $default : $value; 
     
    5753  public function has($key) 
    5854  { 
    59     return !(false === apc_fetch($this->prefix.$key)); 
     55    return !(false === apc_fetch($this->getOption('prefix').$key)); 
    6056  } 
    6157 
     
    6561  public function set($key, $data, $lifetime = null) 
    6662  { 
    67     return apc_store($this->prefix.$key, $data, $this->getLifetime($lifetime)); 
     63    return apc_store($this->getOption('prefix').$key, $data, $this->getLifetime($lifetime)); 
    6864  } 
    6965 
     
    7369  public function remove($key) 
    7470  { 
    75     return apc_delete($this->prefix.$key); 
     71    return apc_delete($this->getOption('prefix').$key); 
    7672  } 
    7773 
     
    124120    } 
    125121 
    126     $regexp = self::patternToRegexp($this->prefix.$pattern); 
     122    $regexp = self::patternToRegexp($this->getOption('prefix').$pattern); 
    127123 
    128124    foreach ($infos['cache_list'] as $info) 
     
    143139      foreach ($infos['cache_list'] as $info) 
    144140      { 
    145         if ($this->prefix.$key == $info['info']) 
     141        if ($this->getOption('prefix').$key == $info['info']) 
    146142        { 
    147143          return $info; 
  • trunk/lib/cache/sfCache.class.php

    r6363 r6365  
    2424 
    2525  protected 
    26     $options = array(); 
     26    $options = array(), 
     27    $prefix  = ''; 
    2728 
    2829  /** 
     
    4344   * Available options: 
    4445   * 
    45    * * automaticCleaningFactor (optional): The automatic cleaning process destroy too old (for the given life time) (default value: 1000) 
     46   * * automatic_cleaning_factor: The automatic cleaning process destroy too old (for the given life time) (default value: 1000) 
    4647   *   cache files when a new cache file is written. 
    4748   *     0               => no automatic cache cleaning 
     
    5556  public function initialize($options = array()) 
    5657  { 
    57     $this->options = array_merge(array('automaticCleaningFactor' => 1000, 'lifetime' => 86400), $options); 
     58    $this->options = array_merge(array( 
     59      'automatic_cleaning_factor' => 1000, 
     60      'lifetime'                  => 86400, 
     61      'prefix'                    => md5(dirname(__FILE__)), 
     62    ), $options); 
     63 
     64    $this->options['prefix'] .= self::SEPARATOR; 
    5865  } 
    5966 
  • trunk/lib/cache/sfEAcceleratorCache.class.php

    r6363 r6365  
    1919class sfEAcceleratorCache extends sfCache 
    2020{ 
    21   protected $prefix = ''; 
    22  
    2321  /** 
    2422   * Initializes this sfCache instance. 
     
    3836      throw new sfInitializationException('You must have EAccelerator installed and enabled to use sfEAcceleratorCache class (or perhaps you forgot to add --with-eaccelerator-shared-memory when installing).'); 
    3937    } 
    40  
    41     $this->prefix = md5(sfConfig::get('sf_app_dir')).self::SEPARATOR; 
    4238  } 
    4339 
     
    4743  public function get($key, $default = null) 
    4844  { 
    49     $value = eaccelerator_get($this->prefix.$key); 
     45    $value = eaccelerator_get($this->getOption('prefix').$key); 
    5046 
    5147    return is_null($value) ? $default : $value; 
     
    5753  public function has($key) 
    5854  { 
    59     return !is_null(eaccelerator_get($this->prefix.$key)); 
     55    return !is_null(eaccelerator_get($this->getOption('prefix').$key)); 
    6056  } 
    6157 
     
    6561  public function set($key, $data, $lifetime = null) 
    6662  { 
    67     return eaccelerator_put($this->prefix.$key, $data, $this->getLifetime($lifetime)); 
     63    return eaccelerator_put($this->getOption('prefix').$key, $data, $this->getLifetime($lifetime)); 
    6864  } 
    6965 
     
    7369  public function remove($key) 
    7470  { 
    75     return eaccelerator_rm($this->prefix.$key); 
     71    return eaccelerator_rm($this->getOption('prefix').$key); 
    7672  } 
    7773 
     
    8581    if (is_array($infos)) 
    8682    { 
    87       $regexp = self::patternToRegexp($this->prefix.$pattern); 
     83      $regexp = self::patternToRegexp($this->getOption('prefix').$pattern); 
    8884 
    8985      foreach ($infos as $info) 
     
    9187        if (preg_match($regexp, $info['name'])) 
    9288        { 
    93           eaccelerator_rm($this->prefix.$key); 
     89          eaccelerator_rm($this->getOption('prefix').$key); 
    9490        } 
    9591      } 
     
    112108      foreach ($infos as $info) 
    113109      { 
    114         if (false !== strpos($info['name'], $this->prefix)) 
     110        if (false !== strpos($info['name'], $this->getOption('prefix'))) 
    115111        { 
    116112          // eaccelerator bug (http://eaccelerator.net/ticket/287) 
     
    161157      foreach ($infos as $info) 
    162158      { 
    163         if ($this->prefix.$key == $info['name']) 
     159        if ($this->getOption('prefix').$key == $info['name']) 
    164160        { 
    165161          return $info; 
  • trunk/lib/cache/sfFileCache.class.php

    r6363 r6365  
    3030  * Available options: 
    3131  * 
    32   * * cacheDir: The directory where to put cache files 
     32  * * cache_dir: The directory where to put cache files 
    3333  * 
    3434  * * see sfCache for options available for all drivers 
     
    4040    parent::initialize($options); 
    4141 
    42     if (!$this->getOption('cacheDir')) 
    43     { 
    44       throw new sfInitializationException('You must pass a "cacheDir" option to initialize a sfFileCache object.'); 
    45     } 
    46  
    47     $this->setCacheDir($this->getOption('cacheDir')); 
     42    if (!$this->getOption('cache_dir')) 
     43    { 
     44      throw new sfInitializationException('You must pass a "cache_dir" option to initialize a sfFileCache object.'); 
     45    } 
     46 
     47    $this->setcache_dir($this->getOption('cache_dir')); 
    4848  } 
    4949 
     
    7474  public function set($key, $data, $lifetime = null) 
    7575  { 
    76     if ($this->getOption('automaticCleaningFactor') > 0 && rand(1, $this->getOption('automaticCleaningFactor')) == 1) 
     76    if ($this->getOption('automatic_cleaning_factor') > 0 && rand(1, $this->getOption('automatic_cleaning_factor')) == 1) 
    7777    { 
    7878      $this->clean(sfCache::OLD); 
     
    101101      $regexp = self::patternToRegexp($pattern); 
    102102      $paths = array(); 
    103       foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->getOption('cacheDir'))) as $path) 
     103      foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->getOption('cache_dir'))) as $path) 
    104104      { 
    105         if (preg_match($regexp, str_replace($this->getOption('cacheDir').DIRECTORY_SEPARATOR, '', $path))) 
     105        if (preg_match($regexp, str_replace($this->getOption('cache_dir').DIRECTORY_SEPARATOR, '', $path))) 
    106106        { 
    107107          $paths[] = $path; 
     
    111111    else 
    112112    { 
    113       $paths = glob($this->getOption('cacheDir').DIRECTORY_SEPARATOR.str_replace(sfCache::SEPARATOR, DIRECTORY_SEPARATOR, $pattern).self::EXTENSION); 
     113      $paths = glob($this->getOption('cache_dir').DIRECTORY_SEPARATOR.str_replace(sfCache::SEPARATOR, DIRECTORY_SEPARATOR, $pattern).self::EXTENSION); 
    114114    } 
    115115 
     
    132132  public function clean($mode = sfCache::ALL) 
    133133  { 
    134     if (!is_dir($this->getOption('cacheDir'))) 
     134    if (!is_dir($this->getOption('cache_dir'))) 
    135135    { 
    136136      return true; 
     
    138138 
    139139    $result = true; 
    140     foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->getOption('cacheDir'))) as $file) 
     140    foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->getOption('cache_dir'))) as $file) 
    141141    { 
    142142      if (sfCache::ALL == $mode || time() > $this->read($file, self::READ_TIMEOUT)) 
     
    190190  protected function getFilePath($key) 
    191191  { 
    192     return $this->getOption('cacheDir').DIRECTORY_SEPARATOR.str_replace(sfCache::SEPARATOR, DIRECTORY_SEPARATOR, $key).self::EXTENSION; 
     192    return $this->getOption('cache_dir').DIRECTORY_SEPARATOR.str_replace(sfCache::SEPARATOR, DIRECTORY_SEPARATOR, $key).self::EXTENSION; 
    193193  } 
    194194 
     
    294294   * @param string The directory where to put the cache files 
    295295   */ 
    296   protected function setCacheDir($cacheDir) 
     296  protected function setcache_dir($cache_dir) 
    297297  { 
    298298    // remove last DIRECTORY_SEPARATOR 
    299     if (DIRECTORY_SEPARATOR == substr($cacheDir, -1)) 
    300     { 
    301       $cacheDir = substr($cacheDir, 0, -1); 
     299    if (DIRECTORY_SEPARATOR == substr($cache_dir, -1)) 
     300    { 
     301      $cache_dir = substr($cache_dir, 0, -1); 
    302302    } 
    303303 
    304304    // create cache dir if needed 
    305     if (!is_dir($cacheDir)) 
     305    if (!is_dir($cache_dir)) 
    306306    { 
    307307      $current_umask = umask(0000); 
    308       @mkdir($cacheDir, 0777, true); 
     308      @mkdir($cache_dir, 0777, true); 
    309309      umask($current_umask); 
    310310    } 
  • trunk/lib/cache/sfMemcacheCache.class.php

    r6363 r6365  
    2020{ 
    2121  protected 
    22     $prefix   = '', 
    2322    $memcache = null; 
    2423 
     
    4847      throw new sfInitializationException('You must have memcache installed and enabled to use sfMemcacheCache class.'); 
    4948    } 
    50  
    51     $this->prefix = md5(sfConfig::get('sf_app_dir')).self::SEPARATOR; 
    5249 
    5350    if ($this->getOption('memcache')) 
     
    9188  public function get($key, $default = null) 
    9289  { 
    93     $value = $this->memcache->get($this->prefix.$key); 
     90    $value = $this->memcache->get($this->getOption('prefix').$key); 
    9491 
    9592    return false === $value ? $default : $value; 
     
    10198  public function has($key) 
    10299  { 
    103     return !(false === $this->memcache->get($this->prefix.$key)); 
     100    return !(false === $this->memcache->get($this->getOption('prefix').$key)); 
    104101  } 
    105102 
     
    120117    } 
    121118 
    122     return $this->memcache->set($this->prefix.$key, $data, false, $lifetime); 
     119    return $this->memcache->set($this->getOption('prefix').$key, $data, false, $lifetime); 
    123120  } 
    124121 
     
    128125  public function remove($key) 
    129126  { 
    130     $this->memcache->delete($this->prefix.'_metadata'.self::SEPARATOR.$key); 
    131  
    132     return $this->memcache->delete($this->prefix.$key); 
     127    $this->memcache->delete($this->getOption('prefix').'_metadata'.self::SEPARATOR.$key); 
     128 
     129    return $this->memcache->delete($this->getOption('prefix').$key); 
    133130  } 
    134131 
     
    180177    } 
    181178 
    182     $regexp = self::patternToRegexp($this->prefix.$pattern); 
     179    $regexp = self::patternToRegexp($this->getOption('prefix').$pattern); 
    183180 
    184181    foreach ($this->getCacheInfo() as $key) 
     
    197194  { 
    198195    $values = array(); 
    199     foreach ($this->memcache->get(array_map(create_function('$k', 'return "'.$this->prefix.'".$k;'), $keys)) as $key => $value) 
    200     { 
    201       $values[str_replace($this->prefix, '', $key)] = $value; 
     196    foreach ($this->memcache->get(array_map(create_function('$k', 'return "'.$this->getOption('prefix').'".$k;'), $keys)) as $key => $value) 
     197    { 
     198      $values[str_replace($this->getOption('prefix'), '', $key)] = $value; 
    202199    } 
    203200 
     
    214211  protected function getMetadata($key) 
    215212  { 
    216     return $this->memcache->get($this->prefix.'_metadata'.self::SEPARATOR.$key); 
     213    return $this->memcache->get($this->getOption('prefix').'_metadata'.self::SEPARATOR.$key); 
    217214  } 
    218215 
     
    225222  protected function setMetadata($key, $lifetime) 
    226223  { 
    227     $this->memcache->set($this->prefix.'_metadata'.self::SEPARATOR.$key, array('lastModified' => time(), 'timeout' => time() + $lifetime), false, $lifetime); 
     224    $this->memcache->set($this->getOption('prefix').'_metadata'.self::SEPARATOR.$key, array('lastModified' => time(), 'timeout' => time() + $lifetime), false, $lifetime); 
    228225  } 
    229226 
     
    235232  protected function setCacheInfo($key) 
    236233  { 
    237     $keys = $this->memcache->get($this->prefix.'_metadata'); 
     234    $keys = $this->memcache->get($this->getOption('prefix').'_metadata'); 
    238235    if (!is_array($keys)) 
    239236    { 
    240237      $keys = array(); 
    241238    } 
    242     $keys[] = $this->prefix.$key; 
    243     $this->memcache->set($this->prefix.'_metadata', $keys, 0); 
     239    $keys[] = $this->getOption('prefix').$key; 
     240    $this->memcache->set($this->getOption('prefix').'_metadata', $keys, 0); 
    244241  } 
    245242 
     
    251248  protected function getCacheInfo() 
    252249  { 
    253     $keys = $this->memcache->get($this->prefix.'_metadata'); 
     250    $keys = $this->memcache->get($this->getOption('prefix').'_metadata'); 
    254251    if (!is_array($keys)) 
    255252    { 
  • trunk/lib/cache/sfSQLiteCache.class.php

    r6363 r6365  
    1919class sfSQLiteCache extends sfCache 
    2020{ 
    21   protected $dbh = null; 
    22  
    23   protected $database = ''; 
     21  protected 
     22    $dbh      = null, 
     23  $database = ''; 
    2424 
    2525  /** 
     
    8282  public function set($key, $data, $lifetime = null) 
    8383  { 
    84     if ($this->getOption('automaticCleaningFactor') > 0 && rand(1, $this->getOption('automaticCleaningFactor')) == 1) 
     84    if ($this->getOption('automatic_cleaning_factor') > 0 && rand(1, $this->getOption('automatic_cleaning_factor')) == 1) 
    8585    { 
    8686      $this->clean(sfCache::OLD); 
  • trunk/lib/cache/sfXCacheCache.class.php

    r6363 r6365  
    1919class sfXCacheCache extends sfCache 
    2020{ 
    21   protected $prefix = ''; 
    22  
    2321  /** 
    2422   * Initializes this sfCache instance. 
     
    3836      throw new sfInitializationException('You must have XCache installed and enabled to use sfXCacheCache class.'); 
    3937    } 
    40  
    41     $this->prefix = md5(sfConfig::get('sf_app_dir')).self::SEPARATOR; 
    4238  } 
    4339 
     
    4743  public function get($key, $default = null) 
    4844  { 
    49     return xcache_isset($this->prefix.$key) ? substr(xcache_get($this->prefix.$key), 12) : $default; 
     45    return xcache_isset($this->getOption('prefix').$key) ? substr(xcache_get($this->getOption('prefix').$key), 12) : $default; 
    5046  } 
    5147 
     
    5551  public function has($key) 
    5652  { 
    57     return xcache_isset($this->prefix.$key); 
     53    return xcache_isset($this->getOption('prefix').$key); 
    5854  } 
    5955 
     
    6561    $lifetime = $this->getLifetime($lifetime); 
    6662 
    67     return xcache_set($this->prefix.$key, str_pad(time() + $lifetime, 12, 0, STR_PAD_LEFT).$data, $lifetime); 
     63    return xcache_set($this->getOption('prefix').$key, str_pad(time() + $lifetime, 12, 0, STR_PAD_LEFT).$data, $lifetime); 
    6864  } 
    6965 
     
    7369  public function remove($key) 
    7470  { 
    75     return xcache_unset($this->prefix.$key); 
     71    return xcache_unset($this->getOption('prefix').$key); 
    7672  } 
    7773 
     
    104100  public function getLastModified($key) 
    105101  { 
    106     if (!xcache_isset($this->prefix.$key)) 
     102    if (!xcache_isset($this->getOption('prefix').$key)) 
    107103    { 
    108104      return 0; 
     
    122118  public function getTimeout($key) 
    123119  { 
    124     return xcache_isset($this->prefix.$key) ? intval(substr(xcache_get($this->prefix.$key), 0, 12)) : 0; 
     120    return xcache_isset($this->getOption('prefix').$key) ? intval(substr(xcache_get($this->getOption('prefix').$key), 0, 12)) : 0; 
    125121  } 
    126122 
     
    132128    $this->checkAuth(); 
    133129 
    134     $regexp = self::patternToRegexp($this->prefix.$pattern); 
     130    $regexp = self::patternToRegexp($this->getOption('prefix').$pattern); 
    135131 
    136132    for ($i = 0, $max = xcache_count(XC_TYPE_VAR); $i < $max; $i++) 
     
    164160        foreach ($infos['cache_list'] as $info) 
    165161        { 
    166           if ($this->prefix.$key == $info['name']) 
     162          if ($this->getOption('prefix').$key == $info['name']) 
    167163          { 
    168164            return $info; 
  • trunk/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/backend/config/config.php

    r2369 r6365  
    77require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 
    88sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir); 
     9 
     10// insert your own autoloading callables here 
     11 
     12if (sfConfig::get('sf_debug')) 
     13{ 
     14  spl_autoload_register(array(sfAutoload::getInstance(), 'autoloadAgain')); 
     15} 
  • trunk/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/backend/config/factories.yml

    r4890 r6365  
     1prod: 
     2  logger: 
     3    class:   sfNoLogger 
     4    param: 
     5      level:   err 
     6      loggers: ~ 
    17cli: 
    28  controller: 
  • trunk/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/backend/config/settings.yml

    r5384 r6365  
    11prod: 
    22  .settings: 
     3    logging_enabled: off 
    34    no_script_name:           off 
    45 
  • trunk/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/crud/config/config.php

    r2369 r6365  
    77require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 
    88sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir); 
     9 
     10// insert your own autoloading callables here 
     11 
     12if (sfConfig::get('sf_debug')) 
     13{ 
     14  spl_autoload_register(array(sfAutoload::getInstance(), 'autoloadAgain')); 
     15} 
  • trunk/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/crud/config/factories.yml

    r4890 r6365  
     1prod: 
     2  logger: 
     3    class:   sfNoLogger 
     4    param: 
     5      level:   err 
     6      loggers: ~ 
    17cli: 
    28  controller: 
  • trunk/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/crud/config/settings.yml

    r5384 r6365  
    11prod: 
    22  .settings: 
     3    logging_enabled: off 
    34    no_script_name:           off 
    45 
  • trunk/lib/plugins/sfPropelPlugin/test/functional/fixtures/config/propel.ini

    r5103 r6365  
    4040propel.builder.addComments = false 
    4141propel.packageObjectModel = true 
     42 
     43propel.defaultTimeStampFormat = Y-m-d H:i:s 
     44propel.defaultTimeFormat = H:i:s 
     45propel.defaultDateFormat = Y-m-d 
  • trunk/lib/task/project/upgrade1.1/sfAutoloadingUpgrade.class.php

    r5260 r6365  
    3131          $content = str_replace("'sfAutoload'", 'sfAutoload::getInstance()', $content); 
    3232 
    33           $this->log($this->formatter->formatSection('config.php', sprintf('Migrating %s', $file))); 
     33          $this->dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('config.php', sprintf('Migrating %s', $file))))); 
    3434          file_put_contents($file, $content); 
    3535        } 
     
    4343if (sfConfig::get('sf_debug')) 
    4444{ 
    45   spl_autoload_register(array('sfAutoload', 'autoloadAgain')); 
     45  spl_autoload_register(array('sfAutoload::getInstance()', 'autoloadAgain')); 
    4646} 
    4747EOF; 
  • trunk/test/functional/fixtures/project/apps/cache/config/config.php

    r2369 r6365  
    77require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 
    88sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir); 
     9 
     10// insert your own autoloading callables here 
     11 
     12if (sfConfig::get('sf_debug')) 
     13{ 
     14  spl_autoload_register(array(sfAutoload::getInstance(), 'autoloadAgain')); 
     15} 
  • trunk/test/functional/fixtures/project/apps/cache/config/factories.yml

    r4890 r6365  
     1prod: 
     2  logger: 
     3    class:   sfNoLogger 
     4    param: 
     5      level:   err 
     6      loggers: ~ 
    17cli: 
    28  controller: 
  • trunk/test/functional/fixtures/project/apps/cache/config/settings.yml

    r2794 r6365  
    11prod: 
    22  .settings: 
     3    logging_enabled: off 
    34    no_script_name:           off 
    45 
  • trunk/test/functional/fixtures/project/apps/frontend/config/config.php

    r2369 r6365  
    77require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 
    88sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir); 
     9 
     10// insert your own autoloading callables here 
     11 
     12if (sfConfig::get('sf_debug')) 
     13{ 
     14  spl_autoload_register(array(sfAutoload::getInstance(), 'autoloadAgain')); 
     15} 
  • trunk/test/functional/fixtures/project/apps/frontend/config/factories.yml

    r4890 r6365  
     1prod: 
     2  logger: 
     3    class:   sfNoLogger 
     4    param: 
     5      level:   err 
     6      loggers: ~ 
    17cli: 
    28  controller: 
  • trunk/test/functional/fixtures/project/apps/frontend/config/settings.yml

    r2802 r6365  
    11prod: 
    22  .settings: 
     3    logging_enabled: off 
    34    no_script_name:           on 
    45 
  • trunk/test/functional/fixtures/project/apps/i18n/config/config.php

    r2740 r6365  
    77require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 
    88sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir); 
     9 
     10// insert your own autoloading callables here 
     11 
     12if (sfConfig::get('sf_debug')) 
     13{ 
     14  spl_autoload_register(array(sfAutoload::getInstance(), 'autoloadAgain')); 
     15} 
  • trunk/test/functional/fixtures/project/apps/i18n/config/factories.yml

    r4890 r6365  
     1prod: 
     2  logger: 
     3    class:   sfNoLogger 
     4    param: 
     5      level:   err 
     6      loggers: ~ 
    17cli: 
    28  controller: 
  • trunk/test/functional/fixtures/project/apps/i18n/config/settings.yml

    r2794 r6365  
    11prod: 
    22  .settings: 
     3    logging_enabled: off 
    34    no_script_name:           off 
    45 
  • trunk/test/functional/fixtures/project/config/propel.ini

    r2543 r6365  
    2525 
    2626; builder settings 
    27 propel.builder.peer.class              = addon.propel.builder.SfPeerBuilder 
    28 propel.builder.object.class            = addon.propel.builder.SfObjectBuilder 
     27propel.builder.peer.class              = plugins.sfPropelPlugin.lib.propel.builder.SfPeerBuilder 
     28propel.builder.object.class            = plugins.sfPropelPlugin.lib.propel.builder.SfObjectBuilder 
    2929 
    30 propel.builder.objectstub.class        = addon.propel.builder.SfExtensionObjectBuilder 
    31 propel.builder.peerstub.class          = addon.propel.builder.SfExtensionPeerBuilder 
    32 propel.builder.objectmultiextend.class = addon.propel.builder.SfMultiExtendObjectBuilder 
    33 propel.builder.mapbuilder.class        = addon.propel.builder.SfMapBuilderBuilder 
     30propel.builder.objectstub.class        = plugins.sfPropelPlugin.lib.propel.builder.SfExtensionObjectBuilder 
     31propel.builder.peerstub.class          = plugins.sfPropelPlugin.lib.propel.builder.SfExtensionPeerBuilder 
     32propel.builder.objectmultiextend.class = plugins.sfPropelPlugin.lib.propel.builder.SfMultiExtendObjectBuilder 
     33propel.builder.mapbuilder.class        = plugins.sfPropelPlugin.lib.propel.builder.SfMapBuilderBuilder 
    3434propel.builder.interface.class         = propel.engine.builder.om.php5.PHP5InterfaceBuilder 
    3535propel.builder.node.class              = propel.engine.builder.om.php5.PHP5NodeBuilder 
     
    4141propel.builder.addComments = false 
    4242propel.packageObjectModel = true 
     43 
     44propel.defaultTimeStampFormat = Y-m-d H:i:s 
     45propel.defaultTimeFormat = H:i:s 
     46propel.defaultDateFormat = Y-m-d 
  • trunk/test/unit/cache/sfCacheDriverTests.class.php

    r6363 r6365  
    6464 
    6565    $cache->clean(); 
    66     $cache->setOption('automaticCleaningFactor', 1); 
     66    $cache->setOption('automatic_cleaning_factor', 1); 
    6767    $cache->set('foo', $data); 
    6868    $cache->set('foo', $data); 
    6969    $cache->set('foo', $data); 
    70     $cache->setOption('automaticCleaningFactor', 1000); 
     70    $cache->setOption('automatic_cleaning_factor', 1000); 
    7171 
    7272    // ->remove() 
  • trunk/test/unit/cache/sfFileCacheTest.php

    r4957 r6365  
    1616// setup 
    1717sfConfig::set('sf_logging_enabled', false); 
    18 $temp = tempnam('/tmp/cachedir', 'tmp'); 
     18$temp = tempnam('/tmp/cache_dir', 'tmp'); 
    1919unlink($temp); 
    2020mkdir($temp); 
     
    2525{ 
    2626  $cache = new sfFileCache(); 
    27   $t->fail('->initialize() throws an sfInitializationException exception if you don\'t pass a "cacheDir" parameter'); 
     27  $t->fail('->initialize() throws an sfInitializationException exception if you don\'t pass a "cache_dir" parameter'); 
    2828} 
    2929catch (sfInitializationException $e) 
    3030{ 
    31   $t->pass('->initialize() throws an sfInitializationException exception if you don\'t pass a "cacheDir" parameter'); 
     31  $t->pass('->initialize() throws an sfInitializationException exception if you don\'t pass a "cache_dir" parameter');