Skip to content

Commit

Permalink
Merge pull request #378 from phpdocker-io/php84
Browse files Browse the repository at this point in the history
PHP 8.4
  • Loading branch information
luispabon authored Nov 22, 2024
2 parents 90201e1 + 6b4999f commit e51338c
Show file tree
Hide file tree
Showing 9 changed files with 159 additions and 1 deletion.
6 changes: 5 additions & 1 deletion public/js/main-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function doMainFormMagic () {
phpVersionSelector.on('change', function () {
extensionMultiSelects.parents('.form-group').hide()

let chosenVersion = '83'
let chosenVersion = '84'
switch ($(this).val()) {
case '8.1':
chosenVersion = '81'
Expand All @@ -111,6 +111,10 @@ function doMainFormMagic () {
case '8.2':
chosenVersion = '82'
break

case '8.3':
chosenVersion = '83'
break
}

extensionMultiSelects.filter('[id$=' + chosenVersion + ']').parents('.form-group').show()
Expand Down
1 change: 1 addition & 0 deletions src/Controller/GeneratorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ private function hydrateProject(array $formData): Project
PhpOptions::PHP_VERSION_81 => $phpData['phpExtensions81'],
PhpOptions::PHP_VERSION_82 => $phpData['phpExtensions82'],
PhpOptions::PHP_VERSION_83 => $phpData['phpExtensions83'],
PhpOptions::PHP_VERSION_84 => $phpData['phpExtensions84'],
default => throw new InvalidArgumentException(sprintf('Unsupported php version %s', $phpData['version'])),
};

Expand Down
8 changes: 8 additions & 0 deletions src/Form/Generator/PhpType.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use App\PHPDocker\PhpExtension\Php81AvailableExtensions;
use App\PHPDocker\PhpExtension\Php82AvailableExtensions;
use App\PHPDocker\PhpExtension\Php83AvailableExtensions;
use App\PHPDocker\PhpExtension\Php84AvailableExtensions;
use App\PHPDocker\PhpExtension\PhpExtension;
use App\PHPDocker\Project\ServiceOptions\Php;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
Expand Down Expand Up @@ -96,6 +97,13 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
'label' => 'Extensions (PHP 8.3)',
'required' => false,
'constraints' => $phpOptionsConstraints,
])
->add('phpExtensions84', ChoiceType::class, [
'choices' => $this->getExtensionChoices((new Php84AvailableExtensions())->getOptional()),
'multiple' => true,
'label' => 'Extensions (PHP 8.4)',
'required' => false,
'constraints' => $phpOptionsConstraints,
]);
}

Expand Down
2 changes: 2 additions & 0 deletions src/PHPDocker/PhpExtension/AvailableExtensionsFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class AvailableExtensionsFactory
private const string PHP_VERSION_81 = '8.1';
private const string PHP_VERSION_82 = '8.2';
private const string PHP_VERSION_83 = '8.3';
private const string PHP_VERSION_84 = '8.4';

