PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Logging » Log » Bug #6185

factory fails with autoload

Details

Submitted2005-12-07 20:51 UTC
Fromwboring at uptilt dot com
Assignedjon
StatusClosed
PackageLog
PHP Version5.1.0
OSgentoo linux
Roadmaps(Not assigned)

Comments

[2005-12-07 20:51 UTC] wboring at uptilt dot com

Description:
------------
calling $log = &Log::factory('console', '', 'TEST');
with an autoload function fails because of Log.php line 124
if (!class_exists($class)) {
@include_once $classfile;
}

It should be

if (!class_exists($class, FALSE)) {
@include_once $classfile;
}

Test script:
---------------
<?php

require_once('Log.php');

function __autoload($class) {
require($class.'.php');
}

$log = &Log::factory('console', '', 'TEST');
?>

Expected result:
----------------
I don't expect this to fail.

Actual result:
--------------
Warning: __autoload(Log_console.php) [function.--autoload]: failed to open stream: No such file or directory in /home/wboring/devel/trunk/htdocs/test/log.php on line 6

Fatal error: __autoload() [function.require]: Failed opening required 'Log_console.php' (include_path='/usr/local/lib/php:/home/wboring/devel/trunk/lib:.') in /home/wboring/devel/trunk/htdocs/test/log.php on line 6