public function __construct(sfEventDispatcher $dispatcher, sfPearEnvironment $environment = null)
 {
     if (!$environment) {
         $environment = new sfPearEnvironment($dispatcher, array('plugin_dir' => sfConfig::get('sf_plugins_dir'), 'cache_dir' => sfConfig::get('sf_cache_dir') . '/.pear', 'web_dir' => sfConfig::get('sf_web_dir'), 'rest_base_class' => 'opPearRest'));
         try {
             $environment->registerChannel(self::OPENPNE_PLUGIN_CHANNEL, true);
         } catch (sfPluginException $e) {
         }
     }
     parent::__construct($dispatcher, $environment);
 }
Ejemplo n.º 2
0
 public function __construct(sfEventDispatcher $dispatcher, sfPearEnvironment $environment = null, $channel = null)
 {
     if (!$environment) {
         $tz = @date_default_timezone_get();
         $environment = new sfPearEnvironment($dispatcher, array('plugin_dir' => sfConfig::get('sf_plugins_dir'), 'cache_dir' => sfConfig::get('sf_cache_dir') . '/.pear', 'web_dir' => sfConfig::get('sf_web_dir'), 'rest_base_class' => 'opPearRest', 'downloader_base_class' => 'opPluginDownloader'));
         date_default_timezone_set($tz);
         $this->channel = $channel;
         if (!$this->channel) {
             $this->channel = self::getDefaultPluginChannelServerName();
         }
         try {
             $environment->registerChannel($this->channel, true);
         } catch (sfPluginException $e) {
         }
     }
     parent::__construct($dispatcher, $environment);
     // register OpenPNE for dependencies
     $this->registerOpenPNEPackage();
 }