/** * Initialize the core. * * @param array $parameters Parameters of \Hoa\Core. * @return \Hoa\Core */ public function initialize(array $parameters = []) { $root = dirname(dirname(__DIR__)); $cwd = 'cli' === PHP_SAPI ? dirname(realpath($_SERVER['argv'][0])) : getcwd(); $this->_parameters = new Parameter\Parameter($this, ['root' => $root, 'cwd' => $cwd], ['root.hoa' => '(:root:)', 'root.application' => '(:cwd:h:)', 'root.data' => '(:%root.application:h:)' . DS . 'Data' . DS, 'protocol.Application' => '(:%root.application:)' . DS, 'protocol.Application/Public' => 'Public' . DS, 'protocol.Data' => '(:%root.data:)', 'protocol.Data/Etc' => 'Etc' . DS, 'protocol.Data/Etc/Configuration' => 'Configuration' . DS, 'protocol.Data/Etc/Locale' => 'Locale' . DS, 'protocol.Data/Library' => 'Library' . DS . 'Hoathis' . DS . RS . 'Library' . DS . 'Hoa' . DS, 'protocol.Data/Lost+found' => 'Lost+found' . DS, 'protocol.Data/Temporary' => 'Temporary' . DS, 'protocol.Data/Variable' => 'Variable' . DS, 'protocol.Data/Variable/Cache' => 'Cache' . DS, 'protocol.Data/Variable/Database' => 'Database' . DS, 'protocol.Data/Variable/Log' => 'Log' . DS, 'protocol.Data/Variable/Private' => 'Private' . DS, 'protocol.Data/Variable/Run' => 'Run' . DS, 'protocol.Data/Variable/Test' => 'Test' . DS, 'protocol.Library' => '(:%protocol.Data:)Library' . DS . 'Hoathis' . DS . RS . '(:%protocol.Data:)Library' . DS . 'Hoa' . DS . RS . '(:%root.hoa:)' . DS . 'Hoathis' . DS . RS . '(:%root.hoa:)' . DS . 'Hoa' . DS, 'namespace.prefix.*' => '(:%protocol.Data:)Library' . DS . RS . '(:%root.hoa:)' . DS, 'namespace.prefix.Application' => '(:%root.application:h:)' . DS]); $this->_parameters->setKeyword('root', $root); $this->_parameters->setKeyword('cwd', $cwd); $this->_parameters->setParameters($parameters); $this->setProtocol(); return $this; }
/** * Set the current ID. * * @param string $id ID. * @return string */ protected function setId($id) { $old = $this->_parameters->getKeyword('id'); $this->_parameters->setKeyword('id', $id); return $old; }