src/File/RenameUpload.php
protected function createFolders()
    {
        $dir    = null;
        $target = $this->getTargetDirectory();

        /** @noinspection IsEmptyFunctionUsageInspection */
        if (!empty($target)) {
            $dir = rtrim($target, '/') . DIRECTORY_SEPARATOR;
            $this->setTarget($dir);
        }

        if ($dir !== null && !is_dir($dir) && $this->isAllowCreateFolders()) {
            /** @noinspection NotOptimalIfConditionsInspection */
            /** @noinspection PhpUsageOfSilenceOperatorInspection */
            if (!@mkdir($dir, 0777, true) && !is_dir($dir)) {
                throw new Exception\NoSuchDirectoryException(
                    sprintf('Directory %s does not exists.', $dir)
                );
            }
        }
    }
protected function createFolders()
    {
        $dir    = null;
        $target = $this->getTargetDirectory();

        /** @noinspection IsEmptyFunctionUsageInspection */
        if (!empty($target)) {
            $dir = rtrim($target, '/') . DIRECTORY_SEPARATOR;
            $this->setTarget($dir);
        }

        if ($dir !== null && !is_dir($dir) && $this->isAllowCreateFolders()) {
            /** @noinspection NotOptimalIfConditionsInspection */
            /** @noinspection PhpUsageOfSilenceOperatorInspection */
            if (!@mkdir($dir, 0777, true) && !is_dir($dir)) {
                throw new Exception\NoSuchDirectoryException(
                    sprintf('Directory %s does not exists.', $dir)
                );
            }
        }
    }
protected function createFolders ( ) { $ dir = null ; $ target = $ this -> getTargetDirectory ( ) ; /** @noinspection IsEmptyFunctionUsageInspection */ if ( ! empty ( $ target ) ) { $ dir = rtrim ( $ target , '/' ) . DIRECTORY_SEPARATOR ; $ this -> setTarget ( $ dir ) ; } if ( $ dir !== null && ! is_dir ( $ dir ) && $ this -> isAllowCreateFolders ( ) ) { /** @noinspection NotOptimalIfConditionsInspection */ /** @noinspection PhpUsageOfSilenceOperatorInspection */ if ( ! @ mkdir ( $ dir , 0777 , true ) && ! is_dir ( $ dir ) ) { throw new Exception \ NoSuchDirectoryException ( sprintf ( 'Directory %s does not exists.' , $ dir ) ) ; } } }
Create destination folder on the fly.

@return void
@throws \Xloit\Bridge\Zend\Filter\Exception\NoSuchDirectoryException
Create destination folder on the fly .