Browse Source

Upgrade PHP Lumen framework (#3390)

* Starting fresh with a Lumen 5.6 default skeleton

* Implemented all tests for Lumen (pretty much identical to Laravel using Eloquent and Blade)
fturmel 7 years ago
parent
commit
d27236b0e7
50 changed files with 1190 additions and 2405 deletions
  1. 13 1
      frameworks/PHP/lumen/.env
  2. 17 0
      frameworks/PHP/lumen/.env.example
  3. 5 3
      frameworks/PHP/lumen/.gitignore
  4. 0 0
      frameworks/PHP/lumen/app/Console/Commands/.gitkeep
  5. 29 0
      frameworks/PHP/lumen/app/Console/Kernel.php
  6. 10 0
      frameworks/PHP/lumen/app/Events/Event.php
  7. 16 0
      frameworks/PHP/lumen/app/Events/ExampleEvent.php
  8. 50 0
      frameworks/PHP/lumen/app/Exceptions/Handler.php
  9. 72 0
      frameworks/PHP/lumen/app/Http/Controllers/Controller.php
  10. 18 0
      frameworks/PHP/lumen/app/Http/Controllers/ExampleController.php
  11. 44 0
      frameworks/PHP/lumen/app/Http/Middleware/Authenticate.php
  12. 20 0
      frameworks/PHP/lumen/app/Http/Middleware/ExampleMiddleware.php
  13. 0 72
      frameworks/PHP/lumen/app/Http/routes.php
  14. 26 0
      frameworks/PHP/lumen/app/Jobs/ExampleJob.php
  15. 24 0
      frameworks/PHP/lumen/app/Jobs/Job.php
  16. 31 0
      frameworks/PHP/lumen/app/Listeners/ExampleListener.php
  17. 4 3
      frameworks/PHP/lumen/app/Models/Fortune.php
  18. 4 2
      frameworks/PHP/lumen/app/Models/World.php
  19. 18 0
      frameworks/PHP/lumen/app/Providers/AppServiceProvider.php
  20. 39 0
      frameworks/PHP/lumen/app/Providers/AuthServiceProvider.php
  21. 19 0
      frameworks/PHP/lumen/app/Providers/EventServiceProvider.php
  22. 32 0
      frameworks/PHP/lumen/app/User.php
  23. 35 0
      frameworks/PHP/lumen/artisan
  24. 30 28
      frameworks/PHP/lumen/benchmark_config.json
  25. 94 5
      frameworks/PHP/lumen/bootstrap/app.php
  26. 36 4
      frameworks/PHP/lumen/composer.json
  27. 285 289
      frameworks/PHP/lumen/composer.lock
  28. 19 0
      frameworks/PHP/lumen/database/factories/ModelFactory.php
  29. 0 0
      frameworks/PHP/lumen/database/migrations/.gitkeep
  30. 16 0
      frameworks/PHP/lumen/database/seeds/DatabaseSeeder.php
  31. 0 9
      frameworks/PHP/lumen/deploy/lumen
  32. 22 23
      frameworks/PHP/lumen/deploy/nginx.conf
  33. 0 6
      frameworks/PHP/lumen/index.php
  34. 0 1655
      frameworks/PHP/lumen/modifiedVendorFiles/Application.php
  35. 0 274
      frameworks/PHP/lumen/modifiedVendorFiles/FileViewFinder.php
  36. 27 0
      frameworks/PHP/lumen/phpunit.xml
  37. 21 0
      frameworks/PHP/lumen/public/.htaccess
  38. 23 1
      frameworks/PHP/lumen/public/index.php
  39. 21 0
      frameworks/PHP/lumen/readme.md
  40. 0 0
      frameworks/PHP/lumen/resources/views/.gitkeep
  41. 0 19
      frameworks/PHP/lumen/resources/views/fortune.php
  42. 13 0
      frameworks/PHP/lumen/resources/views/fortunes.blade.php
  43. 8 0
      frameworks/PHP/lumen/routes/web.php
  44. 6 11
      frameworks/PHP/lumen/setup.sh
  45. 2 0
      frameworks/PHP/lumen/storage/app/.gitignore
  46. 2 0
      frameworks/PHP/lumen/storage/framework/cache/.gitignore
  47. 2 0
      frameworks/PHP/lumen/storage/framework/views/.gitignore
  48. 2 0
      frameworks/PHP/lumen/storage/logs/.gitignore
  49. 21 0
      frameworks/PHP/lumen/tests/ExampleTest.php
  50. 14 0
      frameworks/PHP/lumen/tests/TestCase.php

+ 13 - 1
frameworks/PHP/lumen/.env

@@ -1,5 +1,17 @@
+APP_ENV=local
+APP_DEBUG=false
+APP_KEY=
+APP_TIMEZONE=UTC
+
+LOG_CHANNEL=stack
+LOG_SLACK_WEBHOOK_URL=
+
 DB_CONNECTION=mysql
-DB_HOST=localhost
+DB_HOST=__DBHOST__
+DB_PORT=3306
 DB_DATABASE=hello_world
 DB_USERNAME=benchmarkdbuser
 DB_PASSWORD=benchmarkdbpass
+
+CACHE_DRIVER=file
+QUEUE_DRIVER=sync

+ 17 - 0
frameworks/PHP/lumen/.env.example

@@ -0,0 +1,17 @@
+APP_ENV=local
+APP_DEBUG=true
+APP_KEY=
+APP_TIMEZONE=UTC
+
+LOG_CHANNEL=stack
+LOG_SLACK_WEBHOOK_URL=
+
+DB_CONNECTION=mysql
+DB_HOST=127.0.0.1
+DB_PORT=3306
+DB_DATABASE=homestead
+DB_USERNAME=homestead
+DB_PASSWORD=secret
+
+CACHE_DRIVER=file
+QUEUE_DRIVER=sync

+ 5 - 3
frameworks/PHP/lumen/.gitignore

@@ -1,3 +1,5 @@
-vendor
-storage
-deploy/php-fpm.pid
+/vendor
+/.idea
+Homestead.json
+Homestead.yaml
+/deploy/php-fpm.pid

+ 0 - 0
frameworks/PHP/lumen/app/Console/Commands/.gitkeep


+ 29 - 0
frameworks/PHP/lumen/app/Console/Kernel.php

@@ -0,0 +1,29 @@
+<?php
+
+namespace App\Console;
+
+use Illuminate\Console\Scheduling\Schedule;
+use Laravel\Lumen\Console\Kernel as ConsoleKernel;
+
+class Kernel extends ConsoleKernel
+{
+    /**
+     * The Artisan commands provided by your application.
+     *
+     * @var array
+     */
+    protected $commands = [
+        //
+    ];
+
+    /**
+     * Define the application's command schedule.
+     *
+     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
+     * @return void
+     */
+    protected function schedule(Schedule $schedule)
+    {
+        //
+    }
+}

+ 10 - 0
frameworks/PHP/lumen/app/Events/Event.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace App\Events;
+
+use Illuminate\Queue\SerializesModels;
+
+abstract class Event
+{
+    use SerializesModels;
+}

+ 16 - 0
frameworks/PHP/lumen/app/Events/ExampleEvent.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace App\Events;
+
+class ExampleEvent extends Event
+{
+    /**
+     * Create a new event instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        //
+    }
+}

+ 50 - 0
frameworks/PHP/lumen/app/Exceptions/Handler.php

@@ -0,0 +1,50 @@
+<?php
+
+namespace App\Exceptions;
+
+use Exception;
+use Illuminate\Validation\ValidationException;
+use Illuminate\Auth\Access\AuthorizationException;
+use Illuminate\Database\Eloquent\ModelNotFoundException;
+use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
+use Symfony\Component\HttpKernel\Exception\HttpException;
+
+class Handler extends ExceptionHandler
+{
+    /**
+     * A list of the exception types that should not be reported.
+     *
+     * @var array
+     */
+    protected $dontReport = [
+        AuthorizationException::class,
+        HttpException::class,
+        ModelNotFoundException::class,
+        ValidationException::class,
+    ];
+
+    /**
+     * Report or log an exception.
+     *
+     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
+     *
+     * @param  \Exception  $e
+     * @return void
+     */
+    public function report(Exception $e)
+    {
+        parent::report($e);
+    }
+
+    /**
+     * Render an exception into an HTTP response.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \Exception  $e
+     * @return \Illuminate\Http\Response
+     */
+    public function render($request, Exception $e)
+    {
+        return parent::render($request, $e);
+    }
+}

+ 72 - 0
frameworks/PHP/lumen/app/Http/Controllers/Controller.php

@@ -0,0 +1,72 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\Models\Fortune;
+use App\Models\World;
+use Laravel\Lumen\Routing\Controller as BaseController;
+
+class Controller extends BaseController {
+
+	public function json() {
+		return ['message' => 'Hello, World!'];
+	}
+
+	public function db() {
+		return World::find(random_int(1, 10000));
+	}
+
+	public function queries($queries = 1) {
+		$queries = $this->clamp($queries);
+
+		$rows = [];
+		while ($queries--) {
+			$rows[] = World::find(random_int(1, 10000));
+		}
+
+		return $rows;
+	}
+
+	public function fortunes() {
+		$rows = Fortune::all();
+
+		$insert = new Fortune();
+		$insert->id = 0;
+		$insert->message = "Additional fortune added at request time.";
+
+		$rows->add($insert);
+		$rows = $rows->sortBy("message");
+
+		return view("fortunes", ["rows" => $rows]);
+	}
+
+	public function updates($queries = 1) {
+		$queries = $this->clamp($queries);
+
+		$rows = [];
+
+		while ($queries--) {
+			$row = World::find(random_int(1, 10000));
+			$row->randomNumber = random_int(1, 10000);
+			$row->save();
+
+			$rows[] = $row;
+		}
+
+		return $rows;
+	}
+
+	public function plaintext() {
+		return response("Hello, World!")->header('Content-Type', 'text/plain');
+	}
+
+	private function clamp($value): int {
+		if (!is_numeric($value) || $value < 1) {
+			return 1;
+		} else if ($value > 500) {
+			return 500;
+		} else {
+			return $value;
+		}
+	}
+}

+ 18 - 0
frameworks/PHP/lumen/app/Http/Controllers/ExampleController.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace App\Http\Controllers;
+
+class ExampleController extends Controller
+{
+    /**
+     * Create a new controller instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        //
+    }
+
+    //
+}

+ 44 - 0
frameworks/PHP/lumen/app/Http/Middleware/Authenticate.php

@@ -0,0 +1,44 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Closure;
+use Illuminate\Contracts\Auth\Factory as Auth;
+
+class Authenticate
+{
+    /**
+     * The authentication guard factory instance.
+     *
+     * @var \Illuminate\Contracts\Auth\Factory
+     */
+    protected $auth;
+
+    /**
+     * Create a new middleware instance.
+     *
+     * @param  \Illuminate\Contracts\Auth\Factory  $auth
+     * @return void
+     */
+    public function __construct(Auth $auth)
+    {
+        $this->auth = $auth;
+    }
+
+    /**
+     * Handle an incoming request.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \Closure  $next
+     * @param  string|null  $guard
+     * @return mixed
+     */
+    public function handle($request, Closure $next, $guard = null)
+    {
+        if ($this->auth->guard($guard)->guest()) {
+            return response('Unauthorized.', 401);
+        }
+
+        return $next($request);
+    }
+}

+ 20 - 0
frameworks/PHP/lumen/app/Http/Middleware/ExampleMiddleware.php

@@ -0,0 +1,20 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Closure;
+
+class ExampleMiddleware
+{
+    /**
+     * Handle an incoming request.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \Closure  $next
+     * @return mixed
+     */
+    public function handle($request, Closure $next)
+    {
+        return $next($request);
+    }
+}

+ 0 - 72
frameworks/PHP/lumen/app/Http/routes.php

@@ -1,72 +0,0 @@
-<?php
-
-use Illuminate\Http\Request;
-
-require_once __DIR__.'/Models/World.php';
-require_once __DIR__.'/Models/Fortune.php';
-
-$app->get("plaintext", function() {
-    return response("Hello, World!")->header("Content-Type", "text/plain");
-});
-
-$app->get("json", function() {
-	return response()->json(["message" => "Hello, World!"]);
-});
-
-$app->get("db", function() {
-	$id = mt_rand(1, 10000);
-	$result = World::find($id);
-	return response()->json($result);
-});
-
-$app->get("queries", function(Request $request) {
-	$query_count = $request->input("queries");
-	if ($query_count < 1) {
-		$query_count = 1;
-	}
-	if ($query_count > 500) {
-		$query_count = 500;
-	}
-
-	$worlds = array();
-
-	for ($i = 0; $i < $query_count; $i++) {
-		$id = mt_rand(1, 10000);
-		$world = World::find($id);
-		$worlds[] = $world;
-	}
-
-	return response()->json($worlds);
-});
-
-$app->get("updates", function(Request $request) {
-	$query_count = $request->input("queries");
-	if ($query_count < 1) {
-		$query_count = 1;
-	}
-	if ($query_count > 500) {
-		$query_count = 500;
-	}
-
-	$worlds = array();
-
-	for ($i = 0; $i < $query_count; $i++) {
-		$id = mt_rand(1, 10000);
-		$world = World::find($id);
-		$world->randomNumber = mt_rand(1, 10000);
-		$world->save();
-		$worlds[] = $world;
-	}
-
-	return response()->json($worlds);
-});
-
-$app->get("fortune", function() use ($app) {
-	$fortunes = Fortune::all()->toArray();
-	$new_fortune = array("id" => 0, "message" => "Additional fortune added at request time.");
-	$fortunes[] = $new_fortune;
-	$fortunes = array_sort($fortunes, function($value) {
-		return $value["message"];
-	});
-	return view("fortune", ["fortunes" => $fortunes]);
-});

+ 26 - 0
frameworks/PHP/lumen/app/Jobs/ExampleJob.php

@@ -0,0 +1,26 @@
+<?php
+
+namespace App\Jobs;
+
+class ExampleJob extends Job
+{
+    /**
+     * Create a new job instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        //
+    }
+
+    /**
+     * Execute the job.
+     *
+     * @return void
+     */
+    public function handle()
+    {
+        //
+    }
+}

+ 24 - 0
frameworks/PHP/lumen/app/Jobs/Job.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace App\Jobs;
+
+use Illuminate\Bus\Queueable;
+use Illuminate\Queue\SerializesModels;
+use Illuminate\Queue\InteractsWithQueue;
+use Illuminate\Contracts\Queue\ShouldQueue;
+
+abstract class Job implements ShouldQueue
+{
+    /*
+    |--------------------------------------------------------------------------
+    | Queueable Jobs
+    |--------------------------------------------------------------------------
+    |
+    | This job base class provides a central location to place any logic that
+    | is shared across all of your jobs. The trait included with the class
+    | provides access to the "queueOn" and "delay" queue helper methods.
+    |
+    */
+
+    use InteractsWithQueue, Queueable, SerializesModels;
+}

+ 31 - 0
frameworks/PHP/lumen/app/Listeners/ExampleListener.php

@@ -0,0 +1,31 @@
+<?php
+
+namespace App\Listeners;
+
+use App\Events\ExampleEvent;
+use Illuminate\Queue\InteractsWithQueue;
+use Illuminate\Contracts\Queue\ShouldQueue;
+
+class ExampleListener
+{
+    /**
+     * Create the event listener.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        //
+    }
+
+    /**
+     * Handle the event.
+     *
+     * @param  ExampleEvent  $event
+     * @return void
+     */
+    public function handle(ExampleEvent $event)
+    {
+        //
+    }
+}

+ 4 - 3
frameworks/PHP/lumen/app/Http/Models/Fortune.php → frameworks/PHP/lumen/app/Models/Fortune.php

@@ -1,11 +1,12 @@
 <?php
 
+namespace App\Models;
+
 use Illuminate\Database\Eloquent\Model;
 
 class Fortune extends Model {
 
 	protected $table = "Fortune";
 	public $timestamps = false;
-}
-
-?>
+	
+}

