Skip to content

Commit

Permalink
[php] Cakephp-Workerman bypass cli bootstrap (#7680)
Browse files Browse the repository at this point in the history
* [php] Cakephp-workerman bypass cli bootstrap

* Small change to rerun ci
  • Loading branch information
joanhey authored Nov 9, 2022
1 parent ea525d7 commit e6eee12
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 3 additions & 0 deletions frameworks/PHP/cakephp/cakephp-workerman.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions frameworks/PHP/cakephp/config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 0 additions & 5 deletions frameworks/PHP/cakephp/start.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit e6eee12

Please sign in to comment.