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


PHP FileSystem::moveFile方法代码示例

本文整理汇总了PHP中FileSystem::moveFile方法的典型用法代码示例。如果您正苦于以下问题:PHP FileSystem::moveFile方法的具体用法?PHP FileSystem::moveFile怎么用?PHP FileSystem::moveFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileSystem的用法示例。


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

示例1: dirname

<?php

require_once dirname(__FILE__) . "/../../admin/synch-setup.php";
echo __FILE__ . ' $post = <br /><pre>' . print_r($_POST, true) . '</pre></br>';
echo __FILE__ . ' $_FILES = <br /><pre>' . print_r($_FILES, true) . '</pre></br>';
/*
 * Save the file to disk
 */
//FileSystem::putFileContents();
//'destination/temp.txt'
FileSystem::moveFile($_FILES['file1']['tmp_name'], 'destination/' . $_FILES['file1']['name']);
开发者ID:r007,项目名称:PMoodle,代码行数:11,代码来源:fileUploaderTest.php

示例2: moveBackupFromQueueToSession

 public function moveBackupFromQueueToSession($session, $fileName, $type = 0)
 {
     if (!isset($session) || empty($fileName)) {
         return false;
     }
     $pathFrom = $this->createQueueSessionPath($session->id, $type);
     // Check the queue for a session folder. If there is one copy any zip
     // files inside to the session backups folders
     $pathFrom .= '/' . $fileName;
     if (!FileSystem::exists($pathFrom, 'f')) {
         return false;
     }
     $pathTo = $this->createSessionBackupPath($session);
     $pathTo .= '/' . $fileName;
     FileSystem::createFoldersFromPath(FileSystem::path_pop($pathTo));
     FileSystem::moveFile($pathFrom, $pathTo);
     return true;
 }
开发者ID:r007,项目名称:PMoodle,代码行数:18,代码来源:synch_synch_controller.php

示例3: dirname

<?php

/*
 *
 * @copyright &copy; 2007 The Open University
 * @author c.chambers@open.ac.uk
 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
 * @package synch
 * 
 * This  file is used to transfer a file from the temporary download location
 * into the moodle synch queue.
 */
require_once dirname(__FILE__) . "/setup.php";
global $CFG;
// Get the path of the temporary file
$from = $_FILES['file1']['tmp_name'];
$path = $CFG->synch->path_queue_in;
// If the file is attached to a session save it in a session folder
if (isset($_POST['sessionId'])) {
    $path .= '/' . $_POST['sessionId'];
}
// Create the path to move the file to
$to = $path . '/' . $_FILES['file1']['name'];
// Create folders if they aren't already there
FileSystem::createFoldersFromPath($path);
FileSystem::moveFile($from, $to);
开发者ID:r007,项目名称:PMoodle,代码行数:26,代码来源:queue.php


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