diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php index aa53a0686..18202e0f0 100644 --- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php +++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php @@ -154,11 +154,11 @@ class ProxyFactory $parentDirectory = dirname($fileName); - if (! is_dir($parentDirectory)) { - mkdir($parentDirectory, 0775, true); - } - - if ( ! is_writable($parentDirectory)) { + if ( ! is_dir($parentDirectory)) { + if (false === @mkdir($parentDirectory, 0775, true)) { + throw ProxyException::proxyDirectoryNotWritable(); + } + } else if ( ! is_writable($parentDirectory)) { throw ProxyException::proxyDirectoryNotWritable(); }