Changeset 9890
- Timestamp:
- 06/26/08 13:35:01 (5 months ago)
- Files:
-
- branches/1.1/lib/config/sfApplicationConfiguration.class.php (modified) (1 diff)
- branches/1.1/lib/task/cache/sfCacheClearTask.class.php (modified) (1 diff)
- branches/1.1/lib/task/log/sfLogRotateTask.class.php (modified) (2 diffs)
- branches/1.1/lib/task/project/sfProjectDisableTask.class.php (modified) (1 diff)
- branches/1.1/lib/task/project/sfProjectEnableTask.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/config/sfApplicationConfiguration.class.php
r9722 r9890 175 175 public function checkLock() 176 176 { 177 if (sfToolkit::hasLockFile(sfConfig::get('sf_cache_dir').DIRECTORY_SEPARATOR.$this->getApplication().'_'.$this->getEnvironment().'.lck', 5)) 177 if ( 178 sfToolkit::hasLockFile(sfConfig::get('sf_data_dir').DIRECTORY_SEPARATOR.$this->getApplication().'_'.$this->getEnvironment().'-cli.lck', 5) 179 || 180 sfToolkit::hasLockFile(sfConfig::get('sf_data_dir').DIRECTORY_SEPARATOR.$this->getApplication().'_'.$this->getEnvironment().'.lck') 181 ) 178 182 { 179 183 // application is not available - we'll find the most specific unavailable page... branches/1.1/lib/task/cache/sfCacheClearTask.class.php
r8148 r9890 206 206 protected function getLockFile($app, $env) 207 207 { 208 return sfConfig::get('sf_ cache_dir').'/'.$app.'_'.$env.'.lck';208 return sfConfig::get('sf_data_dir').'/'.$app.'_'.$env.'-cli.lck'; 209 209 } 210 210 } branches/1.1/lib/task/log/sfLogRotateTask.class.php
r9097 r9890 120 120 { 121 121 // create a lock file 122 touch(sfConfig::get('sf_cache_dir').'/'.$app.'_'.$env.'.lck'); 122 $lockFile = sfConfig::get('sf_data_dir').'/'.$app.'_'.$env.'-cli.lck'; 123 $this->getFilesystem()->touch($lockFile); 124 125 // change mode so the web user can remove it if we die 126 $this->getFilesystem()->chmod($lockFile, 0777); 123 127 124 128 // if log file exists rotate it … … 151 155 } 152 156 } 157 158 // release lock 159 $this->getFilesystem()->remove($lockFile); 153 160 } 154 161 } branches/1.1/lib/task/project/sfProjectDisableTask.class.php
r8449 r9890 49 49 $env = $arguments['env']; 50 50 51 $lockFile = sfConfig::get('sf_ cache_dir').'/'.$app.'_'.$env.'.lck';51 $lockFile = sfConfig::get('sf_data_dir').'/'.$app.'_'.$env.'.lck'; 52 52 if (file_exists($lockFile)) 53 53 { 54 54 $this->logSection('enable', sprintf('%s [%s] is currently DISABLED', $app, $env)); 55 55 } 56 else 57 { 58 $this->getFilesystem()->touch($lockFile); 56 59 57 $this->getFilesystem()->touch($lockFile); 58 59 $this->logSection('enable', sprintf('%s [%s] has been DISABLED', $app, $env)); 60 $this->logSection('enable', sprintf('%s [%s] has been DISABLED', $app, $env)); 61 } 60 62 } 61 63 } branches/1.1/lib/task/project/sfProjectEnableTask.class.php
r7401 r9890 49 49 $env = $arguments['env']; 50 50 51 $lockFile = $app.'_'.$env.'.lck';52 if (!file_exists( sfConfig::get('sf_cache_dir').'/'.$lockFile))51 $lockFile = sfConfig::get('sf_data_dir').'/'.$app.'_'.$env.'.lck'; 52 if (!file_exists($lockFile)) 53 53 { 54 54 $this->logSection('enable', sprintf('%s [%s] is currently ENABLED', $app, $env)); 55 55 } 56 else 57 { 58 $this->getFilesystem()->remove($lockFile); 56 59 57 $this->getFilesystem()->remove($lockFile); 60 $clearCache = new sfCacheClearTask($this->dispatcher, $this->formatter); 61 $clearCache->setCommandApplication($this->commandApplication); 62 $clearCache->run(); 58 63 59 $clearCache = new sfCacheClearTask($this->dispatcher, $this->formatter); 60 $clearCache->setCommandApplication($this->commandApplication); 61 $clearCache->run(); 62 63 $this->logSection('enable', sprintf('%s [%s] has been ENABLED', $app, $env)); 64 $this->logSection('enable', sprintf('%s [%s] has been ENABLED', $app, $env)); 65 } 64 66 } 65 67 }