php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33181 SimpleXML causes __autoload error inside of autoloaded class file.
Submitted: 2005-05-30 07:27 UTC Modified: 2005-06-07 01:00 UTC
Votes:3
Avg. Score:3.3 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: nickolasnikolic at hotmail dot com Assigned:
Status: No Feedback Package: SimpleXML related
PHP Version: 5.0.4 OS: Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nickolasnikolic at hotmail dot com
New email:
PHP Version: OS:

 

 [2005-05-30 07:27 UTC] nickolasnikolic at hotmail dot com
Description:
------------
Uncommenting the last line will produce an odd error affilliated with __autoload:

Warning: __autoload(simplexml_load_file.class.php) [function.--autoload]: failed to open stream: No such file or directory in C:\Program Files\SpikeSource\oss\httpd\htdocs\blindcore\classes\test.usage.only.php on line 4

Fatal error: __autoload() [function.require]: Failed opening required 'simplexml_load_file.class.php' (include_path='.;C:\dev\php5\pear') in C:\Program Files\SpikeSource\oss\httpd\htdocs\blindcore\classes\test.usage.only.php on line 4

The server is spikesource's stack. If you need more info, please email.

I hope that it helps!

Reproduce code:
---------------
Source class:
  public function sendFullRequest( $sendFullRequestURL = NULL ){
  	// If the message to send to Amazon has been set.
  	if( $sendFullRequestURL ){
  		// Then sent the request to Amazon
  		$fileHolder = file_get_contents( $sendFullRequestURL );

  		// Return the message that has been set to Amazon for checking.
  		return $fileHolder;
  	}else{
  		// Otherwise, note that something unextpected has occurred.
  		return "An error occurred in base class AmazonMessageOut. \$sendFullRequestURL is not set.";
  	}
  }
}

Called Instance:

// Autoload classes
function __autoload( $className ){
   require_once $className . '.class.php';
}

$messageOut = new AmazonOperation();

$messageOut->setCurrentOperation( $messageOut->OperationItemLookup );
$messageOut->setCurrentResponseGroup( $messageOut->ResponseMedium );

$messageIn = new AmazonResponse();

$nowAString = $messageIn->getAmazonXml( $messageOut->itemLookup( "0375826688" ) );

echo $nowAString;

// $messageIn->loadXmlFile( $nowAString );

Expected result:
----------------
No errors and the Amazon XML loads

Actual result:
--------------
As was said, the following errors for PHP-native functions:

Warning: __autoload(simplexml_load_file.class.php) [function.--autoload]: failed to open stream: No such file or directory in C:\Program Files\SpikeSource\oss\httpd\htdocs\blindcore\classes\test.usage.only.php on line 4

Fatal error: __autoload() [function.require]: Failed opening required 'simplexml_load_file.class.php' (include_path='.;C:\dev\php5\pear') in C:\Program Files\SpikeSource\oss\httpd\htdocs\blindcore\classes\test.usage.only.php on line 4

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-30 07:31 UTC] nickolasnikolic at hotmail dot com
$messageIn->getAmazonXml source is the same as public function sendFullRequest( $sendFullRequestURL = NULL ) - refactored. There is no change between the file instantiated in the example and the current one. The contents of the method are the same.
 [2005-05-30 15:45 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-06-07 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC