コード例 #1
0
ファイル: index.php プロジェクト: BThvedt/rest-scheduler
<?php

use josegonzalez\Dotenv\Loader as Dotenv;
use Radar\Adr\Boot;
use Relay\Middleware\ExceptionHandler;
use Relay\Middleware\ResponseSender;
use Zend\Diactoros\Response;
use Zend\Diactoros\ServerRequestFactory;
require_once '../db.php';
/**
 * Bootstrapping
 */
require '../vendor/autoload.php';
Dotenv::load(['filepath' => dirname(__DIR__) . DIRECTORY_SEPARATOR . '.env', 'toEnv' => true]);
$boot = new Boot();
$adr = $boot->adr();
/**
 * Middleware
 */
$adr->middle(new ResponseSender());
$adr->middle(new ExceptionHandler(new Response()));
$adr->middle('Radar\\Adr\\Handler\\RoutingHandler');
$adr->middle('Radar\\Adr\\Handler\\ActionHandler');
/**
 * Routes
 */
// Just gets all the names of users in the database
$adr->get('AllUserNames', '/allUserNames', function (array $input) {
    global $conn;
    // the database connection I know globals are bad but I'm pretty new at this
    $sql = "SELECT `name` FROM `user`";
コード例 #2
0
ファイル: index.php プロジェクト: andrewshell/radar-fig-demo
<?php

use Radar\Adr\Boot;
use Zend\Diactoros\Response;
use Zend\Diactoros\ServerRequestFactory;
ini_set('display_errors', true);
/**
 * Bootstrapping
 */
require '../vendor/autoload.php';
$boot = new Boot();
$adr = $boot->adr(['Blog\\Delivery\\Config']);
/**
 * Run
 */
$adr->run(ServerRequestFactory::fromGlobals(), new Response());
コード例 #3
0
ファイル: index.php プロジェクト: ezynda3/adr-example
use Relay\Middleware\ExceptionHandler;
use Relay\Middleware\ResponseSender;
use Zend\Diactoros\Response;
use Zend\Diactoros\ServerRequestFactory;
use Illuminate\Database\Capsule\Manager as Capsule;
/**
 * Bootstrapping
 */
require '../vendor/autoload.php';
Dotenv::load(['filepath' => dirname(__DIR__) . DIRECTORY_SEPARATOR . '.env', 'toEnv' => true]);
// Boot Eloquent
$capsule = new Capsule();
$capsule->addConnection(['driver' => 'sqlite', 'database' => __DIR__ . '/../database.sqlite']);
$capsule->bootEloquent();
// Boot Radar
$boot = new Boot();
$adr = $boot->adr([AppProvider::class], true);
/**
 * Middleware
 */
$adr->middle(new ResponseSender());
$adr->middle(new ExceptionHandler(new Response()));
$adr->middle('Radar\\Adr\\Handler\\RoutingHandler');
$adr->middle('Radar\\Adr\\Handler\\ActionHandler');
/**
 * Routes
 */
// Users
$adr->get('Users\\GetUsers', '/users', 'Stark\\Domain\\Services\\Users\\GetUsers');
$adr->get('Users\\GetUser', '/users/{id}', 'Stark\\Domain\\Services\\Users\\GetUser');
$adr->get('Users\\GetUserShifts', '/users/{id}/shifts', 'Stark\\Domain\\Services\\Users\\GetUserShifts');
コード例 #4
0
ファイル: index.php プロジェクト: Crindigo/era
<?php

use josegonzalez\Dotenv\Loader as Dotenv;
use Radar\Adr\Boot;
use Relay\Middleware\ExceptionHandler;
use Relay\Middleware\ResponseSender;
use Zend\Diactoros\Response;
use Zend\Diactoros\ServerRequestFactory;
define('ERA_ROOT', dirname(__DIR__));
/**
 * Bootstrapping
 */
require '../vendor/autoload.php';
Dotenv::load(['filepath' => dirname(__DIR__) . DIRECTORY_SEPARATOR . '.env', 'toEnv' => true]);
$boot = new Boot();
$adr = $boot->adr(['Era\\Boot\\ContainerSetup']);
/**
 * Middleware
 */
$adr->middle(new ResponseSender());
$adr->middle(new ExceptionHandler(new Response()));
$adr->middle('Radar\\Adr\\Handler\\RoutingHandler');
$adr->middle('Radar\\Adr\\Handler\\ActionHandler');
$adr->input('Era\\Http\\Input\\EraInput');
$adr->responder('Era\\Http\\Responder\\TwigResponder');
/**
 * Routes
 */
$adr->get('Era\\Home\\Index', '/', 'Era\\Domain\\Home\\AppService\\Home');
/**
 * Run
コード例 #5
0
ファイル: boot.php プロジェクト: elevenone/radar.zombie
<?php

/**
 *
 * boot.php will protect you from evil and bring good luck
 * and of course it is also protected by my army of lawyers
 *
 */
use josegonzalez\Dotenv\Loader as Dotenv;
use Radar\Adr\Boot;
use Zend\Diactoros\Response;
use Zend\Diactoros\ServerRequestFactory;
/**
 * Boot Radar
 */
$boot = new Boot();
$adr = $boot->adr(['\\Portfolio\\Delivery\\Config']);
/**
 * Run
 */
$adr->run(ServerRequestFactory::fromGlobals(), new Response());
// eof
コード例 #6
0
ファイル: index.php プロジェクト: andrewshell/invoice
use Radar\Adr\Boot;
use Relay\Middleware\ExceptionHandler;
use Relay\Middleware\ResponseSender;
use Zend\Diactoros\Response;
use Zend\Diactoros\ServerRequestFactory;
$filename = __DIR__ . preg_replace('#(\\?.*)$#', '', $_SERVER['REQUEST_URI']);
if (php_sapi_name() === 'cli-server' && is_file($filename)) {
    return false;
}
/**
 * Bootstrapping
 */
require '../vendor/autoload.php';
define('INVOICE_ROOT', realpath(__DIR__ . '/../'));
$boot = new Boot();
$adr = $boot->adr(['Cadre\\Core\\Config', 'Invoice\\Config']);
/**
 * Middleware
 */
$adr->middle(new ResponseSender());
$adr->middle(new ExceptionHandler(new Response()));
$adr->middle('Radar\\Adr\\Handler\\RoutingHandler');
$adr->middle('Radar\\Adr\\Handler\\ActionHandler');
/**
 * Responder
 */
$adr->responder('Cadre\\Core\\Responder\\TwigResponder');
/**
 * Routes
 */
コード例 #7
0
ファイル: boot.php プロジェクト: elevenone/minimal
<?php

/**
 * radar project bootstrap
 */
// use josegonzalez\Dotenv\Loader as Dotenv;
use Radar\Adr\Boot;
use Relay\Middleware\ExceptionHandler;
use Relay\Middleware\ResponseSender;
use Zend\Diactoros\Response;
use Zend\Diactoros\ServerRequestFactory;
// Dotenv::load([
//     'filepath' => dirname(__DIR__) . DIRECTORY_SEPARATOR . '.env',
//     'toEnv' => true,
// ]);
$boot = new Boot();
$adr = $boot->adr(['Application\\Boot\\Config']);
/**
 * Middleware
 */
$adr->middle(new ResponseSender());
$adr->middle(new ExceptionHandler(new Response()));
$adr->middle('Radar\\Adr\\Handler\\RoutingHandler');
$adr->middle('Radar\\Adr\\Handler\\ActionHandler');
/**
 * Delivery
 */
// $adr->input('Application\Delivery\Input');
// $adr->responder('Application\Delivery\Responder');
/**
 * Routes
コード例 #8
0
ファイル: boot.php プロジェクト: elevenone/radar.zombie
/**
 *
 * bootstrap file brings good luck
 *
 */
use josegonzalez\Dotenv\Loader as Dotenv;
use Radar\Adr\Boot;
use Relay\Middleware\ExceptionHandler;
use Relay\Middleware\ResponseSender;
use Zend\Diactoros\Response;
use Zend\Diactoros\ServerRequestFactory;
// use Jnjxp\Routeless\Config as RoutlessConfig;
/**
 * Boot
 */
$boot = new Boot();
// boot adr with Config
$adr = $boot->adr([Application\Config\Application::class]);
/**
 * Middleware
 */
// defined in config container
/**
 * Routes
 */
// defined in config container
/**
 * Run
 */
$adr->run(ServerRequestFactory::fromGlobals(), new Response());