Development

Changeset 7479

You must first sign up to be able to contribute.

Changeset 7479

Show
Ignore:
Timestamp:
02/13/08 23:42:44 (2 years ago)
Author:
dwhittle
Message:

dwhittle: tweaked logging in cache tasks

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dwhittle/1.1/lib/task/cache/sfCacheClearTask.class.php

    r7416 r7479  
    151151      } 
    152152    } 
     153    $this->logSection('cache', 'cleared files'); 
    153154 
    154155    // clear apc cache 
     156    $this->logSection('cache', 'cleared apc'); 
     157 
    155158    $cache = new sfAPCCache(array('prefix' => '')); 
    156159    $cache->clean(sfAPCCache::ALL); 
    157160 
    158     $this->dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('apc', 'cache removed')))); 
     161    // clear autoload cache 
     162    $this->logSection('cache', 'cleared autoload'); 
    159163 
    160     // clear autoload cache 
    161164    foreach(sfFinder::type('file')->name('sf_autoload*')->maxdepth(0)->in(sfToolkit::getTmpDir()) as $file) 
    162165    { 
    163166      @unlink($file); 
    164167    } 
    165     $this->dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('autoload', 'cache removed')))); 
     168 
    166169  } 
    167170 
  • branches/dwhittle/1.1/lib/task/cache/sfCacheGenerateTask.class.php

    r6276 r7479  
    7878    require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.sfConfig::get('sf_apps_dir_name', 'apps').DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.sfConfig::get('sf_config_dir_name', 'config').DIRECTORY_SEPARATOR.'config.php'); 
    7979 
     80    // hide any warnings - like sessions for prod environment 
     81    $error_reporting = error_reporting(0); 
     82 
     83    // generate configuration + view cache 
    8084    $browser = new sfBrowser(); 
    81     $browser->initialize(array()); 
    8285    foreach($uris as $uri) 
    8386    { 
     
    8588    } 
    8689 
    87     $this->dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->format(sprintf('cache generated for application "%s" in environment "%s"', $application, $environment), 'COMMENT')))); 
     90    // generate core_compile 
     91    sfConfigCache::getInstance()->checkConfig('config/core_compile.yml'); 
     92 
     93    error_reporting($error_reporting); 
     94 
     95    $this->logSection('cache', sprintf('generated cache for application "%s" in environment "%s"', $application, $environment)); 
    8896  } 
    8997} 
  • branches/dwhittle/1.1/lib/task/cache/sfCacheOptimizeTask.class.php

    r6276 r7479  
    7474    file_put_contents($config, $optimizer->optimize()); 
    7575 
    76     $this->dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->format(sprintf('optimized cache for application "%s" in environment "%s"', $application, $environment), 'COMMENT')))); 
     76    $this->logSection('cache', sprintf('optimized cache for application "%s" in environment "%s"', $application, $environment)); 
    7777  } 
    7878} 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.