示例#1
0
 private function registerCollectors()
 {
     $this->loader->registerNamespace('Shopware\\Plugin\\Debug', realpath(__DIR__ . '/../../../../Default/Core/Debug/') . '/');
     $eventManager = Shopware()->Container()->get('events');
     $utils = new Utils();
     $errorHandler = $this->collection->get('ErrorHandler');
     if ($this->Config()->get('logTemplateVars')) {
         $this->pushCollector(new TemplateVarCollector($eventManager));
     }
     if ($this->Config()->get('logErrors')) {
         $this->pushCollector(new ErrorCollector($errorHandler, $utils));
     }
     if ($this->Config()->get('logExceptions')) {
         $this->pushCollector(new ExceptionCollector($eventManager, $utils));
     }
     if ($this->Config()->get('logDb')) {
         $this->pushCollector(new DatabaseCollector(Shopware()->Container()->get('db')));
     }
     if ($this->Config()->get('logModel')) {
         $this->pushCollector(new DbalCollector(Shopware()->Container()->get('modelconfig')));
     }
     if ($this->Config()->get('logTemplate')) {
         $this->pushCollector(new TemplateCollector(Shopware()->Container()->get('template'), $utils, Shopware()->Container()->get('kernel')->getRootDir()));
     }
     if ($this->Config()->get('logController')) {
         $this->pushCollector(new ControllerCollector($eventManager, $utils));
     }
     if ($this->Config()->get('logEvents')) {
         $this->pushCollector(new EventCollector($eventManager, $utils));
     }
     foreach ($this->collectors as $collector) {
         $collector->start();
     }
 }
示例#2
0
 /**
  * The Enlight_Plugin_Namespace class constructor expects the name of the namespace and sets it
  * into the internal property.
  *
  * @param   string $name
  */
 public function __construct($name)
 {
     $this->name = $name;
     parent::__construct();
 }
示例#3
0
 /**
  * The Enlight_Plugin_PluginManager class constructor expects an instance of the Enlight_Application, which
  * is set in the internal property.
  *
  * @param Enlight_Application $application
  */
 public function __construct(Enlight_Application $application)
 {
     $this->setApplication($application);
     parent::__construct();
 }