public function setup()
 {
     require_once dirname(__FILE__) . '/../config/opSecurityConfigHandler.class.php';
     $DS = DIRECTORY_SEPARATOR;
     $OpenPNE2Path = sfConfig::get('sf_lib_dir') . $DS . 'vendor' . $DS;
     // ##PROJECT_LIB_DIR##/vendor/
     set_include_path($OpenPNE2Path . PATH_SEPARATOR . get_include_path());
     $result = parent::setup();
     if (0 !== strpos(sfConfig::get('sf_task_name'), 'sfDoctrineBuild')) {
         $configCache = $this->getConfigCache();
         $file = $configCache->checkConfig('data/config/plugin.yml', true);
         if ($file) {
             include $file;
         }
         require_once dirname(__FILE__) . '/../plugin/opPluginManager.class.php';
         $pluginActivations = opPluginManager::getPluginActivationList();
         $pluginActivations = array_merge(array_fill_keys($this->getPlugins(), true), $pluginActivations);
         foreach ($pluginActivations as $key => $value) {
             if (!in_array($key, $this->getPlugins())) {
                 unset($pluginActivations[$key]);
             }
         }
         $pluginActivations = $this->filterSkinPlugins($pluginActivations);
         $this->enablePlugins(array_keys($pluginActivations, true));
         $this->disablePlugins(array_keys($pluginActivations, false));
         unset($this->cache['getPluginPaths']);
         // it should be rewrited
         $this->plugins = array_unique($this->plugins);
     }
     return $result;
 }
 public function setup()
 {
     require_once dirname(__FILE__) . '/../config/opSecurityConfigHandler.class.php';
     $DS = DIRECTORY_SEPARATOR;
     $OpenPNE2Path = sfConfig::get('sf_lib_dir') . $DS . 'vendor' . $DS;
     // ##PROJECT_LIB_DIR##/vendor/
     set_include_path($OpenPNE2Path . PATH_SEPARATOR . get_include_path());
     $result = parent::setup();
     $configCache = $this->getConfigCache();
     $file = $configCache->checkConfig('data/config/plugin.yml', true);
     if ($file) {
         include $file;
     }
     require_once dirname(__FILE__) . '/../plugin/opPluginManager.class.php';
     $pluginActivations = opPluginManager::getPluginActivationList();
     $pluginActivations = array_merge(array_fill_keys($this->getPlugins(), true), $pluginActivations);
     foreach ($pluginActivations as $key => $value) {
         if (!in_array($key, $this->getPlugins())) {
             unset($pluginActivations[$key]);
         }
     }
     $pluginActivations = $this->filterSkinPlugins($pluginActivations);
     $this->enablePlugins(array_keys($pluginActivations, true));
     $this->disablePlugins(array_keys($pluginActivations, false));
     unset($this->cache['getPluginPaths']);
     // it should be rewrited
     $this->plugins = array_unique($this->plugins);
     // gadget
     include $this->getConfigCache()->checkConfig('config/gadget_layout_config.yml');
     include $this->getConfigCache()->checkConfig('config/gadget_config.yml');
     require_once sfConfig::get('sf_lib_dir') . '/config/opGadgetConfigHandler.class.php';
     $gadgetConfigs = sfConfig::get('op_gadget_config', array());
     foreach ($gadgetConfigs as $key => $config) {
         $filename = 'config/' . sfInflector::underscore($key);
         $params = array();
         if ($key != 'gadget') {
             $filename .= '_gadget';
             $params['prefix'] = sfInflector::underscore($key) . '_';
         }
         $filename .= '.yml';
         $this->getConfigCache()->registerConfigHandler($filename, 'opGadgetConfigHandler', $params);
         include $this->getConfigCache()->checkConfig($filename);
     }
     return $result;
 }
Esempio n. 3
0
 private function __construct($pluginName, sfEventDispatcher $dispatcher)
 {
     $this->name = $pluginName;
     $config = opPluginManager::getPluginActivationList();
     if (isset($config[$pluginName])) {
         $this->isActive = $config[$pluginName];
     }
     $info = $this->getPackageInfo();
     if ($info) {
         $this->version = (string) $info->version->release;
         $this->summary = (string) $info->summary;
     } else {
         $manager = new opPluginManager($dispatcher);
         $package = $manager->getEnvironment()->getRegistry()->getPackage($pluginName, opPluginManager::getDefaultPluginChannelServerName());
         if ($package) {
             $this->version = $package->getVersion();
             $this->summary = $package->getSummary();
         }
     }
 }