#33181 [Opn->Fbk]: SimpleXML causes __autoload error inside of autoloaded class file.
ID: 33181
Updated by: sniper@php.net
Reported By: nickolasnikolic at hotmail dot com
-Status: Open
+Status: Feedback
Bug Type: SimpleXML related
Operating System: Windows
PHP Version: 5.0.4
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[2005-05-30 07:31:39] 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 07:27:49] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33181&edit=1
Thread (2 messages)