本文整理匯總了PHP中IO::Delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP IO::Delete方法的具體用法?PHP IO::Delete怎麽用?PHP IO::Delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IO
的用法示例。
在下文中一共展示了IO::Delete方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DeleteByData
/**
* 刪除指定的元素
* @param string $opath 被移動的文件路徑
* @param string $path 目標位置(可能是同一api內或跨api,這兩種情況分開處理)
* @return icosdatas
*/
public function DeleteByData($data)
{
$havesubitem = 0;
if (isset($data['contents'])) {
foreach ($data['contents'] as $key => $value) {
/*print_r($value);
echo '=====<br>';*/
$return = self::DeleteByData($value);
if (intval($return['delete']) < 1) {
$havesubitem = 1;
}
$data['contents'][$key] = $return;
}
}
if ($data['success'] === true && !$havesubitem) {
if ($data['icoid'] == $data['newdata']['icoid']) {
$data['newdata']['move'] = 1;
} else {
$arr = IO::Delete($data['path'], true);
if ($arr['icoid']) {
$data['delete'] = 1;
} else {
$data['success'] = $arr['error'];
}
}
}
return $data;
}
示例2: Migrate
public function Migrate($attach, $remoteid)
{
global $_G;
if (is_numeric($re = self::MoveToSpace($attach, $remoteid))) {
$remoteid = $re;
if (C::t('attachment')->update($attach['aid'], array('remote' => $re))) {
//刪除原文件
$obz = io_remote::getBzByRemoteid($attach['remote']);
if ($obz == 'dzz') {
@unlink($_G['setting']['attachdir'] . $attach['attachment']);
} else {
$opath = $obz . '/' . $attach['attachment'];
IO::Delete($opath);
}
}
C::t('local_storage')->update_usesize_by_remoteid($remoteid, $attach['filesize']);
C::t('local_storage')->update_usesize_by_remoteid($attach['remote'], -$attach['filesize']);
$attach['remote'] = $remoteid;
return $attach;
} else {
if ($re['error']) {
$attach['error'] = $re['error'];
return $attach;
} else {
return false;
}
}
}
示例3: array
$arr['msg'] = 'success';
}
} else {
$arr = array();
$arr['error'] = lang('template', '新建失敗');
}
echo json_encode($arr);
exit;
} elseif ($do == 'deleteIco') {
$arr = array();
$names = array();
$i = 0;
$icoids = $_GET['icoids'];
$bz = trim($_GET['bz']);
foreach ($icoids as $icoid) {
$return = IO::Delete($icoid);
if (!$return['error']) {
//處理數據
$arr['sucessicoids'][$return['icoid']] = $return['icoid'];
$arr['msg'][$return['icoid']] = 'success';
$i++;
} else {
$arr['msg'][$return['icoid']] = $return['error'];
}
}
echo json_encode_gbk($arr);
exit;
} elseif ($do == 'emptyFolder') {
$arr = array();
$fid = intval($_GET['fid']);
if ($return = C::t('folder')->empty_by_fid($fid)) {