protected function execute($arguments = array(), $options = array())
 {
     parent::execute($arguments, $options);
     $webCacheDir = sfConfig::get('sf_web_dir') . '/cache';
     $this->getFilesystem()->chmod($webCacheDir, 0777);
     $dataDir = sfConfig::get('sf_data_dir') . '/config';
     $fileFinder = sfFinder::type('file');
     $this->getFilesystem()->chmod($fileFinder->in($dataDir), 0666);
 }
 protected function execute($arguments = array(), $options = array())
 {
     parent::execute($arguments, $options);
     $webCacheDir = sfConfig::get('sf_web_dir') . '/cache';
     if (!is_dir($webCacheDir)) {
         @$this->getFilesystem()->mkdirs($webCacheDir);
     }
     $this->chmod($webCacheDir, 0777);
     // note those files that failed
     if (count($this->opFailed)) {
         if ('prod' === $options['env']) {
             $this->logBlock(array('Permissions on some files could not be fixed.', 'You may fix this problem for accessing "/pc_backend.php/sns/cache" via your web browser.', '', 'If you want to get more information, please execute "./symfony openpne:permission --env=dev".'), 'INFO_LARGE');
         } else {
             $this->logBlock(array_merge(array('Permissions on the following file(s) could not be fixed:', ''), array_map(create_function('$f', 'return \' - \'.sfDebug::shortenFilePath($f);'), $this->opFailed)), 'ERROR_LARGE');
         }
     }
 }
Exemplo n.º 3
0
 /**
  * @see sfTask
  */
 protected function execute($arguments = array(), $options = array())
 {
     $this->logSection('diem', 'Check file permissions');
     parent::execute();
     $this->current = null;
     $this->failed = array();
     $dirs = array(sfConfig::get('sf_apps_dir'), sfConfig::get('sf_lib_dir'), sfConfig::get('sf_data_dir'));
     $dirFinder = sfFinder::type('dir');
     $fileFinder = sfFinder::type('file');
     foreach ($dirs as $dir) {
         $this->chmod($dirFinder->in($dir), 0777);
         $this->chmod($fileFinder->in($dir), 0666);
     }
     // note those files that failed
     if (count($this->failed)) {
         $this->logBlock(array_merge(array('Permissions on the following file(s) could not be fixed:', ''), array_map(create_function('$f', 'return \' - \'.sfDebug::shortenFilePath($f);'), $this->failed)), 'ERROR_LARGE');
     }
 }
 /**
  * @see sfTask
  */
 protected function execute($arguments = array(), $options = array())
 {
     $this->logSection('Diem Extended', 'Check file permissions');
     parent::execute();
     $this->chmod(dmOs::join(sfConfig::get('sf_web_dir'), 'cache'), 0777);
     $this->current = null;
     $this->failed = array();
     $dirs = array(sfConfig::get('sf_apps_dir'), sfConfig::get('sf_lib_dir'), sfConfig::get('sf_data_dir'), sfConfig::get('sf_data_dir'), dmOs::join(sfConfig::get('sf_web_dir'), 'cache'));
     $dirFinder = sfFinder::type('dir');
     $fileFinder = sfFinder::type('file');
     foreach ($dirs as $dir) {
         $this->chmod($dirFinder->in($dir), 0777);
         $this->chmod($fileFinder->in($dir), 0666);
     }
     if (file_exists($dataBin = dmOs::join(sfConfig::get('sf_data_dir'), 'bin'))) {
         $this->logSection('Diem Extended', 'setting execute bit for user and group to data/bin files');
         $this->chmod($fileFinder->in($dataBin), 0770);
     }
     // note those files that failed
     if (count($this->failed)) {
         $this->logBlock(array_merge(array('Permissions on the following file(s) could not be fixed:', ''), array_map(create_function('$f', 'return \' - \'.sfDebug::shortenFilePath($f);'), $this->failed)), 'ERROR_LARGE');
     }
 }