Skip to content

Commit

Permalink
Drop src/bootstrap.php file
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Dec 22, 2020
1 parent 0f80f6e commit 22db6ae
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 17 deletions.
4 changes: 1 addition & 3 deletions external/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
use XHGui\Saver\SaverInterface;
use XHGui\ServiceContainer;

if (!defined('XHGUI_ROOT_DIR')) {
require dirname(__DIR__) . '/src/bootstrap.php';
}
require __DIR__ . '/../vendor/autoload.php';

$options = getopt('f:');

Expand Down
6 changes: 6 additions & 0 deletions src/ServiceProvider/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ class ConfigProvider implements ServiceProviderInterface
public function register(Container $app)
{
$app['config'] = static function ($app) {
// @deprecated
// define XHGUI_ROOT_DIR constant, config files may use it
if (!defined('XHGUI_ROOT_DIR')) {
define('XHGUI_ROOT_DIR', $app['app.dir']);
}

Config::load($app['app.config_dir'] . '/config.default.php');

if (file_exists($app['app.config_dir'] . '/config.php')) {
Expand Down
12 changes: 0 additions & 12 deletions src/bootstrap.php

This file was deleted.

2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use XHGui\ServiceContainer;

require dirname(__DIR__) . '/src/bootstrap.php';
require __DIR__ . '/../vendor/autoload.php';

$di = ServiceContainer::instance();

Expand Down
2 changes: 1 addition & 1 deletion webroot/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use Slim\Slim as App;
use XHGui\ServiceContainer;

require dirname(__DIR__) . '/src/bootstrap.php';
require dirname(__DIR__) . '/vendor/autoload.php';

$di = ServiceContainer::instance();
/** @var App $app */
Expand Down

0 comments on commit 22db6ae

Please sign in to comment.