Skip to content

Commit d690f9e

Browse files
joanheyfreost
andauthored
[php] Mako update to PHP 8.5 (#10329)
* [php] Mako update to PHP 8.5 * Update directory structure and fix deprecations * Delete frameworks/PHP/mako/composer.lock --------- Co-authored-by: Frederic G. Østby <[email protected]>
1 parent ba8bfe9 commit d690f9e

File tree

10 files changed

+13
-12
lines changed

10 files changed

+13
-12
lines changed

frameworks/PHP/mako/app/controllers/Index.php renamed to frameworks/PHP/mako/app/http/controllers/Index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace app\controllers;
3+
namespace app\http\controllers;
44

55
use mako\http\routing\Controller;
66
use mako\view\ViewFactory;

frameworks/PHP/mako/app/routing/routes.php renamed to frameworks/PHP/mako/app/http/routing/routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use app\controllers\Index;
3+
use app\http\controllers\Index;
44

55
/** @var \mako\http\routing\Routes $routes */
66

frameworks/PHP/mako/app/init.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Configure PHP error reporting.
55
* @see http://php.net/manual/en/function.error-reporting.php
66
*/
7-
error_reporting(E_ALL | E_STRICT);
7+
error_reporting(E_ALL);
88

99
/*
1010
* Choose if errors that are NOT caught by the Mako error and exception handlers should be

frameworks/PHP/mako/app/models/Fortune.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
use mako\database\midgard\ORM;
66

77
class Fortune extends ORM {
8-
protected $tableName = 'Fortune';
8+
protected string $tableName = 'Fortune';
99
}

frameworks/PHP/mako/app/models/World.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
use mako\database\midgard\ORM;
66

77
class World extends ORM {
8-
protected $tableName = 'World';
8+
protected string $tableName = 'World';
99
}

frameworks/PHP/mako/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
33
"php": ">=7.4.0",
4-
"mako/framework": "^9.0"
4+
"mako/framework": "^11.0"
55
},
66
"autoload": {
77
"psr-4": {
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:22.04
1+
FROM ubuntu:24.04
22

33
ARG DEBIAN_FRONTEND=noninteractive
44

@@ -7,22 +7,22 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \
77
apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null
88

99
RUN apt-get install -yqq nginx git unzip \
10-
php8.3-cli php8.3-fpm php8.3-mysql php8.3-mbstring php8.3-xml php8.3-curl > /dev/null
10+
php8.5-cli php8.5-fpm php8.5-mysql php8.5-mbstring php8.5-xml php8.5-curl > /dev/null
1111

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

14-
COPY deploy/conf/* /etc/php/8.3/fpm/
14+
COPY deploy/conf/* /etc/php/8.5/fpm/
1515

1616
ADD ./ /mako
1717
WORKDIR /mako
1818

19-
RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.3/fpm/php-fpm.conf ; fi;
19+
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;
2020

2121
RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --ignore-platform-reqs --quiet
2222

2323
RUN chmod -R 777 app
2424

2525
EXPOSE 8080
2626

27-
CMD service php8.3-fpm start && \
27+
CMD service php8.5-fpm start && \
2828
nginx -c /mako/deploy/nginx.conf

frameworks/PHP/mako/public/index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3+
use mako\application\CurrentApplication;
34
use mako\application\web\Application;
45

56
/**
@@ -10,4 +11,4 @@
1011
/*
1112
* Start and run the application.
1213
*/
13-
Application::start(MAKO_APPLICATION_PATH)->run();
14+
CurrentApplication::set(new Application(MAKO_APPLICATION_PATH))->run();

0 commit comments

Comments
 (0)