/** * Class constructor. * * @since 1.0 */ public function __construct(Container $container) { // Run the parent constructor parent::__construct(); $this->setContainer($container); // Merge the config into the application $config = $container->get('config'); $this->config->merge($config); $this->theme = $this->config->get('theme.default'); define('BASE_URL', $this->get('uri.base.full')); define('DEFAULT_THEME', BASE_URL . 'themes/' . $this->theme); }
/** * Class constructor. * * @since 1.0 */ public function __construct() { // Run the parent constructor parent::__construct(); // Load the configuration object. $this->loadConfiguration(); // Register the application to Factory // @todo Decouple from Factory Factory::$application = $this; Factory::$config = $this->config; $this->theme = $this->config->get('theme.default'); define('BASE_URL', $this->get('uri.base.full')); define('DEFAULT_THEME', BASE_URL . 'themes/' . $this->theme); }
/** * 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 WebClient $client An optional argument to provide dependency injection for the application's * client object. If the argument is a Web\WebClient object that object will become * the application's client object, otherwise a default client object is created. */ public function __construct(Input $input = null, Registry $config = null, WebClient $client = null) { parent::__construct($input, $config); // Build the DI Container $this->container = (new Container())->registerServiceProvider(new ApplicationProvider($this))->registerServiceProvider(new ConfigurationProvider($this->config)); }
/** * Class constructor. * * @since 1.0 */ public function __construct() { // Run the parent constructor parent::__construct(); // Build the DI Container $container = (new Container())->registerServiceProvider(new ApplicationProvider($this))->registerServiceProvider(new ConfigurationProvider($this->config))->registerServiceProvider(new DatabaseProvider())->registerServiceProvider(new DebuggerProvider())->registerServiceProvider(new GitHubProvider()); $this->setContainer($container); $this->loadLanguage()->mark('Application started'); // Register the global dispatcher $this->setDispatcher(new Dispatcher()); // Set up a general application logger $logger = new Logger('JTracker'); $logger->pushHandler(new StreamHandler($this->get('debug.log-path', JPATH_ROOT) . '/app.log', Logger::ERROR)); $logger->pushProcessor(new WebProcessor()); $this->setLogger($logger); }
protected function detectRequestUri() { return str_replace('index.php', '', parent::detectRequestUri()); }
/** * Class constructor. * * @since 1.0 */ public function __construct() { // Run the parent constructor parent::__construct(); // Build the DI Container $container = (new Container())->registerServiceProvider(new ApplicationProvider($this))->registerServiceProvider(new ConfigurationProvider($this->config))->registerServiceProvider(new DatabaseProvider())->registerServiceProvider(new DebuggerProvider())->registerServiceProvider(new GitHubProvider()); $this->setContainer($container); $this->loadLanguage()->mark('Application started'); // Register the global dispatcher $this->setDispatcher(new Dispatcher()); }