public function setUp() { $config = array('environment' => 'test', 'debug' => true); self::$kernel = self::createKernel($config); self::$kernel− > boot(); $this->container = self::$kernel->getContainer(); }
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; }
<?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
<?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);
<?php namespace ICanBoogie; require __DIR__ . '/../vendor/autoload.php'; $app = boot(); $app->connections['primary'] = 'sqlite::memory:';
<?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();