Ejemplo n.º 1
0
<?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`";
Ejemplo n.º 2
0
<?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());
Ejemplo n.º 3
0
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');
Ejemplo n.º 4
0
<?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
Ejemplo n.º 5
0
<?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
Ejemplo n.º 6
0
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
 */
Ejemplo n.º 7
0
<?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
Ejemplo n.º 8
0
/**
 *
 * 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());