diff --git a/frameworks/PHP/cakephp/cakephp-workerman.dockerfile b/frameworks/PHP/cakephp/cakephp-workerman.dockerfile index 1142103c92d..58c566ce70b 100644 --- a/frameworks/PHP/cakephp/cakephp-workerman.dockerfile +++ b/frameworks/PHP/cakephp/cakephp-workerman.dockerfile @@ -26,5 +26,8 @@ RUN chmod -R 777 /cakephp #COPY deploy/conf/cli-php.ini /etc/php/8.1/cli/php.ini +# bypass cli bootstrap for Workerman +RUN sed -i "s|//$isCli = false|$isCli = false|g" config/bootstrap.php + CMD php -c deploy/conf/cli-php.ini \ server.php start diff --git a/frameworks/PHP/cakephp/config/bootstrap.php b/frameworks/PHP/cakephp/config/bootstrap.php index 6c98a8793ae..27ab58a1928 100644 --- a/frameworks/PHP/cakephp/config/bootstrap.php +++ b/frameworks/PHP/cakephp/config/bootstrap.php @@ -115,6 +115,7 @@ * Register application error and exception handlers. */ $isCli = PHP_SAPI === 'cli'; +//$isCli = false; // Workerman if ($isCli) { (new ConsoleErrorHandler(Configure::read('Error')))->register(); } else { diff --git a/frameworks/PHP/cakephp/start.php b/frameworks/PHP/cakephp/start.php index 27a96be1bc7..039cabc2af7 100644 --- a/frameworks/PHP/cakephp/start.php +++ b/frameworks/PHP/cakephp/start.php @@ -21,11 +21,6 @@ use App\Application; use Cake\Http\Server; -class_alias( - 'Cake\Error\ConsoleErrorHandler', - 'Cake\Console\ConsoleErrorHandler' -); - global $server; // Bind your application to the server.