eZ\Publish\Core\Base\ServiceContainer::prepareDirectory PHP Method

prepareDirectory() protected method

Checks for existence of given $directory and tries to create it if found missing.
protected prepareDirectory ( string $directory, string $name )
$directory string Path to the directory
$name string Used for exception message
    protected function prepareDirectory($directory, $name)
    {
        if (!is_dir($directory)) {
            if (false === @mkdir($directory, 0777, true)) {
                throw new RuntimeException(sprintf("Unable to create the %s directory (%s)\n", $name, $directory));
            }
        } elseif (!is_writable($directory)) {
            throw new RuntimeException(sprintf("Unable to write in the %s directory (%s)\n", $name, $directory));
        }
    }