Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/zf2-454'
Browse files Browse the repository at this point in the history
  • Loading branch information
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Writer/FirePhp.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use FirePHP as FirePHPService;
use Zend\Log\Formatter\FirePhp as FirePhpFormatter;
use Zend\Log\Logger;
use Zend\Log\Exception;

/**
* @category Zend
Expand Down Expand Up @@ -83,9 +84,17 @@ protected function doWrite(array $event)
* Gets the FirePhpInterface instance that is used for logging.
*
* @return FirePhp\FirePhpInterface
* @throws Exception\RuntimeException
*/
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
Expand All @@ -95,6 +104,7 @@ public function getFirePhp()
// names would clash in this file on this line.
$this->setFirePhp(new FirePhp\FirePhpBridge(new FirePHPService()));
}

return $this->firephp;
}

Expand Down

0 comments on commit 40d86d0

Please sign in to comment.