Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.16

Bug #1637 The use of interface causes warnings when packaging with PEAR
Submitted: 2004-06-14 17:32 UTC
From: lucasr Assigned: cellog
Status: Closed Package: PEAR
PHP Version: 4.3.7 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2004-06-14 17:32 UTC] lucasr
Description: ------------ General Information ------------------- PHP Version: PHP5 RC2 PEAR Package Version: 1.3.1 Description ----------- I'm developing a PEAR installable framework with PHP5. There are some interfaces in it. When I try to package my framework with `pear package` it raises the following warning: Warning: in Command.php: function "execute" not prefixed with package name "Uirah" Uirah_Command is the interface name and execute is its only defined method. I had a look on PEAR package code and saw that in the PEAR_Common::analyzeSourceCode method, interfaces are not considered in the analysis, so the analyzer tries to evaluate the interface method as a standalone function then this warning is raised. I already fixed this problem here, but I think maybe you can resolve this problem better. :-) Reproduce code: --------------- //Uirah_Command.php <?php require_once "APE/Util/Parameters.php"; require_once "Uirah/CommandContext.php"; interface Uirah_Command { public function execute(Uirah_CommandContext $context, APE_Util_Parameters $params); } ?> Expected result: ---------------- What should happen. :-) lucasr@kuhn:~/Web/pear/uirah$ ls package.xml test Uirah Uirah-0.1.tgz lucasr@kuhn:~/Web/pear/uirah$ pear package Analyzing Uirah/CommandContext.php Analyzing Uirah/Command.php Analyzing Uirah/Forward.php Analyzing Uirah/ViewForward.php Analyzing Uirah/CommandForward.php Analyzing Uirah/Config.php Analyzing Uirah/Controller.php Analyzing Uirah/RequestHandler.php Package /home/lucasr/Web/pear/uirah/Uirah-0.1.tgz done Actual result: -------------- But... when I try to install my package with this interface: lucasr@kuhn:~/Web/pear/uirah$ ls package.xml test Uirah Uirah-0.1.tgz lucasr@kuhn:~/Web/pear/uirah$ pear package Analyzing Uirah/CommandContext.php Analyzing Uirah/Command.php Analyzing Uirah/Forward.php Analyzing Uirah/ViewForward.php Analyzing Uirah/CommandForward.php Analyzing Uirah/Config.php Analyzing Uirah/Controller.php Analyzing Uirah/RequestHandler.php Warning: in Command.php: function "execute" not prefixed with package name "Uirah" Package /home/lucasr/Web/pear/uirah/Uirah-0.1.tgz done

Comments

 [2004-07-10 15:18 UTC] cox at idecnet dot com
This will be solved with channels and per-channel package validations. Will back to this bug when that gets ready. Tomas V.V.Cox
 [2004-10-19 04:23 UTC] cellog
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.