Skip to content

Commit

Permalink
Add Laravel 11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
joanhey committed Mar 17, 2024
1 parent 61e7f40 commit e7037b6
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 0 deletions.
1 change: 1 addition & 0 deletions config
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ fatfree-3.8
fuelphp-1.9
kumbia-1.2
laravel-10.2
laravel-11.0
leaf-3.5
lumen-10.0
phroute-2.2
Expand Down
4 changes: 4 additions & 0 deletions laravel-11.0/_benchmark/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
rm -rf !("_benchmark")
find -path './.*' -delete
rm -rf _benchmark/temp
5 changes: 5 additions & 0 deletions laravel-11.0/_benchmark/clear-cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
# clear cache
php artisan cache:clear
php artisan optimize
echo -e "done"
2 changes: 2 additions & 0 deletions laravel-11.0/_benchmark/hello_world.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
url="$base/$fw/public/index.php/hello/index"
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
/*
PHP-Frameworks-Bench
this is a simple hello world controller to make benchmark
*/
namespace App\Http\Controllers;

class HelloWorldController extends Controller {
public function index(): void {
echo 'Hello World!';
}
}

?>
59 changes: 59 additions & 0 deletions laravel-11.0/_benchmark/laravel/public/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

use Illuminate\Contracts\Http\Kernel;
use Illuminate\Http\Request;

define('LARAVEL_START', microtime(true));

/*
|--------------------------------------------------------------------------
| Check If The Application Is Under Maintenance
|--------------------------------------------------------------------------
|
| If the application is in maintenance / demo mode via the "down" command
| we will load this file so that any pre-rendered content can be shown
| instead of starting the framework, which could cause an exception.
|
*/

if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
require $maintenance;
}

/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| this application. We just need to utilize it! We'll simply require it
| into the script here so we don't need to manually load our classes.
|
*/

require __DIR__.'/../vendor/autoload.php';

/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request using
| the application's HTTP kernel. Then, we will send the response back
| to this client's browser, allowing them to enjoy our application.
|
*/

$app = require_once __DIR__.'/../bootstrap/app.php';

$kernel = $app->make(Kernel::class);

$response = $kernel->handle(
$request = Request::capture()
)->send();

$kernel->terminate($request, $response);


/* *** PHP-Frameworks-Bench *** */
require $_SERVER['DOCUMENT_ROOT'].'/PHP-Frameworks-Bench/libs/output_data.php';
22 changes: 22 additions & 0 deletions laravel-11.0/_benchmark/laravel/routes/web.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
return view('welcome');
});


/* *** PHP-Frameworks-Bench *** */
Route::get('/hello/index', [App\Http\Controllers\HelloWorldController::class, 'index']);
14 changes: 14 additions & 0 deletions laravel-11.0/_benchmark/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
# create project
rm -rf _benchmark/temp
composer create-project --prefer-dist laravel/laravel:11.0.* ./_benchmark/temp --ansi
mv ./_benchmark/temp/{.,}* ./

# have the route & controller
yes|cp -rf _benchmark/laravel/. ./

# some enhancements
composer install --optimize-autoloader --no-dev --ansi
chmod -R o+w storage

rm ./public/.htaccess
11 changes: 11 additions & 0 deletions laravel-11.0/_benchmark/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
composer update

# have the route & controller
yes|cp -rf _benchmark/laravel/. ./

# some enhancements
composer install --optimize-autoloader --no-dev
chmod -R o+w storage

rm ./public/.htaccess

0 comments on commit e7037b6

Please sign in to comment.