Example #1
0
<?php

namespace {
    use xTend\Workbench\Workbench;
    require_once __DIR__ . '/../CLI/Core/Workbench.php';
    Workbench::configure();
    //first match all
    global $matched_application;
    $matched_application = false;
    foreach (Workbench::get('applications') as $name => $restrictions) {
        if (Workbench::match($restrictions)) {
            $matched_application = $name;
        }
    }
    if ($matched_application !== false) {
        require_once __DIR__ . '/../' . $matched_application . '/Core/App.php';
        $matched_application = Workbench::namespace($matched_application);
    }
}
namespace Application {
    global $matched_application;
    if (__NAMESPACE__ == $matched_application) {
        Core\App::start(__DIR__);
        Core\FileHandler::system('Config.App.App.php')->include();
        Core\App::run();
    }
}
Example #2
0
<?php

/*
 * Lantern-CMS
 */
session_start();
define('LCMS_V', '0.0.1');
define('ABSPATH', __DIR__);
define('PATH_VIEWS', ABSPATH . '/lantern/views');
define('PATH_PLUGINS', ABSPATH . '/lantern/plugins');
define('PATH_CACHE', ABSPATH . '/cache');
// Autoloaders
include 'core/autoloader.php';
include 'vendor/autoload.php';
Autoloader::instance('Core', __DIR__)->register();
// register the core autoloader with spl
Autoloader::instance('Lantern', __DIR__)->register();
// register the plugin autoloader with spl
//include 'services.php';
$url = isset($_GET['url']) ? $_GET['url'] : '/';
$app = new Core\App();
$app->configure(parse_ini_file('config.ini'));
$app->run($url);