@@ 108-114 (lines=7) @@ | ||
105 | ||
106 | protected function getTargetFile($directory, $name = null) |
|
107 | { |
|
108 | if (!is_dir($directory)) { |
|
109 | if (false === @mkdir($directory, 0777, true) && !is_dir($directory)) { |
|
110 | throw new FileException(sprintf('Unable to create the "%s" directory', $directory)); |
|
111 | } |
|
112 | } elseif (!is_writable($directory)) { |
|
113 | throw new FileException(sprintf('Unable to write in the "%s" directory', $directory)); |
|
114 | } |
|
115 | ||
116 | $target = rtrim($directory, '/\\').DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : $this->getName($name)); |
|
117 |
@@ 594-600 (lines=7) @@ | ||
591 | protected function buildContainer() |
|
592 | { |
|
593 | foreach (array('cache' => $this->getCacheDir(), 'logs' => $this->getLogDir()) as $name => $dir) { |
|
594 | if (!is_dir($dir)) { |
|
595 | if (false === @mkdir($dir, 0777, true) && !is_dir($dir)) { |
|
596 | throw new \RuntimeException(sprintf("Unable to create the %s directory (%s)\n", $name, $dir)); |
|
597 | } |
|
598 | } elseif (!is_writable($dir)) { |
|
599 | throw new \RuntimeException(sprintf("Unable to write in the %s directory (%s)\n", $name, $dir)); |
|
600 | } |
|
601 | } |
|
602 | ||
603 | $container = $this->getContainerBuilder(); |