-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from myaaghubi/v2.4.1
V2.4.1
- Loading branch information
Showing
42 changed files
with
395 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM php:8.2-apache | ||
FROM php:8.3-apache | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y libicu-dev | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
#!/bin/sh | ||
# create project | ||
rm -rf _benchmark/temp | ||
composer create-project --prefer-dist cakephp/app:4.5.* ./_benchmark/temp | ||
composer create-project --prefer-dist cakephp/app:4.5.* ./_benchmark/temp --ansi | ||
yes|mv ./_benchmark/temp/{.,}* ./ | ||
|
||
# have the route & controller | ||
yes|cp -r _benchmark/cakephp/* ./ | ||
|
||
# some enhancements | ||
composer dump-autoload -o | ||
composer install --no-interaction --no-dev -o | ||
composer install --no-interaction --no-dev -o --ansi | ||
rm ./webroot/.htaccess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<?php | ||
/* | ||
* Local configuration file to provide any overrides to your app.php configuration. | ||
* Copy and save this file as app_local.php and make changes as required. | ||
* Note: It is not recommended to commit files with credentials such as app_local.php | ||
* into source code version control. | ||
*/ | ||
return [ | ||
/* | ||
* Debug Level: | ||
* | ||
* Production Mode: | ||
* false: No error messages, errors, or warnings shown. | ||
* | ||
* Development Mode: | ||
* true: Errors and warnings shown. | ||
*/ | ||
/* *** PHP-Frameworks-Bench *** */ | ||
'debug' => false, | ||
|
||
/* | ||
* Security and encryption configuration | ||
* | ||
* - salt - A random string used in security hashing methods. | ||
* The salt value is also used as the encryption key. | ||
* You should treat it as extremely sensitive data. | ||
*/ | ||
'Security' => [ | ||
'salt' => env('SECURITY_SALT', '__SALT__'), | ||
], | ||
|
||
/* | ||
* Connection information used by the ORM to connect | ||
* to your application's datastores. | ||
* | ||
* See app.php for more configuration options. | ||
*/ | ||
'Datasources' => [ | ||
'default' => [ | ||
'host' => 'localhost', | ||
/* | ||
* CakePHP will use the default DB port based on the driver selected | ||
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment | ||
* the following line and set the port accordingly | ||
*/ | ||
//'port' => 'non_standard_port_number', | ||
|
||
'username' => 'my_app', | ||
'password' => 'secret', | ||
|
||
'database' => 'my_app', | ||
/* | ||
* If not using the default 'public' schema with the PostgreSQL driver | ||
* set it here. | ||
*/ | ||
//'schema' => 'myapp', | ||
|
||
/* | ||
* You can use a DSN string to set the entire configuration | ||
*/ | ||
'url' => env('DATABASE_URL', null), | ||
], | ||
|
||
/* | ||
* The test connection is used during the test suite. | ||
*/ | ||
'test' => [ | ||
'host' => 'localhost', | ||
//'port' => 'non_standard_port_number', | ||
'username' => 'my_app', | ||
'password' => 'secret', | ||
'database' => 'test_myapp', | ||
//'schema' => 'myapp', | ||
'url' => env('DATABASE_TEST_URL', 'sqlite://127.0.0.1/tests.sqlite'), | ||
], | ||
], | ||
|
||
/* | ||
* Email configuration. | ||
* | ||
* Host and credential configuration in case you are using SmtpTransport | ||
* | ||
* See app.php for more configuration options. | ||
*/ | ||
'EmailTransport' => [ | ||
'default' => [ | ||
'host' => 'localhost', | ||
'port' => 25, | ||
'username' => null, | ||
'password' => null, | ||
'client' => null, | ||
'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null), | ||
], | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?php | ||
/** | ||
* Routes configuration. | ||
* | ||
* In this file, you set up routes to your controllers and their actions. | ||
* Routes are very important mechanism that allows you to freely connect | ||
* different URLs to chosen controllers and their actions (functions). | ||
* | ||
* It's loaded within the context of `Application::routes()` method which | ||
* receives a `RouteBuilder` instance `$routes` as method argument. | ||
* | ||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org) | ||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* For full copyright and license information, please see the LICENSE.txt | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) | ||
* @link https://cakephp.org CakePHP(tm) Project | ||
* @license https://opensource.org/licenses/mit-license.php MIT License | ||
*/ | ||
|
||
use Cake\Routing\Route\DashedRoute; | ||
use Cake\Routing\RouteBuilder; | ||
|
||
return function (RouteBuilder $routes): void { | ||
/* | ||
* The default class to use for all routes | ||
* | ||
* The following route classes are supplied with CakePHP and are appropriate | ||
* to set as the default: | ||
* | ||
* - Route | ||
* - InflectedRoute | ||
* - DashedRoute | ||
* | ||
* If no call is made to `Router::defaultRouteClass()`, the class used is | ||
* `Route` (`Cake\Routing\Route\Route`) | ||
* | ||
* Note that `Route` does not do any inflections on URLs which will result in | ||
* inconsistently cased URLs when used with `:plugin`, `:controller` and | ||
* `:action` markers. | ||
*/ | ||
$routes->setRouteClass(DashedRoute::class); | ||
|
||
/* *** PHP-Frameworks-Bench *** */ | ||
$routes->connect('/hello/index', ['controller' => 'HelloWorld', 'action' => 'display', 'home']); | ||
|
||
$routes->scope('/', function (RouteBuilder $builder) { | ||
/* | ||
* Here, we are connecting '/' (base path) to a controller called 'Pages', | ||
* its action called 'display', and we pass a param to select the view file | ||
* to use (in this case, templates/Pages/home.php)... | ||
*/ | ||
$builder->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']); | ||
|
||
/* | ||
* ...and connect the rest of 'Pages' controller's URLs. | ||
*/ | ||
$builder->connect('/pages/*', 'Pages::display'); | ||
|
||
/* | ||
* Connect catchall routes for all controllers. | ||
* | ||
* The `fallbacks` method is a shortcut for | ||
* | ||
* ``` | ||
* $builder->connect('/:controller', ['action' => 'index']); | ||
* $builder->connect('/:controller/:action/*', []); | ||
* ``` | ||
* | ||
* You can remove these routes once you've connected the | ||
* routes you want in your application. | ||
*/ | ||
$builder->fallbacks(); | ||
}); | ||
|
||
/* | ||
* If you need a different set of middleware or none at all, | ||
* open new scope and define routes there. | ||
* | ||
* ``` | ||
* $routes->scope('/api', function (RouteBuilder $builder) { | ||
* // No $builder->applyMiddleware() here. | ||
* | ||
* // Parse specified extensions from URLs | ||
* // $builder->setExtensions(['json', 'xml']); | ||
* | ||
* // Connect API actions here. | ||
* }); | ||
* ``` | ||
*/ | ||
}; |
17 changes: 17 additions & 0 deletions
17
cakephp-5.0/_benchmark/cakephp/src/Controller/HelloWorldController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php declare(strict_types=1); | ||
|
||
/* | ||
PHP-Frameworks-Bench | ||
this is a simple hello world controller to make benchmark | ||
*/ | ||
|
||
namespace App\Controller; | ||
|
||
// such simple controller | ||
class HelloWorldController extends AppController { | ||
|
||
public function display() | ||
{ | ||
return $this->response->withStringBody('Hello World!'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
/** | ||
* The Front Controller for handling every request | ||
* | ||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org) | ||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* For full copyright and license information, please see the LICENSE.txt | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) | ||
* @link https://cakephp.org CakePHP(tm) Project | ||
* @since 0.2.9 | ||
* @license MIT License (https://opensource.org/licenses/mit-license.php) | ||
*/ | ||
|
||
// For built-in server | ||
if (PHP_SAPI === 'cli-server') { | ||
$_SERVER['PHP_SELF'] = '/' . basename(__FILE__); | ||
|
||
$url = parse_url(urldecode($_SERVER['REQUEST_URI'])); | ||
$file = __DIR__ . $url['path']; | ||
if (strpos($url['path'], '..') === false && strpos($url['path'], '.') !== false && is_file($file)) { | ||
return false; | ||
} | ||
} | ||
require dirname(__DIR__) . '/vendor/autoload.php'; | ||
|
||
use App\Application; | ||
use Cake\Http\Server; | ||
|
||
// Bind your application to the server. | ||
$server = new Server(new Application(dirname(__DIR__) . '/config')); | ||
|
||
// Run the request/response through the application and emit the response. | ||
$server->emit($server->run()); | ||
|
||
/* *** PHP-Frameworks-Bench *** */ | ||
require $_SERVER['DOCUMENT_ROOT'].'/PHP-Frameworks-Bench/libs/output_data.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
# clear cache | ||
bin/cake cache clear_all | ||
echo -e "done" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
url="$base/$fw/webroot/index.php/hello/index" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
# create project | ||
rm -rf _benchmark/temp | ||
composer create-project --prefer-dist cakephp/app:5.0.* ./_benchmark/temp --ansi | ||
yes|mv ./_benchmark/temp/{.,}* ./ | ||
|
||
# have the route & controller | ||
yes|cp -r _benchmark/cakephp/* ./ | ||
|
||
# some enhancements | ||
composer dump-autoload -o | ||
composer install --no-interaction --no-dev -o --ansi | ||
rm ./webroot/.htaccess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
composer update | ||
|
||
# have the route & controller | ||
yes|cp -r _benchmark/cakephp/* ./ | ||
|
||
# some enhancements | ||
composer dump-autoload -o | ||
composer install --no-interaction --no-dev -o | ||
rm ./webroot/.htaccess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.