Ejemplo n.º 1
0
 /**
  * called on 'plugins_loaded' event
  *
  * @param null $data
  * @throws \Phile\Exception\ServiceLocatorException
  */
 public function onPluginsLoaded($data = null)
 {
     switch ($this->settings['handler']) {
         case Plugin::HANDLER_ERROR_LOG:
             ServiceLocator::registerService('Phile_ErrorHandler', new ErrorLog($this->settings));
             break;
         case Plugin::HANDLER_DEVELOPMENT:
             ServiceLocator::registerService('Phile_ErrorHandler', new Development($this->settings));
             break;
     }
 }
Ejemplo n.º 2
0
 /**
  * onPluginsLoaded method
  */
 public function onPluginsLoaded()
 {
     // phpFastCache not working in CLI mode...
     if (PHILE_CLI_MODE) {
         return;
     }
     unset($this->settings['active']);
     $config = $this->settings + \phpFastCache::$config;
     $storage = $this->settings['storage'];
     $cache = phpFastCache($storage, $config);
     ServiceLocator::registerService('Phile_Cache', new PhpFastCache($cache));
 }
Ejemplo n.º 3
0
 /**
  * onPluginsLoaded method
  *
  * @param null   $data
  *
  * @return mixed|void
  */
 public function onPluginsLoaded($data = null)
 {
     ServiceLocator::registerService('Phile_Data_Persistence', new SimpleFileDataPersistence());
 }
Ejemplo n.º 4
0
 /**
  * onPluginsLoaded method
  *
  * @param null   $data
  *
  * @return mixed|void
  */
 public function onPluginsLoaded($data = null)
 {
     ServiceLocator::registerService('Phile_Template', new Twig($this->settings));
 }
Ejemplo n.º 5
0
 /**
  * onPluginsLoaded method
  *
  * @param null   $data
  *
  * @return mixed|void
  */
 public function onPluginsLoaded($data = null)
 {
     ServiceLocator::registerService('Phile_Parser_Meta', new Meta($this->settings));
 }