private function _runTestBulletApp($chunkSize, $content) { $app = new Bullet\App(); $app->path('/test', function ($request) use($chunkSize, $content) { $c = new Bullet\Response\Chunked($content); $c->chunkSize = $chunkSize; return $c; }); $response = $app->run('GET', '/test'); $this->assertInstanceOf('Bullet\\Response\\Chunked', $response); ob_start(); $response->send(); $output = ob_get_clean(); return $output; }
<?php /* * Copyright 2015 Matthijs Otterloo. */ require __DIR__ . '/vendor/autoload.php'; $app = new Bullet\App(); $app->path('/zermelo', function () use($app) { $handler = new \Zermelo\Handler(); require 'lib/Core/DefaultRouter.php'; }); // Run the app echo $app->run(new Bullet\Request());
<?php require __DIR__ . '/vendor/autoload.php'; // Your App $app = new Bullet\App(); $app->path('/', function ($request) { return "Hello World!"; }); // Run the app! (takes $method, $url or Bullet\Request object) echo $app->run(new Bullet\Request());
<?php /* * Copyright 2015 Scholica V.O.F. * Created by Thomas Schoffelen */ require __DIR__ . '/vendor/autoload.php'; // Your App $app = new Bullet\App(); $app->path('/magister', function () use($app) { $handler = new \Magister\Handler(); require 'lib/Core/DefaultRouter.php'; }); $app->path('/somtoday', function () use($app) { $handler = new \SOMtoday\Handler(); require 'lib/Core/DefaultRouter.php'; }); $app->path('/zermelo', function () use($app) { $handler = new \Zermelo\Handler(); require 'lib/Core/DefaultRouter.php'; }); // Run the app echo $app->run(new Bullet\Request());
<?php use Rackem\Rack; require __DIR__ . '/src/Bullet/App.php'; require __DIR__ . '/vendor/autoload.php'; // Bullet App $app = new Bullet\App(); $app->path('/', function ($request) { return "Hello World!"; }); // Rack it up! Rack::use_middleware("\\Rackem\\ShowExceptions"); Rack::run($app);