Darghon Posted July 5, 2011 Share Posted July 5, 2011 Hello all, I'm developing my own framework on a windows 7 with xampp istalled, and apc enabled. I made a generator controller that can be accessed through php cli, and I can call a generator. But once I try to call a 2nd one, I get a APC error saying it can not re-initialise a interface: C:\Projects\Framework\fw>php framework build:project Creating folder structure...................DONE Creating default files.........DONE C:\Projects\Framework\fw>php framework build:application frontend [Tue Jul 05 15:33:42 2011] [apc-error] Cannot redeclare class igenerator in C:\Projects\Framework\fw\core\objectCollector.class.php on line 397. C:\Projects\Framework\fw> (it crashes on the autoloader) the 'IGenerator' is the only interface I currently have in the framework, and it's used to manage "builders" so the generator object can work with external or custom builders. How can I fix this? or is this a apc core error? IGenerator Code: (but don't think this has anything to do with it) <?php /** * Any class that implements this interface can be registered to the generator as a builder. * @author Darghon */ interface IGenerator { /** * Public construct method receiving a single parameter, * which represents all possible parameters join in an array */ public function __construct($args = array()); /** * Public destroy method that will be triggered when the class gets unset, or destroyed */ public function __destroy(); /** * The method that the generator class will apply. This method must ALWAYS exist, and return a Boolean on success or fail. * @return boolean */ public function generate(); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/241130-problems-with-apc-and-php-interface/ Share on other sites More sharing options...
Darghon Posted July 5, 2011 Author Share Posted July 5, 2011 Found the problem myself. The autoloader checked if the "IGenerator" class already existed, and if not, reincluded it, but it's an interface, so it got included 2x Thx to anyone who took time to read my question Quote Link to comment https://forums.phpfreaks.com/topic/241130-problems-with-apc-and-php-interface/#findComment-1238615 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.