On Apr 23, 2009, at 00:46, Jordan K. Hubbard wrote:

On Apr 22, 2009, at 10:33 PM, Ryan Schmidt wrote:

The reason I ask is for a change I'm working on for the php5 extension ports. Currently, ports like php5-memcache just print a message telling the user to add these lines to their php.ini:

extension_dir=/opt/local/lib/php/extensions/no-debug-non-zts-20060613
extension=memcache.so

But php can be configured to look for additional ini files in a certain directory. So I would like to modify the php5 port to do this, and then modify ports like php5-memcache to just install a file like e.g. memcache.ini which contains these lines. Then the extension will automatically be loaded and the user won't have to do it manually.

Sounds laudable, just as long as you also figure out how to undo this when the php port is removed. Nothing worse than something which installs itself with side-effects yet fails to remove those side-effects when it's removed / upgraded away. :)

There shouldn't be side-effects. All files will be registered to the corresponding ports, and will be uninstalled by MacPorts if the ports are uninstalled. So e.g. uninstalling php5-memcache would remove memcache.ini.


Currently, the php.ini is in /opt/local/etc. This is a little out in the open and I would like to move it into a directory of its own, probably named for the port, so, say, /opt/local/etc/php5. This would also be a step toward allowing php4 and php5 (and a hypothetical future php6) to be installed simultaneously which is desirable.

Sounds entirely reasonable.

Now I need a directory in which php5 extension ports will install their small additional .ini files. I don't think it should be the same /opt/local/etc/php5 directory because php is set up to first look for its one true php.ini and then load all the additional ini files in a directory; this might cause php.ini to be parsed twice, which is at best wasteful and at worst could cause problems.

How about having a "system" path of ${prefix}/etc/php5 and $ {prefix}/var/db/php5 for the additional bits?

"man porthier" says ${prefix}/var/db is for "misc. automatically generated system-specific database files". These would only be small text files containing configuration information, so they're not databases, so I don't know if this would be the right place... though getting them out of ${prefix}/etc isn't entirely a bad idea, since I don't want users modifying them. Would a place under ${prefix}/share be something to consider? They are "architecture-independent files"... Then again, though the user shouldn't modify the .ini files we install, the user may want to add her own .ini files.


_______________________________________________
macports-dev mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev

Reply via email to