require_once versus include_once
| From: | Chuck Hagenbuch | Date: | Fri, 28 Jul 2000 14:20:54 +0000 |
| Subject: | require_once versus include_once | ||
| Groups: | php.pear | ||
| Request: | Send a blank email to php-pear+get-173@lists.php.net to get a copy of this message | ||
We have a problem in that require_once and include_once can include the same
file. Now, if you have an application that dynamically includes some code -
maybe it dynamically includes PEAR.php if it needs it - and it also always uses,
say, the new Socket.php from Stig that uses PEAR.php - then you can get a
collision.
Maybe we can resolve this with a convention, like "always require_once base
classes (DB.php, PEAR.php, etc), and use factory methods to dynamically include
subclasses".
Am I being clear? Does anyone else see the problem?
-chuck
--
Babies have self esteem. They are born loving their toes and finding them
fascinating and delicious.