PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Logging » Log » Bug #1121

receive Call to a member function on a non-object on test files

Details

Submitted2004-04-03 12:56 UTC
Frombryanhahn at yahoo dot com
StatusNo Feedback
PackageLog
PHP Version4.3.1
OSLinux
Roadmaps(Not assigned)

Comments

[2004-04-03 12:56 UTC] bryanhahn at yahoo dot com

Description:
------------
I installed version 1.8.4 of the logging package and attempted to run some basic tests from the docs/examples directory. When I run the examples, I get the following error:

Fatal error: Call to a member function on a non-object in /home2/www/eorderme/commercecollab/includes/Log-1.8.4/docs/examples/file.php on line 8

The sample uses the singleton method, so I tried the factory method and receive the same error.

php -version
PHP 4.3.1 (cli) (built: Apr 22 2003 18:36:14)
Copyright (c) 1997-2002 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies

Is there some other requirements to running this package other than having PHP v 4.3.0 or greater?

Reproduce code:
---------------
<?php

require_once 'Log.php';

$conf = array('mode' => 0600, 'timeFormat' => '%X %x');
$logger = &Log::factory('file', 'out.log', 'ident', $conf);
for ($i = 0; $i < 10; $i++) {
$logger->log("Log entry $i");
}

Expected result:
----------------
Fatal error: Call to a member function on a non-object in /home2/www/eorderme/commercecollab/includes/Log-1.8.4/docs/examples/file.php on line 8