public function setUp()
 {
     $config = array('environment' => 'test', 'debug' => true);
     self::$kernel = self::createKernel($config);
     self::$kernel− > boot();
     $this->container = self::$kernel->getContainer();
 }
Example #2
0
function initAPI()
{
    global $mods;
    global $core;
    /** Variables */
    $started = session_start();
    $uid = session_id();
    $received = $_REQUEST;
    $expecting = ['class', 'method', 'type', 'data'];
    /** Include API Class and Change to System */
    include 'api.php';
    chdir("../../system");
    /** Loop through the expected input, ignoring others to set varNames*/
    foreach ($expecting as $varName) {
        ${$varName} = isset($received[$varName]) ? $received[$varName] : ($varName == 'data' ? [] : null);
    }
    /** Create an API Request Object for Input */
    $request = new apiRequest($class, $method, $type, $data);
    $api = new api();
    /** Boot Framework */
    $booted = (include 'bootstrap/bootstrap.php');
    if (!$booted) {
        throw new exception("Boot Manager Missing!");
        exit;
    }
    $plugableLibraries = [];
    boot(new bootMode('api'), $plugableLibraries);
    /** Create New API Core */
    $core = new core($api, $plugableLibraries, $mods);
    /** Add Request to Queue */
    $requestId = $api->addRequest($request);
    /** Process API Request */
    $results = $core->processRequests();
    $apiResult = $results[$requestId];
    /** Encode Result */
    $jsonResult = json_encode($apiResult);
    return $jsonResult;
}
Example #3
0
<?php

session_start();
ignore_user_abort(true);
include "inc/config.php";
ini_set("default_charset", $page_charset);
header("Content-type: text/html; charset={$page_charset}");
include "libs/common.php";
boot();
// load
ready();
// finish
Example #4
0
File: index.php Project: reZo/Tiger
<?php

/**
 * Section handler
 *
 * Site index, allows a visitor to view the section they wish to
 *
 * @author  Gareth Stones <*****@*****.**>
 * @license GNU Lesser General Public License
 */
require_once '../important/boot.php';
boot(BOOT_FULL);
Example #5
0
<?php

namespace ICanBoogie;

require __DIR__ . '/../vendor/autoload.php';
$app = boot();
$app->connections['primary'] = 'sqlite::memory:';
Example #6
0
<?php

/*
 * This file is part of the ICanBoogie package.
 *
 * (c) Olivier Laviale <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace ICanBoogie;

require __DIR__ . '/vendor/autoload.php';
return boot();