/** * Getter for registry * * @author Benjamin Carl <*****@*****.**> * @return Doozr_Registry The registry of Doozr * @access protected * @static */ protected static function getRegistry() { if (self::$registry === null) { self::$registry = Doozr_Registry::getInstance(); } return self::$registry; }
/** * Constructor. * * @param Doozr_Datetime_Service $datetime Datetime Service of Doozr * @param int $level Loglevel of the logging extending this class * @param string $fingerprint Fingerprint of the client * * @author Benjamin Carl <*****@*****.**> * * @return \Doozr_Logging_File */ public function __construct(Doozr_Datetime_Service $datetime, $level = null, $fingerprint = null) { // call parents constructor parent::__construct($datetime, $level, $fingerprint); // get registry $registry = Doozr_Registry::getInstance(); // store path-manager $this->setPath($registry->path); // set logfile-name (+path) $this->setLogfile($_SERVER['PHP_SELF']); // set filesystem service $this->setFilesystem(Doozr_Loader_Serviceloader::load('filesystem')); }
/** * Returns the response object for sending header(s). * * @author Benjamin Carl <*****@*****.**> * * @return Doozr_Response_Cli|Doozr_Response_Httpd|Doozr_Response_Web */ protected function getResponse() { // get registry $registry = Doozr_Registry::getInstance(); // get response /* @var $response Doozr_Response_Web */ return $registry->front->getResponse(); }
/** * Initializes the registry of the Doozr Framework. The registry itself * is intend to store the instances mainly used by core classes like Doozr_Path, Doozr_Configuration, * Doozr_Logging and this instances are always accessible by its name after the underscore (_ - written lowercase) * e.g. Doozr_Logging will be available like this $registry->logging, Doozr_Configuration like $registry->configuration * and so on. * * @param array $parameters The parameters to store in parameter bag. * * @author Benjamin Carl <*****@*****.**> * * @return bool TRUE on success * @static */ protected static function initRegistry(array $parameters = []) { self::$registry = Doozr_Registry::getInstance($parameters); // Important for bootstrap result return true; }
/** * Prepares setup for Tests. * * @author Benjamin Carl <*****@*****.**> */ protected function setUp() { /* @var $app Doozr_Kernel_App Get kernel instance */ self::$kernel = Doozr_Kernel_App::boot(DOOZR_APP_ENVIRONMENT, DOOZR_RUNTIME_ENVIRONMENT, DOOZR_UNIX, DOOZR_DEBUGGING, DOOZR_CACHING, DOOZR_CACHING_CONTAINER, DOOZR_LOGGING, DOOZR_PROFILING, DOOZR_APP_ROOT, DOOZR_DIRECTORY_TEMP, DOOZR_DOCUMENT_ROOT, DOOZR_NAMESPACE, DOOZR_NAMESPACE_FLAT); // Store className self::$serviceClassName = 'Doozr_' . self::$serviceName . '_Service'; // Get registry self::$registry = Doozr_Registry::getInstance(); // Load service self::$service = Doozr_Loader_Serviceloader::load(self::$serviceName); }
/** * Initialize the instance, registry and DI. * * @author Benjamin Carl <*****@*****.**> * @static */ public static function init() { // create instance like we would by calling getInstance() self::getInstance(); self::$registry = Doozr_Registry::getInstance(); self::initDependencyInjection(); }