Re: [RFC] prepend_include_path()/append_include_path()
| From: | Markus Fischer | Date: | Thu, 14 Feb 2008 09:20:13 +0000 |
| Subject: | Re: [RFC] prepend_include_path()/append_include_path() | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-35484@lists.php.net to get a copy of this message | ||
Lars Strojny wrote:
Am Donnerstag, den 14.02.2008, 00:56 +0100 schrieb Jochem Maas:Just my "senf" (like 2c, but that's what we call it in Austria :) Personally I never understood why we've set_include_path in the first place anyway. "ini_set('include_path', ..." does exactly the same and the C function does actually exactly this. If this function would have been here since PHP4, fine. But personally, I don't see a justification to introduce a new function for such a simple thing. Considering we've already two ways to achieve the same goal I don't see a reason to add another two ways to deal with simple string handling. There's not verification/validation whatsoever done. - MarkusI think Lars has a point ... maybe set_include_path() could be given a second parameter instead to mitigate the need for seperate funcs?: set_include_path('foo', INCPATH_OVERRIDE); // default set_include_path('foo', INCPATH_APPEND); set_include_path('foo', INCPATH_PREPEND);Thanks for your support, but this seems counter intuitive. Why should *set*_include_path() be used to *append* or *prepend* to the include path? Also learning another mouthful of constants is maybe suboptimal. Getting used to prepend_/append_...() is easy from my point of view, as the name is derived from what's currently present (set_include_path()).