本文整理汇总了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']);
示例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;
}
示例3: dirname
<?php
/*
*
* @copyright © 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);