2016-08-08 22:19:12 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Services;
|
|
|
|
|
|
|
|
class Application
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Start Application
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function run()
|
|
|
|
{
|
2016-08-12 17:59:14 +08:00
|
|
|
// Load Aliases
|
|
|
|
Boot::loadServices();
|
|
|
|
|
|
|
|
// Check Runtime Environment
|
|
|
|
Boot::checkRuntimeEnv();
|
|
|
|
|
|
|
|
// Set Default Timezone to UTC+8
|
|
|
|
Boot::setTimeZone();
|
|
|
|
|
|
|
|
// Load dotenv Configuration
|
|
|
|
Boot::loadDotEnv(BASE_DIR);
|
|
|
|
|
|
|
|
// Register Error Handler
|
|
|
|
Boot::registerErrorHandler();
|
|
|
|
|
|
|
|
// Boot Eloquent ORM
|
|
|
|
Boot::bootEloquent(Config::getDbConfig());
|
|
|
|
|
|
|
|
// Redirect if not installed
|
|
|
|
Boot::checkInstallation();
|
|
|
|
|
|
|
|
// Start Session
|
|
|
|
Boot::startSession();
|
|
|
|
|
|
|
|
// Start Route Dispatching
|
|
|
|
Boot::bootRouter();
|
2016-08-08 22:19:12 +08:00
|
|
|
}
|
|
|
|
|
2016-08-10 13:02:16 +08:00
|
|
|
/**
|
|
|
|
* Get current app version
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2016-08-08 22:19:12 +08:00
|
|
|
public static function getVersion()
|
|
|
|
{
|
|
|
|
$config = require BASE_DIR."/config/app.php";
|
|
|
|
return $config['version'];
|
|
|
|
}
|
2016-08-10 13:02:16 +08:00
|
|
|
|
2016-08-08 22:19:12 +08:00
|
|
|
}
|