Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 59054 - PHP should load all .ini files in a directory for easier config
Summary: PHP should load all .ini files in a directory for easier config
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-31 23:20 UTC by awk
Modified: 2005-08-22 00:44 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
diff of php-sapi.eclass (dif,845 bytes, patch)
2004-07-31 23:21 UTC, awk
Details | Diff
another php-sapi.eclass patch (php-sapi.eclass.diff,696 bytes, patch)
2004-08-01 16:05 UTC, awk
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description awk 2004-07-31 23:20:38 UTC
It's so much easier to drop files in a directory than to edit config files. For instance with Apache you can set it up to include configs from a directory.

PHP4 has a flag for that does this, I'm not sure when it appeared: --with-config-file-scan-dir

Attached is a patch that creates a single directory, /etc/php/extra-ini.d, and configures PHP to look in it. I have tested it with apache2 and cli and it works, very convenient.

Originally I had it create a separate directory in each /etc/php/*-php4 subdirectory. I think one directory is okay. At the moment, if you install mod_php it will overwrite /usr/bin/php with a version that looks in the wrong subdirectory (apache-php instead of cli-php) so they could get mixed up anyway.

Reproducible: Always
Steps to Reproduce:



Expected Results:
Comment 1 awk 2004-07-31 23:21:14 UTC
Created attachment 36564 [details, diff]
diff of php-sapi.eclass
Comment 2 Stuart Herbert (RETIRED) gentoo-dev 2004-08-01 12:01:52 UTC
Well, the option's there in PHP 5.  We could add a USE flag to switch this feature on.  I'm not comfortable with switching this option on by default.

Best regards,
Stu
Comment 3 awk 2004-08-01 16:02:36 UTC
It's harmless to have it on.. if there are no files in the dir, nothing different happens. If there are .ini files, it loads them after loading the regular php.ini.

There could be a USE flag (or the user can emerge with EXTRA_ECONF anyway) but there is some value in standardizing it: PHP ebuilds could also use the directory for config files, rather than messing with the php.ini files. FreeBSD does it this way.
Comment 4 awk 2004-08-01 16:05:20 UTC
Created attachment 36612 [details, diff]
another php-sapi.eclass patch

This is a similar patch but it only activates the feature if $PHPINISCANDIR is
already set when the eclass is loaded.. so it can be turned on in indiviidual
ebuilds with PHPINISCANDIR="/etc/php/extra-ini.d"  .
Comment 5 Stuart Herbert (RETIRED) gentoo-dev 2004-08-02 14:39:29 UTC
Definitely *not* harmless to have it on by default.  Most people won't know about it, and won't poilce the scanned directory effectively.  We have users who like having very detailed control over what *optional* features are switched on or off by default.

I'll add a USE flag so people can switch it on, but I'm not switching it on by default.  Sorry.

Best regards,
Stu
Comment 6 Stuart Herbert (RETIRED) gentoo-dev 2005-08-22 00:44:01 UTC
Hi,

This is fixed in the Gentoo PHP Overlay, by the new dev-lang/php package.

Best regards,
Stu