当前位置: 首页>>代码示例>>PHP>>正文


PHP ftp_rename函数代码示例

本文整理汇总了PHP中ftp_rename函数的典型用法代码示例。如果您正苦于以下问题:PHP ftp_rename函数的具体用法?PHP ftp_rename怎么用?PHP ftp_rename使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ftp_rename函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: rename

 /**
  * {@inheritDoc}
  */
 public function rename($sourceKey, $targetKey)
 {
     $sourcePath = $this->computePath($sourceKey);
     $targetPath = $this->computePath($targetKey);
     $this->ensureDirectoryExists(dirname($targetPath), true);
     return ftp_rename($this->getConnection(), $sourcePath, $targetPath);
 }
开发者ID:saberyounis,项目名称:Sonata-Project,代码行数:10,代码来源:Ftp.php

示例2: ftp_rename

 public function ftp_rename($old_file, $new_file)
 {
     if (!$this->ftp_conn) {
         return false;
     }
     return @ftp_rename($this->ftp_conn, $old_file, $new_file);
 }
开发者ID:Calit2-UCI,项目名称:IoT_Map,代码行数:7,代码来源:ftp_model.php

示例3: rename

 public function rename(string $oldName, string $newName) : bool
 {
     if (ftp_rename($this->connect, $oldName, $newName)) {
         return true;
     } else {
         throw new FolderChangeNameException($oldName);
     }
 }
开发者ID:znframework,项目名称:znframework,代码行数:8,代码来源:Forge.php

示例4: internalMove

 /**
  * {@inheritdoc}
  *
  * @param string $oldAssetFile
  * @param string $newAssetFile
  * @return bool
  * @throws AssetMoveException
  */
 protected function internalMove($oldAssetFile, $newAssetFile)
 {
     $this->reconnectIfNeeded();
     if (!ftp_rename($this->connection, $oldAssetFile, $newAssetFile)) {
         throw new AssetMoveException(sprintf("Unable to move '%s' to '%s'.", $oldAssetFile, $newAssetFile));
     }
     return $newAssetFile;
 }
开发者ID:Akhoris,项目名称:asset,代码行数:16,代码来源:FtpClient.php

示例5: RenombraArchivo

function RenombraArchivo($anterior, $nuevo, $servidor, $puerto, $usuario, $password)
{
    $id_ftp = ConectarFTP($servidor, $puerto, $usuario, $password);
    //Obtiene un manejador y se conecta al Servidor FTP
    $quepaso = ftp_rename($id_ftp, $anterior, $nuevo);
    ftp_quit($id_ftp);
    //Cierra la conexion FTP
    return $quepaso;
}
开发者ID:AndyRocioGtz,项目名称:Registros,代码行数:9,代码来源:ftpfunc.php

示例6: ftpRename

 protected function ftpRename($old, $new)
 {
     $result;
     $conn_id = ftp_connect(FTP_SERVER);
     $login_result = ftp_login($conn_id, FTP_USER_NAME, FTP_USER_PASS);
     $result = ftp_rename($conn_id, $old, $new);
     ftp_close($conn_id);
     return $result;
 }
开发者ID:TaikiFnit,项目名称:CMS-on-PHP-v2,代码行数:9,代码来源:appModel.php

示例7: moveTo

 public function moveTo(MOXMAN_Vfs_IFile $dest)
 {
     if ($dest instanceof MOXMAN_Ftp_File) {
         ftp_rename($this->fileSystem->getConnection(), $this->getInternalPath(), $dest->getInternalPath());
     } else {
         $this->copyTo($dest);
         $this->delete(true);
     }
 }
开发者ID:newton27,项目名称:dolphin.pro,代码行数:9,代码来源:File.php

示例8: rename

 /**
  * Changes name of element
  * 
  * @param string $newName New name
  *
  * @throws cFTP_Exception
  * 
  * @return cFTP_Element 
  */
 public function rename($newName)
 {
     $success = @ftp_rename($this->handle, $this->name, $newName);
     
     if( !$success )
         throw new cFTP_Exception( "Could not rename", 36 );
     
     return $this;
 }
开发者ID:robik,项目名称:cFTP,代码行数:18,代码来源:Item.php

示例9: move_file

 /**
  * 方法:移动文件 
  * @path    -- 原路径 
  * @newpath -- 新路径 
  * @type    -- 若目标目录不存在则新建 
  */
 function move_file($path, $newpath, $type = true)
 {
     if ($type) {
         $this->dir_mkdirs($newpath);
     }
     $this->off = @ftp_rename($this->conn_id, $path, $newpath);
     if (!$this->off) {
         echo "文件移动失败,请检查权限及原路径是否正确!";
     }
 }
开发者ID:8yong8,项目名称:vshop,代码行数:16,代码来源:Ftp.class.php

示例10: atnevez

function atnevez($id, $hova, $reginev)
{
    if (isset($_POST["ujnev"])) {
        $uj = $_POST["ujnev"];
        ftp_rename($id, "{$hova}/{$reginev}", "{$hova}/{$uj}");
        return header("Location: {$PHP_SELF}?mit=" . urlencode($hova));
    } else {
        print "<form action=\"{$PHP_SELF}?mit={$hova}&csa=" . urlencode($reginev) . "\" method=\"POST\">" . "<center>Új Név:&nbsp;<input type=\"text\" name=\"ujnev\" value=\"{$reginev}\">&nbsp;" . "<input type=\"submit\" value=\"Átnevez\"></center>" . "</form><br>";
    }
}
开发者ID:DeteCT0R,项目名称:gts-minicp,代码行数:10,代码来源:funkciok.php

