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

Bug #10400 Fatal Error when creating a bundled package with PFM2
Submitted: 2007-03-16 11:43 UTC
From: berdir Assigned: berdir
Status: Closed Package: PEAR (version 1.5.1)
PHP Version: 5.2.1 OS: Linux
Roadmaps: 1.5.2    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 36 - 36 = ?

 
 [2007-03-16 11:43 UTC] berdir (Sascha Grossenbacher)
Description: ------------ I am getting the following Error when I try to create a bundled package with PEAR_PackageFileManager2. Fatal error: Using $this when not in object context in /usr/share/php/PEAR/Common.php on line 281 (Stack Trace in Actual result-section) It happens only with PackageFileManager2, pear package works fine. But the problematic code belongs to PEAR, so i posted the bug report here. The problem is that $log is a static call to PEAR_Common, this could be solved with adding the following patch (see Test-Script section) Test script: --------------- --- Validator.php.orig 2007-03-16 13:17:12.000000000 +0100 +++ Validator.php 2007-03-16 13:18:21.000000000 +0100 @@ -1683,8 +1683,9 @@ return false; } $dir_prefix = dirname($this->_pf->_packageFile); + $common = new PEAR_Common; $log = isset($this->_pf->_logger) ? array(&$this->_pf->_logger, 'log') : - array('PEAR_Common', 'log'); + array(&$common, 'log'); $info = $this->_pf->getContents(); $info = $info['bundledpackage']; if (!is_array($info)) { Actual result: -------------- Fatal error: Using $this when not in object context in /usr/share/php/PEAR/Common.php on line 281 Call Stack: 0.0007 68488 1. {main}() /home/u80759076/Projekte/KonfigGen/Code/packages/packageBundle.php:0 0.8035 5255340 2. PEAR_PackageFileManager2->debugPackageFile() /home/u80759076/Projekte/KonfigGen/Code/packages/packageBundle.php:51 0.8036 5255340 3. PEAR_PackageFileManager2->writePackageFile() /usr/share/php/PEAR/PackageFileManager2.php:1195 0.8068 5257940 4. PEAR_PackageFile_v2->validate() /usr/share/php/PEAR/PackageFileManager2.php:1123 0.8068 5257940 5. PEAR_PackageFile_v2_Validator->validate() /usr/share/php/PEAR/PackageFile/v2.php:1917 0.8167 5274516 6. PEAR_PackageFile_v2_Validator->_analyzeBundledPackages() /usr/share/php/PEAR/PackageFile/v2/Validator.php:282 0.8168 5274812 7. call_user_func_array() /usr/share/php/PEAR/PackageFile/v2/Validator.php:1700 0.8168 5275084 8. PEAR_Common::log() /usr/share/php/PEAR/PackageFile/v2/Validator.php:0

Comments

 [2007-03-17 20:51 UTC] cellog (Greg Beaver)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.