Skip to content

Commit

Permalink
[php82] fix more tests, update local dev env
Browse files Browse the repository at this point in the history
  • Loading branch information
beinbm committed Aug 10, 2023
1 parent c630799 commit 974aa3e
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 8 deletions.
9 changes: 5 additions & 4 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
services:
web:
# image: beinbm/cake:php74 # enable for php7.4+xdebug
image: beinbm/cake:php80 # enable for php8.0+xdebug
# build: # enable for own builds
# context: ./docker/web
# dockerfile: PHP74.Dockerfile
# image: beinbm/cake:php80 # enable for php8.0+xdebug
image: beinbm/cake:php82 # enable for php8.0+xdebug
build: # enable for own builds
context: ./docker/web
dockerfile: PHP82.Dockerfile
# platform: "linux/amd64"
environment:
#XDEBUG_SESSION: "core"
Expand Down
2 changes: 1 addition & 1 deletion docker/web/PHP74.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:7.4-apache
FROM php:7.4-apache-bullseye

RUN apt-get update && apt-get install -y --no-install-recommends \
&& apt-get install -y libzip-dev unzip openssl libmcrypt-dev libmemcached-dev locales \
Expand Down
2 changes: 1 addition & 1 deletion docker/web/PHP80.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.0-apache
FROM php:8.0-apache-bullseye

RUN apt-get update && apt-get install -y --no-install-recommends \
&& apt-get install -y libzip-dev unzip openssl libmcrypt-dev libmemcached-dev locales \
Expand Down
27 changes: 27 additions & 0 deletions docker/web/PHP82.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM php:8.2-apache-bullseye

RUN apt-get update && apt-get install -y --no-install-recommends \
&& apt-get install -y libzip-dev unzip openssl libmcrypt-dev libmemcached-dev locales \
&& rm -rf /var/lib/apt/lists/*

RUN docker-php-ext-install pdo_mysql zip \
&& pecl install apcu redis memcached mcrypt \
&& docker-php-ext-enable redis memcached mcrypt \
&& echo "extension=apcu.so" >> /usr/local/etc/php/php.ini \
&& echo "apc.enable_cli = 1" >> /usr/local/etc/php/php.ini

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

RUN sed -i '/de_DE /s/^# //g' /etc/locale.gen \
&& sed -i '/es_ES /s/^# //g' /etc/locale.gen \
&& locale-gen

ENV APACHE_DOCUMENT_ROOT /var/www/html/app/webroot

RUN a2enmod rewrite

RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf

RUN pecl install xdebug && pecl install pcov
RUN docker-php-ext-enable xdebug
1 change: 1 addition & 0 deletions lib/Cake/Controller/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
* @property string $webroot Webroot path segment for the request.
* @link https://book.cakephp.org/2.0/en/controllers.html
*/
#[AllowDynamicProperties]
class Controller extends CakeObject implements CakeEventListener {

/**
Expand Down
1 change: 1 addition & 0 deletions lib/Cake/Event/CakeEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*
* @package Cake.Event
*/
#[AllowDynamicProperties]
class CakeEvent {

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/CakeSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ protected static function _setPath($base = null) {
*/
protected static function _setHost($host) {
static::$host = $host;
if (strpos(static::$host, ':') !== false) {
if (strpos((string) static::$host, ':') !== false) {
static::$host = substr(static::$host, 0, strpos(static::$host, ':'));
}
}
Expand Down
2 changes: 2 additions & 0 deletions lib/Cake/Test/Case/Controller/ApplicationControllerTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php
App::uses('AppController', 'Controller');
App::uses('CakeSession', 'Model/Datasource');

/**
* TransSessionIdController class for testing session.use_trans_sid=1.
*
Expand Down
1 change: 1 addition & 0 deletions lib/Cake/TestSuite/ControllerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
*/
class ControllerTestDispatcher extends Dispatcher {

public $response = null;
/**
* The controller to use in the dispatch process
*
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/basics.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ function env($key) {
if (isset($_SERVER['HTTPS'])) {
return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off');
}
return (strpos(env('SCRIPT_URI'), 'https://') === 0);
return (strpos((string) env('SCRIPT_URI'), 'https://') === 0);
}

if ($key === 'SCRIPT_NAME') {
Expand Down

0 comments on commit 974aa3e

Please sign in to comment.