FirePHP and Zend Framework 2

For programming and general questions on Zend Framework

FirePHP and Zend Framework 2

Postby tm8747a on Thu Dec 06, 2012 10:16 pm

I'm trying to get FirePHP working with Zend Framework 2. Technically, I do have it working, but my implementation is not clean. Basically, I'm assuming it should be possible to create a FirePHP writer by just doing something like this:

Code: Select all
$writer = new Zend\Log\Writer\FirePhp();


Problem is I get a "FirePHP Class not found" error. In Zend\Log\Writer\FirePhp.php, there's the following code:

Code: Select all
public function getFirePhp()
{
    if (!$this->firephp instanceof FirePhp\FirePhpInterface
        && !class_exists('FirePHP')
    ) {
        // No FirePHP instance, and no way to create one
        throw new Exception\RuntimeException('FirePHP Class not found');
    }

    // Remember: class names in strings are absolute; thus the class_exists
    // here references the canonical name for the FirePHP class
    if (!$this->firephp instanceof FirePhp\FirePhpInterface
        && class_exists('FirePHP')
    ) {
        // FirePHPService is an alias for FirePHP; otherwise the class
        // names would clash in this file on this line.
        $this->setFirePhp(new FirePhp\FirePhpBridge(new FirePHPService()));
    }

    return $this->firephp;
}


My issue is that I don't know how to set up the FirePHP class (the one in FirePHP.class.php) so that it's found without modifying it or the Zend Framework files (adding namespaces, modifying file name, etc.). Is that doable?
tm8747a
 
Posts: 2
Joined: Thu Dec 06, 2012 10:15 pm

Return to Zend Framework

Who is online

Users browsing this forum: Google [Bot] and 8 guests