src/File/RenameUpload.php
protected function fileDispersion($finalTarget)
    {
        if (strpos($finalTarget, DIRECTORY_SEPARATOR . 'original_image' . DIRECTORY_SEPARATOR) !== false) {
            return $finalTarget;
        }
        if ($this->isFileDispersionEnabled()) {
            $file           = pathinfo($finalTarget, PATHINFO_BASENAME);
            $dispersionPath = $this->getDispersionPath($file);
            $directory      = pathinfo($finalTarget, PATHINFO_DIRNAME) . $dispersionPath;
            $finalTarget    = $directory . $file;

            $this->setTargetDirectory($directory);
            $this->createFolders();
        }

        return $finalTarget;
    }
protected function fileDispersion($finalTarget)
    {
        if (strpos($finalTarget, DIRECTORY_SEPARATOR . 'original_image' . DIRECTORY_SEPARATOR) !== false) {
            return $finalTarget;
        }
        if ($this->isFileDispersionEnabled()) {
            $file           = pathinfo($finalTarget, PATHINFO_BASENAME);
            $dispersionPath = $this->getDispersionPath($file);
            $directory      = pathinfo($finalTarget, PATHINFO_DIRNAME) . $dispersionPath;
            $finalTarget    = $directory . $file;

            $this->setTargetDirectory($directory);
            $this->createFolders();
        }

        return $finalTarget;
    }
protected function fileDispersion ( $ finalTarget ) { if ( strpos ( $ finalTarget , DIRECTORY_SEPARATOR . 'original_image' . DIRECTORY_SEPARATOR ) !== false ) { return $ finalTarget ; } if ( $ this -> isFileDispersionEnabled ( ) ) { $ file = pathinfo ( $ finalTarget , PATHINFO_BASENAME ) ; $ dispersionPath = $ this -> getDispersionPath ( $ file ) ; $ directory = pathinfo ( $ finalTarget , PATHINFO_DIRNAME ) . $ dispersionPath ; $ finalTarget = $ directory . $ file ; $ this -> setTargetDirectory ( $ directory ) ; $ this -> createFolders ( ) ; } return $ finalTarget ; }
Process file dispersion.

@param string $finalTarget

@return string
@throws \Xloit\Bridge\Zend\Filter\Exception\NoSuchDirectoryException
Process file dispersion .