Move to PHP 8.0 (#4051)

This commit is contained in:
Buster "Silver Eagle" Neece 2021-04-22 21:16:00 -05:00 committed by GitHub
parent c5e3072819
commit acab8806b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
55 changed files with 236 additions and 263 deletions

View File

@ -1,4 +1,11 @@
FROM azuracast/azuracast_testing:latest FROM php:8.0-cli-alpine
RUN apk add --no-cache npm
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
RUN mkdir /app
WORKDIR /app
USER root USER root

View File

@ -1,5 +1,8 @@
#!/usr/bin/env sh #!/usr/bin/env sh
# Install Composer dependencies if not already installed.
composer install --no-interaction --ignore-platform-reqs
# Import locales on backend # Import locales on backend
bin/console locale:import bin/console locale:import

View File

@ -1,11 +1,15 @@
FROM azuracast/azuracast_testing:latest FROM php:8.0-cli-alpine
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
RUN mkdir /app
WORKDIR /app
USER root USER root
ENV APPLICATION_ENV="testing" ENV APPLICATION_ENV="testing"
COPY ./entrypoint.sh /entrypoint.sh COPY ./entrypoint.sh /entrypoint.sh
RUN chmod a+x /entrypoint.sh RUN chmod a+x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]

View File

@ -1,7 +1,7 @@
#!/usr/bin/env sh #!/usr/bin/env sh
# Install Composer dependencies # Install Composer dependencies
composer install --no-interaction --ignore-platform-req=ext-maxminddb composer install --no-interaction --ignore-platform-reqs
# Import locales on backend # Import locales on backend
bin/console locale:generate bin/console locale:generate

View File

