/**
  * Initialize Plugin
  *
  * Sets up Tideways, watchers, apiKey, various config options
  */
 public function init()
 {
     parent::init();
     if (!self::isInstalled()) {
         return;
     }
     $config = new \Zend_Config_Xml(self::getConfigName());
     self::$config = $config->participation;
 }
 /**
  * @throws \Zend_EventManager_Exception_InvalidArgumentException
  */
 public function init()
 {
     parent::init();
     \Pimcore::getEventManager()->attach('system.maintenance', array($this, 'maintenanceJob'));
     \Pimcore::getEventManager()->attach('system.console.init', function (\Zend_EventManager_Event $e) {
         $application = $e->getTarget();
         $application->add(new \LuceneSearch\Console\Command\FrontendCrawlCommand());
     });
 }
Example #3
0
 /**
  * Init Plugin.
  *
  * @throws \Zend_EventManager_Exception_InvalidArgumentException
  */
 public function init()
 {
     parent::init();
     \Pimcore::getEventManager()->attach('system.startup', function (\Zend_EventManager_Event $e) {
         $frontController = $e->getTarget();
         if ($frontController instanceof \Zend_Controller_Front) {
             $frontController->registerPlugin(new Controller\Plugin\GatewayRouter());
         }
     });
 }
Example #4
0
 /**
  * Init Plugin.
  */
 public function init()
 {
     parent::init();
     \Pimcore::getEventManager()->attach('system.console.init', function (\Zend_EventManager_Event $e) {
         /** @var \Pimcore\Console\Application $application */
         $application = $e->getTarget();
         // add a namespace to autoload commands from
         $application->addAutoloadNamespace('Manager\\Console', PIMCORE_PLUGINS_PATH . '/Manager/lib/Manager/Console');
     });
 }
Example #5
0
 public function init()
 {
     parent::init();
     \Zend_Controller_Action_HelperBroker::addPrefix('Member_Controller_Action_Helper');
     // attach default listeners
     \Pimcore::getEventManager()->attach('member.register.validate', ['\\Member\\Listener\\Register', 'validate'], 0);
     \Pimcore::getEventManager()->attach('member.password.reset', ['\\Member\\Listener\\Password', 'reset'], 0);
     if (Config::get('actions')->postRegister) {
         \Pimcore::getEventManager()->attach('member.register.post', ['\\Member\\Listener\\Register', Config::get('actions')->postRegister], 0);
     }
 }
Example #6
0
 public function init()
 {
     parent::init();
     \Pimcore::getEventManager()->attach('system.startup', function (\Zend_EventManager_Event $e) {
         /** @var \Zend_Controller_Front $front */
         $front = $e->getTarget();
         // system.startup occurs too early to register view scripts path
         // we need to do it through controller plugin in preDispatch()
         $front->registerPlugin(new Controller\Plugin\Frontend());
     });
 }
 public function init()
 {
     parent::init();
     $this->env = getenv('PIMCORE_ENVIRONMENT') ?: (getenv('REDIRECT_PIMCORE_ENVIRONMENT') ?: '');
     // init definitions
     $this->containerDefinitions = new DefinitionsLocator();
     $this->parameters = new DefinitionsLocator(DefinitionsLocator::PARAMETERS);
     $this->envContainerDefinitions = new DefinitionsLocator(DefinitionsLocator::CONTAINER, $this->env);
     // register events
     \Pimcore::getEventManager()->attach('system.startup', [$this, 'initContainer']);
     \Pimcore::getEventManager()->attach('system.console.init', [$this, 'initContainer']);
     \Pimcore::getEventManager()->attach('system.cache.clear', [$this, 'clearProxyCache']);
     \Pimcore::getEventManager()->attach('system.cache.clearTemporaryFiles', [$this, 'clearProxyCache']);
     //\Pimcore::getEventManager()->attach('frontend.controller.preInit', [$this, 'initController']);
 }
Example #8
0
 public function init()
 {
     parent::init();
     // register your events here
     // using anonymous function
     \Pimcore::getEventManager()->attach("document.postAdd", function ($event) {
         // do something
         $document = $event->getTarget();
     });
     // using methods
     \Pimcore::getEventManager()->attach("document.postUpdate", [$this, "handleDocument"]);
     // for more information regarding events, please visit:
     // http://www.pimcore.org/wiki/display/PIMCORE/Event+API+%28EventManager%29+since+2.1.1
     // http://framework.zend.com/manual/1.12/de/zend.event-manager.event-manager.html
     // http://www.pimcore.org/wiki/pages/viewpage.action?pageId=12124202
 }
