Ejemplo n.º 1
0
 /**
  * Gets the service locator (experimental).
  * @return IServiceLocator
  */
 public final function getServiceLocator()
 {
     if ($this->serviceLocator === NULL) {
         $this->serviceLocator = new ServiceLocator(Environment::getServiceLocator());
         foreach ($this->defaultServices as $name => $service) {
             if (!$this->serviceLocator->hasService($name)) {
                 $this->serviceLocator->addService($name, $service);
             }
         }
     }
     return $this->serviceLocator;
 }
Ejemplo n.º 2
0
 /**
  * initialize error handling
  */
 protected function initializeErrorHandling()
 {
     if (ServiceLocator::hasService('Phile_ErrorHandler')) {
         $errorHandler = ServiceLocator::getService('Phile_ErrorHandler');
         set_error_handler([$errorHandler, 'handleError']);
         register_shutdown_function([$errorHandler, 'handleShutdown']);
         ini_set('display_errors', $this->settings['display_errors']);
     }
 }
Ejemplo n.º 3
0
 /**
  * initialize error handling
  */
 protected function initializeErrorHandling()
 {
     if (ServiceLocator::hasService('Phile_ErrorHandler')) {
         $errorHandler = ServiceLocator::getService('Phile_ErrorHandler');
         set_error_handler(array($errorHandler, 'handleError'));
     }
 }