diff --git a/chubbyphp-framework-1.1/.gitignore b/chubbyphp-framework-1.1/.gitignore new file mode 100644 index 000000000..48b8bf907 --- /dev/null +++ b/chubbyphp-framework-1.1/.gitignore @@ -0,0 +1 @@ +vendor/ diff --git a/chubbyphp-framework-1.1/_benchmark/hello_world.sh b/chubbyphp-framework-1.1/_benchmark/hello_world.sh new file mode 100644 index 000000000..f0f049590 --- /dev/null +++ b/chubbyphp-framework-1.1/_benchmark/hello_world.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +url="$base/$fw/index.php/hello/index" diff --git a/chubbyphp-framework-1.1/_benchmark/setup.sh b/chubbyphp-framework-1.1/_benchmark/setup.sh new file mode 100644 index 000000000..51020a34f --- /dev/null +++ b/chubbyphp-framework-1.1/_benchmark/setup.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +composer install --no-dev --optimize-autoloader diff --git a/chubbyphp-framework-1.1/composer.json b/chubbyphp-framework-1.1/composer.json new file mode 100644 index 000000000..7c55b6501 --- /dev/null +++ b/chubbyphp-framework-1.1/composer.json @@ -0,0 +1,7 @@ +{ + "require": { + "chubbyphp/chubbyphp-framework": "1.1.*", + "nikic/fast-route": "1.3.*", + "slim/psr7": "0.4.*" + } +} diff --git a/chubbyphp-framework-1.1/composer.lock b/chubbyphp-framework-1.1/composer.lock new file mode 100644 index 000000000..113f9e79b --- /dev/null +++ b/chubbyphp-framework-1.1/composer.lock @@ -0,0 +1,602 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "70703310e586a28204b568bf9424783f", + "packages": [ + { + "name": "chubbyphp/chubbyphp-framework", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/chubbyphp/chubbyphp-framework.git", + "reference": "681959db86abfd861d9b7a91618e686e93c3b935" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/chubbyphp/chubbyphp-framework/zipball/681959db86abfd861d9b7a91618e686e93c3b935", + "reference": "681959db86abfd861d9b7a91618e686e93c3b935", + "shasum": "" + }, + "require": { + "php": "^7.2", + "psr/container": "^1.0", + "psr/http-factory": "^1.0.1", + "psr/http-message": "^1.0.1", + "psr/http-message-implementation": "^1.0", + "psr/http-server-middleware": "^1.0.1", + "psr/log": "^1.1" + }, + "require-dev": { + "aura/router": "^3.1", + "chubbyphp/chubbyphp-mock": "^1.4", + "friendsofphp/php-cs-fixer": "^2.15.1", + "infection/infection": "^0.12.2", + "nikic/fast-route": "^1.3", + "nunomaduro/phpinsights": "^1.7", + "phploc/phploc": "^5.0", + "phpstan/phpstan": "^0.11.12", + "phpunit/phpunit": "^8.2.4", + "zendframework/zend-diactoros": "^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Chubbyphp\\Framework\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dominik Zogg", + "email": "dominik.zogg@gmail.com" + } + ], + "description": "A minimal Framework using PSR 3, PSR 7, PSR 11, PSR 15 and PSR 17.", + "keywords": [ + "PSR-11", + "chubbyphp", + "framework", + "microframework", + "middleware", + "psr-15", + "psr-17", + "psr-3", + "psr-7", + "requesthandler" + ], + "time": "2019-07-24T19:40:35+00:00" + }, + { + "name": "fig/http-message-util", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message-util.git", + "reference": "35b19404371b31b3a43823c755398c48c9966db4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message-util/zipball/35b19404371b31b3a43823c755398c48c9966db4", + "reference": "35b19404371b31b3a43823c755398c48c9966db4", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Fig\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Utility classes and constants for use with PSR-7 (psr/http-message)", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2018-11-19T16:19:58+00:00" + }, + { + "name": "nikic/fast-route", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/FastRoute.git", + "reference": "181d480e08d9476e61381e04a71b34dc0432e812" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/FastRoute/zipball/181d480e08d9476e61381e04a71b34dc0432e812", + "reference": "181d480e08d9476e61381e04a71b34dc0432e812", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35|~5.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "FastRoute\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov", + "email": "nikic@php.net" + } + ], + "description": "Fast request router for PHP", + "keywords": [ + "router", + "routing" + ], + "time": "2018-02-13T20:26:39+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "time": "2019-04-30T12:38:16+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/http-server-handler", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-server-handler.git", + "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/aff2f80e33b7f026ec96bb42f63242dc50ffcae7", + "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Server\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP server-side request handler", + "keywords": [ + "handler", + "http", + "http-interop", + "psr", + "psr-15", + "psr-7", + "request", + "response", + "server" + ], + "time": "2018-10-30T16:46:14+00:00" + }, + { + "name": "psr/http-server-middleware", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-server-middleware.git", + "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/2296f45510945530b9dceb8bcedb5cb84d40c5f5", + "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "psr/http-message": "^1.0", + "psr/http-server-handler": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Server\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP server-side middleware", + "keywords": [ + "http", + "http-interop", + "middleware", + "psr", + "psr-15", + "psr-7", + "request", + "response" + ], + "time": "2018-10-30T17:12:04+00:00" + }, + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2016-02-11T07:05:27+00:00" + }, + { + "name": "slim/psr7", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/slimphp/Slim-Psr7.git", + "reference": "d312896b7cd4aca7d4b86b64acdfcb5cc3da758f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/slimphp/Slim-Psr7/zipball/d312896b7cd4aca7d4b86b64acdfcb5cc3da758f", + "reference": "d312896b7cd4aca7d4b86b64acdfcb5cc3da758f", + "shasum": "" + }, + "require": { + "fig/http-message-util": "^1.1", + "php": "^7.1", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^2" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-json": "*", + "http-interop/http-factory-tests": "^0.5.0", + "php-http/psr7-integration-tests": "dev-master", + "phpstan/phpstan": "^0.10", + "phpunit/phpunit": "^6.0|^7.0", + "squizlabs/php_codesniffer": "^3.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Slim\\Psr7\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Josh Lockhart", + "email": "hello@joshlockhart.com", + "homepage": "http://joshlockhart.com" + }, + { + "name": "Andrew Smith", + "email": "a.smith@silentworks.co.uk", + "homepage": "http://silentworks.co.uk" + }, + { + "name": "Rob Allen", + "email": "rob@akrabat.com", + "homepage": "http://akrabat.com" + }, + { + "name": "Pierre Berube", + "email": "pierre@lgse.com", + "homepage": "http://www.lgse.com" + } + ], + "description": "Strict PSR-7 implementation", + "homepage": "https://www.slimframework.com", + "keywords": [ + "http", + "psr-7", + "psr7" + ], + "time": "2019-08-02T17:06:08+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/chubbyphp-framework-1.1/index.php b/chubbyphp-framework-1.1/index.php new file mode 100644 index 000000000..bac9d667c --- /dev/null +++ b/chubbyphp-framework-1.1/index.php @@ -0,0 +1,38 @@ +<?php + +use Chubbyphp\Framework\Application; +use Chubbyphp\Framework\ErrorHandler; +use Chubbyphp\Framework\ExceptionHandler; +use Chubbyphp\Framework\Middleware\MiddlewareDispatcher; +use Chubbyphp\Framework\RequestHandler\CallbackRequestHandler; +use Chubbyphp\Framework\Router\FastRouteRouter; +use Chubbyphp\Framework\Router\Route; +use Slim\Psr7\Factory\ResponseFactory; +use Slim\Psr7\Factory\ServerRequestFactory; + +$_SERVER['REQUEST_URI'] = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['REQUEST_URI']); + +require 'vendor/autoload.php'; + +set_error_handler([ErrorHandler::class, 'handle']); + +$responseFactory = new ResponseFactory(); + +$route = Route::get('/hello/index', 'hello', new CallbackRequestHandler( + function () use ($responseFactory) { + $response = $responseFactory->createResponse(); + $response->getBody()->write('Hello World!'); + + return $response; + } +)); + +$app = new Application( + new FastRouteRouter([$route]), + new MiddlewareDispatcher(), + new ExceptionHandler($responseFactory, true) +); + +$app->send($app->handle(ServerRequestFactory::createFromGlobals())); + +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';