if (file_exists($autoload = $root_path . DS . 'vendor' . DS . 'autoload.php')) { require_once $autoload; } /** * ---------------------------------------------------- * Set environment * ---------------------------------------------------- * Define path and the environment locations. */ $env = new \Weloquent\Config\Environment($root_path); /** * ---------------------------------------------------- * Load .env file * ---------------------------------------------------- */ $location = $env->which(); if (empty($location)) { printf('<h1>%s</h1>', 'Unable to define the environment. Make sure to define your hostname.'); } $loaded = $env->load($location); if (empty($loaded)) { printf('<h1>%s</h1>', 'Unable to locate your environment file.'); } /** * ---------------------------------------------------- * Check required vars * ---------------------------------------------------- */ $check = $env->check(array('APP_ENV', 'APP_THEME', 'DB_NAME', 'DB_USER', 'DB_PASSWORD', 'DB_HOST', 'WP_HOME', 'WP_SITEURL'), $loaded); /** * ----------------------------------------------------
* Set my custom request class * ----------------------------------------------------- */ Application::requestClass('Weloquent\\Core\\Http\\Request'); /* |-------------------------------------------------------------------------- | Detect The Application Environment |-------------------------------------------------------------------------- | | Laravel takes a dead simple approach to your application environments | so you can just specify a machine name for the host that matches a | given environment, then we will automatically detect it for you. | */ $objEnv = new Weloquent\Config\Environment(dirname(ABSPATH)); $env = $objEnv->which(); $app['env'] = $env; /* |-------------------------------------------------------------------------- | Bind Paths |-------------------------------------------------------------------------- | | Here we are binding the paths configured in paths.php to the app. You | should not be changing these here. If you need to change these you | may do so within the paths.php file and they will be bound here. | */ $app->bindInstallPaths(require SRC_PATH . '/bootstrap/paths.php'); /* |-------------------------------------------------------------------------- | Bind The Application In The Container
*/ $app = new Illuminate\Foundation\Application(); /* |-------------------------------------------------------------------------- | Detect The Application Environment |-------------------------------------------------------------------------- | | Laravel takes a dead simple approach to your application environments | so you can just specify a machine name for the host that matches a | given environment, then we will automatically detect it for you. | */ $env = $app->detectEnvironment(function () { $root_path = dirname(dirname(__DIR__)); $env = new \Weloquent\Config\Environment($root_path . DS); return $env->which(); }); /* |-------------------------------------------------------------------------- | Bind Paths |-------------------------------------------------------------------------- | | Here we are binding the paths configured in paths.php to the app. You | should not be changing these here. If you need to change these you | may do so within the paths.php file and they will be bound here. | */ $app->bindInstallPaths(require __DIR__ . '/paths.php'); /* |-------------------------------------------------------------------------- | Load The Application