本文整理汇总了PHP中FileSystem::deleteFile方法的典型用法代码示例。如果您正苦于以下问题:PHP FileSystem::deleteFile方法的具体用法?PHP FileSystem::deleteFile怎么用?PHP FileSystem::deleteFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileSystem
的用法示例。
在下文中一共展示了FileSystem::deleteFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clear
/**
*
* @param string $area
* @param string $key
*/
public static function clear($area = "", $key = "")
{
$path = self::getCacheDir($area);
if ($key == "") {
FileSystem::deleteDir($path);
} else {
FileSystem::deleteFile($path . "/" . md5($key) . ".txt");
}
}
示例2: uploadFileToRemoteHost
public function uploadFileToRemoteHost($path, $url, $deleteFile = true)
{
global $SynchSessionController;
$sessionId = $SynchSessionController->getCurrentSessionId();
$fileUploader = new CurlFileUploader($path, $url, 'file1', array('sessionId' => $sessionId));
$fileUploader->UploadFile();
if ($deleteFile) {
FileSystem::deleteFile($path);
}
return true;
}
示例3: array
require '../_inc/functions.inc';
require '../_inc/FileInterface.inc';
require '../_inc/FileSystemInterface.inc';
$return = array();
$return['result'] = 'fail';
$return['errors'] = array();
if (!isset($_REQUEST['filename']) || empty($_REQUEST['filename'])) {
$return['missing'] = array('filename' => 'File Name');
} elseif (mb_strpos($_REQUEST['filename'], '/') !== false) {
$return['errors'][] = 'Invalid file name';
} else {
// should validate/sanitise the filename
$file_to_delete = '../' . FMS_USER_FOLDER . '/' . trim($_REQUEST['filename']);
if (!is_file($file_to_delete)) {
$return['result'] = 'success';
} else {
$file = new \File($file_to_delete);
$fileSystem = new \FileSystem('../' . FMS_USER_FOLDER);
if ($fileSystem->deleteFile($file)) {
$return['result'] = 'success';
} else {
$return['errors'][] = $fileSystem->error;
}
}
}
if (defined('FMS_AJAX') && FMS_AJAX === true) {
header("HTTP/1.1 200 OK");
header('Content-type: text/plain; charset=utf-8');
echo json_encode($return);
exit;
}