+ 4 - 2
frameworks/PHP/lumen/app/Http/Models/World.php → frameworks/PHP/lumen/app/Models/World.php

@@ -1,10 +1,12 @@
 <?php
+
+namespace App\Models;
+
 use Illuminate\Database\Eloquent\Model;
 
 class World extends Model {
 
 	protected $table = "World";
 	public $timestamps = false;
-}
 
-?>
+}

+ 18 - 0
frameworks/PHP/lumen/app/Providers/AppServiceProvider.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace App\Providers;
+
+use Illuminate\Support\ServiceProvider;
+
+class AppServiceProvider extends ServiceProvider
+{
+    /**
+     * Register any application services.
+     *
+     * @return void
+     */
+    public function register()
+    {
+        //
+    }
+}

+ 39 - 0
frameworks/PHP/lumen/app/Providers/AuthServiceProvider.php

@@ -0,0 +1,39 @@
+<?php
+
+namespace App\Providers;
+
+use App\User;
+use Illuminate\Support\Facades\Gate;
+use Illuminate\Support\ServiceProvider;
+
+class AuthServiceProvider extends ServiceProvider
+{
+    /**
+     * Register any application services.
+     *
+     * @return void
+     */
+    public function register()
+    {
+        //
+    }
+
+    /**
+     * Boot the authentication services for the application.
+     *
+     * @return void
+     */
+    public function boot()
+    {
+        // Here you may define how you wish users to be authenticated for your Lumen
+        // application. The callback which receives the incoming request instance
+        // should return either a User instance or null. You're free to obtain
+        // the User instance via an API token or any other method necessary.
+
+        $this->app['auth']->viaRequest('api', function ($request) {
+            if ($request->input('api_token')) {
+                return User::where('api_token', $request->input('api_token'))->first();
+            }
+        });
+    }
+}

+ 19 - 0
frameworks/PHP/lumen/app/Providers/EventServiceProvider.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Providers;
+
+use Laravel\Lumen\Providers\EventServiceProvider as ServiceProvider;
+
+class EventServiceProvider extends ServiceProvider
+{
+    /**
+     * The event listener mappings for the application.
+     *
+     * @var array
+     */
+    protected $listen = [
+        'App\Events\SomeEvent' => [
+            'App\Listeners\EventListener',
+        ],
+    ];
+}

+ 32 - 0
frameworks/PHP/lumen/app/User.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace App;
+
+use Illuminate\Auth\Authenticatable;
+use Laravel\Lumen\Auth\Authorizable;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
+use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
+
+class User extends Model implements AuthenticatableContract, AuthorizableContract
+{
+    use Authenticatable, Authorizable;
+
+    /**
+     * The attributes that are mass assignable.
+     *
+     * @var array
+     */
+    protected $fillable = [
+        'name', 'email',
+    ];
+
+    /**
+     * The attributes excluded from the model's JSON form.
+     *
+     * @var array
+     */
+    protected $hidden = [
+        'password',
+    ];
+}

+ 35 - 0
frameworks/PHP/lumen/artisan

@@ -0,0 +1,35 @@
+#!/usr/bin/env php
+<?php
+
+use Symfony\Component\Console\Input\ArgvInput;
+use Symfony\Component\Console\Output\ConsoleOutput;
+
+/*
+|--------------------------------------------------------------------------
+| Create The Application
+|--------------------------------------------------------------------------
+|
+| First we need to get an application instance. This creates an instance
+| of the application / container and bootstraps the application so it
+| is ready to receive HTTP / Console requests from the environment.
+|
+*/
+
+$app = require __DIR__.'/bootstrap/app.php';
+
+/*
+|--------------------------------------------------------------------------
+| Run The Artisan Application
+|--------------------------------------------------------------------------
+|
+| When we run the console application, the current CLI command will be
+| executed in this console and the response sent back to a terminal
+| or another output device for the developers. Here goes nothing!
+|
+*/
+
+$kernel = $app->make(
+    'Illuminate\Contracts\Console\Kernel'
+);
+
+exit($kernel->handle(new ArgvInput, new ConsoleOutput));

+ 30 - 28
frameworks/PHP/lumen/benchmark_config.json

@@ -1,29 +1,31 @@
-
 {
-  "framework": "lumen",
-  "tests": [{
-    "default": {
-      "setup_file": "setup",
-      "json_url": "/json",
-      "plaintext_url": "/plaintext",
-      "db_url": "/db",
-      "query_url": "/queries?queries=",
-      "fortune_url": "/fortune",
-      "update_url": "/updates?queries=",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Micro",
-      "database": "MySQL",
-      "framework": "Lumen",
-      "language": "PHP",
-      "flavor": "PHP5",
-      "orm": "Full",
-      "platform": "None",
-      "webserver": "nginx",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "Lumen",
-      "versus": "php-php5"
-    }
-  }]
-}
+	"framework": "lumen",
+	"tests": [
+		{
+			"default": {
+				"setup_file": "setup",
+				"json_url": "/json",
+				"db_url": "/db",
+				"query_url": "/queries/",
+				"fortune_url": "/fortunes",
+				"update_url": "/updates/",
+				"plaintext_url": "/plaintext",
+				"port": 8080,
+				"approach": "Realistic",
+				"classification": "Micro",
+				"database": "MySQL",
+				"framework": "lumen",
+				"language": "PHP",
+				"flavor": "PHP7",
+				"orm": "Full",
+				"platform": "None",
+				"webserver": "nginx",
+				"os": "Linux",
+				"database_os": "Linux",
+				"display_name": "Lumen 5.6",
+				"notes": "",
+				"versus": "php7"
+			}
+		}
+	]
+}

