php: Get rid of all config.php parameters

Since all options controlled by the config.php parameters can now be
overridden directly, there's no reason to keep them around.
This commit is contained in:
talyz 2020-04-24 13:29:46 +02:00
parent 2ba7926959
commit 72636bc2f6
No known key found for this signature in database
GPG Key ID: 2DED2151F4671A2B
5 changed files with 84 additions and 88 deletions

View File

@ -154,55 +154,50 @@ environment.systemPackages = [
) )
];</programlisting> ];</programlisting>
The default <literal>php</literal> attribute hasn't lost any extensions - The default <literal>php</literal> attribute hasn't lost any
the <literal>opcache</literal> extension was added there. extensions. The <literal>opcache</literal> extension has been
added.
All upstream PHP extensions are available under <package><![CDATA[php.extensions.<name?>]]></package>. All upstream PHP extensions are available under <package><![CDATA[php.extensions.<name?>]]></package>.
</para> </para>
<para> <para>
The updated <literal>php</literal> attribute is now easily customizable to your liking All PHP <literal>config</literal> flags have been removed for
by using extensions instead of writing config files or changing configure flags. the following reasons:
Therefore we have removed the following configure flags:
<itemizedlist> <itemizedlist>
<title>PHP <literal>config</literal> flags that we don't read anymore:</title> <listitem>
<listitem><para><literal>config.php.argon2</literal></para></listitem> <para>
<listitem><para><literal>config.php.bcmath</literal></para></listitem> The updated <literal>php</literal> attribute is now easily
<listitem><para><literal>config.php.bz2</literal></para></listitem> customizable to your liking by using
<listitem><para><literal>config.php.calendar</literal></para></listitem> <literal>php.withExtensions</literal> or
<listitem><para><literal>config.php.curl</literal></para></listitem> <literal>php.buildEnv</literal> instead of writing config files
<listitem><para><literal>config.php.exif</literal></para></listitem> or changing configure flags.
<listitem><para><literal>config.php.ftp</literal></para></listitem> </para>
<listitem><para><literal>config.php.gd</literal></para></listitem> </listitem>
<listitem><para><literal>config.php.gettext</literal></para></listitem> <listitem>
<listitem><para><literal>config.php.gmp</literal></para></listitem> <para>
<listitem><para><literal>config.php.imap</literal></para></listitem> The remaining configuration flags can now be set directly on
<listitem><para><literal>config.php.intl</literal></para></listitem> the <literal>php</literal> attribute. For example, instead of
<listitem><para><literal>config.php.ldap</literal></para></listitem>
<listitem><para><literal>config.php.libxml2</literal></para></listitem> <programlisting>
<listitem><para><literal>config.php.libzip</literal></para></listitem> php.override {
<listitem><para><literal>config.php.mbstring</literal></para></listitem> config.php.embed = true;
<listitem><para><literal>config.php.mysqli</literal></para></listitem> config.php.apxs2 = false;
<listitem><para><literal>config.php.mysqlnd</literal></para></listitem> }
<listitem><para><literal>config.php.openssl</literal></para></listitem> </programlisting>
<listitem><para><literal>config.php.pcntl</literal></para></listitem>
<listitem><para><literal>config.php.pdo_mysql</literal></para></listitem> you should now write
<listitem><para><literal>config.php.pdo_odbc</literal></para></listitem>
<listitem><para><literal>config.php.pdo_pgsql</literal></para></listitem> <programlisting>
<listitem><para><literal>config.php.phpdbg</literal></para></listitem> php.override {
<listitem><para><literal>config.php.postgresql</literal></para></listitem> embedSupport = true;
<listitem><para><literal>config.php.readline</literal></para></listitem> apxs2Support = false;
<listitem><para><literal>config.php.soap</literal></para></listitem> }
<listitem><para><literal>config.php.sockets</literal></para></listitem> </programlisting>
<listitem><para><literal>config.php.sodium</literal></para></listitem> </para>
<listitem><para><literal>config.php.sqlite</literal></para></listitem> </listitem>
<listitem><para><literal>config.php.tidy</literal></para></listitem>
<listitem><para><literal>config.php.xmlrpc</literal></para></listitem>
<listitem><para><literal>config.php.xsl</literal></para></listitem>
<listitem><para><literal>config.php.zip</literal></para></listitem>
<listitem><para><literal>config.php.zlib</literal></para></listitem>
</itemizedlist> </itemizedlist>
</para> </para>
</listitem> </listitem>
<listitem> <listitem>

View File

