frontend/modules/elfind/src/elFinderVolumeLocalFileSystem.class.php
/**
     * Move file into another parent dir.
     * Return new file path or false.
     *
     * @param  string $source source file path
     * @param $targetDir
     * @param  string $name file name
     * @return bool|string
     * @internal param string $target target dir path
     * @author Dmitry (dio) Levashov
     */
Move file into another parent dir.
Return new file path or false.


Move file into another parent dir . Return new file path or false .
protected function _move($source, $targetDir, $name)
    {
        $mtime = filemtime($source);
        $target = $this->_joinPath($targetDir, $name);
        $move_folder = is_dir($source);
        $source_dir = dirname($source);
        $target_dir = dirname($target);
        if ($source_dir !== $target_dir) { $is_rename = false; } else { $is_rename = true; }
        $regEvent = $this->event_move($source, $target, $is_rename);
        if ($regEvent['result'] == 'error') {
            return $this->setError($regEvent['info']);
        } elseif ($regEvent['result'] == 'queued' && $move_folder) {
            if (!file_exists($target)) {
                FileSys::mkdir($target, UserFiles::CHMOD_DIR, true);
                $copying_in_progress = $target . DIRECTORY_SEPARATOR . UserFiles::DIR_COPYING_IN_PROGRESS;
                touch($copying_in_progress);
            }
        }
        isset($this->options['keepTimestamp']['move']) && $mtime && touch($target, $mtime);
        foreach ($regEvent['event_data'] as $k => $v) {
            array_push(parent::$event_data, $regEvent['event_data'][$k]);
        }
        clearstatcache();
        return $target;
    }
protected function _move ( $ source , $ targetDir , $ name ) { $ mtime = filemtime ( $ source ) ; $ target = $ this -> _joinPath ( $ targetDir , $ name ) ; $ move_folder = is_dir ( $ source ) ; $ source_dir = dirname ( $ source ) ; $ target_dir = dirname ( $ target ) ; if ( $ source_dir !== $ target_dir ) { $ is_rename = false ; } else { $ is_rename = true ; } $ regEvent = $ this -> event_move ( $ source , $ target , $ is_rename ) ; if ( $ regEvent [ 'result' ] == 'error' ) { return $ this -> setError ( $ regEvent [ 'info' ] ) ; } elseif ( $ regEvent [ 'result' ] == 'queued' && $ move_folder ) { if ( ! file_exists ( $ target ) ) { FileSys :: mkdir ( $ target , UserFiles :: CHMOD_DIR , true ) ; $ copying_in_progress = $ target . DIRECTORY_SEPARATOR . UserFiles :: DIR_COPYING_IN_PROGRESS ; touch ( $ copying_in_progress ) ; } } isset ( $ this -> options [ 'keepTimestamp' ] [ 'move' ] ) && $ mtime && touch ( $ target , $ mtime ) ; foreach ( $ regEvent [ 'event_data' ] as $ k => $ v ) { array_push ( parent :: $ event_data , $ regEvent [ 'event_data' ] [ $ k ] ) ; } clearstatcache ( ) ; return $ target ; }
Move file into another parent dir.
Move file into another parent dir .
/** Оригинальное тело ф-ии до моих правок
        $mtime = filemtime($source);
        $target = $this->_joinPath($targetDir, $name);

        if ($ret = rename($source, $target) ? $target : false) {
            isset($this->options['keepTimestamp']['move']) && $mtime && touch($target, $mtime);
            clearstatcache();
        }

        return $ret;
        */ /*
        var_dump($source);
        var_dump($target);
        exit;
        */ //var_dump($regEvent); exit; //return $target; //return $this->setError('Copy folder in progress');