/**
* Supported PHP versions
Expand All @@ -37,6 +38,7 @@ class AvailableExtensionsFactory
self::PHP_VERSION_81 => Php81AvailableExtensions::class,
self::PHP_VERSION_82 => Php82AvailableExtensions::class,
self::PHP_VERSION_83 => Php83AvailableExtensions::class,
self::PHP_VERSION_84 => Php84AvailableExtensions::class,
];

/**
Expand Down
9 changes: 9 additions & 0 deletions src/PHPDocker/PhpExtension/Php82AvailableExtensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,16 @@ protected function getOptionalExtensionsMap(): array
'MySQL' => ['packages' => ['php8.2-mysql']],
'OAuth' => ['packages' => ['php8.2-oauth']],
'ODBC' => ['packages' => ['php8.2-odbc']],
'OpenTelemetry' => ['packages' => ['php8.2-opentelemetry']],
'Pcov' => ['packages' => ['php8.2-pcov']],
'PostgreSQL' => ['packages' => ['php8.2-pgsql']],
'PostgreSQL (libpq)' => ['packages' => ['php8.2-pq']],
'Phalcon 5' => ['packages' => ['php8.2-phalcon']],
'Pinba' => ['packages' => ['php8.2-pinba']],
'PHPDBG' => ['packages' => ['php8.2-phpdbg']],
'propro' => ['packages' => ['php8.2-propro']],
'Protobuf' => ['packages' => ['php8.2-protobuf']],
'ps' => ['packages' => ['php8.2-ps']],
'pspell' => ['packages' => ['php8.2-pspell']],
'PSR' => ['packages' => ['php8.2-psr']],
'raphf' => ['packages' => ['php8.2-raphf']],
Expand All @@ -93,9 +99,12 @@ protected function getOptionalExtensionsMap(): array
'Solr' => ['packages' => ['php8.2-solr']],
'SQLite3' => ['packages' => ['php8.2-sqlite3']],
'ssh2' => ['packages' => ['php8.2-ssh2']],
'STOMP protocol' => ['packages' => ['php8.2-stomp']],
'Swoole' => ['packages' => ['php8.2-swoole']],
'Sybase' => ['packages' => ['php8.2-sybase']],
'Tidy' => ['packages' => ['php8.2-tidy']],
'UOPZ' => ['packages' => ['php8.2-uopz']],
'Upload progress' => ['packages' => ['php8.2-uploadprogress']],
'UUID' => ['packages' => ['php8.2-uuid']],
'vips' => ['packages' => ['php8.2-vips']],
'Xdebug' => ['packages' => ['php8.2-xdebug']],
Expand Down
8 changes: 8 additions & 0 deletions src/PHPDocker/PhpExtension/Php83AvailableExtensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,15 @@ protected function getOptionalExtensionsMap(): array
'MySQL' => ['packages' => ['php8.3-mysql']],
'OAuth' => ['packages' => ['php8.3-oauth']],
'ODBC' => ['packages' => ['php8.3-odbc']],
'OpenTelemetry' => ['packages' => ['php8.3-opentelemetry']],
'Pcov' => ['packages' => ['php8.3-pcov']],
'PostgreSQL' => ['packages' => ['php8.3-pgsql']],
'PostgreSQL (libpq)' => ['packages' => ['php8.3-pq']],
'Phalcon 5' => ['packages' => ['php8.3-phalcon']],
'Pinba' => ['packages' => ['php8.3-pinba']],
'PHPDBG' => ['packages' => ['php8.3-phpdbg']],
'Protobuf' => ['packages' => ['php8.3-protobuf']],
'ps' => ['packages' => ['php8.3-ps']],
'pspell' => ['packages' => ['php8.3-pspell']],
'PSR' => ['packages' => ['php8.3-psr']],
'raphf' => ['packages' => ['php8.3-raphf']],
Expand All @@ -93,9 +98,12 @@ protected function getOptionalExtensionsMap(): array
'Solr' => ['packages' => ['php8.3-solr']],
'SQLite3' => ['packages' => ['php8.3-sqlite3']],
'ssh2' => ['packages' => ['php8.3-ssh2']],
'STOMP protocol' => ['packages' => ['php8.3-stomp']],
'Swoole' => ['packages' => ['php8.3-swoole']],
'Sybase' => ['packages' => ['php8.3-sybase']],
'Tidy' => ['packages' => ['php8.3-tidy']],
'UOPZ' => ['packages' => ['php8.3-uopz']],
'Upload progress' => ['packages' => ['php8.3-uploadprogress']],
'UUID' => ['packages' => ['php8.3-uuid']],
'vips' => ['packages' => ['php8.3-vips']],
'Xdebug' => ['packages' => ['php8.3-xdebug']],
Expand Down
122 changes: 122 additions & 0 deletions src/PHPDocker/PhpExtension/Php84AvailableExtensions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?php
declare(strict_types=1);
/**
* Copyright 2023 Luis Alberto Pabón Flores
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

namespace App\PHPDocker\PhpExtension;

class Php84AvailableExtensions extends BaseAvailableExtensions
{
/**
* @inheritDoc
* @return array<string, array<string, string[]>>
*/
protected function getMandatoryExtensionsMap(): array
{
return [
'cURL' => ['packages' => ['php8.4-curl']],
'MBSTRING' => ['packages' => ['php8.4-mbstring']],
'OPCache' => ['packages' => ['php8.4-opcache']],
'Readline' => ['packages' => ['php8.4-readline']],
'XML' => ['packages' => ['php8.4-xml']],
'Zip' => ['packages' => ['php8.4-zip']],
];
}

