Re: [Phplib-users] PEAR & _prepend
Brought to you by:
nhruby,
richardarcher
From: Layne W. <la...@dr...> - 2004-09-03 17:43:35
|
Quoth Frank Bax: > I just installed some PEAR components and noticed that _prepend was > created in /var/www/pear/lib - a directory that also happens to be > in php.ini I can think of a couple of ways to resolve having two > _prepend.php files (one for pear, one for phplib), but I'm wondering > what might be a recommend way to resolve this? Quite easy - don't use auto-prepend. I have found it very advantageous to have customizeable prepends. I don't always want to be bound by my default prepend environment on every script (sometimes I don't want or need any prepend at all) and I've never understood why people would want a prepend file that is used for multiple projects - at that level it can't do much an= d so I'd still need a manually prepended file for my project-specific setup. In a similar vein, I don't use the include_path. I know exactly which library file I want to include - making the server find all of the files I need at run time hundreds of thousands of times each day is inefficient. Because I am a lazy programmer and don't want to type paths, and because having absolute paths in code is bad for portability between workstation/test server/production servers, I set constants in my prepend that contain the full path to each library. For instance, =20 define("I", "/var/www/project_z/includes/"); define("PL", "/var/www/php-lib-stable/php/"); ... include_once I."some.inc"; include_once PL."template.inc"; Ok, I'm climbing down off my soapbox now. --=20 Layne Weathers |