/** * Class constructor. * * @param Input $input An optional argument to provide dependency injection for the application's * input object. If the argument is a Input object that object will become * the application's input object, otherwise a default input object is created. * @param Registry $config An optional argument to provide dependency injection for the application's * config object. If the argument is a Registry object that object will become * the application's config object, otherwise a default config object is created. * @param WebEnvironment $environment An optional argument to provide dependency injection for the application's * client object. If the argument is a Web\WebEnvironment object that object will become * the application's client object, otherwise a default client object is created. * @param ResponseInterface $response The response object. * * @since 2.0 */ public function __construct(Input $input = null, Registry $config = null, WebEnvironment $environment = null, ResponseInterface $response = null) { $this->environment = $environment instanceof WebEnvironment ? $environment : new WebEnvironment(); $this->response = $response instanceof ResponseInterface ? $response : new Response(); // Call the constructor as late as possible (it runs `initialise`). parent::__construct($input, $config); // Set the system URIs. $this->loadSystemUris(); // Set the execution datetime and timestamp; $this->set('execution.datetime', gmdate('Y-m-d H:i:s')); $this->set('execution.timestamp', time()); }
/** * is utilized for reading data from inaccessible members. * * @param $name string * * @return mixed */ public function __get($name) { $allowNames = array('io'); if (in_array($name, $allowNames)) { return $this->{$name}; } return parent::__get($name); }
/** * is utilized for reading data from inaccessible members. * * @param $name string * * @return mixed */ public function __get($name) { $allowNames = array('environment', 'response'); if (in_array($name, $allowNames)) { return $this->{$name}; } return parent::__get($name); }