Ed Lazor wrote:

I'm creating classes that rely on the presence of other classes that I've
created.  Does PHP5 provide a way to specify these dependencies or a way to
check these dependencies when the class is instantiated?  For example, class
Automobile would fail to instantiate if class Tire wasn't available.

PHP5 does not, but PEAR was created specifically to solve this problem. All you need to do is package your modular classes as packages, and then people can use the pear installer to enforce the dependencies prior to runtime. Then, at runtime, all you have to do is assume they are there, as the user can't install your class without the presence of the others (well, they can, but it requires some monkey business and they would have to know that it failed)


Greg

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to