lib/transfer.php
/**
     * Run by child process (async)
     */
Run by child process (async)
Run by child process ( async )
public function forked($pid, $args){
        $fcStatus = $this->mapper->find($args['fileId']);
        $fcStatus->setStatus("processing");
        $this->mapper->update($fcStatus);
        \OC\Files\Filesystem::init($args['userId'], '/');
        $path = \OC\Files\Filesystem::getPath($args['fileId']);
        if (strlen($path) <= 0){
            echo "cannot find path for: `" . $args['userId'] . ":" . $args['fileId'] . "`" . PHP_EOL;
            return;
        }
        echo PHP_EOL. " " . $pid . " {{ " . $path . " }} start...";
        sleep(5);
        echo PHP_EOL. " " . $pid . " {{ " . $path . " }} ... end";
    }
public function forked ( $ pid , $ args ) { $ fcStatus = $ this -> mapper -> find ( $ args [ 'fileId' ] ) ; $ fcStatus -> setStatus ( " processing " ) ; $ this -> mapper -> update ( $ fcStatus ) ; \ OC \ Files \ Filesystem :: init ( $ args [ 'userId' ] , '/' ) ; $ path = \ OC \ Files \ Filesystem :: getPath ( $ args [ 'fileId' ] ) ; if ( strlen ( $ path ) <= 0 ) { echo " cannot find path for: ` " . $ args [ 'userId' ] . " : " . $ args [ 'fileId' ] . " ` " . PHP_EOL ; return ; } echo PHP_EOL . " " . $ pid . "  {{  " . $ path . "  }} start... " ; sleep ( 5 ) ; echo PHP_EOL . " " . $ pid . "  {{  " . $ path . "  }} ... end " ; }
Run by child process (async)
Run by child process ( async )
// get path of file // TODO: make sure the user can access the file // detect failed lookups // \OC\Files\Filesystem::getFileInfo($args['fileId']); // $view = new \OC\Files\View('/' . $args['userId'] . '/files'); // $fileinfo = $view->getFileInfo("blaat.txt"); // echo "{{ " . $fileinfo->getInternalPath() . " }}" .PHP_EOL; // echo "{{ " . $fileinfo->getId() . " }}" .PHP_EOL; // echo "{{ " . $fileinfo->getMountPoint() . " }}" .PHP_EOL; // echo "{{ " . $fileinfo->getSize() . " }}" .PHP_EOL; // echo "{{ " . $fileinfo->getType() . " }}" .PHP_EOL; // echo "{{ " . $fileinfo->stat() . " }}" .PHP_EOL; // echo "... forked end \t" . $pid . PHP_EOL; // TODO: load user from $user_name // TODO: load file from $file_id // TODO: check permissions // TODO: load external config // TODO: start external session // TODO: start transfer // TODO: update status table