+ 94 - 5
frameworks/PHP/lumen/bootstrap/app.php

@@ -1,13 +1,102 @@
 <?php
+
 require_once __DIR__.'/../vendor/autoload.php';
 
-Dotenv::load(__DIR__.'/../');
+try {
+    (new Dotenv\Dotenv(__DIR__.'/../'))->load();
+} catch (Dotenv\Exception\InvalidPathException $e) {
+    //
+}
+
+/*
+|--------------------------------------------------------------------------
+| Create The Application
+|--------------------------------------------------------------------------
+|
+| Here we will load the environment and create the application instance
+| that serves as the central piece of this framework. We'll use this
+| application as an "IoC" container and router for this framework.
+|
+*/
+
+$app = new Laravel\Lumen\Application(
+    realpath(__DIR__.'/../')
+);
+
+// $app->withFacades();
 
-$app = new Laravel\Lumen\Application;
-$app->withFacades();
 $app->withEloquent();
 
-require __DIR__.'/../app/Http/routes.php';
+/*
+|--------------------------------------------------------------------------
+| Register Container Bindings
+|--------------------------------------------------------------------------
+|
+| Now we will register a few bindings in the service container. We will
+| register the exception handler and the console kernel. You may add
+| your own bindings here if you like or you can make another file.
+|
+*/
 
-return $app;
+$app->singleton(
+    Illuminate\Contracts\Debug\ExceptionHandler::class,
+    App\Exceptions\Handler::class
+);
+
+$app->singleton(
+    Illuminate\Contracts\Console\Kernel::class,
+    App\Console\Kernel::class
+);
+
+/*
+|--------------------------------------------------------------------------
+| Register Middleware
+|--------------------------------------------------------------------------
+|
+| Next, we will register the middleware with the application. These can
+| be global middleware that run before and after each request into a
+| route or middleware that'll be assigned to some specific routes.
+|
+*/
 
+// $app->middleware([
+//    App\Http\Middleware\ExampleMiddleware::class
+// ]);
+
+// $app->routeMiddleware([
+//     'auth' => App\Http\Middleware\Authenticate::class,
+// ]);
+
+/*
+|--------------------------------------------------------------------------
+| Register Service Providers
+|--------------------------------------------------------------------------
+|
+| Here we will register all of the application's service providers which
+| are used to bind services into the container. Service providers are
+| totally optional, so you are not required to uncomment this line.
+|
+*/
+
+// $app->register(App\Providers\AppServiceProvider::class);
+// $app->register(App\Providers\AuthServiceProvider::class);
+// $app->register(App\Providers\EventServiceProvider::class);
+
+/*
+|--------------------------------------------------------------------------
+| Load The Application Routes
+|--------------------------------------------------------------------------
+|
+| Next we will include the routes file so that they can all be added to
+| the application. This will provide all of the URLs the application
+| can respond to, as well as the controllers that may handle them.
+|
+*/
+
+$app->router->group([
+    'namespace' => 'App\Http\Controllers',
+], function ($router) {
+    require __DIR__.'/../routes/web.php';
+});
+
+return $app;

+ 36 - 4
frameworks/PHP/lumen/composer.json

@@ -1,6 +1,38 @@
 {
-   "require": {
-   	"laravel/lumen" : "5.0.1"
-   }
+    "name": "laravel/lumen",
+    "description": "The Laravel Lumen Framework.",
+    "keywords": ["framework", "laravel", "lumen"],
+    "license": "MIT",
+    "type": "project",
+    "require": {
+        "php": ">=7.1.3",
+        "laravel/lumen-framework": "5.6.*",
+        "vlucas/phpdotenv": "~2.2"
+    },
+    "require-dev": {
+        "fzaninotto/faker": "~1.4",
+        "phpunit/phpunit": "~7.0",
+        "mockery/mockery": "~1.0"
+    },
+    "autoload": {
+        "psr-4": {
+            "App\\": "app/"
+        }
+    },
+    "autoload-dev": {
+        "classmap": [
+            "tests/",
+            "database/"
+        ]
+    },
+    "scripts": {
+        "post-root-package-install": [
+            "php -r \"copy('.env.example', '.env');\""
+        ]
+    },
+    "minimum-stability": "dev",
+    "prefer-stable": true,
+    "config": {
+        "optimize-autoloader": true
+    }
 }
-

File diff suppressed because it is too large
+ 285 - 289
frameworks/PHP/lumen/composer.lock


+ 19 - 0
frameworks/PHP/lumen/database/factories/ModelFactory.php

@@ -0,0 +1,19 @@
+<?php
+
+/*
+|--------------------------------------------------------------------------
+| Model Factories
+|--------------------------------------------------------------------------
+|
+| Here you may define all of your model factories. Model factories give
+| you a convenient way to create models for testing and seeding your
+| database. Just tell the factory how a default model should look.
+|
+*/
+
+$factory->define(App\User::class, function (Faker\Generator $faker) {
+    return [
+        'name' => $faker->name,
+        'email' => $faker->email,
+    ];
+});

+ 0 - 0
frameworks/PHP/lumen/database/migrations/.gitkeep


+ 16 - 0
frameworks/PHP/lumen/database/seeds/DatabaseSeeder.php

@@ -0,0 +1,16 @@
+<?php
+
+use Illuminate\Database\Seeder;
+
+class DatabaseSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        // $this->call('UsersTableSeeder');
+    }
+}

+ 0 - 9
frameworks/PHP/lumen/deploy/lumen

@@ -1,9 +0,0 @@
-<VirtualHost *:8080>
-  Alias /lumen/ "/home/ubuntu/FrameworkBenchmarks/lumen/public/"
-  <Directory /home/ubuntu/FrameworkBenchmarks/lumen/public/>
-          Options Indexes FollowSymLinks MultiViews
-          #AllowOverride None
-          Order allow,deny
-          allow from all
-  </Directory>
-</VirtualHost>

+ 22 - 23
frameworks/PHP/lumen/deploy/nginx.conf

@@ -1,42 +1,41 @@
-worker_processes  auto;
 
