Permalink
Browse files

combined conditional checks

  • Loading branch information...
Brian Fenton
Brian Fenton committed Oct 7, 2010
1 parent 5ccf4f4 commit e2c2e5b42aa7b84295511fc378d3a1e3aaf0ab43
Showing with 4 additions and 6 deletions.
  1. +4 −6 src/KLogger.php
View
@@ -153,12 +153,10 @@ public function __construct($logDirectory, $priority)
mkdir($logDirectory, self::$_defaultPermissions, true);
}
- if (file_exists($this->_logFile)) {
- if (!is_writable($this->_logFile)) {
- $this->_logStatus = self::OPEN_FAILED;
- $this->_messageQueue[] = $this->_messages['writefail'];
- return;
- }
+ if (file_exists($this->_logFile) && !is_writable($this->_logFile)) {
+ $this->_logStatus = self::OPEN_FAILED;
+ $this->_messageQueue[] = $this->_messages['writefail'];
+ return;
}
if (($this->_fileHandle = fopen($this->_logFile, "a"))) {

0 comments on commit e2c2e5b

Please sign in to comment.