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/2878' into develop
Browse files Browse the repository at this point in the history
Conflicts:
	library/Zend/File/Transfer/Adapter/AbstractAdapter.php
	library/Zend/File/Transfer/Adapter/Http.php
	tests/ZendTest/Log/Writer/AbstractTest.php
	tests/ZendTest/Log/Writer/DbTest.php
  • Loading branch information
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 29 deletions.
12 changes: 6 additions & 6 deletions src/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ public function debug($message, $extra = array())
public static function registerErrorHandler(Logger $logger)
{
// Only register once per instance
if (self::$registeredErrorHandler) {
if (static::$registeredErrorHandler) {
return false;
}

Expand Down Expand Up @@ -536,7 +536,7 @@ public static function registerErrorHandler(Logger $logger)
));
}
});
self::$registeredErrorHandler = true;
static::$registeredErrorHandler = true;
return true;
}

Expand All @@ -547,7 +547,7 @@ public static function registerErrorHandler(Logger $logger)
public static function unregisterErrorHandler()
{
restore_error_handler();
self::$registeredErrorHandler = false;
static::$registeredErrorHandler = false;
}

/**
Expand All @@ -561,7 +561,7 @@ public static function unregisterErrorHandler()
public static function registerExceptionHandler(Logger $logger)
{
// Only register once per instance
if (self::$registeredExceptionHandler) {
if (static::$registeredExceptionHandler) {
return false;
}

Expand All @@ -580,7 +580,7 @@ public static function registerExceptionHandler(Logger $logger)
}
$logger->log(Logger::ERR, $exception->getMessage(), $extra);
});
self::$registeredExceptionHandler = true;
static::$registeredExceptionHandler = true;
return true;
}

Expand All @@ -590,6 +590,6 @@ public static function registerExceptionHandler(Logger $logger)
public static function unregisterExceptionHandler()
{
restore_exception_handler();
self::$registeredExceptionHandler = false;
static::$registeredExceptionHandler = false;
}
}
8 changes: 4 additions & 4 deletions src/Writer/Syslog.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ protected function initializeValidFacilities()
*/
protected function initializeSyslog()
{
self::$lastApplication = $this->appName;
self::$lastFacility = $this->facility;
static::$lastApplication = $this->appName;
static::$lastFacility = $this->facility;
openlog($this->appName, LOG_PID, $this->facility);
}

Expand Down Expand Up @@ -231,8 +231,8 @@ protected function doWrite(array $event)
$priority = $this->defaultPriority;
}

if ($this->appName !== self::$lastApplication
|| $this->facility !== self::$lastFacility
if ($this->appName !== static::$lastApplication
|| $this->facility !== static::$lastFacility
) {
$this->initializeSyslog();
}
Expand Down
10 changes: 0 additions & 10 deletions test/Writer/AbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ protected function setUp()
$this->_writer = new ConcreteWriter();
}

/**
* @group ZF-6085
*/
public function testSetFormatter()
{
$this->_writer->setFormatter(new SimpleFormatter());
$this->setExpectedException('Zend\Log\Exception\InvalidArgumentException');
$this->_writer->setFormatter(new \StdClass());
}

public function testSetSimpleFormatterByName()
{
$instance = $this->_writer->setFormatter('simple');
Expand Down
9 changes: 0 additions & 9 deletions test/Writer/DbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,6 @@ public function testShutdownRemovesReferenceToDatabaseInstance()
$this->writer->write(array('message' => 'this should fail'));
}

/**
* @group ZF-10089
*/
public function testThrowStrictSetFormatter()
{
$this->setExpectedException('Zend\Log\Exception\InvalidArgumentException');
$this->writer->setFormatter(new \StdClass());
}

public function testWriteDateTimeAsTimestamp()
{
$date = new DateTime();
Expand Down

0 comments on commit 86d3ae8

Please sign in to comment.