Browse Source

[Laravel][Lumen] Update to v8 (#6098)

* Update composer.json

* update require-dev

* Update laravel.dockerfile

* Update Handler.php

* Update cache.php

* remove tinker and fideloper

* update composer for Swoole

* update Lumen composer

* Update app.php

* Update Handler.php

* Update Handler.php

* update app.php

* add artisan optimize

* update composer

* Update app.php

* Update nginx.conf

* rename socket

* update lumen config files

* Update app.php

* add lumen opcache preloader

* Update lumen.dockerfile

* remove lumen preloading (non official repo)

* update lumen-swoole

* Update lumen-swoole.dockerfile

* clean dockerfiles

* Update laravel.dockerfile

* Update laravel.dockerfile
J-C HERON 4 years ago
parent
commit
c2ecb8b84a

+ 3 - 19
frameworks/PHP/laravel/app/Exceptions/Handler.php

@@ -2,7 +2,6 @@
 
 
 namespace App\Exceptions;
 namespace App\Exceptions;
 
 
-use Exception;
 use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
 use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
 
 
 class Handler extends ExceptionHandler
 class Handler extends ExceptionHandler
@@ -27,27 +26,12 @@ class Handler extends ExceptionHandler
     ];
     ];
 
 
     /**
     /**
-     * Report or log an exception.
+     * Register the exception handling callbacks for the application.
      *
      *
-     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
-     *
-     * @param  \Exception  $exception
      * @return void
      * @return void
      */
      */
-    public function report(Exception $exception)
-    {
-        parent::report($exception);
-    }
-
-    /**
-     * Render an exception into an HTTP response.
-     *
-     * @param  \Illuminate\Http\Request  $request
-     * @param  \Exception  $exception
-     * @return \Illuminate\Http\Response
-     */
-    public function render($request, Exception $exception)
+    public function register()
     {
     {
-        return parent::render($request, $exception);
+        //
     }
     }
 }
 }

+ 8 - 15
frameworks/PHP/laravel/composer.json

