Example #1
0
 /**
  * Class App
  * @package Mariana\Framework
  * @desc Bootstrap for the frameworkz
  */
 public static function run()
 {
     # Session start
     Session::start();
     # Setup
     Environment::setup();
     # Load dependencys
     require_once ROOT . DS . 'app' . DS . 'routes.php';
     require_once ROOT . DS . 'app' . DS . 'config.php';
     # Set Language and import translation files (LANG)
     self::setLanguage();
     # Connect
     Database::$connection;
     # Route
     Router::route();
 }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# REMOVE ERROR DISPLAY
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
# DEFINE SOME VARIABLES
define('ROOT', realpath(dirname(__FILE__)));
define('DS', DIRECTORY_SEPARATOR);
# GET AUTOLOAD
require_once ROOT . DS . "vendor" . DS . "autoload.php";
require_once ROOT . DS . "app" . DS . "functions.php";
# DEFINE USAGES
use Mariana\Framework\Config;
use Mariana\Framework\Security\Environment;
use Mariana\Framework\Database;
# BOOT AND VALIDATE THE COMMAND LINE INTERFACE
Environment::setup();
require_once ROOT . DS . "app" . DS . "config.php";
if (Config::get("mode") !== "dev") {
    echo "Console only available on dev mode, please configure your application";
    exit;
}
# SET OPTIONS
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//(Config::get("mode")== "dev")?: exit() ;
$options = array();
$options[] = "help";
$options[] = "server";
$options[] = "create";
$options[] = "update";
# SET COMMANDS
////////////////////////////////////////////////////////////////////////////////////////////////////////////////