本文整理匯總了PHP中IO::getQuota方法的典型用法代碼示例。如果您正苦於以下問題:PHP IO::getQuota方法的具體用法?PHP IO::getQuota怎麽用?PHP IO::getQuota使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IO
的用法示例。
在下文中一共展示了IO::getQuota方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getQuota
public function getQuota($remoteid)
{
global $_G;
$data = self::fetch_by_remoteid($remoteid);
$return = array();
if ($data['type'] == 'local') {
$return['usesize'] = C::t('attachment')->getSizeByRemote($remoteid);
$return['totalsize'] = disk_free_space($_G['setting']['attachdir']);
} elseif ($data['type'] == 'pan') {
$bz = $data['bz'] . ':' . $data['id'] . ':';
$arr = IO::getQuota($bz);
$return['usesize'] = C::t('attachment')->getSizeByRemote($remoteid);
if (is_numeric($arr['quota']) && is_numeric($arr['used'])) {
$return['totalsize'] = $arr['quota'] - $arr['used'];
}
} elseif ($data['type'] == 'storage') {
$return['usesize'] = C::t('attachment')->getSizeByRemote($remoteid);
$return['totalsize'] = 0;
} elseif ($data['type'] == 'ftp') {
$bz = $data['bz'] . ':' . $data['id'] . ':';
$return['usesize'] = C::t('attachment')->getSizeByRemote($remoteid);
$return['totalsize'] = 0;
} else {
$return['usesize'] = C::t('attachment')->getSizeByRemote($remoteid);
$return['totalsize'] = 0;
}
return $return;
}