diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php index 9436bcb71..aa53a0686 100644 --- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php +++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php @@ -153,7 +153,12 @@ class ProxyFactory $file = str_replace($placeholders, $replacements, $file); $parentDirectory = dirname($fileName); - if (! is_dir($parentDirectory) && ! mkdir($parentDirectory, 0775, true)) { + + if (! is_dir($parentDirectory)) { + mkdir($parentDirectory, 0775, true); + } + + if ( ! is_writable($parentDirectory)) { throw ProxyException::proxyDirectoryNotWritable(); }