예제 #1
0
defined('APPLICATION_ENVIRONMENT') || define('APPLICATION_ENVIRONMENT', 'development');
// Define application basename
defined('APPLICATION_BASENAME') || define('APPLICATION_BASENAME', basename($_SERVER['PHP_SELF']));
// Define absolute application path
defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../src/Application'));
// Define absolute framework path
defined('UTILS_PATH') || define('UTILS_PATH', realpath(dirname(__FILE__) . '/../Library/Utils'));
// Add framework and application paths to the PHP path environment
set_include_path(implode(PATH_SEPARATOR, array(realpath(APPLICATION_PATH), realpath(UTILS_PATH), get_include_path())));
require_once '../src/Application/autoloader.php';
use Lib\Init;
use Lib\MySQLQuery;
use Application\Models\Create;
use Application\Models\Update;
// Set initial configuration
$init = new Init();
$init->setup();
if (count($argv) == 1) {
    echo "You must enter a parameter!\n";
} else {
    switch ($argv[1]) {
        case 'schema:create':
            $db = MySQLQuery::getInstance();
            $query = Create::Run();
            $db->run($query);
            echo "Database schema was created successfully!\n";
            break;
        case 'schema:update':
            $db = MySQLQuery::getInstance();
            $query = Update::Run();
            $db->run($query);
예제 #2
0
<?php

require 'autoloader.php';
use Lib\Init;
use Lib\Loader;
/** Set initial configuration */
$init = new Init();
$init->setup();
$init->setLang();
/** Get loader for controller and template */
$loader = new Loader();
$loader->get();