Example #9
0
 public function init()
 {
     parent::init();
     // register your events here
     // using anonymous function
     \Pimcore::getEventManager()->attach("document.postAdd", function ($event) {
         // do something
         $document = $event->getTarget();
     });
     // using methods
     \Pimcore::getEventManager()->attach("document.postUpdate", [$this, "handleDocument"]);
     // for more information regarding events, please visit:
     // https://www.pimcore.org/docs/latest/Extending_Pimcore/Event_API_and_Event_Manager.html
     // http://framework.zend.com/manual/1.12/de/zend.event-manager.event-manager.html
     // https://www.pimcore.org/docs/latest/Extending_Pimcore/Plugin_Developers_Guide/Plugin_Class.html
 }
 /**
  * {@inheritdoc}
  */
 public function init()
 {
     parent::init();
     $environment = Config::getSystemConfig()->get("general")->get("environment");
     // Set up dependency injection container
     $builder = new ContainerBuilder();
     $builder->useAnnotations(true);
     // Configure the container
     $builder->addDefinitions(PIMCORE_WEBSITE_PATH . "/config/container.php");
     if ($environment !== "local") {
         // Use whatever cache Pimcore has configured (if it has one configured) to cache object
         // definitions in the container
         $builder->setDefinitionCache(new PimcoreCache());
     } else {
         // For development, or debugging we don't want to cache the container
         $builder->setDefinitionCache(new ArrayCache());
     }
     $environmentConfigFile = DefinitionFileLocator::getPath($environment);
     $parametersFile = ParametersFileLocator::getPath();
     if (file_exists($environmentConfigFile)) {
         $builder->addDefinitions($environmentConfigFile);
     }
     if (file_exists($parametersFile)) {
         $builder->addDefinitions($parametersFile);
     }
     $container = $builder->build();
     /** @var \Zend_Controller_Dispatcher_Interface $currentDispatcher */
     $currentDispatcher = \Zend_Controller_Front::getInstance()->getDispatcher();
     $dispatcher = new Dispatcher();
     $dispatcher->setContainer($container);
     $dispatcher->setControllerDirectory($currentDispatcher->getControllerDirectory());
     $dispatcher->setDefaultModule($currentDispatcher->getDefaultModule());
     $dispatcher->setDefaultAction($currentDispatcher->getDefaultAction());
     $dispatcher->setDefaultControllerName($currentDispatcher->getDefaultControllerName());
     \Zend_Controller_Front::getInstance()->setDispatcher($dispatcher);
 }
 public function init()
 {
     parent::init();
 }
 public function init()
 {
     parent::init();
     $this->initConsoleCommands();
 }
Example #13
0
 /**
  * preDispatch Plugin
  *
  * @param $e
  */
 public function preDispatch($e)
 {
     parent::preDispatch();
     self::getShop()->attachEvents();
 }
Example #14
0
 /**
  * The main plugin method. It is executing as first and it is setting
  * Supercache as a Zend Plugin.
  *
  * @throws \Zend_EventManager_Exception_InvalidArgumentException
  */
 public function init()
 {
     $finder = new Finder(self::getInstallPath(), new LoggerProxy());
     $this->cacheManager = new CacheManager($finder);
     $front = \Zend_Controller_Front::getInstance();
     $front->registerPlugin(new Cache($finder), 902);
     parent::init();
     \Pimcore::getEventManager()->attach("document.preUpdate", array($this, "deleteCache"));
     \Pimcore::getEventManager()->attach("document.preDelete", array($this, "deleteCache"));
     \Pimcore::getEventManager()->attach("object.preUpdate", array($this, "deleteCache"));
     \Pimcore::getEventManager()->attach("object.preDelete", array($this, "deleteCache"));
     \Pimcore::getEventManager()->attach("system.cache.clearOutputCache", array($this, "deleteCache"));
     \Pimcore::getEventManager()->attach("admin.activateMaintenanceMode", array($this, "deleteCache"));
 }
 /**
  * Initialize Plugin
  *
  * Sets up maintenance event listener
  */
 public function init()
 {
     parent::init();
     \Pimcore::getEventManager()->attach("system.maintenance", array($this, 'performMaintenance'));
 }
Example #16
0
 /**
  * preDispatch Plugin
  *
  * @param $e
  */
 public function preDispatch($e)
 {
     parent::preDispatch();
 }
Example #17
0
 /**
  * @return bool
  */
 public static function dropTables()
 {
     $result = true;
     if (!self::checkTables()) {
         return true;
     }
     try {
         $db = PluginLib\AbstractPlugin::getDb();
         $db->query('DROP TABLE IF EXISTS ' . self::$_tableName);
     } catch (Exception $e) {
         $result = false;
         Logger::error("Failed to remove tables; " . $e->getMessage());
     }
     return $result;
 }