Example #1
0
<?php

/**
 * Pop Web Bootstrap Application Framework CLI PHP Script
 */
// Require autoloader
$autoloader = (include __DIR__ . '/../vendor/autoload.php');
// Create main app object, register the app module and run the app
try {
    $config = (include __DIR__ . '/../app/config/application.php');
    $config['routes'] = ['<controller> [<action>] [<param>]' => ['prefix' => 'App\\Controller\\Console\\'], '*' => ['controller' => 'App\\Controller\\Console\\ConsoleController', 'action' => 'error']];
    unset($config['services']);
    $app = new Pop\Application($autoloader, $config);
    $app->register('app', new App\Console($app));
    $app->run();
} catch (\Exception $exception) {
    $app = new App\Console();
    $app->error($exception);
}
Example #2
0
if (stripos(php_sapi_name(), 'cli') === false || stripos(php_sapi_name(), 'server') !== false) {
    header('Content-Type: text/html');
    echo '<!DOCTYPE html>' . PHP_EOL . '<html><head><title>HTTP 403 (Forbidden)</title>' . '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="robots" content="none" /></head>' . '<body><h1>HTTP 403 (Forbidden)</h1></body></html>';
    exit;
}
require_once __DIR__ . '/../config.php';
set_time_limit(0);
try {
    // Check the app constants
    if (!defined('BASE_PATH') || !defined('APP_PATH') || !defined('APP_URI') || !defined('DB_INTERFACE') || !defined('DB_NAME')) {
        throw new \Exception('Error: The config file is not properly configured. Please check the config file or install the system.');
    }
    // Get the autoloader
    $autoloader = (require APP_ABS_PATH . '/vendor/autoload.php');
    $appConfig = (include APP_ABS_PATH . '/config/application.php');
    $config = (include MODULES_PATH . '/phire-console-1.0/config/module.php');
    $config['phire-console']['services'] = $appConfig['services'];
    $config['phire-console']['routes'] = $config['phire-console']['cli-routes'];
    $autoloader->addPsr4($config['phire-console']['prefix'], $config['phire-console']['src']);
    // Create and run the app as a self-contained console app
    $app = new Pop\Application($autoloader, $config['phire-console']);
    $app->register('phire', new Phire\Console\Module\Module($app));
    if (!\Phire\Table\Modules::findBy(['name' => 'phire-console'])->active) {
        $app->trigger('app.route.pre');
        throw new \Phire\Exception('The Phire Console module is not active.');
    }
    $app->run();
} catch (Exception $exception) {
    $phire = new Phire\Console\Module\Module();
    $phire->error($exception);
}
Example #3
0
<?php

/**
 * Phire CMS (http://www.phirecms.org/)
 *
 * @link       https://github.com/phirecms/phirecms
 * @author     Nick Sagona, III <*****@*****.**>
 * @copyright  Copyright (c) 2009-2016 NOLA Interactive, LLC. (http://www.nolainteractive.com)
 * @license    http://www.phirecms.org/license     New BSD License
 */
require_once __DIR__ . '/config.php';
try {
    // Check the app constants
    if (!defined('BASE_PATH') || !defined('APP_PATH') || !defined('APP_URI') || !defined('DB_INTERFACE') || !defined('DB_NAME')) {
        throw new \Exception('Error: The config file is not properly configured. Please check the config file or install the system.');
    }
    // Get the autoloader
    $autoloader = (require __DIR__ . APP_PATH . '/vendor/autoload.php');
    // Create main app object
    $app = new Pop\Application($autoloader, include __DIR__ . APP_PATH . '/config/application.php');
    // Register the main Phire module, run the app
    $app->register('phire', new Phire\Module($app))->run();
} catch (Exception $exception) {
    $phire = new Phire\Module();
    $phire->error($exception);
}
Example #4
0
<?php

require_once __DIR__ . '/../vendor/autoload.php';
// Create the app, loading the config file
$app = new Pop\Application(include __DIR__ . '/../app/config/application.php');
// Run the app
$app->run();
Example #5
0
<?php

/**
 * Pop Web Bootstrap Application Framework (http://www.popphp.org/)
 *
 * @link       https://github.com/popphp/pop-bootstrap
 * @author     Nick Sagona, III <*****@*****.**>
 * @copyright  Copyright (c) 2009-2016 NOLA Interactive, LLC. (http://www.nolainteractive.com)
 * @license    http://www.popphp.org/license     New BSD License
 */
// Require autoloader
$autoloader = (include __DIR__ . '/../vendor/autoload.php');
// Create main app object, register the app module and run the app
try {
    $app = new Pop\Application($autoloader, include __DIR__ . '/../app/config/application.php');
    $app->register('app', new App\Module($app));
    $app->run();
} catch (\Exception $exception) {
    $app = new App\Module();
    $app->error($exception);
}