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. :)

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?

Don't forget, /etc/rc used to be a single file...

And indeed I wasn't looking: it *is* a single file, even on Leopard.

Sorry, brain-fart. I meant the /usr/local/etc/rc file - you're correct that /etc/rc remains still too historical to be replaced, though it certainly should be.

- Jordan

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

Reply via email to