@ -4,7 +4,7 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"type": "project", "type": "project",
"require": { "require": {
"php": ">=7.4 || ^8.0", "php": "^8.0",
"ext-PDO": "*", "ext-PDO": "*",
"ext-fileinfo": "*", "ext-fileinfo": "*",
"ext-gd": "*", "ext-gd": "*",
@ -40,7 +40,7 @@
"league/flysystem-aws-s3-v3": "^2.0", "league/flysystem-aws-s3-v3": "^2.0",
"league/mime-type-detection": "^1.7", "league/mime-type-detection": "^1.7",
"league/plates": "^3.1", "league/plates": "^3.1",
"lstrojny/fxmlrpc": "dev-master", "lstrojny/fxmlrpc": "dev-php8 as 0.13",
"matomo/device-detector": "^4.0", "matomo/device-detector": "^4.0",
"mezzio/mezzio-session": "^1.3", "mezzio/mezzio-session": "^1.3",
"mezzio/mezzio-session-cache": "^1.4", "mezzio/mezzio-session-cache": "^1.4",
@ -57,7 +57,7 @@
"psr/simple-cache": "^1.0", "psr/simple-cache": "^1.0",
"ramsey/uuid": "^4.0", "ramsey/uuid": "^4.0",
"ramsey/uuid-doctrine": "^1.6", "ramsey/uuid-doctrine": "^1.6",
"rlanvin/php-ip": "^2.0", "rlanvin/php-ip": "dev-master",
"slim/http": "^1.1", "slim/http": "^1.1",
"slim/slim": "^4.2", "slim/slim": "^4.2",
"spatie/flysystem-dropbox": "^2", "spatie/flysystem-dropbox": "^2",
@ -80,6 +80,12 @@
"wikimedia/composer-merge-plugin": "dev-master", "wikimedia/composer-merge-plugin": "dev-master",
"zircote/swagger-php": "^3" "zircote/swagger-php": "^3"
}, },
"repositories": [
{
"type": "git",
"url": "https://github.com/VincentLanglet/fxmlrpc.git"
}
],
"require-dev": { "require-dev": {
"codeception/codeception": "^4.0", "codeception/codeception": "^4.0",
"codeception/module-asserts": "^1.1", "codeception/module-asserts": "^1.1",
@ -107,6 +113,7 @@
"symfony/polyfill-php72": "1.99", "symfony/polyfill-php72": "1.99",
"symfony/polyfill-php73": "1.99", "symfony/polyfill-php73": "1.99",
"symfony/polyfill-php74": "1.99", "symfony/polyfill-php74": "1.99",
"symfony/polyfill-php80": "1.99",
"symfony/polyfill-iconv": "1.99", "symfony/polyfill-iconv": "1.99",
"symfony/polyfill-intl-grapheme": "1.99", "symfony/polyfill-intl-grapheme": "1.99",
"symfony/polyfill-intl-normalizer": "1.99", "symfony/polyfill-intl-normalizer": "1.99",

186
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "17f74c9a9115bff2e514f58d32a7f93f", "content-hash": "e86fbe854cbc0f8ea151f1c5c9fee013",
"packages": [ "packages": [
{ {
"name": "aws/aws-sdk-php", "name": "aws/aws-sdk-php",
@ -102,12 +102,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/AzuraCast/azuraforms.git", "url": "https://github.com/AzuraCast/azuraforms.git",
"reference": "16da3c4c2ca17d2b5e89d1569f9ef39f58e7e95c" "reference": "ed1aaa82c684ebd2a748a6e834fd307f3618bd48"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/AzuraCast/azuraforms/zipball/16da3c4c2ca17d2b5e89d1569f9ef39f58e7e95c", "url": "https://api.github.com/repos/AzuraCast/azuraforms/zipball/ed1aaa82c684ebd2a748a6e834fd307f3618bd48",
"reference": "16da3c4c2ca17d2b5e89d1569f9ef39f58e7e95c", "reference": "ed1aaa82c684ebd2a748a6e834fd307f3618bd48",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -163,7 +163,7 @@
"type": "patreon" "type": "patreon"
} }
], ],
"time": "2021-04-06T22:53:26+00:00" "time": "2021-04-22T09:53:37+00:00"
}, },
{ {
"name": "azuracast/flysystem-v2-extensions", "name": "azuracast/flysystem-v2-extensions",
@ -862,40 +862,39 @@
}, },
{ {
"name": "doctrine/cache", "name": "doctrine/cache",
"version": "1.10.2", "version": "1.11.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/cache.git", "url": "https://github.com/doctrine/cache.git",
"reference": "13e3381b25847283a91948d04640543941309727" "reference": "a9c1b59eba5a08ca2770a76eddb88922f504e8e0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/cache/zipball/13e3381b25847283a91948d04640543941309727", "url": "https://api.github.com/repos/doctrine/cache/zipball/a9c1b59eba5a08ca2770a76eddb88922f504e8e0",
"reference": "13e3381b25847283a91948d04640543941309727", "reference": "a9c1b59eba5a08ca2770a76eddb88922f504e8e0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "~7.1 || ^8.0" "php": "~7.1 || ^8.0"
}, },
"conflict": { "conflict": {
"doctrine/common": ">2.2,<2.4" "doctrine/common": ">2.2,<2.4",
"psr/cache": ">=3"
}, },
"require-dev": { "require-dev": {
"alcaeus/mongo-php-adapter": "^1.1", "alcaeus/mongo-php-adapter": "^1.1",
"doctrine/coding-standard": "^6.0", "cache/integration-tests": "dev-master",
"doctrine/coding-standard": "^8.0",
"mongodb/mongodb": "^1.1", "mongodb/mongodb": "^1.1",
"phpunit/phpunit": "^7.0", "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"predis/predis": "~1.0" "predis/predis": "~1.0",
"psr/cache": "^1.0 || ^2.0",
"symfony/cache": "^4.4 || ^5.2"
}, },
"suggest": { "suggest": {
"alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver"
}, },
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9.x-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
@ -942,7 +941,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/doctrine/cache/issues", "issues": "https://github.com/doctrine/cache/issues",
"source": "https://github.com/doctrine/cache/tree/1.10.x" "source": "https://github.com/doctrine/cache/tree/1.11.0"
}, },
"funding": [ "funding": [
{ {
@ -958,7 +957,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-07-07T18:54:01+00:00" "time": "2021-04-13T14:46:17+00:00"
}, },
{ {
"name": "doctrine/collections", "name": "doctrine/collections",
@ -3481,31 +3480,24 @@
}, },
{ {
"name": "lstrojny/fxmlrpc", "name": "lstrojny/fxmlrpc",
"version": "dev-master", "version": "dev-php8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/lstrojny/fxmlrpc.git", "url": "https://github.com/VincentLanglet/fxmlrpc.git",
"reference": "968c92c12a950146551f228f709170c52ca35911" "reference": "8f053ee53d27da796adff3e1ca929f48e7171c1f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/lstrojny/fxmlrpc/zipball/968c92c12a950146551f228f709170c52ca35911",
"reference": "968c92c12a950146551f228f709170c52ca35911",
"shasum": ""
}, },
"require": { "require": {
"php": "~7.1", "php": "^7.2 || ^8.0",
"php-http/discovery": "^1.0" "php-http/discovery": "^1.0"
}, },
"require-dev": { "require-dev": {
"internations/kodierungsregelwerksammlung": "dev-master", "lstrojny/hmmmath": "^0.8",
"lstrojny/hmmmath": "dev-master",
"monolog/monolog": "~1", "monolog/monolog": "~1",
"php-http/guzzle6-adapter": "^1.0 || ^2.0", "php-http/guzzle7-adapter": "^0.1",
"php-http/httplug": "^1.0 || ^2.0", "php-http/httplug": "^1.0 || ^2.0",
"php-http/message": "^1.2", "php-http/message": "^1.2",
"php-http/message-factory": "^1.0", "php-http/message-factory": "^1.0",
"phpunit/phpunit": "~7", "phpunit/phpunit": "^8.5",
"psr/http-factory": "*", "psr/http-factory": "*",
"psr/log": "*", "psr/log": "*",
"symfony/process": "~2.1", "symfony/process": "~2.1",
@ -3518,11 +3510,11 @@
"php-http/curl-client": "A simple PSR-7 compatible HTTP client", "php-http/curl-client": "A simple PSR-7 compatible HTTP client",
"php-http/guzzle5-adapter": "Guzzle 5 PSR-7 adapter", "php-http/guzzle5-adapter": "Guzzle 5 PSR-7 adapter",
"php-http/guzzle6-adapter": "Guzzle 6 PSR-7 adapter", "php-http/guzzle6-adapter": "Guzzle 6 PSR-7 adapter",
"php-http/guzzle7-adapter": "Guzzle 7 PSR-7 adapter",
"php-http/message": "For PSR-7 message factories", "php-http/message": "For PSR-7 message factories",
"zendframework/zend-log": "To use ZF2 Zend\\Log\\Logger as a logger", "zendframework/zend-log": "To use ZF2 Zend\\Log\\Logger as a logger",
"zendframework/zendframework1": "To use ZF1 Log" "zendframework/zendframework1": "To use ZF1 Log"
}, },
"default-branch": true,
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
@ -3534,7 +3526,11 @@
"fXmlRpc\\": "src/fXmlRpc" "fXmlRpc\\": "src/fXmlRpc"
} }
}, },
"notification-url": "https://packagist.org/downloads/", "autoload-dev": {
"psr-4": {
"fXmlRpc\\": "tests/fXmlRpc"
}
},
"license": [ "license": [
"MIT" "MIT"
], ],
@ -3553,11 +3549,7 @@
"xml", "xml",
"xmlrpc" "xmlrpc"
], ],
"support": { "time": "2020-12-17T18:20:51+00:00"
"issues": "https://github.com/lstrojny/fxmlrpc/issues",
"source": "https://github.com/lstrojny/fxmlrpc/tree/master"
},
"time": "2020-11-23T14:42:43+00:00"
}, },
{ {
"name": "matomo/device-detector", "name": "matomo/device-detector",
@ -5724,25 +5716,26 @@
}, },
{ {
"name": "rlanvin/php-ip", "name": "rlanvin/php-ip",
"version": "v2.1.0", "version": "dev-master",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/rlanvin/php-ip.git", "url": "https://github.com/rlanvin/php-ip.git",
"reference": "1bea521987f3c7db5f4b9f17f321e90feaefad11" "reference": "6b74d8bc8f054e2f2da8b636e772b8155b8f1b97"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/rlanvin/php-ip/zipball/1bea521987f3c7db5f4b9f17f321e90feaefad11", "url": "https://api.github.com/repos/rlanvin/php-ip/zipball/6b74d8bc8f054e2f2da8b636e772b8155b8f1b97",
"reference": "1bea521987f3c7db5f4b9f17f321e90feaefad11", "reference": "6b74d8bc8f054e2f2da8b636e772b8155b8f1b97",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-gmp": "*", "ext-gmp": "*",
"php": "~7.0" "php": ">=7.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": ">=6.5 <8.1" "phpunit/phpunit": "^6.5|^8.0"
}, },
"default-branch": true,
"type": "library", "type": "library",
"autoload": { "autoload": {
"psr-4": { "psr-4": {
@ -5762,9 +5755,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/rlanvin/php-ip/issues", "issues": "https://github.com/rlanvin/php-ip/issues",
"source": "https://github.com/rlanvin/php-ip/tree/v2.1.0" "source": "https://github.com/rlanvin/php-ip/tree/v3.0.0-rc1"
}, },
"time": "2020-10-31T12:31:56+00:00" "time": "2021-04-18T09:53:09+00:00"
}, },
{ {
"name": "slim/http", "name": "slim/http",
@ -7493,89 +7486,6 @@
], ],
"time": "2021-01-22T09:19:47+00:00" "time": "2021-01-22T09:19:47+00:00"
}, },
{
"name": "symfony/polyfill-php80",
"version": "v1.22.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91",
"reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.22-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php80\\": ""
},
"files": [
"bootstrap.php"
],
"classmap": [
"Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ion Bazan",
"email": "ion.bazan@gmail.com"
},
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2021-01-07T16:49:33+00:00"
},
{ {
"name": "symfony/process", "name": "symfony/process",
"version": "v5.2.4", "version": "v5.2.4",
@ -12973,13 +12883,21 @@
"time": "2021-03-09T10:59:23+00:00" "time": "2021-03-09T10:59:23+00:00"
} }
], ],
"aliases": [], "aliases": [
{
"package": "lstrojny/fxmlrpc",
"version": "dev-php8",
"alias": "0.13",
"alias_normalized": "0.13.0.0"
}
],
"minimum-stability": "dev", "minimum-stability": "dev",
"stability-flags": { "stability-flags": {
"azuracast/azuraforms": 20, "azuracast/azuraforms": 20,
"azuracast/flysystem-v2-extensions": 20, "azuracast/flysystem-v2-extensions": 20,
"azuracast/nowplaying": 20, "azuracast/nowplaying": 20,
"lstrojny/fxmlrpc": 20, "lstrojny/fxmlrpc": 20,
"rlanvin/php-ip": 20,
"supervisorphp/supervisor": 20, "supervisorphp/supervisor": 20,
"wikimedia/composer-merge-plugin": 20, "wikimedia/composer-merge-plugin": 20,
"roave/security-advisories": 20 "roave/security-advisories": 20
@ -12987,7 +12905,7 @@
"prefer-stable": true, "prefer-stable": true,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": ">=7.4 || ^8.0", "php": "^8.0",
"ext-pdo": "*", "ext-pdo": "*",
"ext-fileinfo": "*", "ext-fileinfo": "*",
"ext-gd": "*", "ext-gd": "*",

View File

@ -2,6 +2,8 @@ version : '2.2'
services : services :
web : web :
build :
context : .
environment : environment :
APPLICATION_ENV : 'testing' APPLICATION_ENV : 'testing'
volumes : volumes :

View File

@ -33,9 +33,8 @@ abstract class AbstractAdminCrudController
* @param ServerRequest $request * @param ServerRequest $request
* @param string|int|null $id * @param string|int|null $id
* *
* @return object|bool|null
*/ */
protected function doEdit(ServerRequest $request, $id = null) protected function doEdit(ServerRequest $request, $id = null): object|bool|null
{ {
$record = $this->getRecord($id); $record = $this->getRecord($id);
return $this->form->process($request, $record); return $this->form->process($request, $record);

View File

@ -45,8 +45,10 @@ class IndexController
$meminfoRaw = explode("\n", file_get_contents("/proc/meminfo")); $meminfoRaw = explode("\n", file_get_contents("/proc/meminfo"));
$meminfo = []; $meminfo = [];
foreach ($meminfoRaw as $line) { foreach ($meminfoRaw as $line) {
[$key, $val] = explode(":", $line); if (str_contains($line, ':')) {
$meminfo[$key] = trim($val); [$key, $val] = explode(":", $line);
$meminfo[$key] = trim($val);
}
} }
$memoryTotal = Quota::convertFromReadableSize($meminfo['MemTotal']) ?? BigInteger::zero(); $memoryTotal = Quota::convertFromReadableSize($meminfo['MemTotal']) ?? BigInteger::zero();

View File

@ -68,9 +68,8 @@ abstract class AbstractApiCrudController
* @param object $record * @param object $record
* @param ServerRequest $request * @param ServerRequest $request
* *
* @return mixed
*/ */
protected function viewRecord($record, ServerRequest $request) protected function viewRecord($record, ServerRequest $request): mixed
{ {
if (!($record instanceof $this->entityClass)) { if (!($record instanceof $this->entityClass)) {
throw new InvalidArgumentException(sprintf('Record must be an instance of %s.', $this->entityClass)); throw new InvalidArgumentException(sprintf('Record must be an instance of %s.', $this->entityClass));
@ -126,9 +125,8 @@ abstract class AbstractApiCrudController
/** /**
* @param object $object * @param object $object
* *
* @return mixed
*/ */
protected function displayShortenedObject($object) protected function displayShortenedObject($object): mixed
{ {
if (method_exists($object, 'getName')) { if (method_exists($object, 'getName')) {
return $object->getName(); return $object->getName();

View File

@ -129,7 +129,7 @@ class StorageLocationsController extends AbstractAdminApiCrudController
} }
/** @inheritDoc */ /** @inheritDoc */
protected function viewRecord($record, ServerRequest $request) protected function viewRecord($record, ServerRequest $request): mixed
{ {
/** @var Entity\StorageLocation $record */ /** @var Entity\StorageLocation $record */
$original = parent::viewRecord($record, $request); $original = parent::viewRecord($record, $request);

View File

@ -97,7 +97,7 @@ class RequestsController
->addOrderBy('sm.title', 'ASC'); ->addOrderBy('sm.title', 'ASC');
} }
$search_phrase = trim($params['searchPhrase']); $search_phrase = trim($params['searchPhrase'] ?? '');
if (!empty($search_phrase)) { if (!empty($search_phrase)) {
$qb->andWhere('(sm.title LIKE :query OR sm.artist LIKE :query OR sm.album LIKE :query)') $qb->andWhere('(sm.title LIKE :query OR sm.artist LIKE :query OR sm.album LIKE :query)')
->setParameter('query', '%' . $search_phrase . '%'); ->setParameter('query', '%' . $search_phrase . '%');

View File

@ -38,9 +38,8 @@ abstract class AbstractStationCrudController
* @param ServerRequest $request * @param ServerRequest $request
* @param string|int|null $id * @param string|int|null $id
* *
* @return object|bool|null
*/ */
protected function doEdit(ServerRequest $request, $id = null) protected function doEdit(ServerRequest $request, $id = null): object|bool|null
{ {
$station = $request->getStation(); $station = $request->getStation();
$this->form->setStation($station); $this->form->setStation($station);

View File

@ -160,7 +160,7 @@ class OverviewController
for ($i = 0; $i < 24; $i++) { for ($i = 0; $i < 24; $i++) {
$hourly_labels[] = $i . ':00'; $hourly_labels[] = $i . ':00';
$totals = $totals_by_hour[$i] ?: [0]; $totals = $totals_by_hour[$i] ?? [0];
$stat_value = round(array_sum($totals) / count($totals), 2); $stat_value = round(array_sum($totals) / count($totals), 2);
$hourly_rows[] = $stat_value; $hourly_rows[] = $stat_value;
@ -197,11 +197,13 @@ class OverviewController
$song_totals = []; $song_totals = [];
foreach ($song_totals_raw as $total_type => $total_records) { foreach ($song_totals_raw as $total_type => $total_records) {
$song_totals[$total_type] = [];
foreach ($total_records as $total_record) { foreach ($total_records as $total_record) {
$song_totals[$total_type][] = $total_record; $song_totals[$total_type][] = $total_record;
} }
$song_totals[$total_type] = array_slice((array)$song_totals[$total_type], 0, 10, true); $song_totals[$total_type] = array_slice($song_totals[$total_type], 0, 10, true);
} }
/* Song "Deltas" (Changes in Listener Count) */ /* Song "Deltas" (Changes in Listener Count) */

View File

@ -33,9 +33,8 @@ class DeferredCallable
} }
/** /**
* @return mixed
*/ */
public function __invoke(...$args) public function __invoke(...$args): mixed
{ {
/** @var callable $callable */ /** @var callable $callable */
$callable = $this->callable; $callable = $this->callable;

View File

@ -145,9 +145,8 @@ final class BatchIteratorAggregate implements IteratorAggregate
/** /**
* @param mixed $value * @param mixed $value
* *
* @return mixed|object
*/ */
private function getObjectFromValue($value) private function getObjectFromValue($value): mixed
{ {
if ($this->customFetchFunction instanceof Closure) { if ($this->customFetchFunction instanceof Closure) {
return ($this->customFetchFunction)($value, $this->entityManager); return ($this->customFetchFunction)($value, $this->entityManager);

View File

@ -134,9 +134,8 @@ class Relay
} }
/** /**
* @return mixed|null
*/ */
public function getNowplaying() public function getNowplaying(): mixed
{ {
return $this->nowplaying; return $this->nowplaying;
} }

View File

@ -69,7 +69,12 @@ class RolePermissionRepository extends Repository
->execute(); ->execute();
foreach ($post_values as $post_key => $post_value) { foreach ($post_values as $post_key => $post_value) {
[$post_key_action, $post_key_id] = explode('_', $post_key); if (str_contains($post_key, '_')) {
[$post_key_action, $post_key_id] = explode('_', $post_key);
} else {
$post_key_action = $post_key;
$post_key_id = null;
}
if ($post_key_action !== 'actions' || empty($post_value)) { if ($post_key_action !== 'actions' || empty($post_value)) {
continue; continue;

View File

@ -67,9 +67,8 @@ class StationRepository extends Repository
} }
/** /**
* @return mixed
*/ */
public function fetchAll() public function fetchAll(): mixed
{ {
return $this->em->createQuery( return $this->em->createQuery(
<<<'DQL' <<<'DQL'

View File

@ -61,9 +61,8 @@ class StationStreamerRepository extends Repository
* @param Entity\Station $station * @param Entity\Station $station
* @param string $username * @param string $username
* *
* @return string|bool
*/ */
public function onConnect(Entity\Station $station, string $username = '') public function onConnect(Entity\Station $station, string $username = ''): string|bool
{ {
// End all current streamer sessions. // End all current streamer sessions.
$this->broadcastRepo->endAllActiveBroadcasts($station); $this->broadcastRepo->endAllActiveBroadcasts($station);

View File

@ -348,9 +348,8 @@ class SongHistory implements SongInterface
} }
/** /**
* @return mixed
*/ */
public function getDeltaPoints() public function getDeltaPoints(): mixed
{ {
return $this->delta_points; return $this->delta_points;
} }

View File

@ -211,9 +211,8 @@ class StationWebhook
* @param string $key * @param string $key
* @param mixed|null $default * @param mixed|null $default
* *
* @return mixed|null
*/ */
public function getMetadataKey(string $key, $default = null) public function getMetadataKey(string $key, $default = null): mixed
{ {
return $this->metadata[$key] ?? $default; return $this->metadata[$key] ?? $default;
} }

View File

@ -426,9 +426,9 @@ class StorageLocation
} }
/** /**
* @return StationMedia[]|Collection * @return Collection|StationMedia[]
*/ */
public function getMedia() public function getMedia(): Collection
{ {
return $this->media; return $this->media;
} }

View File

@ -21,9 +21,8 @@ trait UniqueId
protected $unique_id; protected $unique_id;
/** /**
* @return mixed
*/ */
public function getUniqueId() public function getUniqueId(): mixed
{ {
return $this->unique_id; return $this->unique_id;
} }

View File

@ -42,7 +42,7 @@ abstract class AbstractSettingsForm extends EntityForm
} }
/** @inheritDoc */ /** @inheritDoc */
public function process(ServerRequest $request, $record = null) public function process(ServerRequest $request, $record = null): object|bool
{ {
if (null === $record) { if (null === $record) {
$record = $this->settingsRepo->readSettings(); $record = $this->settingsRepo->readSettings();

View File

@ -82,7 +82,7 @@ class EntityForm extends Form
* *
* @return object|bool The modified object if edited/created, or `false` if not processed. * @return object|bool The modified object if edited/created, or `false` if not processed.
*/ */
public function process(ServerRequest $request, $record = null) public function process(ServerRequest $request, $record = null): object|bool
{ {
if (!isset($this->entityClass)) { if (!isset($this->entityClass)) {
throw new Exception('Entity class name is not specified.'); throw new Exception('Entity class name is not specified.');
@ -169,9 +169,8 @@ class EntityForm extends Form
/** /**
* @param object $object * @param object $object
* *
* @return mixed
*/ */
protected function displayShortenedObject($object) protected function displayShortenedObject($object): mixed
{ {
if (method_exists($object, 'getName')) { if (method_exists($object, 'getName')) {
return $object->getName(); return $object->getName();

View File

@ -27,9 +27,8 @@ class PlaylistTime extends Time
} }
/** /**
* @return string|int
*/ */
public function getValue() public function getValue(): string|int
{ {
if (empty($this->value)) { if (empty($this->value)) {
return ''; return '';

View File

@ -39,7 +39,7 @@ class PermissionsForm extends EntityForm
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function process(ServerRequest $request, $record = null) public function process(ServerRequest $request, $record = null): object|bool
{ {
if ($record instanceof Entity\Role && Entity\Role::SUPER_ADMINISTRATOR_ROLE_ID === $record->getId()) { if ($record instanceof Entity\Role && Entity\Role::SUPER_ADMINISTRATOR_ROLE_ID === $record->getId()) {
$this->set_permissions = false; $this->set_permissions = false;

View File

@ -34,7 +34,7 @@ class SettingsForm extends AbstractSettingsForm
} }
/** @inheritDoc */ /** @inheritDoc */
public function process(ServerRequest $request, $record = null) public function process(ServerRequest $request, $record = null): object|bool
{ {
if ('https' !== $request->getUri()->getScheme()) { if ('https' !== $request->getUri()->getScheme()) {
$alwaysUseSsl = $this->getField('always_use_ssl'); $alwaysUseSsl = $this->getField('always_use_ssl');

View File

@ -57,7 +57,7 @@ class StationCloneForm extends StationForm
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function process(ServerRequest $request, $record = null) public function process(ServerRequest $request, $record = null): object|bool
{ {
if (!$record instanceof Entity\Station) { if (!$record instanceof Entity\Station) {
throw new InvalidArgumentException('Record must be a station.'); throw new InvalidArgumentException('Record must be a station.');

View File

@ -76,7 +76,7 @@ class StationForm extends EntityForm
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function process(ServerRequest $request, $record = null) public function process(ServerRequest $request, $record = null): object|bool
{ {
// Check for administrative permissions and hide admin fields otherwise. // Check for administrative permissions and hide admin fields otherwise.
$acl = $request->getAcl(); $acl = $request->getAcl();

View File

@ -35,7 +35,7 @@ class StationMountForm extends EntityForm
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function process(ServerRequest $request, $record = null) public function process(ServerRequest $request, $record = null): object|bool
{ {
$record = parent::process($request, $record); $record = parent::process($request, $record);

View File

@ -65,7 +65,7 @@ class StationWebhookForm extends EntityForm
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function process(ServerRequest $request, $record = null) public function process(ServerRequest $request, $record = null): object|bool
{ {
if (!$record instanceof Entity\StationWebhook) { if (!$record instanceof Entity\StationWebhook) {
throw new InvalidArgumentException( throw new InvalidArgumentException(

View File

@ -30,7 +30,7 @@ class UserForm extends EntityForm
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function process(ServerRequest $request, $record = null) public function process(ServerRequest $request, $record = null): object|bool
{ {
// Check for administrative permissions and hide admin fields otherwise. // Check for administrative permissions and hide admin fields otherwise.
$user = $request->getUser(); $user = $request->getUser();

View File

@ -34,7 +34,7 @@ class UserProfileForm extends EntityForm
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function process(ServerRequest $request, $record = null) public function process(ServerRequest $request, $record = null): object|bool
{ {
$user = $request->getUser(); $user = $request->getUser();

View File

@ -21,7 +21,7 @@ final class Response extends \Slim\Http\Response
* Send headers that expire the content immediately and prevent caching. * Send headers that expire the content immediately and prevent caching.
* @return static * @return static
*/ */
public function withNoCache() public function withNoCache(): static
{ {
$response = $this->response $response = $this->response
->withHeader('Pragma', 'no-cache') ->withHeader('Pragma', 'no-cache')
@ -39,7 +39,7 @@ final class Response extends \Slim\Http\Response
* *
* @return static * @return static
*/ */
public function withCacheLifetime(int $seconds = self::CACHE_ONE_MONTH) public function withCacheLifetime(int $seconds = self::CACHE_ONE_MONTH): static
{ {
$response = $this->response $response = $this->response
->withHeader('Pragma', '') ->withHeader('Pragma', '')
@ -86,7 +86,7 @@ final class Response extends \Slim\Http\Response
* *
* @return static * @return static
*/ */
public function renderFile($file_path, $file_name = null) public function renderFile($file_path, $file_name = null): static
{ {
set_time_limit(600); set_time_limit(600);
@ -117,7 +117,7 @@ final class Response extends \Slim\Http\Response
* *
* @return static * @return static
*/ */
public function renderStringAsFile($file_data, $content_type, $file_name = null) public function renderStringAsFile($file_data, $content_type, $file_name = null): static
{ {
$response = $this->response $response = $this->response
->withHeader('Pragma', 'public') ->withHeader('Pragma', 'public')
@ -147,7 +147,7 @@ final class Response extends \Slim\Http\Response
StreamInterface $fileStream, StreamInterface $fileStream,
string $contentType, string $contentType,
?string $fileName = null ?string $fileName = null
) { ): static {
set_time_limit(600); set_time_limit(600);
$response = $this->response $response = $this->response

View File

@ -124,10 +124,9 @@ final class ServerRequest extends \Slim\Http\ServerRequest
* @param string $attr * @param string $attr
* @param string $class_name * @param string $class_name
* *
* @return mixed
* @throws Exception\InvalidRequestAttribute * @throws Exception\InvalidRequestAttribute
*/ */
protected function getAttributeOfClass($attr, $class_name) protected function getAttributeOfClass($attr, $class_name): mixed
{ {
$object = $this->serverRequest->getAttribute($attr); $object = $this->serverRequest->getAttribute($attr);

View File

@ -94,9 +94,8 @@ class DoctrineEntityNormalizer extends AbstractNormalizer
* @param string|null $format * @param string|null $format
* @param array $context * @param array $context
* *
* @return mixed
*/ */
public function normalize($object, string $format = null, array $context = []) public function normalize($object, string $format = null, array $context = []): mixed
{ {
if ($this->isCircularReference($object, $context)) { if ($this->isCircularReference($object, $context)) {
return $this->handleCircularReference($object, $format, $context); return $this->handleCircularReference($object, $format, $context);
@ -214,7 +213,7 @@ class DoctrineEntityNormalizer extends AbstractNormalizer
* *
* @return bool|string[]|AttributeMetadataInterface[] * @return bool|string[]|AttributeMetadataInterface[]
*/ */
protected function getAllowedAttributes($classOrObject, array $context, $attributesAsString = false) protected function getAllowedAttributes($classOrObject, array $context, $attributesAsString = false): bool|array
{ {
$meta = $this->classMetadataFactory->getMetadataFor($classOrObject)->getAttributesMetadata(); $meta = $this->classMetadataFactory->getMetadataFor($classOrObject)->getAttributesMetadata();
@ -251,9 +250,8 @@ class DoctrineEntityNormalizer extends AbstractNormalizer
* @param null $format * @param null $format
* @param array $context * @param array $context
* *
* @return mixed
*/ */
protected function getAttributeValue($object, $prop_name, $format = null, array $context = []) protected function getAttributeValue($object, $prop_name, $format = null, array $context = []): mixed
{ {
$form_mode = $context[self::NORMALIZE_TO_IDENTIFIERS] ?? false; $form_mode = $context[self::NORMALIZE_TO_IDENTIFIERS] ?? false;
@ -310,9 +308,8 @@ class DoctrineEntityNormalizer extends AbstractNormalizer
* @param object $entity * @param object $entity
* @param string $key * @param string $key
* *
* @return mixed|null
*/ */
protected function getProperty($entity, $key) protected function getProperty($entity, $key): mixed
{ {
// Default to "getStatus", "getConfig", etc... // Default to "getStatus", "getConfig", etc...
$getter_method = $this->getMethodName($key, 'get'); $getter_method = $this->getMethodName($key, 'get');
@ -385,9 +382,8 @@ class DoctrineEntityNormalizer extends AbstractNormalizer
* @param string $key * @param string $key
* @param mixed $value * @param mixed $value
* *
* @return mixed|null
*/ */
protected function setProperty($entity, $key, $value) protected function setProperty($entity, $key, $value): mixed
{ {
$method_name = $this->getMethodName($key, 'set'); $method_name = $this->getMethodName($key, 'set');

View File

@ -185,7 +185,7 @@ abstract class AbstractFrontend extends AbstractAdapter
* *
* @return mixed[]|bool * @return mixed[]|bool
*/ */
protected function processCustomConfig(?string $custom_config_raw) protected function processCustomConfig(?string $custom_config_raw): array|bool
{ {
$custom_config = []; $custom_config = [];

View File

@ -53,7 +53,7 @@ class Flow
ServerRequest $request, ServerRequest $request,
Response $response, Response $response,
string $temp_dir = null string $temp_dir = null
) { ): array|ResponseInterface|null {
if (null === $temp_dir) { if (null === $temp_dir) {
$temp_dir = sys_get_temp_dir() . '/uploads/'; $temp_dir = sys_get_temp_dir() . '/uploads/';
} }

View File

@ -10,7 +10,7 @@ trait AvailableStaticallyTrait
/** /**
* @return static * @return static
*/ */
public static function getInstance() public static function getInstance(): static
{ {
return self::$instance; return self::$instance;
} }

View File

@ -34,9 +34,8 @@ class Xml
* *
* @param array $array * @param array $array
* *
* @return mixed
*/ */
public static function arrayToXml($array) public static function arrayToXml($array): mixed
{ {
$xml_info = new SimpleXMLElement('<?xml version="1.0"?><return></return>'); $xml_info = new SimpleXMLElement('<?xml version="1.0"?><return></return>');
self::arrToXml($array, $xml_info); self::arrToXml($array, $xml_info);

View File

@ -25,7 +25,7 @@ $assets
</div> </div>
<div class="list-group list-group-flush"> <div class="list-group list-group-flush">
<?php foreach ($category['items'] as $item): ?> <?php foreach ($category['items'] as $item): ?>
<a class="list-group-item list-group-item-action" href="<?=$item['url']?>" title="<?=$item['title']?>"> <a class="list-group-item list-group-item-action" href="<?=$item['url']?>" title="<?=($item['title'] ?? '')?>">
<?=$item['label']?> <?=$item['label']?>
</a> </a>
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -46,6 +46,7 @@ $page_class .= ' theme-' . $customization->getPublicTheme();
<?=$this->section('content')?> <?=$this->section('content')?>
<?php <?php
$hide_footer ??= false;
if (!$customization->hideProductName() && !$hide_footer): ?> if (!$customization->hideProductName() && !$hide_footer): ?>
<footer id="footer" class="footer-alt" role="contentinfo"> <footer id="footer" class="footer-alt" role="contentinfo">
<?=sprintf( <?=sprintf(

View File

@ -1,4 +1,5 @@
<?php <?php
/** @var \App\Assets $assets */ /** @var \App\Assets $assets */
$assets->addInlineJs($this->fetch('partials/sidebar_menu.js'), 99); $assets->addInlineJs($this->fetch('partials/sidebar_menu.js'), 99);
@ -7,11 +8,14 @@ $assets->addInlineJs($this->fetch('partials/sidebar_menu.js'), 99);
* @var string $active * @var string $active
* @var \App\Http\Router $router * @var \App\Http\Router $router
*/ */
$active ??= null;
?> ?>
<ul class="navdrawer-nav"> <ul class="navdrawer-nav">
<?php foreach ($menu as $category_id => $category): ?> <?php
foreach ($menu as $category_id => $category): ?>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link <?=$category['class']?> <?php <a class="nav-link <?=($category['class'] ?? '')?> <?php
if ($active === $category_id): ?>active<?php if ($active === $category_id): ?>active<?php
endif; ?>" endif; ?>"
<?php <?php
@ -19,7 +23,7 @@ $assets->addInlineJs($this->fetch('partials/sidebar_menu.js'), 99);
else: ?>data-toggle="collapse" href="#sidebar-submenu-<?=$category_id?>"<?php else: ?>data-toggle="collapse" href="#sidebar-submenu-<?=$category_id?>"<?php
endif; ?> endif; ?>
<?php <?php
if ($category['external']): ?>target="_blank"<?php if ($category['external'] ?? false): ?>target="_blank"<?php
endif; ?> endif; ?>
<?php <?php
if (isset($category['confirm'])): ?>data-confirm-title="<?=$this->e($category['confirm'])?>"<?php if (isset($category['confirm'])): ?>data-confirm-title="<?=$this->e($category['confirm'])?>"<?php
@ -30,7 +34,7 @@ $assets->addInlineJs($this->fetch('partials/sidebar_menu.js'), 99);
<i class="navdrawer-nav-icon material-icons" aria-hidden="true"><?=$category['icon']?></i> <i class="navdrawer-nav-icon material-icons" aria-hidden="true"><?=$category['icon']?></i>
<?=$category['label']?> <?=$category['label']?>
<?php <?php
if ($category['external']): ?> if ($category['external'] ?? false): ?>
<i class="material-icons sm">open_in_new</i> <i class="material-icons sm">open_in_new</i>
<?php <?php
endif; ?> endif; ?>
@ -42,11 +46,19 @@ $assets->addInlineJs($this->fetch('partials/sidebar_menu.js'), 99);
<?php <?php
foreach ($category['items'] as $item_id => $item): ?> foreach ($category['items'] as $item_id => $item): ?>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link pl-4 py-2 text-muted <?=$item['class']?>" <a class="nav-link pl-4 py-2 text-muted <?=($item['class'] ?? '')?>"
href="<?=$item['url']?>" href="<?=$item['url']?>"
<?php if ($item['external']): ?>target="_blank"<?php endif; ?> <?php
<?php if (isset($item['confirm'])): ?>data-confirm-title="<?=$this->e($item['confirm'])?>"<?php endif; ?> if ($item['external'] ?? false): ?>target="_blank"<?php
<?php if (isset($item['title'])): ?>title="<?=$this->e($item['title'])?>"<?php endif; ?>> endif; ?>
<?php
if (isset($item['confirm'])): ?>data-confirm-title="<?=$this->e(
$item['confirm']
)?>"<?php
endif; ?>
<?php
if (isset($item['title'])): ?>title="<?=$this->e($item['title'])?>"<?php
endif; ?>>
<?=$item['label']?> <?=$item['label']?>
</a> </a>
</li> </li>

View File

@ -8,4 +8,11 @@
$assets->addInlineJs($this->fetch('partials/station_form.js'), 99); $assets->addInlineJs($this->fetch('partials/station_form.js'), 99);
echo $this->fetch('system/form_page', ['title' => $title, 'header' => $header, 'form' => $form]); echo $this->fetch(
'system/form_page',
[
'title' => $title ?? null,
'header' => $header ?? null,
'form' => $form,
]
);

View File

@ -4,8 +4,8 @@ $assets
->addInlineJs($this->fetch('stations/mounts/edit.js'), 99); ->addInlineJs($this->fetch('stations/mounts/edit.js'), 99);
echo $this->fetch('system/form_page', [ echo $this->fetch('system/form_page', [
'title' => $title, 'title' => $title ?? null,
'header' => $header, 'header' => $header ?? null,
'form' => $form, 'form' => $form,
'render_mode' => 'edit' 'render_mode' => 'edit',
]); ]);

View File

@ -4,8 +4,8 @@ $assets
->addInlineJs($this->fetch('stations/remotes/edit.js'), 99); ->addInlineJs($this->fetch('stations/remotes/edit.js'), 99);
echo $this->fetch('system/form_page', [ echo $this->fetch('system/form_page', [
'title' => $title, 'title' => $title ?? null,
'header' => $header, 'header' => $header ?? null,
'form' => $form, 'form' => $form,
'render_mode' => 'edit' 'render_mode' => 'edit',
]); ]);

View File

@ -9,8 +9,8 @@
*/ */
$this->layout('main', [ $this->layout('main', [
'title' => $title, 'title' => $title ?? null,
'header' => $header, 'header' => $header ?? null,
'manual' => true, 'manual' => true,
]); ]);

View File

@ -28,7 +28,7 @@
- name: Install Composer Dependencies (Development) - name: Install Composer Dependencies (Development)
become: true become: true
become_user: azuracast become_user: azuracast
shell: composer install shell : composer install --ignore-platform-req=php
args: args:
chdir: "{{ www_base }}" chdir: "{{ www_base }}"
when: app_env == "development" when: app_env == "development"
@ -36,7 +36,7 @@
- name: Install Composer Dependencies (Production) - name: Install Composer Dependencies (Production)
become: true become: true
become_user: azuracast become_user: azuracast
shell: composer install --no-dev --optimize-autoloader shell : composer install --ignore-platform-req=php --no-dev --optimize-autoloader
args: args:
chdir: "{{ www_base }}" chdir: "{{ www_base }}"
when: app_env == "production" when: app_env == "production"

View File

@ -44,33 +44,46 @@
- php7.2-mbstring - php7.2-mbstring
- php7.2-intl - php7.2-intl
- php7.2-redis - php7.2-redis
- name: Install PHP 7.4
apt:
name: "{{ packages }}"
state: latest
vars:
packages:
- php7.4-fpm - php7.4-fpm
- php7.4-cli - php7.4-cli
- php7.4-gd - php7.4-gd
- php7.4-curl - php7.4-curl
- php7.4-xml # IceCast XML config - php7.4-xml
- php7.4-zip # Composer installs - php7.4-zip
- php7.4-mysqlnd # MySQL Native Driver (Doctrine) - php7.4-mysqlnd
- php7.4-mbstring # Codeception Tests - php7.4-mbstring
- php7.4-intl # Localization - php7.4-intl
- php7.4-redis # Cache - php7.4-redis
- php7.4-bcmath # BigInteger - php7.4-bcmath
- php7.4-gmp # BigInteger and PHP-IP - php7.4-gmp
- php7.4-maxminddb # Maxmind (GeoIP) DB native ext - php7.4-maxminddb
- name : Install PHP 8.0
apt :
name : "{{ packages }}"
state : latest
vars :
packages :
- php8.0-fpm
- php8.0-cli
- php8.0-gd
- php8.0-curl
- php8.0-xml # IceCast XML config
- php8.0-zip # Composer installs
- php8.0-mysqlnd # MySQL Native Driver (Doctrine)
- php8.0-mbstring # Codeception Tests
- php8.0-intl # Localization
- php8.0-redis # Cache
- php8.0-bcmath # BigInteger
- php8.0-gmp # BigInteger and PHP-IP
- php8.0-maxminddb # Maxmind (GeoIP) DB native ext
- name: Configure PHP FPM Pool - name: Configure PHP FPM Pool
template: src=fpmpool.j2 dest=/etc/php/7.4/fpm/pool.d/www.conf force=true template : src=fpmpool.j2 dest=/etc/php/8.0/fpm/pool.d/www.conf force=true
- name: Configure php-fpm php.ini - name: Configure php-fpm php.ini
ini_file: ini_file:
dest: /etc/php/7.4/fpm/php.ini dest : /etc/php/8.0/fpm/php.ini
section: PHP section: PHP
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"
@ -81,7 +94,7 @@
- name: Configure php-cli php.ini - name: Configure php-cli php.ini
ini_file: ini_file:
dest: /etc/php/7.4/cli/php.ini dest : /etc/php/8.0/cli/php.ini
section: PHP section: PHP
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View File

@ -1,4 +1,4 @@
export LC_ALL=C export LC_ALL=C
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
minimal_apt_get_install='apt-get install -y --no-install-recommends' minimal_apt_get_install='apt-get install -y --no-install-recommends'

View File

@ -1,3 +1,5 @@
#!/bin/bash #!/bin/bash
/usr/sbin/php-fpm7.4 -F --fpm-config /etc/php/7.4/fpm/php-fpm.conf -c /etc/php/7.4/fpm/ source /etc/php/.version
/usr/sbin/php-fpm${PHP_VERSION} -F --fpm-config /etc/php/${PHP_VERSION}/fpm/php-fpm.conf -c /etc/php/${PHP_VERSION}/fpm/

View File

@ -3,27 +3,31 @@ set -e
source /bd_build/buildconfig source /bd_build/buildconfig
set -x set -x
PHP_VERSION=8.0
add-apt-repository -y ppa:ondrej/php add-apt-repository -y ppa:ondrej/php
apt-get update apt-get update
$minimal_apt_get_install php7.4-fpm php7.4-cli php7.4-gd \ $minimal_apt_get_install php${PHP_VERSION}-fpm php${PHP_VERSION}-cli php${PHP_VERSION}-gd \
php7.4-curl php7.4-xml php7.4-zip php7.4-bcmath php7.4-gmp \ php${PHP_VERSION}-curl php${PHP_VERSION}-xml php${PHP_VERSION}-zip php${PHP_VERSION}-bcmath \
php7.4-mysqlnd php7.4-mbstring php7.4-intl php7.4-redis \ php${PHP_VERSION}-gmp php${PHP_VERSION}-mysqlnd php${PHP_VERSION}-mbstring php${PHP_VERSION}-intl \
php7.4-maxminddb php7.4-xdebug \ php${PHP_VERSION}-redis php${PHP_VERSION}-maxminddb php${PHP_VERSION}-xdebug \
mariadb-client mariadb-client
# Copy PHP configuration # Copy PHP configuration
mkdir -p /run/php mkdir -p /run/php
touch /run/php/php7.4-fpm.pid touch /run/php/php${PHP_VERSION}-fpm.pid
cp /bd_build/php/php.ini.tmpl /etc/php/7.4/fpm/05-azuracast.ini.tmpl echo "PHP_VERSION=${PHP_VERSION}" >>/etc/php/.version
cp /bd_build/php/www.conf.tmpl /etc/php/7.4/fpm/www.conf.tmpl
cp /bd_build/php/php.ini.tmpl /etc/php/${PHP_VERSION}/fpm/05-azuracast.ini.tmpl
cp /bd_build/php/www.conf.tmpl /etc/php/${PHP_VERSION}/fpm/www.conf.tmpl
# Install Composer # Install Composer
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
# Install PHP SPX profiler # Install PHP SPX profiler
$minimal_apt_get_install php7.4-dev zlib1g-dev build-essential $minimal_apt_get_install php${PHP_VERSION}-dev zlib1g-dev build-essential
cd /bd_build cd /bd_build
git clone https://github.com/NoiseByNorthwest/php-spx.git git clone https://github.com/NoiseByNorthwest/php-spx.git
@ -33,7 +37,7 @@ phpize
make make
sudo make install sudo make install
apt-get remove --purge -y php7.4-dev zlib1g-dev build-essential apt-get remove --purge -y php${PHP_VERSION}-dev zlib1g-dev build-essential
echo "extension=spx.so" > /etc/php/7.4/cli/conf.d/30-spx.ini echo "extension=spx.so" >/etc/php/${PHP_VERSION}/cli/conf.d/30-spx.ini
echo "extension=spx.so" > /etc/php/7.4/fpm/conf.d/30-spx.ini echo "extension=spx.so" >/etc/php/${PHP_VERSION}/fpm/conf.d/30-spx.ini

View File

@ -1,4 +1,8 @@
#!/bin/bash #!/bin/bash
# Copy the php.ini template to its destination. # Copy the php.ini template to its destination.
dockerize -template "/etc/php/7.4/fpm/05-azuracast.ini.tmpl:/etc/php/7.4/fpm/conf.d/05-azuracast.ini" -template "/etc/php/7.4/fpm/www.conf.tmpl:/etc/php/7.4/fpm/pool.d/www.conf" cp /etc/php/7.4/fpm/conf.d/05-azuracast.ini /etc/php/7.4/cli/conf.d/05-azuracast.ini source /etc/php/.version
dockerize -template "/etc/php/${PHP_VERSION}/fpm/05-azuracast.ini.tmpl:/etc/php/${PHP_VERSION}/fpm/conf.d/05-azuracast.ini" \
-template "/etc/php/${PHP_VERSION}/fpm/www.conf.tmpl:/etc/php/${PHP_VERSION}/fpm/pool.d/www.conf" \
cp /etc/php/${PHP_VERSION}/fpm/conf.d/05-azuracast.ini /etc/php/${PHP_VERSION}/cli/conf.d/05-azuracast.ini