src/ImageStack/Cache/RawFileCache.php
protected function assertDirectory($filename)
    {
        $dirname = dirname($filename);
        if (!is_dir($dirname)) {
            if (is_file($dirname)) {
                throw new RawFileCacheException(sprintf('File with same name : %s', $dirname), RawFileCacheException::FILE_WITH_SAME_NAME);
            }
            @mkdir($dirname, $this->getOption('dir_mode', 0755), true);
            if (!is_dir($dirname)) {
                throw new RawFileCacheException(sprintf('Cannot create directory : %s', $dirname), RawFileCacheException::CANNOT_CREATE_DIRECTORY);
            }
        }
    }
protected function assertDirectory($filename)
    {
        $dirname = dirname($filename);
        if (!is_dir($dirname)) {
            if (is_file($dirname)) {
                throw new RawFileCacheException(sprintf('File with same name : %s', $dirname), RawFileCacheException::FILE_WITH_SAME_NAME);
            }
            @mkdir($dirname, $this->getOption('dir_mode', 0755), true);
            if (!is_dir($dirname)) {
                throw new RawFileCacheException(sprintf('Cannot create directory : %s', $dirname), RawFileCacheException::CANNOT_CREATE_DIRECTORY);
            }
        }
    }
protected function assertDirectory ( $ filename ) { $ dirname = dirname ( $ filename ) ; if ( ! is_dir ( $ dirname ) ) { if ( is_file ( $ dirname ) ) { throw new RawFileCacheException ( sprintf ( 'File with same name : %s' , $ dirname ) , RawFileCacheException :: FILE_WITH_SAME_NAME ) ; } @ mkdir ( $ dirname , $ this -> getOption ( 'dir_mode' , 0755 ) , true ) ; if ( ! is_dir ( $ dirname ) ) { throw new RawFileCacheException ( sprintf ( 'Cannot create directory : %s' , $ dirname ) , RawFileCacheException :: CANNOT_CREATE_DIRECTORY ) ; } } }
Assert that the parent directory can or will exist.
@param string $filename
@throws RawFileCacheException
Assert that the parent directory can or will exist .