From 18a1cd2d4ff09cb2a299b304bb0bfff3ba8c2e6e Mon Sep 17 00:00:00 2001 From: Luis Pabon Date: Fri, 22 Nov 2024 11:09:54 +0000 Subject: [PATCH 1/5] PHP 8.4 --- public/js/main-form.js | 6 +- src/Controller/GeneratorController.php | 1 + .../PhpExtension/Php84AvailableExtensions.php | 111 ++++++++++++++++++ src/PHPDocker/Project/ServiceOptions/Php.php | 2 + 4 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 src/PHPDocker/PhpExtension/Php84AvailableExtensions.php diff --git a/public/js/main-form.js b/public/js/main-form.js index 9f4326e..7f11351 100644 --- a/public/js/main-form.js +++ b/public/js/main-form.js @@ -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' @@ -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() diff --git a/src/Controller/GeneratorController.php b/src/Controller/GeneratorController.php index c125206..2089c8c 100644 --- a/src/Controller/GeneratorController.php +++ b/src/Controller/GeneratorController.php @@ -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'])), }; diff --git a/src/PHPDocker/PhpExtension/Php84AvailableExtensions.php b/src/PHPDocker/PhpExtension/Php84AvailableExtensions.php new file mode 100644 index 0000000..2ab3dd1 --- /dev/null +++ b/src/PHPDocker/PhpExtension/Php84AvailableExtensions.php @@ -0,0 +1,111 @@ +> + */ + 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> + */ + protected function getOptionalExtensionsMap(): array + { + return [ + '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']], + 'Decimal' => ['packages' => ['php8.4-decimal']], + 'DS (Data Structures)' => ['packages' => ['php8.4-ds']], + 'Enchant' => ['packages' => ['php8.4-enchant']], + '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']], + 'GRPC' => ['packages' => ['php8.4-grpc']], + 'HTTP' => ['packages' => ['php8.4-http']], + 'igbinary' => ['packages' => ['php8.4-igbinary']], + 'ImageMagick' => ['packages' => ['php8.4-imagick']], + 'IMAP' => ['packages' => ['php8.4-imap']], + 'Inotify' => ['packages' => ['php8.4-inotify']], + 'Interbase' => ['packages' => ['php8.4-interbase']], + 'Intl (Internationalisation)' => ['packages' => ['php8.4-intl']], + 'LDAP' => ['packages' => ['php8.4-ldap']], + 'LZ4' => ['packages' => ['php8.4-lz4']], + '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']], + 'Pcov' => ['packages' => ['php8.4-pcov']], + 'PostgreSQL' => ['packages' => ['php8.4-pgsql']], + 'PHPDBG' => ['packages' => ['php8.4-phpdbg']], + 'Protobuf' => ['packages' => ['php8.4-protobuf']], + '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']], + 'Samba Client' => ['packages' => ['php8.4-smbclient']], + 'SNMP' => ['packages' => ['php8.4-snmp']], + 'SOAP' => ['packages' => ['php8.4-soap']], + 'Solr' => ['packages' => ['php8.4-solr']], + 'SQLite3' => ['packages' => ['php8.4-sqlite3']], + 'ssh2' => ['packages' => ['php8.4-ssh2']], + 'Swoole' => ['packages' => ['php8.4-swoole']], + 'Sybase' => ['packages' => ['php8.4-sybase']], + 'Tidy' => ['packages' => ['php8.4-tidy']], + 'UUID' => ['packages' => ['php8.4-uuid']], + 'vips' => ['packages' => ['php8.4-vips']], + 'Xdebug' => ['packages' => ['php8.4-xdebug']], + 'Xhprof' => ['packages' => ['php8.4-xhprof']], + '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']], + 'zstd (Zstandard)' => ['packages' => ['php8.4-zstd']], + ]; + } +} diff --git a/src/PHPDocker/Project/ServiceOptions/Php.php b/src/PHPDocker/Project/ServiceOptions/Php.php index 8237b25..5402f52 100644 --- a/src/PHPDocker/Project/ServiceOptions/Php.php +++ b/src/PHPDocker/Project/ServiceOptions/Php.php @@ -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; @@ -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, From 6eb0c5e54ccafae23e01508c77f96ac911a3d7d2 Mon Sep 17 00:00:00 2001 From: Luis Pabon Date: Fri, 22 Nov 2024 11:13:29 +0000 Subject: [PATCH 2/5] Fixes --- src/Form/Generator/PhpType.php | 8 ++++++++ templates/generator.html.twig | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/Form/Generator/PhpType.php b/src/Form/Generator/PhpType.php index 79f6268..dd8c6fe 100644 --- a/src/Form/Generator/PhpType.php +++ b/src/Form/Generator/PhpType.php @@ -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; @@ -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, ]); } diff --git a/templates/generator.html.twig b/templates/generator.html.twig index 0906576..30902cd 100644 --- a/templates/generator.html.twig +++ b/templates/generator.html.twig @@ -58,6 +58,8 @@
+ {{ form_row(attribute(form.phpOptions, 'phpExtensions84')) }} + {{ form_row(attribute(form.phpOptions, 'phpExtensions83')) }} {{ form_row(attribute(form.phpOptions, 'phpExtensions82')) }} From e3731ec1ca64fd42617b8370f943667aaafbec5d Mon Sep 17 00:00:00 2001 From: Luis Pabon Date: Fri, 22 Nov 2024 12:01:27 +0000 Subject: [PATCH 3/5] Fixes --- src/PHPDocker/PhpExtension/AvailableExtensionsFactory.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PHPDocker/PhpExtension/AvailableExtensionsFactory.php b/src/PHPDocker/PhpExtension/AvailableExtensionsFactory.php index 4775684..4af867a 100644 --- a/src/PHPDocker/PhpExtension/AvailableExtensionsFactory.php +++ b/src/PHPDocker/PhpExtension/AvailableExtensionsFactory.php @@ -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 @@ -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, ]; /** From f2d16b465a133c84c4ca272f8c5680a41a80908b Mon Sep 17 00:00:00 2001 From: Luis Pabon Date: Fri, 22 Nov 2024 12:01:59 +0000 Subject: [PATCH 4/5] Update list of available extensions on PHP8.4 and set aside a few that aren't available that apparently are coming through --- .../PhpExtension/Php84AvailableExtensions.php | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/PHPDocker/PhpExtension/Php84AvailableExtensions.php b/src/PHPDocker/PhpExtension/Php84AvailableExtensions.php index 2ab3dd1..e644fad 100644 --- a/src/PHPDocker/PhpExtension/Php84AvailableExtensions.php +++ b/src/PHPDocker/PhpExtension/Php84AvailableExtensions.php @@ -44,30 +44,41 @@ protected function getMandatoryExtensionsMap(): array 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']], - 'Decimal' => ['packages' => ['php8.4-decimal']], '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']], - 'GRPC' => ['packages' => ['php8.4-grpc']], 'HTTP' => ['packages' => ['php8.4-http']], 'igbinary' => ['packages' => ['php8.4-igbinary']], 'ImageMagick' => ['packages' => ['php8.4-imagick']], 'IMAP' => ['packages' => ['php8.4-imap']], - 'Inotify' => ['packages' => ['php8.4-inotify']], 'Interbase' => ['packages' => ['php8.4-interbase']], 'Intl (Internationalisation)' => ['packages' => ['php8.4-intl']], 'LDAP' => ['packages' => ['php8.4-ldap']], - 'LZ4' => ['packages' => ['php8.4-lz4']], + 'Libvirt' => ['packages' => ['php8.4-libvirt-php']], 'Mailparse' => ['packages' => ['php8.4-mailparse']], 'MaxMind DB' => ['packages' => ['php8.4-maxminddb']], 'mcrypt' => ['packages' => ['php8.4-mcrypt']], @@ -78,34 +89,34 @@ protected function getOptionalExtensionsMap(): array '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']], - 'Protobuf' => ['packages' => ['php8.4-protobuf']], + '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']], - 'Samba Client' => ['packages' => ['php8.4-smbclient']], 'SNMP' => ['packages' => ['php8.4-snmp']], 'SOAP' => ['packages' => ['php8.4-soap']], - 'Solr' => ['packages' => ['php8.4-solr']], 'SQLite3' => ['packages' => ['php8.4-sqlite3']], 'ssh2' => ['packages' => ['php8.4-ssh2']], - 'Swoole' => ['packages' => ['php8.4-swoole']], + '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']], - 'vips' => ['packages' => ['php8.4-vips']], 'Xdebug' => ['packages' => ['php8.4-xdebug']], - 'Xhprof' => ['packages' => ['php8.4-xhprof']], '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']], - 'zstd (Zstandard)' => ['packages' => ['php8.4-zstd']], ]; } } From 6b4999fb2d8e2735a034c1228eb0d5819143a920 Mon Sep 17 00:00:00 2001 From: Luis Pabon Date: Fri, 22 Nov 2024 12:02:15 +0000 Subject: [PATCH 5/5] Add missing extensions to php8.2 and 3 --- src/PHPDocker/PhpExtension/Php82AvailableExtensions.php | 9 +++++++++ src/PHPDocker/PhpExtension/Php83AvailableExtensions.php | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/src/PHPDocker/PhpExtension/Php82AvailableExtensions.php b/src/PHPDocker/PhpExtension/Php82AvailableExtensions.php index 111f97b..e90bc80 100644 --- a/src/PHPDocker/PhpExtension/Php82AvailableExtensions.php +++ b/src/PHPDocker/PhpExtension/Php82AvailableExtensions.php @@ -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']], @@ -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']], diff --git a/src/PHPDocker/PhpExtension/Php83AvailableExtensions.php b/src/PHPDocker/PhpExtension/Php83AvailableExtensions.php index 1b52d2c..36f2d02 100644 --- a/src/PHPDocker/PhpExtension/Php83AvailableExtensions.php +++ b/src/PHPDocker/PhpExtension/Php83AvailableExtensions.php @@ -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']], @@ -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']],