示例11: rename

 public function rename($remotePath, $localPath)
 {
     if (@ftp_nlist($this->link, $localPath)) {
         if (!@ftp_rename($this->link, $localPath, $remotePath)) {
             $error = error_get_last();
             throw new Exception(sprintf('%s: Failed to %s file. Remote Path: %s, Local Path: %s, Error: %s', get_class($this), __FUNCTION__, $remotePath, $localPath, $error['message']));
         }
     }
     return $this;
 }
开发者ID:bramverstraten,项目名称:fogproject,代码行数:10,代码来源:FOGFTP.class.php

示例12: move_file

 /** 
  * 方法:移动文件 
  * @path    -- 原路径 
  * @newpath -- 新路径 
  * @type    -- 若目标目录不存在则新建 
  */
 function move_file($path, $newpath, $type = true)
 {
     if ($type) {
         $this->dir_mkdirs($newpath);
     }
     $this->off = @ftp_rename($this->conn_id, $path, $newpath);
     if (!$this->off) {
         return false;
     } else {
         return true;
     }
 }
开发者ID:codingoneapp,项目名称:codingone,代码行数:18,代码来源:ftp.php

示例13: moveFtpFile

 public static function moveFtpFile($filename, $process)
 {
     $ftp_dir = $process . '/';
     $final_destination = '/processed_feed/' . $filename;
     $ftp_conn = ftp_connect(config('monster.ftp_server'), 21);
     if ($ftp_conn) {
         $ftp_login = ftp_login($ftp_conn, config('monster.ftp_user'), config('monster.ftp_password'));
         if ($ftp_login) {
             $is_passive = ftp_pasv($ftp_conn, true);
             if ($is_passive) {
                 $is_dir_changed = ftp_chdir($ftp_conn, $ftp_dir);
                 if (!$is_dir_changed) {
                     ftp_close($ftp_conn);
                 } else {
                     // move ftp file
                     $ftp_files = ftp_nlist($ftp_conn, "");
                     if (in_array($filename, $ftp_files)) {
                         if ($process == 'test' || $process == 'processed_feed') {
                             // TO DO: keep it to test the export process
                             $is_deleted = ftp_delete($ftp_conn, '/' . $ftp_dir . $filename);
                             if ($is_deleted) {
                                 ExportLog::create(['process' => $process, 'filename' => $filename, 'message' => 'was deleted from FTP [' . $process . '] folder']);
                                 FileInProgress::where(['file_name' => $filename])->delete();
                             } else {
                                 ExportLog::create(['process' => $process, 'filename' => $filename, 'message' => 'cannot be deleted']);
                                 FileInProgress::where(['file_name' => $filename])->delete();
                             }
                         } else {
                             $is_moved = ftp_rename($ftp_conn, $filename, $final_destination);
                             if ($is_moved) {
                                 ExportLog::create(['process' => $process, 'filename' => $filename, 'message' => 'was moved to FTP [processed_feed] folder']);
                                 FileInProgress::where(['file_name' => $filename])->delete();
                             } else {
                                 ExportLog::create(['process' => $process, 'filename' => $filename, 'message' => 'cannot be moved to [' . $final_destination . ']']);
                             }
                         }
                     } else {
                         ExportLog::create(['process' => $process, 'filename' => $filename, 'message' => 'is not found on the FTP server']);
                     }
                 }
             }
         }
         ftp_close($ftp_conn);
     }
     //queue local file for deletion
     FileDeleteQueue::create(['file_name' => $filename]);
 }
开发者ID:lucy-udalykh,项目名称:samples,代码行数:47,代码来源:Monster.php

示例14: prepare

 /**
  *  preprocess Index action.
  *
  *  @access    public
  *  @return    string  Forward name (null if no errors.)
  */
 function prepare()
 {
     if ($this->af->validate() == 0) {
         $username = $this->af->get('ftp_username');
         $password = $this->af->get('ftp_password');
         $xoops_root_path = $this->af->get('root_path');
         var_dump($username, $password, $xoops_root_path);
         if ($conn_id = ftp_connect('localhost')) {
             $this->af->setApp($i++, $i++);
             if (ftp_login($conn_id, $username, $password)) {
                 $ftp_root = $this->seekFTPRoot($conn_id);
                 if ($ftp_root !== false) {
                     $install_dir = str_replace($ftp_root, '', $xoops_root_path) . '/install';
                     $install_dir_dest = $install_dir . '_' . Ethna_Util::getRandom(16);
                     ftp_rename($conn_id, $install_dir, $install_dir_dest);
                     $mainfile = str_replace($ftp_root, '', $xoops_root_path) . '/mainfile.php';
                     ftp_chmod($conn_id, 0644, $mainfile);
                     return null;
                 }
             }
         }
     }
     return 'json_error';
 }
开发者ID:hiro1173,项目名称:legacy,代码行数:30,代码来源:Removedir.php

示例15: rename

 /**
  * @inheritdoc
  */
 public function rename($path, $newpath)
 {
     return ftp_rename($this->getConnection(), $path, $newpath);
 }
开发者ID:stevedaddy,项目名称:react,代码行数:7,代码来源:Ftp.php


注:本文中的ftp_rename函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。