@@ -8,18 +8,15 @@
     ],
     ],
     "license": "MIT",
     "license": "MIT",
     "require": {
     "require": {
-        "php": "^7.1.3",
-        "fideloper/proxy": "^4.0",
-        "laravel/framework": "5.8.*",
-        "laravel/tinker": "^1.0"
+        "php": "^7.3",
+        "laravel/framework": "^8.0"
     },
     },
     "require-dev": {
     "require-dev": {
-        "beyondcode/laravel-dump-server": "^1.0",
-        "filp/whoops": "^2.0",
-        "fzaninotto/faker": "^1.4",
-        "mockery/mockery": "^1.0",
-        "nunomaduro/collision": "^2.0",
-        "phpunit/phpunit": "^7.5"
+        "facade/ignition": "^2.3.6",
+        "fzaninotto/faker": "^1.9.1",
+        "mockery/mockery": "^1.3.1",
+        "nunomaduro/collision": "^5.0",
+        "phpunit/phpunit": "^9.3"
     },
     },
     "config": {
     "config": {
         "optimize-autoloader": true,
         "optimize-autoloader": true,
@@ -34,11 +31,7 @@
     "autoload": {
     "autoload": {
         "psr-4": {
         "psr-4": {
             "App\\": "app/"
             "App\\": "app/"
-        },
-        "classmap": [
-            "database/seeds",
-            "database/factories"
-        ]
+        }
     },
     },
     "autoload-dev": {
     "autoload-dev": {
         "psr-4": {
         "psr-4": {

+ 17 - 7
frameworks/PHP/laravel/config/cache.php

@@ -1,5 +1,7 @@
 <?php
 <?php
 
 
+use Illuminate\Support\Str;
+
 return [
 return [
 
 
     /*
     /*
@@ -11,7 +13,8 @@ return [
     | using this caching library. This connection is used when another is
     | using this caching library. This connection is used when another is
     | not explicitly specified when executing a given caching function.
     | not explicitly specified when executing a given caching function.
     |
     |
-    | Supported: "apc", "array", "database", "file", "memcached", "redis"
+    | Supported: "apc", "array", "database", "file",
+    |            "memcached", "redis", "dynamodb"
     |
     |
     */
     */
 
 
@@ -36,6 +39,7 @@ return [
 
 
         'array' => [
         'array' => [
             'driver' => 'array',
             'driver' => 'array',
+            'serialize' => false,
         ],
         ],
 
 
         'database' => [
         'database' => [
@@ -57,7 +61,7 @@ return [
                 env('MEMCACHED_PASSWORD'),
                 env('MEMCACHED_PASSWORD'),
             ],
             ],
             'options' => [
             'options' => [
-                // Memcached::OPT_CONNECT_TIMEOUT  => 2000,
+                // Memcached::OPT_CONNECT_TIMEOUT => 2000,
             ],
             ],
             'servers' => [
             'servers' => [
                 [
                 [
@@ -70,7 +74,16 @@ return [
 
 
         'redis' => [
         'redis' => [
             'driver' => 'redis',
             'driver' => 'redis',
-            'connection' => 'default',
+            'connection' => 'cache',
+        ],
+
+        'dynamodb' => [
+            'driver' => 'dynamodb',
+            'key' => env('AWS_ACCESS_KEY_ID'),
+            'secret' => env('AWS_SECRET_ACCESS_KEY'),
+            'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
+            'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
+            'endpoint' => env('DYNAMODB_ENDPOINT'),
         ],
         ],
 
 
     ],
     ],
@@ -86,9 +99,6 @@ return [
     |
     |
     */
     */
 
 
-    'prefix' => env(
-        'CACHE_PREFIX',
-        str_slug(env('APP_NAME', 'laravel'), '_').'_cache'
-    ),
+    'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
 
 
 ];
 ];

+ 1 - 1
frameworks/PHP/laravel/deploy/conf/php-fpm.conf

@@ -161,7 +161,7 @@ group = www-data
 ;                            (IPv6 and IPv4-mapped) on a specific port;
 ;                            (IPv6 and IPv4-mapped) on a specific port;
 ;   '/path/to/unix/socket' - to listen on a unix socket.
 ;   '/path/to/unix/socket' - to listen on a unix socket.
 ; Note: This value is mandatory.
 ; Note: This value is mandatory.
-listen = /run/php/php7.3-fpm.sock
+listen = /run/php/php-fpm.sock
 
 
 ; Set listen(2) backlog.
 ; Set listen(2) backlog.
 ; Default Value: 511 (-1 on FreeBSD and OpenBSD)
 ; Default Value: 511 (-1 on FreeBSD and OpenBSD)

+ 1 - 1
frameworks/PHP/laravel/deploy/nginx.conf

@@ -41,7 +41,7 @@ http {
 
 
 
 
     upstream fastcgi_backend {
     upstream fastcgi_backend {
-        server unix:/var/run/php/php7.3-fpm.sock;
+        server unix:/var/run/php/php-fpm.sock;
         keepalive 40;
         keepalive 40;
     }
     }
 
 

+ 8 - 15
frameworks/PHP/laravel/deploy/swoole/composer.json

@@ -8,19 +8,16 @@
     ],
     ],
     "license": "MIT",
     "license": "MIT",
     "require": {
     "require": {
-        "php": "^7.1.3",
-        "fideloper/proxy": "^4.0",
-        "laravel/framework": "5.8.*",
-        "laravel/tinker": "^1.0",
+        "php": "^7.3",
+        "laravel/framework": "^8.0",
         "swooletw/laravel-swoole": "^v2.6"
         "swooletw/laravel-swoole": "^v2.6"
     },
     },
     "require-dev": {
     "require-dev": {
-        "beyondcode/laravel-dump-server": "^1.0",
-        "filp/whoops": "^2.0",
-        "fzaninotto/faker": "^1.4",
-        "mockery/mockery": "^1.0",
-        "nunomaduro/collision": "^2.0",
-        "phpunit/phpunit": "^7.5"
+        "facade/ignition": "^2.3.6",
+        "fzaninotto/faker": "^1.9.1",
+        "mockery/mockery": "^1.3.1",
+        "nunomaduro/collision": "^5.0",
+        "phpunit/phpunit": "^9.3"
     },
     },
     "config": {
     "config": {
         "optimize-autoloader": true,
         "optimize-autoloader": true,
@@ -35,11 +32,7 @@
     "autoload": {
     "autoload": {
         "psr-4": {
         "psr-4": {
             "App\\": "app/"
             "App\\": "app/"
-        },
-        "classmap": [
-            "database/seeds",
-            "database/factories"
-        ]
+        }
     },
     },
     "autoload-dev": {
     "autoload-dev": {
         "psr-4": {
         "psr-4": {

+ 18 - 21
frameworks/PHP/lumen/app/Console/Kernel.php

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

+ 35 - 39
frameworks/PHP/lumen/app/Exceptions/Handler.php

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

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

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

+ 74 - 74
frameworks/PHP/lumen/bootstrap/app.php

@@ -1,107 +1,107 @@
 <?php
 <?php
+require_once __DIR__ . '/../vendor/autoload.php';
 
 
-require_once __DIR__.'/../vendor/autoload.php';
+(new Laravel\Lumen\Bootstrap\LoadEnvironmentVariables(dirname(__DIR__)))->bootstrap();
 
 
-try {
-    Dotenv\Dotenv::create(__DIR__.'/../')->load();
-} catch (Dotenv\Exception\InvalidPathException $e) {
-    //
-}
+date_default_timezone_set(env('APP_TIMEZONE', 'UTC'));
 
 
 /*
 /*
-|--------------------------------------------------------------------------
-| 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__.'/../')
-);
+ * |--------------------------------------------------------------------------
+ * | 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(dirname(__DIR__));
 
 
 // $app->withFacades();
 // $app->withFacades();
 
 
 $app->withEloquent();
 $app->withEloquent();
 
 
 /*
 /*
-|--------------------------------------------------------------------------
-| 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.
-|
-*/
-
-$app->singleton(
-    Illuminate\Contracts\Debug\ExceptionHandler::class,
-    App\Exceptions\Handler::class
-);
-
-$app->singleton(
-    Illuminate\Contracts\Console\Kernel::class,
-    App\Console\Kernel::class
-);
+ * |--------------------------------------------------------------------------
+ * | 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.
+ * |
+ */
+
+$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.
-|
-*/
+ * |--------------------------------------------------------------------------
+ * | Register Config Files
+ * |--------------------------------------------------------------------------
+ * |
+ * | Now we will register the "app" configuration file. If the file exists in
+ * | your configuration directory it will be loaded; otherwise, we'll load
+ * | the default version. You may register other files below as needed.
+ * |
+ */
+
+if (env('APP_SWOOLE', false)) {
+	$app->register(\SwooleTW\Http\LumenServiceProvider::class);
+	$app->configure('swoole_http');
+}
+$app->configure('database');
+/*
+ * |--------------------------------------------------------------------------
+ * | 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->middleware([
-//    App\Http\Middleware\ExampleMiddleware::class
+// App\Http\Middleware\ExampleMiddleware::class
 // ]);
 // ]);
 
 
 // $app->routeMiddleware([
 // $app->routeMiddleware([
-//     'auth' => App\Http\Middleware\Authenticate::class,
+// '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.
-|
-*/
+ * |--------------------------------------------------------------------------
+ * | 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\AppServiceProvider::class);
 // $app->register(App\Providers\AuthServiceProvider::class);
 // $app->register(App\Providers\AuthServiceProvider::class);
 // $app->register(App\Providers\EventServiceProvider::class);
 // $app->register(App\Providers\EventServiceProvider::class);
 
 
-if (env('APP_SWOOLE',false)) {
-	$app->register(SwooleTW\Http\LumenServiceProvider::class);
-	$app->configure('swoole_http');
-}
-
 /*
 /*
-|--------------------------------------------------------------------------
-| 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.
-|
-*/
+ * |--------------------------------------------------------------------------
+ * | 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([
 $app->router->group([
-    'namespace' => 'App\Http\Controllers',
+	'namespace' => 'App\Http\Controllers'
 ], function ($router) {
 ], function ($router) {
-    require __DIR__.'/../routes/web.php';
+	require __DIR__ . '/../routes/web.php';
 });
 });
 
 
 return $app;
 return $app;

+ 6 - 7
frameworks/PHP/lumen/composer.json

@@ -5,14 +5,13 @@
     "license": "MIT",
     "license": "MIT",
     "type": "project",
     "type": "project",
     "require": {
     "require": {
-        "php": ">=7.1.3",
-        "laravel/lumen-framework": "5.8.*",
-        "vlucas/phpdotenv": "^3.0"
+        "php": "^7.3",
+        "laravel/lumen-framework": "^8.1"
     },
     },
     "require-dev": {
     "require-dev": {
-        "fzaninotto/faker": "~1.4",
-        "phpunit/phpunit": "~7.5",
-        "mockery/mockery": "~1.0"
+        "fzaninotto/faker": "^1.9.1",
+        "mockery/mockery": "^1.3.1",
+        "phpunit/phpunit": "^9.3"
     },
     },
     "autoload": {
     "autoload": {
         "psr-4": {
         "psr-4": {
@@ -27,7 +26,7 @@
     },
     },
     "scripts": {
     "scripts": {
         "post-root-package-install": [
         "post-root-package-install": [
-            "php -r \"copy('.env.example', '.env');\""
+            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
         ]
         ]
     },
     },
     "minimum-stability": "dev",
     "minimum-stability": "dev",

+ 11 - 11
frameworks/PHP/lumen/deploy/conf/php-fpm.conf

@@ -14,14 +14,14 @@
 ; Pid file
 ; Pid file
 ; Note: the default prefix is /var
 ; Note: the default prefix is /var
 ; Default Value: none
 ; Default Value: none
-pid = /run/php/php7.3-fpm.pid
+pid = /run/php/php-fpm.pid
 
 
 ; Error log file
 ; Error log file
 ; If it's set to "syslog", log is sent to syslogd instead of being written
 ; If it's set to "syslog", log is sent to syslogd instead of being written
 ; into a local file.
 ; into a local file.
 ; Note: the default prefix is /var
 ; Note: the default prefix is /var
 ; Default Value: log/php-fpm.log
 ; Default Value: log/php-fpm.log
-;error_log = /var/log/php7.3-fpm.log
+;error_log = /var/log/php-fpm.log
 error_log = /dev/stderr
 error_log = /dev/stderr
 
 
 
 
@@ -68,7 +68,7 @@ error_log = /dev/stderr
 ; Use it with caution.
 ; Use it with caution.
 ; Note: A value of 0 indicates no limit
 ; Note: A value of 0 indicates no limit
 ; Default Value: 0
 ; Default Value: 0
-; process.max = 128
+process.max = 0
 
 
 ; Specify the nice(2) priority to apply to the master process (only if set)
 ; Specify the nice(2) priority to apply to the master process (only if set)
 ; The value can vary from -19 (highest priority) to 20 (lowest priority)
 ; The value can vary from -19 (highest priority) to 20 (lowest priority)
@@ -84,12 +84,12 @@ error_log = /dev/stderr
 
 
 ; Set open file descriptor rlimit for the master process.
 ; Set open file descriptor rlimit for the master process.
 ; Default Value: system defined value
 ; Default Value: system defined value
-;rlimit_files = 1024
+rlimit_files = 100000
 
 
 ; Set max core size rlimit for the master process.
 ; Set max core size rlimit for the master process.
 ; Possible Values: 'unlimited' or an integer greater or equal to 0
 ; Possible Values: 'unlimited' or an integer greater or equal to 0
 ; Default Value: system defined value
 ; Default Value: system defined value
-;rlimit_core = 0
+rlimit_core = 'unlimited'
 
 
 ; Specify the event mechanism FPM will use. The following is available:
 ; Specify the event mechanism FPM will use. The following is available:
 ; - select     (any POSIX os)
 ; - select     (any POSIX os)
@@ -124,7 +124,7 @@ systemd_interval = 0
 ; Relative path can also be used. They will be prefixed by:
 ; Relative path can also be used. They will be prefixed by:
 ;  - the global prefix if it's been set (-p argument)
 ;  - the global prefix if it's been set (-p argument)
 ;  - /usr otherwise
 ;  - /usr otherwise
-;include=/etc/php/7.3/fpm/pool.d/*.conf
+;include=/etc/php/7.4/fpm/pool.d/*.conf
 
 
 ; Start a new pool named 'www'.
 ; Start a new pool named 'www'.
 ; the variable $pool can be used in any directive and will be replaced by the
 ; the variable $pool can be used in any directive and will be replaced by the
@@ -161,11 +161,11 @@ group = www-data
 ;                            (IPv6 and IPv4-mapped) on a specific port;
 ;                            (IPv6 and IPv4-mapped) on a specific port;
 ;   '/path/to/unix/socket' - to listen on a unix socket.
 ;   '/path/to/unix/socket' - to listen on a unix socket.
 ; Note: This value is mandatory.
 ; Note: This value is mandatory.
-listen = /run/php/php7.3-fpm.sock
+listen = /run/php/php-fpm.sock
 
 
 ; Set listen(2) backlog.
 ; Set listen(2) backlog.
 ; Default Value: 511 (-1 on FreeBSD and OpenBSD)
 ; Default Value: 511 (-1 on FreeBSD and OpenBSD)
-listen.backlog = 65535
+listen.backlog = -1
 
 
 ; Set permissions for unix socket, if one is used. In Linux, read/write
 ; Set permissions for unix socket, if one is used. In Linux, read/write
 ; permissions must be set in order to allow connections from a web server. Many
 ; permissions must be set in order to allow connections from a web server. Many
@@ -357,7 +357,7 @@ pm.max_spare_servers = 512
 ;   last request memory:  0
 ;   last request memory:  0
 ;
 ;
 ; Note: There is a real-time FPM status monitoring sample web page available
 ; Note: There is a real-time FPM status monitoring sample web page available
-;       It's available in: /usr/share/php/7.3/fpm/status.html
+;       It's available in: /usr/share/php/7.4/fpm/status.html
 ;
 ;
 ; Note: The value must start with a leading slash (/). The value can be
 ; Note: The value must start with a leading slash (/). The value can be
 ;       anything, but it may not be a good idea to use the .php extension or it
 ;       anything, but it may not be a good idea to use the .php extension or it
@@ -469,12 +469,12 @@ pm.max_spare_servers = 512
 
 
 ; Set open file descriptor rlimit.
 ; Set open file descriptor rlimit.
 ; Default Value: system defined value
 ; Default Value: system defined value
-;rlimit_files = 1024
+rlimit_files = 100000
 
 
 ; Set max core size rlimit.
 ; Set max core size rlimit.
 ; Possible Values: 'unlimited' or an integer greater or equal to 0
 ; Possible Values: 'unlimited' or an integer greater or equal to 0
 ; Default Value: system defined value
 ; Default Value: system defined value
-;rlimit_core = 0
+rlimit_core = 'unlimited'
 
 
 ; Chroot to this directory at the start. This value must be defined as an
 ; Chroot to this directory at the start. This value must be defined as an
 ; absolute path. When this value is not set, chroot is not used.
 ; absolute path. When this value is not set, chroot is not used.

+ 17 - 8
frameworks/PHP/lumen/deploy/conf/php.ini

@@ -1206,11 +1206,11 @@ mysqlnd.collect_memory_statistics = Off
 
 
 ; Default size of the mysqlnd memory pool, which is used by result sets.
 ; Default size of the mysqlnd memory pool, which is used by result sets.
 ; http://php.net/mysqlnd.mempool_default_size
 ; http://php.net/mysqlnd.mempool_default_size
-;mysqlnd.mempool_default_size = 16000
+mysqlnd.mempool_default_size = 32768
 
 
 ; Size of a pre-allocated buffer used when sending commands to MySQL in bytes.
 ; Size of a pre-allocated buffer used when sending commands to MySQL in bytes.
 ; http://php.net/mysqlnd.net_cmd_buffer_size
 ; http://php.net/mysqlnd.net_cmd_buffer_size
-;mysqlnd.net_cmd_buffer_size = 2048
+mysqlnd.net_cmd_buffer_size = 4096
 
 
 ; Size of a pre-allocated buffer used for reading data sent by the server in
 ; Size of a pre-allocated buffer used for reading data sent by the server in
 ; bytes.
 ; bytes.
@@ -1770,14 +1770,14 @@ opcache.enable=1
 ;opcache.enable_cli=0
 ;opcache.enable_cli=0
 
 
 ; The OPcache shared memory storage size.
 ; The OPcache shared memory storage size.
-;opcache.memory_consumption=128
+opcache.memory_consumption=256
 
 
 ; The amount of memory for interned strings in Mbytes.
 ; The amount of memory for interned strings in Mbytes.
-;opcache.interned_strings_buffer=8
+opcache.interned_strings_buffer=16
 
 
 ; The maximum number of keys (scripts) in the OPcache hash table.
 ; The maximum number of keys (scripts) in the OPcache hash table.
 ; Only numbers between 200 and 1000000 are allowed.
 ; Only numbers between 200 and 1000000 are allowed.
-;opcache.max_accelerated_files=10000
+opcache.max_accelerated_files=7963
 
 
 ; The maximum percentage of "wasted" memory until a restart is scheduled.
 ; The maximum percentage of "wasted" memory until a restart is scheduled.
 ;opcache.max_wasted_percentage=5
 ;opcache.max_wasted_percentage=5
@@ -1798,7 +1798,7 @@ opcache.validate_timestamps=0
 ;opcache.revalidate_freq=2
 ;opcache.revalidate_freq=2
 
 
 ; Enables or disables file search in include_path optimization
 ; Enables or disables file search in include_path optimization
-;opcache.revalidate_path=0
+opcache.revalidate_path=0
 
 
 ; If disabled, all PHPDoc comments are dropped from the code to reduce the
 ; If disabled, all PHPDoc comments are dropped from the code to reduce the
 ; size of the optimized code.
 ; size of the optimized code.
@@ -1878,7 +1878,7 @@ opcache.enable_file_override=1
 
 
 ; Enables or disables copying of PHP code (text segment) into HUGE PAGES.
 ; Enables or disables copying of PHP code (text segment) into HUGE PAGES.
 ; This should improve performance, but requires appropriate OS configuration.
 ; This should improve performance, but requires appropriate OS configuration.
-opcache.huge_code_pages=1
+;opcache.huge_code_pages=1
 
 
 ; Validate cached file permissions.
 ; Validate cached file permissions.
 ;opcache.validate_permission=0
 ;opcache.validate_permission=0
@@ -1886,6 +1886,15 @@ opcache.huge_code_pages=1
 ; Prevent name collisions in chroot'ed environment.
 ; Prevent name collisions in chroot'ed environment.
 ;opcache.validate_root=0
 ;opcache.validate_root=0
 
 
+; Prevents caching files that are less than this number of seconds old. 
+; It protects from caching of incompletely updated files. 
+; In case all file updates on your site are atomic, you may increase performance by setting it to "0".
+opcache.file_update_protection=0
+
+opcache.fast_shutdown=1
+
+opcache.preload_user=www-data
+
 [curl]
 [curl]
 ; A default value for the CURLOPT_CAINFO option. This is required to be an
 ; A default value for the CURLOPT_CAINFO option. This is required to be an
 ; absolute path.
 ; absolute path.
@@ -1911,4 +1920,4 @@ opcache.huge_code_pages=1
 
 
 ; Local Variables:
 ; Local Variables:
 ; tab-width: 4
 ; tab-width: 4
-; End:
+; End:

+ 1 - 2
frameworks/PHP/lumen/deploy/nginx.conf

@@ -22,7 +22,6 @@ http {
     keepalive_disable none;
     keepalive_disable none;
     keepalive_requests 10000;
     keepalive_requests 10000;
     
     
-
     #the bench don't use any static file
     #the bench don't use any static file
     #open_file_cache max=2000 inactive=20s;
     #open_file_cache max=2000 inactive=20s;
     #open_file_cache_valid 60s;
     #open_file_cache_valid 60s;
@@ -42,7 +41,7 @@ http {
 
 
 
 
     upstream fastcgi_backend {
     upstream fastcgi_backend {
-        server unix:/var/run/php/php7.3-fpm.sock;
+        server unix:/var/run/php/php-fpm.sock;
         keepalive 40;
         keepalive 40;
     }
     }
 
 

+ 6 - 7
frameworks/PHP/lumen/deploy/swoole/composer.json

@@ -5,15 +5,14 @@
     "license": "MIT",
     "license": "MIT",
     "type": "project",
     "type": "project",
     "require": {
     "require": {
-        "php": ">=7.1.3",
-        "laravel/lumen-framework": "5.8.*",
-        "vlucas/phpdotenv": "^3.0",
+        "php": "^7.3",
+        "laravel/lumen-framework": "^8.1",
         "swooletw/laravel-swoole": "^v2.6"
         "swooletw/laravel-swoole": "^v2.6"
     },
     },
     "require-dev": {
     "require-dev": {
-        "fzaninotto/faker": "~1.4",
-        "phpunit/phpunit": "~7.5",
-        "mockery/mockery": "~1.0"
+        "fzaninotto/faker": "^1.9.1",
+        "mockery/mockery": "^1.3.1",
+        "phpunit/phpunit": "^9.3"
     },
     },
     "autoload": {
     "autoload": {
         "psr-4": {
         "psr-4": {
@@ -28,7 +27,7 @@
     },
     },
     "scripts": {
     "scripts": {
         "post-root-package-install": [
         "post-root-package-install": [
-            "php -r \"copy('.env.example', '.env');\""
+             "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
         ]
         ]
     },
     },
     "minimum-stability": "dev",
     "minimum-stability": "dev",

+ 2 - 1
frameworks/PHP/lumen/lumen-swoole.dockerfile

@@ -23,8 +23,9 @@ RUN deploy/swoole/install-composer.sh
 
 
 RUN apt-get update -yqq > /dev/null && \
 RUN apt-get update -yqq > /dev/null && \
     apt-get install -yqq git unzip > /dev/null
     apt-get install -yqq git unzip > /dev/null
+
 COPY deploy/swoole/composer* ./
 COPY deploy/swoole/composer* ./
-RUN php composer.phar install -a --no-dev --quiet
+RUN php composer.phar install --optimize-autoloader --classmap-authoritative --no-dev --quiet
 
 
 RUN echo "APP_SWOOLE=true" >> .env
 RUN echo "APP_SWOOLE=true" >> .env