Bug #15233 Updated: Possibility to make include() from within functions with global scope

From: Date: Thu, 06 Jun 2002 10:44:57 +0000
Subject: Bug #15233 Updated: Possibility to make include() from within functions with global scope
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-9629@lists.php.net to get a copy of this message
ID: 15233 Updated by: tero.tilus@iki.fi Reported By: flying@dom.natm.ru Status: Open Bug Type: Feature/Change Request Operating System: all PHP Version: 4.0.6 New Comment: Possible (even though not particularily good) workaround is to "register" (put them in say global array, which maps class/function names to filenames) your "dynamic libraries" where you would normally want to load them. Then where ever you want to access dynamically loaded classes/functions, first include file containing it/them. This works only when you don't really _have_to_ access global namespace. I used this approach on a system where config files scattered all over the filesystem (like apache's .htaccess) can locally change behaviour of my system and add features (register new "handlers" etc). Instead of actually loading these configs only register new features and loading is performed only when I need to instantiate a "dynamically loaded" class. Previous Comments: ------------------------------------------------------------------------ [2002-06-05 13:29:03] tero.tilus@iki.fi I had to change my developement tool due to lack of the possibility to create dynamically loadable (php) modules (with php). PHP just could't do what I wanted. Just as Kevin said, this is critical feature in modular systems. ------------------------------------------------------------------------ [2002-05-10 05:37:03] kevin@oceania.net for modular installations this type of feature is critical. The alternatives are the code you see produced in *nuke type cms system. I really leaves php lacking ------------------------------------------------------------------------ [2002-01-26 06:45:23] flying@dom.natm.ru It is very important to have a possibility to perform include() or require() from within a function or class method and have included file into global scope. Here is a lot of reasons. Primary one is to make it possible to create dynamically loaded modules, it is very important into large projects. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=15233&edit=1

« previous php.bugs (#9629) next »