@ -17,23 +17,22 @@ let
, defaultPhpExtensions , defaultPhpExtensions
# Sapi flags # Sapi flags
, cgiSupport ? config.php.cgi or true , cgiSupport ? true
, cliSupport ? config.php.cli or true , cliSupport ? true
, fpmSupport ? config.php.fpm or true , fpmSupport ? true
, pearSupport ? config.php.pear or true , pearSupport ? true
, pharSupport ? config.php.phar or true , pharSupport ? true
, phpdbgSupport ? config.php.phpdbg or true , phpdbgSupport ? true
# Misc flags # Misc flags
, apxs2Support ? config.php.apxs2 or (!stdenv.isDarwin) , apxs2Support ? !stdenv.isDarwin
, argon2Support ? config.php.argon2 or true , argon2Support ? true
, cgotoSupport ? config.php.cgoto or false , cgotoSupport ? false
, embedSupport ? config.php.embed or false , embedSupport ? false
, ipv6Support ? config.php.ipv6 or true , ipv6Support ? true
, systemdSupport ? config.php.systemd or stdenv.isLinux , systemdSupport ? stdenv.isLinux
, valgrindSupport ? config.php.valgrind or true , valgrindSupport ? true
, ztsSupport ? (config.php.zts or false) || (apxs2Support) , ztsSupport ? apxs2Support
}@args: }@args:
let let
self = generic args; self = generic args;

View File

@ -18,12 +18,12 @@ with stdenv.lib;
let let
phpConfig = { phpConfig = {
config.php.embed = true; embedSupport = true;
config.php.apxs2 = false; apxs2Support = false;
config.php.systemd = false; systemdSupport = false;
config.php.phpdbg = false; phpdbgSupport = false;
config.php.cgi = false; cgiSupport = false;
config.php.fpm = false; fpmSupport = false;
}; };
php72-unit = php72base.override phpConfig; php72-unit = php72base.override phpConfig;

View File

@ -8,8 +8,8 @@
}: }:
let php-embed = php.override { let php-embed = php.override {
config.php.embed = true; embedSupport = true;
config.php.apxs2 = false; apxs2Support = false;
}; };
pythonPlugin = pkg : lib.nameValuePair "python${if pkg.isPy2 then "2" else "3"}" { pythonPlugin = pkg : lib.nameValuePair "python${if pkg.isPy2 then "2" else "3"}" {

View File

@ -332,48 +332,50 @@ mapAliases ({
pg_tmp = ephemeralpg; # added 2018-01-16 pg_tmp = ephemeralpg; # added 2018-01-16
php-embed = throw '' php-embed = throw ''
php*-embed has been dropped, you can build the same package by using php*-embed has been dropped, you can build something similar
something similar with this following snippet: with the following snippet:
(php74.override { config.php.embed = true; config.php.apxs2 = false; }) php74.override { embedSupport = true; apxs2Support = false; }
''; # added 2020-04-01 ''; # added 2020-04-01
php72-embed = php-embed; # added 2020-04-01 php72-embed = php-embed; # added 2020-04-01
php73-embed = php-embed; # added 2020-04-01 php73-embed = php-embed; # added 2020-04-01
php74-embed = php-embed; # added 2020-04-01 php74-embed = php-embed; # added 2020-04-01
phpPackages-embed = throw '' phpPackages-embed = throw ''
php*Packages-embed has been dropped, you can build the same package by using php*Packages-embed has been dropped, you can build something
something similar with this following snippet: similar with the following snippet:
(php74.override { config.php.embed = true; config.php.apxs2 = false; }).packages (php74.override { embedSupport = true; apxs2Support = false; }).packages
''; # added 2020-04-01 ''; # added 2020-04-01
php74Packages-embed = phpPackages-embed; php74Packages-embed = phpPackages-embed;
php73Packages-embed = phpPackages-embed; php73Packages-embed = phpPackages-embed;
php72Packages-embed = phpPackages-embed; php72Packages-embed = phpPackages-embed;
php-unit = throw '' php-unit = throw ''
php*-unit has been dropped, you can build the same package by using php*-unit has been dropped, you can build something similar with
something similar with this following snippet: the following snippet:
(php74.override { php74.override {
config.php.embed = true; embedSupport = true;
config.php.apxs2 = false; apxs2Support = false;
config.php.systemd = false; systemdSupport = false;
config.php.phpdbg = false; phpdbgSupport = false;
config.php.cgi = false; cgiSupport = false;
config.php.fpm = false; }) fpmSupport = false;
}
''; # added 2020-04-01 ''; # added 2020-04-01
php72-unit = php-unit; # added 2020-04-01 php72-unit = php-unit; # added 2020-04-01
php73-unit = php-unit; # added 2020-04-01 php73-unit = php-unit; # added 2020-04-01
php74-unit = php-unit; # added 2020-04-01 php74-unit = php-unit; # added 2020-04-01
phpPackages-unit = throw '' phpPackages-unit = throw ''
php*Packages-unit has been dropped, you can build the same package by using php*Packages-unit has been dropped, you can build something
something similar with this following snippet: similar with this following snippet:
(php74.override { (php74.override {
config.php.embed = true; embedSupport = true;
config.php.apxs2 = false; apxs2Support = false;
config.php.systemd = false; systemdSupport = false;
config.php.phpdbg = false; phpdbgSupport = false;
config.php.cgi = false; cgiSupport = false;
config.php.fpm = false; }).packages fpmSupport = false;
}).packages
''; # added 2020-04-01 ''; # added 2020-04-01
php74Packages-unit = phpPackages-unit; php74Packages-unit = phpPackages-unit;
php73Packages-unit = phpPackages-unit; php73Packages-unit = phpPackages-unit;