Exemple #1
0
use GuzzleHttp\Client as HTTPClient;
if (!\defined('ROOT')) {
    require_once __DIR__ . '/preload.php';
}
/**
 * This is the regular bootstrapping script for Airship. If you write your own
 * API endpoint different from public/index.php, make sure you require_once
 * this file.
 *
 * @global State $state
 */
/**
 * 1. Set up the cabins.
 */
require_once ROOT . '/cabins.php';
\Airship\autoload('\\Airship\\Cabin', '~/Cabin');
/**
 * 2. Let's bootstrap the routes and other configuration
 *    for the current cabin (set in cabins.php)
 */
if (!$state->active_cabin) {
    \http_response_code(404);
    echo \file_get_contents(__DIR__ . '/error_pages/no-cabin.html');
    exit(1);
}
$active = $state->cabins[$state->active_cabin];
$state->lang = isset($active['lang']) ? $active['lang'] : 'en-us';
// default
/**
 * 3. Defer execution if we are updating this Cabin:
 */
Exemple #2
0
 * 2. Load the Airship functions
 */
require_once ROOT . '/Airship.php';
/**
 * 3. Let's autoload the composer packages
 */
require_once \dirname(ROOT) . '/vendor/autoload.php';
// Let's also make sure we're using a good version of libsodium
if (!Halite::isLibsodiumSetupCorrectly()) {
    die("Airship requires libsodium 1.0.9 or newer (with a stable version of the PHP bindings).");
}
/**
 * 4. Autoload the Engine files
 */
\Airship\autoload('Airship\\Alerts', '~/Alerts');
\Airship\autoload('Airship\\Engine', '~/Engine');
/**
 * 5. Load up the registry singleton for latest types
 */
$state = State::instance();
// 5a. Initialize the Gears.
require_once ROOT . '/gear_init.php';
/**
 * 6. Load the global functions
 */
require_once ROOT . '/global_functions.php';
require_once ROOT . '/lens_functions.php';
/**
 * 7. Load all of the cryptography keys
 */
require_once ROOT . '/keys.php';
Exemple #3
0
}
/**
 * 2. Load the Airship functions
 */
require_once ROOT . '/Airship.php';
require_once __DIR__ . '/motifs.php';
/**
 * 3. Let's autoload the composer packages
 */
require_once \dirname(ROOT) . '/vendor/autoload.php';
/**
 * 4. Autoload the Engine files
 */
\Airship\autoload('Airship\\Alerts', '~/Alerts');
\Airship\autoload('Airship\\Engine', '~/Engine');
\Airship\autoload('Airship\\Installer', '~/Installer');
$state = \Airship\Engine\State::instance();
require_once ROOT . '/gear_init.php';
/**
 * 5. Load the global functions
 */
require_once ROOT . '/global_functions.php';
require_once ROOT . '/lens_functions.php';
if (ISCLI) {
    if ($argc < 2) {
        echo "\n", 'Error: No argument passed to command line interface.', "\n\n";
        exit(1);
    }
    $cli = new \Airship\Installer\Commands($argv);
    exit(0);
}