/** * 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; }
/** * 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']); } }
/** * initialize error handling */ protected function initializeErrorHandling() { if (ServiceLocator::hasService('Phile_ErrorHandler')) { $errorHandler = ServiceLocator::getService('Phile_ErrorHandler'); set_error_handler(array($errorHandler, 'handleError')); } }