-error_log stderr error;
+worker_processes    auto;
+error_log           stderr error;
 
 events {
     worker_connections  16384;
 }
 
 http {
-    include /usr/local/nginx/conf/mime.types;    
-    default_type  application/octet-stream;
-    access_log off;
-    server_tokens off;
-    sendfile        on;
-    keepalive_timeout  65;
+    include             __IROOT__/nginx/conf/mime.types;
+    default_type        application/octet-stream;
+    access_log          off;
+    server_tokens       off;
+    sendfile            on;
+    keepalive_timeout   65;
 
     upstream fastcgi_backend {
-        server 127.0.0.1:9001;
-        keepalive 50;
+        server      127.0.0.1:9001;
+        keepalive   50;
     }
-    server {
-        listen       8080;
-        server_name  localhost;
 
-        root /home/ubuntu/FrameworkBenchmarks/lumen/;
-        index  index.php;
+    server {
+        listen          8080;
+        server_name     localhost;
+        root            __TROOT__/public;
+        index           index.php;
 
         location / {
-           try_files $uri $uri/ /index.php?$query_string;
+            try_files $uri $uri/ /index.php?$query_string;
         }
 
         location ~ \.php$ {
-            try_files $uri =404;
-            fastcgi_pass   fastcgi_backend;
-            fastcgi_keep_conn on;
-            fastcgi_index  index.php;
-            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
-            include        /usr/local/nginx/conf/fastcgi_params;
+            try_files           $uri =404;
+            fastcgi_pass        fastcgi_backend;
+            fastcgi_keep_conn   on;
+            fastcgi_index       index.php;
+            fastcgi_param       SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+            include             __IROOT__/nginx/conf/fastcgi_params;
         }
-
     }
 }

+ 0 - 6
frameworks/PHP/lumen/index.php

@@ -1,6 +0,0 @@
-<?php
-
-$app = require __DIR__.'/bootstrap/app.php';
-
-$app->run();
-

+ 0 - 1655
frameworks/PHP/lumen/modifiedVendorFiles/Application.php

@@ -1,1655 +0,0 @@
-<?php namespace Laravel\Lumen;
-
-use Closure;
-use Exception;
-use ErrorException;
-use Monolog\Logger;
-use FastRoute\Dispatcher;
-use Illuminate\Http\Request;
-use Illuminate\Http\Response;
-use Illuminate\Pipeline\Pipeline;
-use Monolog\Handler\StreamHandler;
-use Illuminate\Container\Container;
-use Illuminate\Foundation\Composer;
-use Monolog\Formatter\LineFormatter;
-use Illuminate\Filesystem\Filesystem;
-use Illuminate\Support\Facades\Facade;
-use Illuminate\Support\ServiceProvider;
-use Symfony\Component\Console\Output\ConsoleOutput;
-use Illuminate\Http\Exception\HttpResponseException;
-use Illuminate\Config\Repository as ConfigRepository;
-use Symfony\Component\HttpKernel\HttpKernelInterface;
-use Illuminate\Contracts\Routing\TerminableMiddleware;
-use Symfony\Component\HttpFoundation\BinaryFileResponse;
-use Symfony\Component\HttpKernel\Exception\HttpException;
-use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
-use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
-use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
-use Illuminate\Contracts\Foundation\Application as ApplicationContract;
-use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
-
-class Application extends Container implements ApplicationContract, HttpKernelInterface
-{
-
-    /**
-     * Indicates if the class aliases have been registered.
-     *
-     * @var bool
-     */
-    protected static $aliasesRegistered = false;
-
-    /**
-     * The base path of the application installation.
-     *
-     * @var string
-     */
-    protected $basePath;
-
-    /**
-     * The storage path of the application installation.
-     *
-     * @var string
-     */
-    protected $storagePath;
-
-    /**
-     * The configuration path of the application installation.
-     *
-     * @var string
-     */
-    protected $configPath;
-
-    /**
-     * The resource path of the application installation.
-     *
-     * @var string
-     */
-    protected $resourcePath;
-
-    /**
-     * All of the loaded configuration files.
-     *
-     * @var array
-     */
-    protected $loadedConfigurations = [];
-
-    /**
-     * All of the routes waiting to be registered.
-     *
-     * @var array
-     */
-    protected $routes = [];
-
-    /**
-     * All of the named routes and URI pairs.
-     *
-     * @var array
-     */
-    public $namedRoutes = [];
-
-    /**
-     * The shared attributes for the current route group.
-     *
-     * @var array|null
-     */
-    protected $groupAttributes;
-
-    /**
-     * All of the global middleware for the application.
-     *
-     * @var array
-     */
-    protected $middleware = [];
-
-    /**
-     * All of the route specific middleware short-hands.
-     *
-     * @var array
-     */
-    protected $routeMiddleware = [];
-
-    /**
-     * The current route being dispatched.
-     *
-     * @var array
-     */
-    protected $currentRoute;
-
-    /**
-     * The loaded service providers.
-     *
-     * @var array
-     */
-    protected $loadedProviders = [];
-
-    /**
-     * The service binding methods that have been executed.
-     *
-     * @var array
-     */
-    protected $ranServiceBinders = [];
-
-    /**
-     * The FastRoute dispatcher.
-     *
-     * @var \FastRoute\Dispatcher
-     */
-    protected $dispatcher;
-
-    /**
-     * Create a new Lumen application instance.
-     *
-     * @param  string|null  $basePath
-     * @return void
-     */
-    public function __construct($basePath = null)
-    {
-        date_default_timezone_set(env('APP_TIMEZONE', 'UTC'));
-
-        $this->basePath = $basePath;
-        $this->bootstrapContainer();
-        $this->registerErrorHandling();
-    }
-
-    /**
-     * Bootstrap the application container.
-     *
-     * @return void
-     */
-    protected function bootstrapContainer()
-    {
-        static::setInstance($this);
-
-        $this->instance('app', $this);
-
-        $this->registerContainerAliases();
-    }
-
-    /**
-     * Get the version number of the application.
-     *
-     * @return string
-     */
-    public function version()
-    {
-        return 'Lumen (5.0.10) (Laravel Components 5.0.*)';
-    }
-
-    /**
-     * Get or check the current application environment.
-     *
-     * @param  mixed
-     * @return string
-     */
-    public function environment()
-    {
-        return env('APP_ENV', 'production');
-    }
-
-    /**
-     * Determine if the application is currently down for maintenance.
-     *
-     * @return bool
-     */
-    public function isDownForMaintenance()
-    {
-        return false;
-    }
-
-    /**
-     * Register all of the configured providers.
-     *
-     * @return void
-     */
-    public function registerConfiguredProviders()
-    {
-        //
-    }
-
-    /**
-     * Register a service provider with the application.
-     *
-     * @param  \Illuminate\Support\ServiceProvider|string  $provider
-     * @param  array  $options
-     * @param  bool   $force
-     * @return \Illuminate\Support\ServiceProvider
-     */
-    public function register($provider, $options = array(), $force = false)
-    {
-        if (!$provider instanceof ServiceProvider) {
-            $provider = new $provider($this);
-        }
-
-        if (array_key_exists($providerName = get_class($provider), $this->loadedProviders)) {
-            return;
-        }
-
-        $this->loadedProviders[$providerName] = true;
-
-        $provider->register();
-        $provider->boot();
-    }
-
-    /**
-     * Register a deferred provider and service.
-     *
-     * @param  string  $provider
-     * @param  string  $service
-     * @return void
-     */
-    public function registerDeferredProvider($provider, $service = null)
-    {
-        return $this->register($provider);
-    }
-
-    /**
-     * Boot the application's service providers.
-     *
-     * @return void
-     */
-    public function boot()
-    {
-        //
-    }
-
-    /**
-     * Register a new boot listener.
-     *
-     * @param  mixed  $callback
-     * @return void
-     */
-    public function booting($callback)
-    {
-        //
-    }
-
-    /**
-     * Register a new "booted" listener.
-     *
-     * @param  mixed  $callback
-     * @return void
-     */
-    public function booted($callback)
-    {
-        //
-    }
-
-    /**
-     * Set the error handling for the application.
-     *
-     * @return void
-     */
-    protected function registerErrorHandling()
-    {
-        error_reporting(-1);
-
-        set_error_handler(function ($level, $message, $file = '', $line = 0) {
-            if (error_reporting() & $level) {
-                throw new ErrorException($message, 0, $level, $file, $line);
-            }
-        });
-
-        set_exception_handler(function ($e) {
-            $this->handleUncaughtException($e);
-        });
-    }
-
-    /**
-     * Send the exception to the handler and retunr the response.
-     *
-     * @param  Exception  $e
-     * @return Response
-     */
-    protected function sendExceptionToHandler($e)
-    {
-        $handler = $this->make('Illuminate\Contracts\Debug\ExceptionHandler');
-
-        $handler->report($e);
-
-        return $handler->render($this->make('request'), $e);
-    }
-
-    /**
-     * Handle an uncaught exception instance.
-     *
-     * @param  Exception  $e
-     * @return void
-     */
-    protected function handleUncaughtException($e)
-    {
-        $handler = $this->make('Illuminate\Contracts\Debug\ExceptionHandler');
-
-        $handler->report($e);
-
-        if ($this->runningInConsole()) {
-            $handler->renderForConsole(new ConsoleOutput, $e);
-        } else {
-            $handler->render($this->make('request'), $e)->send();
-        }
-    }
-
-    /**
-     * Throw an HttpException with the given data.
-     *
-     * @param  int     $code
-     * @param  string  $message
-     * @param  array   $headers
-     * @return void
-     *
-     * @throws \Symfony\Component\HttpKernel\Exception\HttpException
-     */
-    public function abort($code, $message = '', array $headers = array())
-    {
-        if ($code == 404) {
-            throw new NotFoundHttpException($message);
-        }
-
-        throw new HttpException($code, $message, null, $headers);
-    }
-
-    /**
-     * Resolve the given type from the container.
-     *
-     * @param  string  $abstract
-     * @param  array   $parameters
-     * @return mixed
-     */
-    public function make($abstract, $parameters = [])
-    {
-        if (array_key_exists($abstract, $this->availableBindings) &&
-            ! array_key_exists($this->availableBindings[$abstract], $this->ranServiceBinders)) {
-            $this->{$method = $this->availableBindings[$abstract]}();
-
-            $this->ranServiceBinders[$method] = true;
-        }
-
-        return parent::make($abstract, $parameters);
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerAuthBindings()
-    {
-        $this->singleton('auth', function () {
-            return $this->loadComponent('auth', 'Illuminate\Auth\AuthServiceProvider', 'auth');
-        });
-
-        $this->singleton('auth.driver', function () {
-            return $this->loadComponent('auth', 'Illuminate\Auth\AuthServiceProvider', 'auth.driver');
-        });
-
-        $this->singleton('auth.password', function () {
-            return $this->loadComponent('auth', 'Illuminate\Auth\Passwords\PasswordResetServiceProvider', 'auth.password');
-        });
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerBusBindings()
-    {
-        $this->singleton('Illuminate\Contracts\Bus\Dispatcher', function () {
-            $this->register('Illuminate\Bus\BusServiceProvider');
-
-            return $this->make('Illuminate\Contracts\Bus\Dispatcher');
-        });
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerCacheBindings()
-    {
-        $this->singleton('cache', function () {
-            return $this->loadComponent('cache', 'Illuminate\Cache\CacheServiceProvider');
-        });
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerConfigBindings()
-    {
-        $this->singleton('config', function () {
-            return new ConfigRepository;
-        });
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerComposerBindings()
-    {
-        $this->app->singleton('composer', function ($app) {
-            return new Composer($app->make('files'), $this->basePath());
-        });
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerCookieBindings()
-    {
-        $this->singleton('cookie', function () {
-            return $this->loadComponent('session', 'Illuminate\Cookie\CookieServiceProvider', 'cookie');
-        });
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerDatabaseBindings()
-    {
-        $this->singleton('db', function () {
-            return $this->loadComponent(
-                'database', [
-                    'Illuminate\Database\DatabaseServiceProvider',
-                    'Illuminate\Pagination\PaginationServiceProvider'],
-                'db'
-            );
-        });
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerEncrypterBindings()
-    {
-        $this->singleton('encrypter', function () {
-            return $this->loadComponent('app', 'Illuminate\Encryption\EncryptionServiceProvider', 'encrypter');
-        });
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerEventBindings()
-    {
-        $this->singleton('events', function () {
-            $this->register('Illuminate\Events\EventServiceProvider');
-
-            return $this->make('events');
-        });
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerErrorBindings()
-    {
-        if (! $this->bound('Illuminate\Contracts\Debug\ExceptionHandler')) {
-            $this->singleton(
-                'Illuminate\Contracts\Debug\ExceptionHandler', 'Laravel\Lumen\Exceptions\Handler'
-            );
-        }
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerFilesBindings()
-    {
-        $this->singleton('files', function () {
-            return new Filesystem;
-        });
-
-        $this->singleton('filesystem', function () {
-            return $this->loadComponent('filesystems', 'Illuminate\Filesystem\FilesystemServiceProvider', 'filesystem');
-        });
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerHashBindings()
-    {
-        $this->singleton('hash', function () {
-            $this->register('Illuminate\Hashing\HashServiceProvider');
-
-            return $this->make('hash');
-        });
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerLogBindings()
-    {
-        $this->singleton('Psr\Log\LoggerInterface', function () {
-            return new Logger('lumen', [$this->getMonologHandler()]);
-        });
-    }
-
-    /**
-     * Get the Monolog handler for the application.
-     *
-     * @return \Monolog\Handler\AbstractHandler
-     */
-    protected function getMonologHandler()
-    {
-        return (new StreamHandler(getcwd().'/vendor/laravel/lumen-framework/storage/logs/lumen.log', Logger::DEBUG))
-                            ->setFormatter(new LineFormatter(null, null, true, true));
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerMailBindings()
-    {
-        $this->singleton('mailer', function () {
-            $this->configure('services');
-
-            return $this->loadComponent('mail', 'Illuminate\Mail\MailServiceProvider', 'mailer');
-        });
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerQueueBindings()
-    {
-        $this->singleton('queue', function () {
-            return $this->loadComponent('queue', 'Illuminate\Queue\QueueServiceProvider', 'queue');
-        });
-
-        $this->singleton('queue.connection', function () {
-            return $this->loadComponent('queue', 'Illuminate\Queue\QueueServiceProvider', 'queue.connection');
-        });
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerRedisBindings()
-    {
-        $this->singleton('redis', function() {
-            return $this->loadComponent('database', 'Illuminate\Redis\RedisServiceProvider', 'redis');
-        });
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerRequestBindings()
-    {
-        $this->singleton('Illuminate\Http\Request', function () {
-            return Request::capture()->setUserResolver(function () {
-                return $this->make('auth')->user();
-            })->setRouteResolver(function () {
-                return $this->currentRoute;
-            });
-        });
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerSessionBindings()
-    {
-        $this->singleton('session', function () {
-            return $this->loadComponent('session', 'Illuminate\Session\SessionServiceProvider');
-        });
-
-        $this->singleton('session.store', function () {
-            return $this->loadComponent('session', 'Illuminate\Session\SessionServiceProvider', 'session.store');
-        });
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerTranslationBindings()
-    {
-        $this->singleton('translator', function () {
-            $this->configure('app');
-
-            $this->instance('path.lang', $this->getLanguagePath());
-
-            $this->register('Illuminate\Translation\TranslationServiceProvider');
-
-            return $this->make('translator');
-        });
-    }
-
-    /**
-     * Get the path to the application's language files.
-     *
-     * @return string
-     */
-    protected function getLanguagePath()
-    {
-        if (is_dir($appPath = $this->resourcePath('lang'))) {
-            return $appPath;
-        } else {
-            return __DIR__.'/../lang';
-        }
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerUrlGeneratorBindings()
-    {
-        $this->singleton('url', function () {
-            return new Routing\UrlGenerator($this);
-        });
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerValidatorBindings()
-    {
-        $this->singleton('validator', function () {
-            $this->register('Illuminate\Validation\ValidationServiceProvider');
-
-            return $this->make('validator');
-        });
-    }
-
-    /**
-     * Register container bindings for the application.
-     *
-     * @return void
-     */
-    protected function registerViewBindings()
-    {
-        $this->singleton('view', function () {
-            return $this->loadComponent('view', 'Illuminate\View\ViewServiceProvider');
-        });
-    }
-
-    /**
-     * Configure and load the given component and provider.
-     *
-     * @param  string  $config
-     * @param  array|string  $providers
-     * @param  string|null  $return
-     * @return mixed
-     */
-    protected function loadComponent($config, $providers, $return = null)
-    {
-        $this->configure($config);
-
-        foreach ((array) $providers as $provider) {
-            $this->register($provider);
-        }
-
-        return $this->make($return ?: $config);
-    }
-
-    /**
-     * Load a configuration file into the application.
-     *
-     * @return void
-     */
-    public function configure($name)
-    {
-        if (isset($this->loadedConfigurations[$name])) {
-            return;
-        }
-
-        $this->loadedConfigurations[$name] = true;
-
-        $path = $this->getConfigurationPath($name);
-
-        if ($path) {
-            $this->make('config')->set($name, require $path);
-        }
-    }
-
-    /**
-     * Get the path to the given configuration file.
-     *
-     * @param  string  $name
-     * @return string
-     */
-    protected function getConfigurationPath($name)
-    {
-        $appConfigPath = ($this->configPath ?: $this->basePath('config')).'/'.$name.'.php';
-
-        if (file_exists($appConfigPath)) {
-            return $appConfigPath;
-        } elseif (file_exists($path = __DIR__.'/../config/'.$name.'.php')) {
-            return $path;
-        }
-    }
-
-    /**
-     * Register the facades for the application.
-     *
-     * @return void
-     */
-    public function withFacades()
-    {
-        Facade::setFacadeApplication($this);
-
-        if (! static::$aliasesRegistered) {
-            static::$aliasesRegistered = true;
-
-            class_alias('Illuminate\Support\Facades\App', 'App');
-            class_alias('Illuminate\Support\Facades\Auth', 'Auth');
-            class_alias('Illuminate\Support\Facades\Bus', 'Bus');
-            class_alias('Illuminate\Support\Facades\DB', 'DB');
-            class_alias('Illuminate\Support\Facades\Cache', 'Cache');
-            class_alias('Illuminate\Support\Facades\Cookie', 'Cookie');
-            class_alias('Illuminate\Support\Facades\Crypt', 'Crypt');
-            class_alias('Illuminate\Support\Facades\Event', 'Event');
-            class_alias('Illuminate\Support\Facades\Hash', 'Hash');
-            class_alias('Illuminate\Support\Facades\Log', 'Log');
-            class_alias('Illuminate\Support\Facades\Mail', 'Mail');
-            class_alias('Illuminate\Support\Facades\Queue', 'Queue');
-            class_alias('Illuminate\Support\Facades\Request', 'Request');
-            class_alias('Illuminate\Support\Facades\Schema', 'Schema');
-            class_alias('Illuminate\Support\Facades\Session', 'Session');
-            class_alias('Illuminate\Support\Facades\Storage', 'Storage');
-            class_alias('Illuminate\Support\Facades\Validator', 'Validator');
-        }
-    }
-
-    /**
-     * Load the Eloquent library for the application.
-     *
-     * @return void
-     */
-    public function withEloquent()
-    {
-        $this->make('db');
-    }
-
-    /**
-     * Register a set of routes with a set of shared attributes.
-     *
-     * @param  array  $attributes
-     * @param  Closure  $callback
-     * @return void
-     */
-    public function group(array $attributes, Closure $callback)
-    {
-        $this->groupAttributes = $attributes;
-
-        call_user_func($callback, $this);
-
-        $this->groupAttributes = null;
-    }
-
-    /**
-     * Register a route with the application.
-     *
-     * @param  string  $uri
-     * @param  mixed  $action
-     * @return $this
-     */
-    public function get($uri, $action)
-    {
-        $this->addRoute('GET', $uri, $action);
-
-        return $this;
-    }
-
-    /**
-     * Register a route with the application.
-     *
-     * @param  string  $uri
-     * @param  mixed  $action
-     * @return $this
-     */
-    public function post($uri, $action)
-    {
-        $this->addRoute('POST', $uri, $action);
-
-        return $this;
-    }
-
-    /**
-     * Register a route with the application.
-     *
-     * @param  string  $uri
-     * @param  mixed  $action
-     * @return $this
-     */
-    public function put($uri, $action)
-    {
-        $this->addRoute('PUT', $uri, $action);
-
-        return $this;
-    }
-
-    /**
-     * Register a route with the application.
-     *
-     * @param  string  $uri
-     * @param  mixed  $action
-     * @return $this
-     */
-    public function patch($uri, $action)
-    {
-        $this->addRoute('PATCH', $uri, $action);
-
-        return $this;
-    }
-
-    /**
-     * Register a route with the application.
-     *
-     * @param  string  $uri
-     * @param  mixed  $action
-     * @return $this
-     */
-    public function delete($uri, $action)
-    {
-        $this->addRoute('DELETE', $uri, $action);
-
-        return $this;
-    }
-
-    /**
-     * Register a route with the application.
-     *
-     * @param  string  $uri
-     * @param  mixed  $action
-     * @return $this
-     */
-    public function options($uri, $action)
-    {
-        $this->addRoute('OPTIONS', $uri, $action);
-
-        return $this;
-    }
-
-    /**
-     * Add a route to the collection.
-     *
-     * @param  string  $method
-     * @param  string  $uri
-     * @param  mixed  $action
-     */
-    protected function addRoute($method, $uri, $action)
-    {
-        $action = $this->parseAction($action);
-
-        $uri = $uri === '/' ? $uri : '/'.trim($uri, '/');
-
-        if (isset($this->groupAttributes)) {
-            if (isset($this->groupAttributes['prefix'])) {
-                $uri = rtrim('/'.trim($this->groupAttributes['prefix'], '/').$uri, '/');
-            }
-
-            $action = $this->mergeGroupAttributes($action);
-        }
-
-        if (isset($action['as'])) {
-            $this->namedRoutes[$action['as']] = $uri;
-        }
-
-        $this->routes[$method.$uri] = ['method' => $method, 'uri' => $uri, 'action' => $action];
-    }
-
-    /**
-     * Parse the action into an array format.
-     *
-     * @param  mixed  $action
-     * @return array
-     */
-    protected function parseAction($action)
-    {
-        if (is_string($action)) {
-            return ['uses' => $action];
-        } elseif (! is_array($action)) {
-            return [$action];
-        }
-
-        return $action;
-    }
-
-    /**
-     * Merge the group attributes into the action.
-     *
-     * @param  array  $action
-     * @return array
-     */
-    protected function mergeGroupAttributes(array $action)
-    {
-        return $this->mergeNamespaceGroup(
-            $this->mergeMiddlewareGroup($action)
-        );
-    }
-
-    /**
-     * Merge the namespace group into the action.
-     *
-     * @param  array  $action
-     * @return array
-     */
-    protected function mergeNamespaceGroup(array $action)
-    {
-        if (isset($this->groupAttributes['namespace']) && isset($action['uses'])) {
-            $action['uses'] = $this->groupAttributes['namespace'].'\\'.$action['uses'];
-        }
-
-        return $action;
-    }
-
-    /**
-     * Merge the middleware group into the action.
-     *
-     * @param  array  $action
-     * @return array
-     */
-    protected function mergeMiddlewareGroup($action)
-    {
-        if (isset($this->groupAttributes['middleware'])) {
-            if (isset($action['middleware'])) {
-                $action['middleware'] .= '|'.$this->groupAttributes['middleware'];
-            } else {
-                $action['middleware'] = $this->groupAttributes['middleware'];
-            }
-        }
-
-        return $action;
-    }
-
-    /**
-     * Add new middleware to the application.
-     *
-     * @param  array  $middleware
-     * @return $this
-     */
-    public function middleware(array $middleware)
-    {
-        $this->middleware = array_unique(array_merge($this->middleware, $middleware));
-
-        return $this;
-    }
-
-    /**
-     * Define the route middleware for the application.
-     *
-     * @param  array  $middleware
-     * @return $this
-     */
-    public function routeMiddleware(array $middleware)
-    {
-        $this->routeMiddleware = array_merge($this->routeMiddleware, $middleware);
-
-        return $this;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function handle(SymfonyRequest $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
-    {
-        return $this->dispatch($request);
-    }
-
-    /**
-     * Run the application and send the response.
-     *
-     * @param  SymfonyRequest|null  $request
-     * @return void
-     */
-    public function run($request = null)
-    {
-        $response = $this->dispatch($request);
-
-        if ($response instanceof SymfonyResponse) {
-            $response->send();
-        } else {
-            echo (string) $response;
-        }
-
-        if (count($this->middleware) > 0) {
-            $this->callTerminableMiddleware($response);
-        }
-    }
-
-    /**
-     * Call the terminable middleware.
-     *
-     * @param  mixed  $response
-     * @return void
-     */
-    protected function callTerminableMiddleware($response)
-    {
-        $response = $this->prepareResponse($response);
-
-        foreach ($this->middleware as $middleware) {
-            $instance = $this->make($middleware);
-
-            if ($instance instanceof TerminableMiddleware) {
-                $instance->terminate(
-                    $this->make('request'), $response
-                );
-            }
-        }
-    }
-
-    /**
-     * Dispatch the incoming request.
-     *
-     * @param  SymfonyRequest|null  $request
-     * @return Response
-     */
-    public function dispatch($request = null)
-    {
-        if ($request) {
-            $this->instance('Illuminate\Http\Request', $request);
-            $this->ranServiceBinders['registerRequestBindings'] = true;
-
-            $method = $request->getMethod();
-            $pathInfo = $request->getPathInfo();
-        } else {
-            $method = $this->getMethod();
-            $pathInfo = $this->getPathInfo();
-        }
-
-        try {
-            return $this->sendThroughPipeline($this->middleware, function () use ($method, $pathInfo) {
-                if (isset($this->routes[$method.$pathInfo])) {
-                    return $this->handleFoundRoute([true, $this->routes[$method.$pathInfo]['action'], []]);
-                }
-
-                return $this->handleDispatcherResponse(
-                    $this->createDispatcher()->dispatch($method, $pathInfo)
-                );
-            });
-        } catch (Exception $e) {
-            return $this->sendExceptionToHandler($e);
-        }
-    }
-
-    /**
-     * Create a FastRoute dispatcher instance for the application.
-     *
-     * @return Dispatcher
-     */
-    protected function createDispatcher()
-    {
-        return $this->dispatcher ?: \FastRoute\simpleDispatcher(function ($r) {
-            foreach ($this->routes as $route) {
-                $r->addRoute($route['method'], $route['uri'], $route['action']);
-            }
-        });
-    }
-
-    /**
-     * Set the FastRoute dispatcher instance.
-     *
-     * @param  \FastRoute\Dispatcher  $dispatcher
-     * @return void
-     */
-    public function setDispatcher(Dispatcher $dispatcher)
-    {
-        $this->dispatcher = $dispatcher;
-    }
-
-    /**
-     * Handle the response from the FastRoute dispatcher.
-     *
-     * @param  array  $routeInfo
-     * @return mixed
-     */
-    protected function handleDispatcherResponse($routeInfo)
-    {
-        switch ($routeInfo[0]) {
-            case Dispatcher::NOT_FOUND:
-                throw new NotFoundHttpException;
-
-            case Dispatcher::METHOD_NOT_ALLOWED:
-                throw new MethodNotAllowedHttpException($routeInfo[1]);
-
-            case Dispatcher::FOUND:
-                return $this->handleFoundRoute($routeInfo);
-        }
-    }
-
-    /**
-     * Handle a route found by the dispatcher.
-     *
-     * @param  array  $routeInfo
-     * @return mixed
-     */
-    protected function handleFoundRoute($routeInfo)
-    {
-        $this->currentRoute = $routeInfo;
-
-        $action = $routeInfo[1];
-
-        // Pipe through route middleware...
-        if (isset($action['middleware'])) {
-            $middleware = $this->gatherMiddlewareClassNames($action['middleware']);
-
-            return $this->prepareResponse($this->sendThroughPipeline($middleware, function () use ($routeInfo) {
-                return $this->callActionOnArrayBasedRoute($routeInfo);
-            }));
-        }
-
-        return is_string($response = $this->callActionOnArrayBasedRoute($routeInfo))
-                         ? $response : $this->prepareResponse($response);
-    }
-
-    /**
-     * Call the Closure on the array based route.
-     *
-     * @param  array  $routeInfo
-     * @return mixed
-     */
-    protected function callActionOnArrayBasedRoute($routeInfo)
-    {
-        $action = $routeInfo[1];
-
-        if (isset($action['uses'])) {
-            return $this->callControllerAction($routeInfo);
-        }
-
-        foreach ($action as $value) {
-            if ($value instanceof Closure) {
-                $closure = $value->bindTo(new Routing\Closure);
-                break;
-            }
-        }
-
-        try {
-            return $this->call($closure, $routeInfo[2]);
-        } catch (HttpResponseException $e) {
-            return $e->getResponse();
-        }
-    }
-
-    /**
-     * Call a controller based route.
-     *
-     * @param  array  $routeInfo
-     * @return mixed
-     */
-    protected function callControllerAction($routeInfo)
-    {
-        list($controller, $method) = explode('@', $routeInfo[1]['uses']);
-
-        if (! method_exists($instance = $this->make($controller), $method)) {
-            throw new NotFoundHttpException;
-        }
-
-        if ($instance instanceof Routing\Controller) {
-            return $this->callLumenController($instance, $method, $routeInfo);
-        } else {
-            return $this->callControllerCallable(
-                [$instance, $method], $routeInfo[2]
-            );
-        }
-    }
-
-    /**
-     * Send the request through a Lumen controller.
-     *
-     * @param  mixed  $instance
-     * @param  string  $method
-     * @param  array  $routeInfo
-     * @return mixed
-     */
-    protected function callLumenController($instance, $method, $routeInfo)
-    {
-        $middleware = $instance->getMiddlewareForMethod(
-            $this->make('request'), $method
-        );
-
-        if (count($middleware) > 0) {
-            return $this->callLumenControllerWithMiddleware(
-                $instance, $method, $routeInfo, $middleware
-            );
-        } else {
-            return $this->callControllerCallable(
-                [$instance, $method], $routeInfo[2]
-            );
-        }
-    }
-
-    /**
-     * Send the request through a set of controller middleware.
-     *
-     * @param  mixed  $instance
-     * @param  string  $method
-     * @param  array  $routeInfo
-     * @param  array  $middleware
-     * @return mixed
-     */
-    protected function callLumenControllerWithMiddleware($instance, $method, $routeInfo, $middleware)
-    {
-        $middleware = $this->gatherMiddlewareClassNames($middleware);
-
-        return $this->sendThroughPipeline($middleware, function () use ($instance, $method, $routeInfo) {
-            return $this->callControllerCallable(
-                [$instance, $method], $routeInfo[2]
-            );
-        });
-    }
-
-    /**
-     * Call the callable for a controller action with the given parameters.
-     *
-     * @param  array  $callable
-     * @param  array $parameters
-     * @return mixed
-     */
-    protected function callControllerCallable(array $callable, array $parameters)
-    {
-        try {
-            return $this->prepareResponse(
-                $this->call($callable, $parameters)
-            );
-        } catch (HttpResponseException $e) {
-            return $e->getResponse();
-        }
-    }
-
-    /**
-     * Gather the full class names for the middleware short-cut string.
-     *
-     * @param  string  $middleware
-     * @return array
-     */
-    protected function gatherMiddlewareClassNames($middleware)
-    {
-        $middleware = is_string($middleware) ? explode('|', $middleware) : (array) $middleware;
-
-        return array_map(function ($name) {
-            return $this->routeMiddleware[$name];
-        }, $middleware);
-    }
-
-    /**
-     * Send the request through the pipeline with the given callback.
-     *
-     * @param  array  $middleware
-     * @param  Closure  $then
-     * @return mixed
-     */
-    protected function sendThroughPipeline(array $middleware, Closure $then)
-    {
-        if (count($middleware) > 0) {
-            return (new Pipeline($this))
-                ->send($this->make('request'))
-                ->through($middleware)
-                ->then($then);
-        }
-
-        return $then();
-    }
-
-    /**
-     * Prepare the response for sending.
-     *
-     * @param  mixed  $response
-     * @return Response
-     */
-    public function prepareResponse($response)
-    {
-        if (! $response instanceof SymfonyResponse) {
-            $response = new Response($response);
-        } elseif ($response instanceof BinaryFileResponse) {
-            $response = $response->prepare(Request::capture());
-        }
-
-        return $response;
-    }
-
-    /**
-     * Get the current HTTP request method.
-     *
-     * @return string
-     */
-    protected function getMethod()
-    {
-        if (isset($_POST['_method'])) {
-            return strtoupper($_POST['_method']);
-        } else {
-            return $_SERVER['REQUEST_METHOD'];
-        }
-    }
-
-    /**
-     * Get the current HTTP path info.
-     *
-     * @return string
-     */
-    public function getPathInfo()
-    {
-        $query = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '';
-
-        return '/'.trim(str_replace('?'.$query, '', $_SERVER['REQUEST_URI']), '/');
-    }
-
-    /**
-     * Get the base path for the application.
-     *
-     * @param  string  $path
-     * @return string
-     */
-    public function basePath($path = null)
-    {
-        if (isset($this->basePath)) {
-            return $this->basePath.($path ? '/'.$path : $path);
-        }
-
-        if ($this->runningInConsole() || php_sapi_name() === 'cli-server') {
-            $this->basePath = getcwd();
-        } else {
-            $this->basePath = realpath(getcwd().'/../');
-        }
-
-        return $this->basePath($path);
-    }
-
-    /**
-     * Get the storage path for the application.
-     *
-     * @param  string  $path
-     * @return string
-     */
-    public function storagePath($path = null)
-    {
-        if ($this->storagePath) {
-            return $this->storagePath.($path ? '/'.$path : $path);
-        }
-
-        return $this->basePath().'/storage'.($path ? '/'.$path : $path);
-    }
-
-    /**
-     * Set a custom storage path for the application.
-     *
-     * @param  string  $path
-     * @return $this
-     */
-    public function useStoragePath($path)
-    {
-        $this->storagePath = $path;
-
-        return $this;
-    }
-
-    /**
-     * Get the database path for the application.
-     *
-     * @return string
-     */
-    public function databasePath()
-    {
-        return $this->basePath().'/database';
-    }
-
-    /**
-     * Set a custom configuration path for the application.
-     *
-     * @param  string  $path
-     * @return $this
-     */
-    public function useConfigPath($path)
-    {
-        $this->configPath = $path;
-
-        return $this;
-    }
-
-    /**
-     * Get the resource path for the application.
-     *
-     * @param  string  $path
-     * @return string
-     */
-    public function resourcePath($path = null)
-    {
-        if ($this->resourcePath) {
-            return $this->resourcePath.($path ? '/'.$path : $path);
-        }
-
-        return $this->basePath().'/resources'.($path ? '/'.$path : $path);
-    }
-
-    /**
-     * Set a custom resource path for the application.
-     *
-     * @param  string  $path
-     * @return $this
-     */
-    public function useResourcePath($path)
-    {
-        $this->resourcePath = $path;
-
-        return $this;
-    }
-
-    /**
-     * Determine if the application is running in the console.
-     *
-     * @return string
-     */
-    public function runningInConsole()
-    {
-        return php_sapi_name() == 'cli';
-    }
-
-    /**
-     * Prepare the application to execute a console command.
-     *
-     * @return void
-     */
-    public function prepareForConsoleCommand()
-    {
-        $this->withFacades();
-
-        $this->make('cache');
-        $this->make('queue');
-
-        $this->configure('database');
-
-        $this->register('Illuminate\Database\MigrationServiceProvider');
-        $this->register('Illuminate\Database\SeedServiceProvider');
-        $this->register('Illuminate\Queue\ConsoleServiceProvider');
-    }
-
-    /**
-     * Get the raw routes for the application.
-     *
-     * @return array
-     */
-    public function getRoutes()
-    {
-        return $this->routes;
-    }
-
-    /**
-     * Set the cached routes.
-     *
-     * @param  array  $routes
-     * @return void
-     */
-    public function setRoutes(array $routes)
-    {
-        $this->routes = $routes;
-    }
-
-    /**
-     * Register the core container aliases.
-     *
-     * @return void
-     */
-    protected function registerContainerAliases()
-    {
-        $this->aliases = [
-            'Illuminate\Contracts\Foundation\Application' => 'app',
-            'Illuminate\Contracts\Auth\Guard' => 'auth.driver',
-            'Illuminate\Contracts\Auth\PasswordBroker' => 'auth.password',
-            'Illuminate\Contracts\Cache\Factory' => 'cache',
-            'Illuminate\Contracts\Cache\Repository' => 'cache.store',
-            'Illuminate\Container\Container' => 'app',
-            'Illuminate\Contracts\Container\Container' => 'app',
-            'Illuminate\Contracts\Cookie\Factory' => 'cookie',
-            'Illuminate\Contracts\Cookie\QueueingFactory' => 'cookie',
-            'Illuminate\Contracts\Encryption\Encrypter' => 'encrypter',
-            'Illuminate\Contracts\Events\Dispatcher' => 'events',
-            'Illuminate\Contracts\Filesystem\Factory' => 'filesystem',
-            'Illuminate\Contracts\Hashing\Hasher' => 'hash',
-            'log' => 'Psr\Log\LoggerInterface',
-            'Illuminate\Contracts\Mail\Mailer' => 'mailer',
-            'Illuminate\Contracts\Queue\Queue' => 'queue.connection',
-            'Illuminate\Redis\Database' => 'redis',
-            'Illuminate\Contracts\Redis\Database' => 'redis',
-            'request' => 'Illuminate\Http\Request',
-            'Illuminate\Session\SessionManager' => 'session',
-            'Illuminate\Contracts\View\Factory' => 'view',
-        ];
-    }
-
-    /**
-     * The available container bindings and their respective load methods.
-     *
-     * @var array
-     */
-    public $availableBindings = [
-        'auth' => 'registerAuthBindings',
-        'auth.driver' => 'registerAuthBindings',
-        'Illuminate\Contracts\Auth\Guard' => 'registerAuthBindings',
-        'auth.password' => 'registerAuthBindings',
-        'Illuminate\Contracts\Auth\PasswordBroker' => 'registerAuthBindings',
-        'Illuminate\Contracts\Bus\Dispatcher' => 'registerBusBindings',
-        'cache' => 'registerCacheBindings',
-        'Illuminate\Contracts\Cache\Factory' => 'registerCacheBindings',
-        'Illuminate\Contracts\Cache\Repository' => 'registerCacheBindings',
-        'config' => 'registerConfigBindings',
-        'composer' => 'registerComposerBindings',
-        'cookie' => 'registerCookieBindings',
-        'Illuminate\Contracts\Cookie\Factory' => 'registerCookieBindings',
-        'Illuminate\Contracts\Cookie\QueueingFactory' => 'registerCookieBindings',
-        'db' => 'registerDatabaseBindings',
-        'encrypter' => 'registerEncrypterBindings',
-        'Illuminate\Contracts\Encryption\Encrypter' => 'registerEncrypterBindings',
-        'events' => 'registerEventBindings',
-        'Illuminate\Contracts\Events\Dispatcher' => 'registerEventBindings',
-        'Illuminate\Contracts\Debug\ExceptionHandler' => 'registerErrorBindings',
-        'files' => 'registerFilesBindings',
-        'filesystem' => 'registerFilesBindings',
-        'Illuminate\Contracts\Filesystem\Factory' => 'registerFilesBindings',
-        'hash' => 'registerHashBindings',
-        'Illuminate\Contracts\Hashing\Hasher' => 'registerHashBindings',
-        'log' => 'registerLogBindings',
-        'Psr\Log\LoggerInterface' => 'registerLogBindings',
-        'mailer' => 'registerMailBindings',
-        'Illuminate\Contracts\Mail\Mailer' => 'registerMailBindings',
-        'queue' => 'registerQueueBindings',
-        'queue.connection' => 'registerQueueBindings',
-        'Illuminate\Contracts\Queue\Queue' => 'registerQueueBindings',
-        'redis' => 'registerRedisBindings',
-        'request' => 'registerRequestBindings',
-        'Illuminate\Http\Request' => 'registerRequestBindings',
-        'session' => 'registerSessionBindings',
-        'session.store' => 'registerSessionBindings',
-        'Illuminate\Session\SessionManager' => 'registerSessionBindings',
-        'translator' => 'registerTranslationBindings',
-        'url' => 'registerUrlGeneratorBindings',
-        'validator' => 'registerValidatorBindings',
-        'view' => 'registerViewBindings',
-        'Illuminate\Contracts\View\Factory' => 'registerViewBindings',
-    ];
-
-    /**
-     * Get the HTML from the Lumen welcome screen.
-     *
-     * @return string
-     */
-    public function welcome()
-    {
-        return "<html>
-            <head>
-                <title>Lumen</title>
-
-                <link href='//fonts.googleapis.com/css?family=Lato:100' rel='stylesheet' type='text/css'>
-
-                <style>
-                    body {
-                        margin: 0;
-                        padding: 0;
-                        width: 100%;
-                        height: 100%;
-                        color: #B0BEC5;
-                        display: table;
-                        font-weight: 100;
-                        font-family: 'Lato';
-                    }
-
-                    .container {
-                        text-align: center;
-                        display: table-cell;
-                        vertical-align: middle;
-                    }
-
-                    .content {
-                        text-align: center;
-                        display: inline-block;
-                    }
-
-                    .title {
-                        font-size: 96px;
-                        margin-bottom: 40px;
-                    }
-
-                    .quote {
-                        font-size: 24px;
-                    }
-                </style>
-            </head>
-            <body>
-                <div class=\"container\">
-                    <div class=\"content\">
-                        <div class=\"title\">Lumen.</div>
-                    </div>
-                </div>
-            </body>
-        </html>
-        ";
-    }
-}

+ 0 - 274
frameworks/PHP/lumen/modifiedVendorFiles/FileViewFinder.php

@@ -1,274 +0,0 @@
-<?php namespace Illuminate\View;
-
-use InvalidArgumentException;
-use Illuminate\Filesystem\Filesystem;
-
-class FileViewFinder implements ViewFinderInterface {
-
-	/**
-	 * The filesystem instance.
-	 *
-	 * @var \Illuminate\Filesystem\Filesystem
-	 */
-	protected $files;
-
-	/**
-	 * The array of active view paths.
-	 *
-	 * @var array
-	 */
-	protected $paths;
-
-	/**
-	 * The array of views that have been located.
-	 *
-	 * @var array
-	 */
-	protected $views = array();
-
-	/**
-	 * The namespace to file path hints.
-	 *
-	 * @var array
-	 */
-	protected $hints = array();
-
-	/**
-	 * Register a view extension with the finder.
-	 *
-	 * @var array
-	 */
-	protected $extensions = array('blade.php', 'php');
-
-	/**
-	 * Create a new file view loader instance.
-	 *
-	 * @param  \Illuminate\Filesystem\Filesystem  $files
-	 * @param  array  $paths
-	 * @param  array  $extensions
-	 * @return void
-	 */
-	public function __construct(Filesystem $files, array $paths, array $extensions = null)
-	{
-		$this->files = $files;
-		$this->paths = $paths;
-
-		if (isset($extensions))
-		{
-			$this->extensions = $extensions;
-		}
-	}
-
-	/**
-	 * Get the fully qualified location of the view.
-	 *
-	 * @param  string  $name
-	 * @return string
-	 */
-	public function find($name)
-	{
-		if (isset($this->views[$name])) return $this->views[$name];
-
-		if ($this->hasHintInformation($name = trim($name)))
-		{
-			return $this->views[$name] = $this->findNamedPathView($name);
-		}
-
-		return $this->views[$name] = $this->findInPaths($name, $this->paths);
-	}
-
-	/**
-	 * Get the path to a template with a named path.
-	 *
-	 * @param  string  $name
-	 * @return string
-	 */
-	protected function findNamedPathView($name)
-	{
-		list($namespace, $view) = $this->getNamespaceSegments($name);
-
-		return $this->findInPaths($view, $this->hints[$namespace]);
-	}
-
-	/**
-	 * Get the segments of a template with a named path.
-	 *
-	 * @param  string  $name
-	 * @return array
-	 *
-	 * @throws \InvalidArgumentException
-	 */
-	protected function getNamespaceSegments($name)
-	{
-		$segments = explode(static::HINT_PATH_DELIMITER, $name);
-
-		if (count($segments) != 2)
-		{
-			throw new InvalidArgumentException("View [$name] has an invalid name.");
-		}
-
-		if ( ! isset($this->hints[$segments[0]]))
-		{
-			throw new InvalidArgumentException("No hint path defined for [{$segments[0]}].");
-		}
-
-		return $segments;
-	}
-
-	/**
-	 * Find the given view in the list of paths.
-	 *
-	 * @param  string  $name
-	 * @param  array   $paths
-	 * @return string
-	 *
-	 * @throws \InvalidArgumentException
-	 */
-	protected function findInPaths($name, $paths)
-	{
-		foreach ((array) $paths as $path)
-		{
-			foreach ($this->getPossibleViewFiles($name) as $file)
-			{
-				if ($this->files->exists($viewPath = $path.'/'.$file))
-				{
-					return $viewPath;
-				}
-			}
-		}
-        return getcwd()."/resources/views/fortune.php";
-		throw new InvalidArgumentException("View [$name] not found.");
-	}
-
-	/**
-	 * Get an array of possible view files.
-	 *
-	 * @param  string  $name
-	 * @return array
-	 */
-	protected function getPossibleViewFiles($name)
-	{
-		return array_map(function($extension) use ($name)
-		{
-			return str_replace('.', '/', $name).'.'.$extension;
-
-		}, $this->extensions);
-	}
-
-	/**
-	 * Add a location to the finder.
-	 *
-	 * @param  string  $location
-	 * @return void
-	 */
-	public function addLocation($location)
-	{
-		$this->paths[] = $location;
-	}
-
-	/**
-	 * Add a namespace hint to the finder.
-	 *
-	 * @param  string  $namespace
-	 * @param  string|array  $hints
-	 * @return void
-	 */
-	public function addNamespace($namespace, $hints)
-	{
-		$hints = (array) $hints;
-
-		if (isset($this->hints[$namespace]))
-		{
-			$hints = array_merge($this->hints[$namespace], $hints);
-		}
-
-		$this->hints[$namespace] = $hints;
-	}
-
-	/**
-	 * Prepend a namespace hint to the finder.
-	 *
-	 * @param  string  $namespace
-	 * @param  string|array  $hints
-	 * @return void
-	 */
-	public function prependNamespace($namespace, $hints)
-	{
-		$hints = (array) $hints;
-
-		if (isset($this->hints[$namespace]))
-		{
-			$hints = array_merge($hints, $this->hints[$namespace]);
-		}
-
-		$this->hints[$namespace] = $hints;
-	}
-
-	/**
-	 * Register an extension with the view finder.
-	 *
-	 * @param  string  $extension
-	 * @return void
-	 */
-	public function addExtension($extension)
-	{
-		if (($index = array_search($extension, $this->extensions)) !== false)
-		{
-			unset($this->extensions[$index]);
-		}
-
-		array_unshift($this->extensions, $extension);
-	}
-
-	/**
-	 * Returns whether or not the view specify a hint information.
-	 *
-	 * @param  string  $name
-	 * @return bool
-	 */
-	public function hasHintInformation($name)
-	{
-		return strpos($name, static::HINT_PATH_DELIMITER) > 0;
-	}
-
-	/**
-	 * Get the filesystem instance.
-	 *
-	 * @return \Illuminate\Filesystem\Filesystem
-	 */
-	public function getFilesystem()
-	{
-		return $this->files;
-	}
-
-	/**
-	 * Get the active view paths.
-	 *
-	 * @return array
-	 */
-	public function getPaths()
-	{
-		return $this->paths;
-	}
-
-	/**
-	 * Get the namespace to file path hints.
-	 *
-	 * @return array
-	 */
-	public function getHints()
-	{
-		return $this->hints;
-	}
-
-	/**
-	 * Get registered extensions.
-	 *
-	 * @return array
-	 */
-	public function getExtensions()
-	{
-		return $this->extensions;
-	}
-
-}

+ 27 - 0
frameworks/PHP/lumen/phpunit.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit backupGlobals="false"
+         backupStaticAttributes="false"
+         bootstrap="bootstrap/app.php"
+         colors="true"
+         convertErrorsToExceptions="true"
+         convertNoticesToExceptions="true"
+         convertWarningsToExceptions="true"
+         processIsolation="false"
+         stopOnFailure="false"
+         syntaxCheck="false">
+    <testsuites>
+        <testsuite name="Application Test Suite">
+            <directory suffix="Test.php">./tests</directory>
+        </testsuite>
+    </testsuites>
+    <filter>
+        <whitelist processUncoveredFilesFromWhitelist="true">
+            <directory suffix=".php">./app</directory>
+        </whitelist>
+    </filter>
+    <php>
+        <env name="APP_ENV" value="testing"/>
+        <env name="CACHE_DRIVER" value="array"/>
+        <env name="QUEUE_DRIVER" value="sync"/>
+    </php>
+</phpunit>

+ 21 - 0
frameworks/PHP/lumen/public/.htaccess

@@ -0,0 +1,21 @@
+<IfModule mod_rewrite.c>
+    <IfModule mod_negotiation.c>
+        Options -MultiViews -Indexes
+    </IfModule>
+
+    RewriteEngine On
+
+    # Handle Authorization Header
+    RewriteCond %{HTTP:Authorization} .
+    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
+
+    # Redirect Trailing Slashes If Not A Folder...
+    RewriteCond %{REQUEST_FILENAME} !-d
+    RewriteCond %{REQUEST_URI} (.+)/$
+    RewriteRule ^ %1 [L,R=301]
+
+    # Handle Front Controller...
+    RewriteCond %{REQUEST_FILENAME} !-d
+    RewriteCond %{REQUEST_FILENAME} !-f
+    RewriteRule ^ index.php [L]
+</IfModule>

+ 23 - 1
frameworks/PHP/lumen/public/index.php

@@ -1,6 +1,28 @@
 <?php
 
+/*
+|--------------------------------------------------------------------------
+| Create The Application
+|--------------------------------------------------------------------------
+|
+| First we need to get an application instance. This creates an instance
+| of the application / container and bootstraps the application so it
+| is ready to receive HTTP / Console requests from the environment.
+|
+*/
+
 $app = require __DIR__.'/../bootstrap/app.php';
 
-$app->run();
+/*
+|--------------------------------------------------------------------------
+| Run The Application
+|--------------------------------------------------------------------------
+|
+| Once we have the application, we can handle the incoming request
+| through the kernel, and send the associated response back to
+| the client's browser allowing them to enjoy the creative
+| and wonderful application we have prepared for them.
+|
+*/
 
+$app->run();

+ 21 - 0
frameworks/PHP/lumen/readme.md

@@ -0,0 +1,21 @@
+# Lumen PHP Framework
+
+[![Build Status](https://travis-ci.org/laravel/lumen-framework.svg)](https://travis-ci.org/laravel/lumen-framework)
+[![Total Downloads](https://poser.pugx.org/laravel/lumen-framework/d/total.svg)](https://packagist.org/packages/laravel/lumen-framework)
+[![Latest Stable Version](https://poser.pugx.org/laravel/lumen-framework/v/stable.svg)](https://packagist.org/packages/laravel/lumen-framework)
+[![Latest Unstable Version](https://poser.pugx.org/laravel/lumen-framework/v/unstable.svg)](https://packagist.org/packages/laravel/lumen-framework)
+[![License](https://poser.pugx.org/laravel/lumen-framework/license.svg)](https://packagist.org/packages/laravel/lumen-framework)
+
+Laravel Lumen is a stunningly fast PHP micro-framework for building web applications with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Lumen attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as routing, database abstraction, queueing, and caching.
+
+## Official Documentation
+
+Documentation for the framework can be found on the [Lumen website](http://lumen.laravel.com/docs).
+
+## Security Vulnerabilities
+
+If you discover a security vulnerability within Lumen, please send an e-mail to Taylor Otwell at [email protected]. All security vulnerabilities will be promptly addressed.
+
+## License
+
+The Lumen framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

+ 0 - 0
frameworks/PHP/lumen/resources/views/.gitkeep


+ 0 - 19
frameworks/PHP/lumen/resources/views/fortune.php

@@ -1,19 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>Fortunes</title>
-</head>
-<body>
-<table>
-<tr>
-<th>id</th>
-<th>message</th>
-</tr>
-<?php
-foreach($fortunes as $f) {
-	echo ("<tr><td>" . $f["id"] . "</td><td>" . e($f["message"]) . "</td></tr>");
-}
-?>
-</table>
-</body>
-</html>

+ 13 - 0
frameworks/PHP/lumen/resources/views/fortunes.blade.php

@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head><title>Fortunes</title></head>
+<body>
+<table>
+	<tr><th>id</th><th>message</th></tr>
+
+	@foreach($rows as $row)
+		<tr><td>{{$row->id}}</td><td>{{$row->message}}</td></tr>
+	@endforeach
+</table>
+</body>
+</html>

+ 8 - 0
frameworks/PHP/lumen/routes/web.php

@@ -0,0 +1,8 @@
+<?php
+
+$router->get('/json', 'Controller@json');
+$router->get('/db', 'Controller@db');
+$router->get('/queries[/{queries}]', 'Controller@queries');
+$router->get('/fortunes', 'Controller@fortunes');
+$router->get('/updates[/{queries}]', 'Controller@updates');
+$router->get('/plaintext', 'Controller@plaintext');

+ 6 - 11
frameworks/PHP/lumen/setup.sh

@@ -1,16 +1,11 @@
 #!/bin/bash
 
-sed -i 's|localhost|'"${DBHOST}"'|g' .env
-sed -i 's|root .*/FrameworkBenchmarks/lumen|root '"${TROOT}"'|g' deploy/nginx.conf
-sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' deploy/nginx.conf
+fw_depends mysql php7 nginx composer
 
-fw_depends mysql php5 nginx composer
+sed -i 's|__DBHOST__|'${DBHOST}'|g' .env
 
-rm vendor/illuminate/view/FileViewFinder.php
-cp modifiedVendorFiles/FileViewFinder.php vendor/illuminate/view/
-rm vendor/laravel/lumen-framework/src/Application.php
-cp modifiedVendorFiles/Application.php vendor/laravel/lumen-framework/src/
-touch vendor/laravel/lumen-framework/storage/logs/lumen.log
+sed -i 's|__IROOT__|'${IROOT}'|g' deploy/nginx.conf
+sed -i 's|__TROOT__|'${TROOT}'|g' deploy/nginx.conf
 
-php-fpm --fpm-config $FWROOT/toolset/setup/linux/languages/php/php-fpm.conf -g $TROOT/deploy/php-fpm.pid
-nginx -c $TROOT/deploy/nginx.conf
+php-fpm --fpm-config ${FWROOT}/toolset/setup/linux/languages/php/php-fpm.conf -g ${TROOT}/deploy/php-fpm.pid
+nginx -c ${TROOT}/deploy/nginx.conf

+ 2 - 0
frameworks/PHP/lumen/storage/app/.gitignore

@@ -0,0 +1,2 @@
+*
+!.gitignore

+ 2 - 0
frameworks/PHP/lumen/storage/framework/cache/.gitignore

@@ -0,0 +1,2 @@
+*
+!.gitignore

+ 2 - 0
frameworks/PHP/lumen/storage/framework/views/.gitignore

@@ -0,0 +1,2 @@
+*
+!.gitignore

+ 2 - 0
frameworks/PHP/lumen/storage/logs/.gitignore

@@ -0,0 +1,2 @@
+*
+!.gitignore

+ 21 - 0
frameworks/PHP/lumen/tests/ExampleTest.php

@@ -0,0 +1,21 @@
+<?php
+
+use Laravel\Lumen\Testing\DatabaseMigrations;
+use Laravel\Lumen\Testing\DatabaseTransactions;
+
+class ExampleTest extends TestCase
+{
+    /**
+     * A basic test example.
+     *
+     * @return void
+     */
+    public function testExample()
+    {
+        $this->get('/');
+
+        $this->assertEquals(
+            $this->app->version(), $this->response->getContent()
+        );
+    }
+}

+ 14 - 0
frameworks/PHP/lumen/tests/TestCase.php

@@ -0,0 +1,14 @@
+<?php
+
+abstract class TestCase extends Laravel\Lumen\Testing\TestCase
+{
+    /**
+     * Creates the application.
+     *
+     * @return \Laravel\Lumen\Application
+     */
+    public function createApplication()
+    {
+        return require __DIR__.'/../bootstrap/app.php';
+    }
+}

Some files were not shown because too many files changed in this diff