Sfoglia il codice sorgente

Check for directory before throwing 'no existing directory' exception

Josh McRae 8 anni fa
parent
commit
c0eeca76fd
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/Monolog/Handler/StreamHandler.php

+ 1 - 1
src/Monolog/Handler/StreamHandler.php

@@ -167,7 +167,7 @@ class StreamHandler extends AbstractProcessingHandler
             set_error_handler(array($this, 'customErrorHandler'));
             set_error_handler(array($this, 'customErrorHandler'));
             $status = mkdir($dir, 0777, true);
             $status = mkdir($dir, 0777, true);
             restore_error_handler();
             restore_error_handler();
-            if (false === $status) {
+            if (false === $status && !is_dir($dir)) {
                 throw new \UnexpectedValueException(sprintf('There is no existing directory at "%s" and its not buildable: '.$this->errorMessage, $dir));
                 throw new \UnexpectedValueException(sprintf('There is no existing directory at "%s" and its not buildable: '.$this->errorMessage, $dir));
             }
             }
         }
         }