示例#1
0
 /**
  * Check file system full path
  *
  * @param  string $fullPath
  * @param  bool $recursive
  * @param  bool $existence
  * @return bool
  */
 protected function _checkFullPath($fullPath, $recursive, $existence)
 {
     $result = true;
     if ($recursive && $this->_filesystem->isDirectory($fullPath)) {
         $pathsToCheck = $this->_filesystem->getNestedKeys($fullPath);
         array_unshift($pathsToCheck, $fullPath);
     } else {
         $pathsToCheck = array($fullPath);
     }
     $skipFileNames = array('.svn', '.htaccess');
     foreach ($pathsToCheck as $pathToCheck) {
         if (in_array(basename($pathToCheck), $skipFileNames)) {
             continue;
         }
         if ($existence) {
             $setError = !$this->_filesystem->isWritable($fullPath);
         } else {
             $setError = $this->_filesystem->has($fullPath) && !$this->_filesystem->isWritable($fullPath);
         }
         if ($setError) {
             $this->_getInstaller()->getDataModel()->addError(Mage::helper('Mage_Install_Helper_Data')->__('Path "%s" must be writable.', $pathToCheck));
             $result = false;
         }
     }
     return $result;
 }
示例#2
0
 /**
  * Render view config object for current package and theme
  *
  * @return Magento_Config_View
  */
 public function getViewConfig()
 {
     $key = $this->getDesignTheme()->getId();
     if (isset($this->_viewConfigs[$key])) {
         return $this->_viewConfigs[$key];
     }
     $configFiles = Mage::getConfig()->getModuleConfigurationFiles('view.xml');
     $themeConfigFile = $this->getFilename('view.xml', array());
     if ($this->_filesystem->has($themeConfigFile)) {
         $configFiles[] = $themeConfigFile;
     }
     $config = new Magento_Config_View($configFiles);
     $this->_viewConfigs[$key] = $config;
     return $config;
 }