Re: require_once problem

From: Date: Wed, 09 Feb 2005 14:53:20 +0000
Subject: Re: require_once problem
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-36090@lists.php.net to get a copy of this message
Hi Sebastian Bergmann who wrote:
Bug #3402 [1] took me a while to figure out but now I tracked it down to a problem with require_once that I would like to share with you in hope for a general solution. In the following diagram "a -> b" means that there is a require_once call for the sourcefile of class b in the sourcefile of class a: TestCase -> TestResult -> TestSuite -> Warning -> TestCase By the time Warning requires TestCase the TestCase class has not been declared but its sourcefile has been loaded and require_once treats it (correctly) as included. Any idea on how to elegantly solve this would be appreciated, Sebastian -- [1] http://pear.php.net/bugs/bug.php?id=3402 It's a fool answer,
If I right understand it's a circle require problem. Is it ? That's a funny design, but why not. Is it not possible to create from the front a loose simple object of class TestCase, e.g. your Success.php from PHPUnit2 tests, just to have the class explicit ? And the make the real stuff. Sure bloody, but bloody answers can lead to solutions for bloody problems. à+ -- bertrand Gugger (toggg)

« previous php.pear.dev (#36090) next »