/**
* @inheritDoc
* @return array<string, array<string, string[]>>
*/
protected function getOptionalExtensionsMap(): array
{
return [
// 'Decimal' => ['packages' => ['php8.4-decimal']],
// 'GRPC' => ['packages' => ['php8.4-grpc']],
// 'Inotify' => ['packages' => ['php8.4-inotify']],
// 'LZ4' => ['packages' => ['php8.4-lz4']],
// 'Protobuf' => ['packages' => ['php8.4-protobuf']],
// 'Pinba' => ['packages' => ['php8.4-pinba']],
// 'Samba Client' => ['packages' => ['php8.4-smbclient']],
// 'Solr' => ['packages' => ['php8.4-solr']],
// 'Swoole' => ['packages' => ['php8.4-swoole']],
// 'vips' => ['packages' => ['php8.4-vips']],
// 'Xhprof' => ['packages' => ['php8.4-xhprof']],
// 'zstd (Zstandard)' => ['packages' => ['php8.4-zstd']],

'AMQP' => ['packages' => ['php8.4-amqp']],
'AST' => ['packages' => ['php8.4-ast']],
'Bcmath' => ['packages' => ['php8.4-bcmath']],
'bzip2' => ['packages' => ['php8.4-bz2']],
'CGI' => ['packages' => ['php8.4-cgi']],
'DBA' => ['packages' => ['php8.4-dba']],
'DS (Data Structures)' => ['packages' => ['php8.4-ds']],
'Enchant' => ['packages' => ['php8.4-enchant']],
'Excimer' => ['packages' => ['php8.4-excimer']],
'GD' => ['packages' => ['php8.4-gd']],
'Gearman' => ['packages' => ['php8.4-gearman']],
'Gmagick (GraphicsMagick)' => ['packages' => ['php8.4-gmagick']],
'GMP' => ['packages' => ['php8.4-gmp']],
'GNUPG' => ['packages' => ['php8.4-gnupg']],
'HTTP' => ['packages' => ['php8.4-http']],
'igbinary' => ['packages' => ['php8.4-igbinary']],
'ImageMagick' => ['packages' => ['php8.4-imagick']],
'IMAP' => ['packages' => ['php8.4-imap']],
'Interbase' => ['packages' => ['php8.4-interbase']],
'Intl (Internationalisation)' => ['packages' => ['php8.4-intl']],
'LDAP' => ['packages' => ['php8.4-ldap']],
'Libvirt' => ['packages' => ['php8.4-libvirt-php']],
'Mailparse' => ['packages' => ['php8.4-mailparse']],
'MaxMind DB' => ['packages' => ['php8.4-maxminddb']],
'mcrypt' => ['packages' => ['php8.4-mcrypt']],
'Memcache' => ['packages' => ['php8.4-memcache']],
'Memcached' => ['packages' => ['php8.4-memcached']],
'MongoDB' => ['packages' => ['php8.4-mongodb']],
'MessagePack' => ['packages' => ['php8.4-msgpack']],
'MySQL' => ['packages' => ['php8.4-mysql']],
'OAuth' => ['packages' => ['php8.4-oauth']],
'ODBC' => ['packages' => ['php8.4-odbc']],
'OpenTelemetry' => ['packages' => ['php8.4-opentelemetry']],
'Pcov' => ['packages' => ['php8.4-pcov']],
'PostgreSQL' => ['packages' => ['php8.4-pgsql']],
'PostgreSQL (libpq)' => ['packages' => ['php8.4-pq']],
'Phalcon 5' => ['packages' => ['php8.4-phalcon']],
'PHPDBG' => ['packages' => ['php8.4-phpdbg']],
'ps' => ['packages' => ['php8.4-ps']],
'pspell' => ['packages' => ['php8.4-pspell']],
'PSR' => ['packages' => ['php8.4-psr']],
'raphf' => ['packages' => ['php8.4-raphf']],
'Redis' => ['packages' => ['php8.4-redis']],
'rrd' => ['packages' => ['php8.4-rrd']],
'SNMP' => ['packages' => ['php8.4-snmp']],
'SOAP' => ['packages' => ['php8.4-soap']],
'SQLite3' => ['packages' => ['php8.4-sqlite3']],
'ssh2' => ['packages' => ['php8.4-ssh2']],
'STOMP protocol' => ['packages' => ['php8.4-stomp']],
'Sybase' => ['packages' => ['php8.4-sybase']],
'Tidy' => ['packages' => ['php8.4-tidy']],
'UOPZ' => ['packages' => ['php8.4-uopz']],
'Upload progress' => ['packages' => ['php8.4-uploadprogress']],
'UUID' => ['packages' => ['php8.4-uuid']],
'Xdebug' => ['packages' => ['php8.4-xdebug']],
'XMLRPC' => ['packages' => ['php8.4-xmlrpc']],
'XSL' => ['packages' => ['php8.4-xsl']],
'Yac' => ['packages' => ['php8.4-yac']],
'YAML' => ['packages' => ['php8.4-yaml']],
'ZMQ (ZeroMQ)' => ['packages' => ['php8.4-zmq']],
];
}
}
2 changes: 2 additions & 0 deletions src/PHPDocker/Project/ServiceOptions/Php.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Php extends Base
public const string PHP_VERSION_81 = '8.1';
public const string PHP_VERSION_82 = '8.2';
public const string PHP_VERSION_83 = '8.3';
public const string PHP_VERSION_84 = '8.4';

private string $version;

Expand All @@ -41,6 +42,7 @@ class Php extends Base
* Supported PHP versions
*/
private const array SUPPORTED_VERSIONS = [
self::PHP_VERSION_84,
self::PHP_VERSION_83,
self::PHP_VERSION_82,
self::PHP_VERSION_81,
Expand Down
2 changes: 2 additions & 0 deletions templates/generator.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
</div>

<div class="col col-lg-6 col-md-6">
{{ form_row(attribute(form.phpOptions, 'phpExtensions84')) }}

{{ form_row(attribute(form.phpOptions, 'phpExtensions83')) }}

{{ form_row(attribute(form.phpOptions, 'phpExtensions82')) }}
Expand Down

0 comments on commit e51338c

Please sign in to comment.