Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion frameworks/PHP/cakephp/benchmark_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@
"webserver": "none",
"os": "Linux",
"database_os": "Linux",
"display_name": "CakePHP-workerman",
"display_name": "CakePHP [workerman]",
"notes": "",
"versus": "php"
}
}]
}

13 changes: 7 additions & 6 deletions frameworks/PHP/cakephp/cakephp-workerman.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \
apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null

RUN apt-get install -yqq git unzip \
php8.4-cli php8.4-mysql php8.4-mbstring php8.4-intl php8.4-xml php8.4-curl > /dev/null
php8.5-cli php8.5-mysql php8.5-mbstring php8.5-intl php8.5-xml php8.5-curl > /dev/null

COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

RUN apt-get install -y php-pear php8.4-dev libevent-dev > /dev/null
RUN pecl install event-3.1.4 > /dev/null && echo "extension=event.so" > /etc/php/8.4/cli/conf.d/event.ini
RUN apt-get install -y php-pear php8.5-dev libevent-dev > /dev/null
RUN pecl install event-3.1.4 > /dev/null && echo "extension=event.so" > /etc/php/8.5/cli/conf.d/event.ini

EXPOSE 8080

ADD ./ /cakephp
WORKDIR /cakephp

RUN composer require joanhey/adapterman:^0.7
RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet
RUN composer require joanhey/adapterman:^0.7 --quiet
RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet

RUN chmod -R 777 /cakephp

#COPY deploy/conf/cli-php.ini /etc/php/8.4/cli/php.ini
#COPY deploy/conf/cli-php.ini /etc/php/8.5/cli/php.ini

CMD php -c deploy/conf/cli-php.ini \
server.php start

10 changes: 5 additions & 5 deletions frameworks/PHP/cakephp/cakephp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \
apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null

RUN apt-get install -yqq nginx git unzip \
php8.4-fpm php8.4-mysql php8.4-xml php8.4-mbstring php8.4-intl php8.4-dev php8.4-curl > /dev/null
php8.5-fpm php8.5-mysql php8.5-xml php8.5-mbstring php8.5-intl php8.5-dev php8.5-curl > /dev/null

COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

COPY deploy/conf/* /etc/php/8.4/fpm/
COPY deploy/conf/* /etc/php/8.4/cli/
COPY deploy/conf/* /etc/php/8.5/fpm/
COPY deploy/conf/* /etc/php/8.5/cli/

ADD ./ /cakephp
WORKDIR /cakephp

RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.4/fpm/php-fpm.conf ; fi;
RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.5/fpm/php-fpm.conf ; fi;

RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet

RUN chmod -R 777 /cakephp

CMD service php8.4-fpm start && \
CMD service php8.5-fpm start && \
nginx -c /cakephp/deploy/nginx.conf

3 changes: 3 additions & 0 deletions frameworks/PHP/cakephp/deploy/conf/cli-php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ opcache.jit_buffer_size = 128M
opcache.jit = tracing

disable_functions=header,header_remove,headers_sent,headers_list,http_response_code,setcookie,session_create_id,session_id,session_name,session_save_path,session_status,session_start,session_write_close,session_regenerate_id,session_unset,session_get_cookie_params,session_set_cookie_params,set_time_limit

#php 8.5
error_reporting = E_ALL & ~E_DEPRECATED
6 changes: 3 additions & 3 deletions frameworks/PHP/cakephp/server.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

class HeaderDate
{
const NAME = 'Date: ';
const DATE_FORMAT = 'D, d M Y H:i:s \G\M\T';

/**
* Date header
Expand All @@ -37,9 +37,9 @@ class HeaderDate

public static function init(): void
{
self::$date = self::NAME.gmdate(DATE_RFC7231);
self::$date = 'Date: '.gmdate(self::DATE_FORMAT);
Timer::add(1, static function () {
self::$date = self::NAME.gmdate(DATE_RFC7231);
self::$date = 'Date: '.gmdate(self::DATE_FORMAT);
});
}
}
Loading