Browse Source

[php] Plain update to Adapterman 0.6 (#8024)

Joan Miquel 2 years ago
parent
commit
83bb090f46

+ 1 - 1
frameworks/PHP/php/deploy/workerman/cli-php.ini

@@ -13,4 +13,4 @@ memory_limit = 512M
 opcache.jit_buffer_size=128M
 opcache.jit_buffer_size=128M
 opcache.jit=tracing
 opcache.jit=tracing
 
 
-disable_functions=header,header_remove,headers_sent,http_response_code,setcookie,session_create_id,session_id,session_name,session_save_path,session_status,session_start,session_write_close,set_time_limit
+disable_functions=header,header_remove,headers_sent,http_response_code,setcookie,session_create_id,session_id,session_name,session_save_path,session_status,session_start,session_write_close,session_regenerate_id,set_time_limit

+ 4 - 4
frameworks/PHP/php/deploy/workerman/composer.json

@@ -1,5 +1,5 @@
 {
 {
-    "require": {
-      "joanhey/adapterman": "0.5"
-    }
-  }
+  "require": {
+    "joanhey/adapterman": "^0.6"
+  }
+}

+ 3 - 3
frameworks/PHP/php/deploy/workerman/start.php

@@ -18,7 +18,7 @@ $web->onWorkerStart = static function () {
     Header::init();
     Header::init();
 };
 };
 
 
-$web->onMessage = static function ($connection, $request) {
+$web->onMessage = static function ($connection) {
     $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
     $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
     /* if ($path === '/') {
     /* if ($path === '/') {
         $connection->send(exec_php_file(WEBROOT.'/index.php', $request));
         $connection->send(exec_php_file(WEBROOT.'/index.php', $request));
@@ -48,8 +48,8 @@ function exec_php_file($file)
     // Try to include php file.
     // Try to include php file.
     try {
     try {
         include $file;
         include $file;
-    } catch (\Exception $e) {
-        echo $e;
+    } catch (Throwable $t) {
+        echo $t;
     }
     }
     return ob_get_clean();
     return ob_get_clean();
 }
 }

+ 1 - 1
frameworks/PHP/php/php-workerman.dockerfile

@@ -20,7 +20,7 @@ ADD ./ /php
 WORKDIR /php
 WORKDIR /php
 
 
 COPY deploy/workerman/composer.json ./
 COPY deploy/workerman/composer.json ./
-RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet
+RUN composer install --optimize-autoloader --classmap-authoritative --no-dev 
 
 
 COPY deploy/workerman/start.php ./
 COPY deploy/workerman/start.php ./