diff --git a/external/import.php b/external/import.php index 8690d623c..674f614e5 100644 --- a/external/import.php +++ b/external/import.php @@ -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:'); diff --git a/src/ServiceProvider/ConfigProvider.php b/src/ServiceProvider/ConfigProvider.php index d0afd7125..76f67d744 100644 --- a/src/ServiceProvider/ConfigProvider.php +++ b/src/ServiceProvider/ConfigProvider.php @@ -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')) { diff --git a/src/bootstrap.php b/src/bootstrap.php deleted file mode 100644 index a3a8fa2db..000000000 --- a/src/bootstrap.php +++ /dev/null @@ -1,12 +0,0 @@ -