Пример #1
0
 protected function parseOptions($options)
 {
     if (xo_has(self::SCOPE_CONFIGS, $options) && xo_get(self::SCOPE_CONFIGS, $options)) {
         $scopeConfigs = xo_get(self::SCOPE_CONFIGS);
         $scopes = array();
         foreach ($scopeConfigs as $scopeConfig) {
             $scopeConfig[XIDE_Scope::RELATIVE_REGISTRY_NAMESPACE] = xo_get(self::SCOPE_NS_PREFIX) . '.' . $scopeConfig[XIDE_Scope::SCOPE_NAME] . '.absolute';
             $scopeConfig[XIDE_Scope::ABSOLUTE_REGISTRY_NAMESPACE] = xo_get(self::SCOPE_NS_PREFIX) . '.' . $scopeConfig[XIDE_Scope::SCOPE_NAME] . '.relative';
             $scopes[] = new XIDE_Scope($scopeConfig);
         }
         xo_set(self::SCOPES, $scopes);
     }
 }
Пример #2
0
 public function resolveResources()
 {
     $resourceData = xapp_get_option(self::RESOURCES_DATA, $this);
     if ($resourceData !== null) {
         $resourceItems = (array) xapp_object_find($resourceData, '.items', array('class=' . 'cmx.types.Resource'));
         if ($resourceItems != null && count($resourceItems)) {
             foreach ($resourceItems as $resourceItem) {
                 if (!xapp_property_exists($resourceItem, XAPP_RESOURCE_URL_RESOLVED) || !xapp_property_exists($resourceItem, XAPP_RESOURCE_PATH_ABSOLUTE)) {
                     $this->resolveResource($resourceItem);
                 }
             }
             xo_set(self::RESOURCES_DATA, $resourceItems);
         }
     } else {
         return false;
     }
     return true;
 }
Пример #3
0
 /**
  * init class instance by validating cache directory for being readable and writable
  *
  * @error 15502
  * @return void
  * @throws Xapp_Cache_Driver_Exception
  */
 protected function init()
 {
     try {
         $dir = new SplFileInfo(xapp_get_option(self::PATH, $this));
         if (!$dir->isReadable()) {
             throw new Xapp_Cache_Driver_Exception("cache directory is not readable", 1550201);
         }
         if (!$dir->isWritable()) {
             throw new Xapp_Cache_Driver_Exception("cache directory is not writable", 1550202);
         }
         xo_set(self::PATH, rtrim($dir->getRealPath(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR, $this);
         $complete_path = xo_get(self::PATH, $this) . DIRECTORY_SEPARATOR . xo_get(self::SUBPATH, $this);
         if (!is_dir($complete_path)) {
             @mkdir($complete_path);
         }
         $subpath = xo_get(self::SUBPATH, $this) . DS;
         xo_set(self::SUBPATH, $subpath, $this);
     } catch (Exception $e) {
         throw new Xapp_Cache_Driver_Exception(xapp_sprintf("cache directory file info error: %d - %s", $e->getCode(), $e->getMessage()), 1550203);
     }
 }