Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ Note: This project is based on
* [Laravel](https://github.com/laravel/laravel)
* [Leaf](https://github.com/leafsphp/leaf)
* [Lumen](https://github.com/laravel/lumen)
* [Nette](https://github.com/nette/web-project)
* [PhRoute](https://github.com/mrjgreen/phroute)
* [Silex](https://github.com/silexphp/Silex)
* [Slim](https://github.com/slimphp/Slim)
Expand Down
1 change: 1 addition & 0 deletions config
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ laravel-10.3
laravel-11.0
leaf-3.11
lumen-10.0
nette-3.3
phroute-2.2
pure-php
silex-2.3
Expand Down
4 changes: 4 additions & 0 deletions nette-3.3/_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
3 changes: 3 additions & 0 deletions nette-3.3/_benchmark/clear-cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
# clear cache
echo -e "done"
2 changes: 2 additions & 0 deletions nette-3.3/_benchmark/hello_world.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
url="$base/$fw/www/index.php/hello/index"
50 changes: 50 additions & 0 deletions nette-3.3/_benchmark/nette/app/Bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

declare(strict_types=1);

namespace app;

use Nette;
use Nette\Bootstrap\Configurator;


class Bootstrap
{
private Configurator $configurator;
private string $rootDir;


public function __construct()
{
$this->rootDir = dirname(__DIR__);
$this->configurator = new Configurator;
$this->configurator->setTempDirectory($this->rootDir . '/temp');
}


public function bootWebApplication(): Nette\DI\Container
{
$this->initializeEnvironment();
$this->setupContainer();
return $this->configurator->createContainer();
}


public function initializeEnvironment(): void
{
//$this->configurator->setDebugMode('secret@23.75.345.200'); // enable for your remote IP
$this->configurator->enableTracy($this->rootDir . '/log');

$this->configurator->createRobotLoader()
->addDirectory(__DIR__)
->register();
}


private function setupContainer(): void
{
$configDir = $this->rootDir . '/config';
$this->configurator->addConfig($configDir . '/common.neon');
$this->configurator->addConfig($configDir . '/services.neon');
}
}
29 changes: 29 additions & 0 deletions nette-3.3/_benchmark/nette/app/Core/RouterFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

namespace app\Core;

use Nette;
use Nette\Application\Routers\RouteList;

/*
PHP-Frameworks-Bench
this is a simple hello world controller to make benchmark
*/
final class RouterFactory
{
use Nette\StaticClass;

public static function createRouter(): RouteList
{
$router = new RouteList;
$router
->withPath('index.php')
->addRoute('hello/index', function () {
echo 'Hello World!';
});

return $router;
}
}
33 changes: 33 additions & 0 deletions nette-3.3/_benchmark/nette/config/common.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# see https://doc.nette.org/en/configuring

parameters:


application:
mapping: App\Presentation\*\**Presenter


database:
dsn: 'sqlite::memory:'
user:
password:


latte:
strictTypes: yes
strictParsing: yes
extensions:
- App\Presentation\Accessory\LatteExtension


assets:
mapping:
default:
path: assets
# type: vite # Uncomment to activate Vite for asset building


di:
export:
parameters: no
tags: no
11 changes: 11 additions & 0 deletions nette-3.3/_benchmark/nette/config/services.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
- App\Core\RouterFactory::createRouter


search:
- in: %appDir%
classes:
- *Facade
- *Factory
- *Repository
- *Service
13 changes: 13 additions & 0 deletions nette-3.3/_benchmark/nette/www/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

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

$bootstrap = new app\Bootstrap;
$container = $bootstrap->bootWebApplication();
$application = $container->getByType(Nette\Application\Application::class);
$application->run();

/* *** PHP-Frameworks-Bench *** */
require $_SERVER['DOCUMENT_ROOT'].'/PHP-Frameworks-Bench/libs/output_data.php';
12 changes: 12 additions & 0 deletions nette-3.3/_benchmark/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
# create project
rm -rf _benchmark/temp
composer create-project nette/web-project:3.3.* ./_benchmark/temp --ansi
mv ./_benchmark/temp/* ./

# override the route & controller
yes|cp -r _benchmark/nette/* ./

# some enhancement
composer install --no-dev --optimize-autoloader --ansi
chmod -R o+w log temp
9 changes: 9 additions & 0 deletions nette-3.3/_benchmark/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
composer update

# override the route & controller
yes|cp -r _benchmark/nette/* ./

# some enhancements
composer install --no-dev --optimize-autoloader
chmod -R o+w log temp
Loading