src/FileJunglist.php
public function rotateInstalledFiles($installPath)
    {
        $fsm = new Filesystem;
        $tempDir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid('oci-');
        DebugPrinter::log('Rotating files using `%s` dir', $tempDir);
        // unzipped contents may or may not contain `upload.*` directory,
        // which holds actual opencart contents.
        $dirs = glob($installPath . DIRECTORY_SEPARATOR . '*', GLOB_ONLYDIR);
        foreach ($dirs as $key => $dir) {
            if ($dir[0] === '.') {
                unset($dirs[$key]);
            }
        }
        if (sizeof($dirs) === 1) {
            $subDirectory = $tempDir . DIRECTORY_SEPARATOR .
                dirname(reset($dirs));
            $fsm->rename($installPath, $tempDir);
            $fsm->rename($subDirectory, $installPath);
            $fsm->remove($tempDir);
        }
    }
public function rotateInstalledFiles($installPath)
    {
        $fsm = new Filesystem;
        $tempDir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid('oci-');
        DebugPrinter::log('Rotating files using `%s` dir', $tempDir);
        // unzipped contents may or may not contain `upload.*` directory,
        // which holds actual opencart contents.
        $dirs = glob($installPath . DIRECTORY_SEPARATOR . '*', GLOB_ONLYDIR);
        foreach ($dirs as $key => $dir) {
            if ($dir[0] === '.') {
                unset($dirs[$key]);
            }
        }
        if (sizeof($dirs) === 1) {
            $subDirectory = $tempDir . DIRECTORY_SEPARATOR .
                dirname(reset($dirs));
            $fsm->rename($installPath, $tempDir);
            $fsm->rename($subDirectory, $installPath);
            $fsm->remove($tempDir);
        }
    }
public function rotateInstalledFiles ( $ installPath ) { $ fsm = new Filesystem ; $ tempDir = sys_get_temp_dir ( ) . DIRECTORY_SEPARATOR . uniqid ( 'oci-' ) ; DebugPrinter :: log ( 'Rotating files using `%s` dir' , $ tempDir ) ; // unzipped contents may or may not contain `upload.*` directory, // which holds actual opencart contents. $ dirs = glob ( $ installPath . DIRECTORY_SEPARATOR . '*' , GLOB_ONLYDIR ) ; foreach ( $ dirs as $ key => $ dir ) { if ( $ dir [ 0 ] === '.' ) { unset ( $ dirs [ $ key ] ) ; } } if ( sizeof ( $ dirs ) === 1 ) { $ subDirectory = $ tempDir . DIRECTORY_SEPARATOR . dirname ( reset ( $ dirs ) ) ; $ fsm -> rename ( $ installPath , $ tempDir ) ; $ fsm -> rename ( $ subDirectory , $ installPath ) ; $ fsm -> remove ( $ tempDir ) ; } }
Moves installed files out of `upload` dir.

@param string $installPath Opencart installation path.

@return void
@since 0.1.0
Moves installed files out of upload dir .