Skip to content

Commit c19f603

Browse files
authored
Working with Docker again (#68)
* preliminarily working * ignore depreciated warnings (ugly orange screen)
1 parent 637ccac commit c19f603

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ WORKDIR /var/www/html
66

77

88

9-
FROM php:7.4-fpm-alpine
9+
FROM php:8.1.6RC1-fpm-alpine3.15
1010

1111
# Install dev dependencies
1212
RUN apk add --no-cache --virtual .build-deps \
@@ -38,22 +38,24 @@ RUN pecl install \
3838
imagick \
3939
xdebug
4040

41+
# We currently can't natively pull iconv with PHP8, see: https://github.com/docker-library/php/issues/240#issuecomment-876464325
42+
RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ --allow-untrusted
43+
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so
44+
4145
# Install and enable php extensions
4246
RUN docker-php-ext-enable \
4347
imagick \
4448
xdebug
4549
RUN docker-php-ext-configure zip
4650
RUN docker-php-ext-install \
4751
curl \
48-
iconv \
4952
pdo \
5053
pdo_mysql \
5154
pcntl \
52-
tokenizer \
5355
xml \
5456
gd \
5557
zip \
56-
bcmath
58+
bcmath
5759

5860
WORKDIR /var/www/html
5961
COPY src src/

src/Services/RouterService.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ class RouterService
232232
public function __construct()
233233
{
234234
// To ignore the Notice instead of Isset on missing POST vars
235-
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
235+
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING & ~E_DEPRECATED);
236236

237237
if (isset($_POST['auth_type'])) {
238238
$_SESSION['auth_service'] = $_POST['auth_type'];
@@ -284,7 +284,7 @@ public function router(): void
284284
} elseif ($this->ds_token_ok() == false) {
285285
header('Location: ' . $GLOBALS['app_url'] . '/index.php?page=select_api');
286286
} else {
287-
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
287+
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING & ~E_DEPRECATED);
288288
$controller = "\Example\Controllers\Examples\\" . $this->getController($page);
289289
new $controller($page);
290290
exit();
@@ -347,13 +347,13 @@ public function router(): void
347347
// handle eg001 being listed in project root
348348
} elseif ($page == 'eg001') {
349349
// To ignore the Notice instead of Isset on missing POST vars
350-
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
350+
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING & ~E_DEPRECATED);
351351
$controller = '\Example\\' . $this->getController($page);
352352
new $controller($page);
353353
exit();
354354
} else {
355355
// To ignore the Notice instead of Isset on missing POST vars
356-
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
356+
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING & ~E_DEPRECATED);
357357
$controller = '\Example\Controllers\Examples\\' . $this->getController($page);
358358
new $controller($page);
359359
exit();

0 commit comments

Comments
 (0)