本文整理汇总了PHP中get_size函数的典型用法代码示例。如果您正苦于以下问题:PHP get_size函数的具体用法?PHP get_size怎么用?PHP get_size使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_size函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_size
function get_size($dir)
{
$speicher = 0;
$dateien = 0;
$verz = 0;
if ($handle = @opendir($dir)) {
while ($file = readdir($handle)) {
if ($file != "." && $file != ".." && $file != "Books") {
if (@is_dir($dir . "/" . $file)) {
$wert = get_size($dir . "/" . $file);
$speicher += $wert[2];
$dateien += $wert[0];
$verz += $wert[1];
$verz++;
if ($speicher > 900000000) {
break;
}
} else {
$speicher += @filesize($dir . "/" . $file);
$dateien++;
}
if ($dateien > 1000 || $verz > 1000) {
break;
}
}
}
closedir($handle);
}
$zurueck[0] = $dateien;
$zurueck[1] = $verz;
$zurueck[2] = $speicher;
return $zurueck;
}
示例2: curr_file
function curr_file($file_id)
{
global $db, $tpf, $settings, $code;
$file = $db->fetch_one_array("select * from {$tpf}files where file_id='{$file_id}'");
if (!$file) {
$file['is_del'] = 1;
} else {
$file['dl'] = create_down_url($file);
$in_extract = $code == md5($file['file_key']) ? 1 : 0;
$file['username'] = $file['p_name'] = @$db->result_first("select username from {$tpf}users where userid='{$file['userid']}' limit 1");
$rs = $db->fetch_one_array("select folder_id,folder_name from {$tpf}folders where userid='{$file['userid']}' and folder_id='{$file['folder_id']}'");
$file['file_category'] = $rs['folder_name'] ? '<a href="' . urr("space", "username=" . rawurlencode($file['username']) . "&folder_id=" . $rs['folder_id']) . '" target="_blank">' . $rs['folder_name'] . '</a>' : '- ' . __('uncategory') . ' -';
$file_key = trim($file['file_key']);
$tmp_ext = $file['file_extension'] ? '.' . $file['file_extension'] : "";
$file_extension = $file['file_extension'];
$file_ext = get_real_ext($file_extension);
$file['file_description'] = str_replace('<br>', LF, $file[file_description]);
$file['a_space'] = urr("space", "username=" . rawurlencode($file['username']));
$file['file_name_min'] = filter_word($file['file_name'] . $tmp_ext);
$file['file_name'] = filter_word($file['file_name'] . $tmp_ext);
$file['file_size'] = get_size($file['file_size']);
$file['p_time'] = $file['file_time'];
$file['file_time'] = $file['time_hidden'] ? __('hidden') : date("Y-m-d", $file['file_time']);
$file['credit_down'] = $file['file_credit'] ? (int) $file['file_credit'] : (int) $settings['credit_down'];
$file['username'] = $file[user_hidden] ? __('hidden') : ($file['username'] ? '<a href="' . $file['a_space'] . '">' . $file['username'] . '</a>' : __('hidden'));
$file['file_downs'] = $file['stat_hidden'] ? __('hidden') : get_discount($file[userid], $file['file_downs']);
$file['file_views'] = $file['stat_hidden'] ? __('hidden') : get_discount($file[userid], $file['file_views']);
$file['file_url'] = $settings['phpdisk_url'] . urr("viewfile", "file_id={$file['file_id']}");
if (get_plans(get_profile($file[userid], 'plan_id'), 'open_second_page') == 3) {
$file['a_downfile'] = urr("download", "file_id={$file_id}&key=" . random(32));
$file['a_downfile2'] = urr("download", "file_id={$file_id}&key=" . random(32));
}
}
return $file;
}
示例3: make
function make()
{
$args = parse_syscall_args(SYSPROTO_H);
$tab_name = getSyscallNames();
$info = merge_name_args($args, $tab_name);
$size = get_size($info);
$begin = get_static_begin($size["size_tab"] + 1, $size["max_size_proto"] + 1);
$str_tab = get_ctab_syscall($info, $size["size_tab"]);
$tt = $begin . "" . $str_tab . " };\n";
file_put_contents("./syscall_info.h", $tt);
}
示例4: get_directorysize
function get_directorysize($dir)
{
global $cs_main;
try {
$retval = get_size($cs_main['def_path'] . $dir);
} catch (Exception $e) {
$cs_err[1] = 'ERROR....';
$cs_err[2] = $e;
$retval = $cs_err;
}
return $retval;
}
示例5: get_size
function get_size($path)
{
if (!is_dir($path)) return filesize($path);
if (($handle = opendir($path)) != FALSE) {
$size = 0;
while (false !== ($file = readdir($handle))) {
if ($file != '.' && $file != '..') {
// function filesize has been deleted
$size += get_size($path . '/' . $file);
}
}
closedir($handle);
return $size;
}
}
示例6: get_size
function get_size($path)
{
if (!is_dir($path)) {
return filesize($path);
}
$dir = opendir($path);
while ($file = readdir($dir)) {
if (is_file($path . "/" . $file)) {
$size += filesize($path . "/" . $file);
}
if (is_dir($path . "/" . $file) && $file != "." && $file != "..") {
$size += get_size($path . "/" . $file);
}
}
return $size;
}
示例7: check
function check()
{
if ($_SESSION['step'] < 1) {
go("index");
}
$_SESSION['step'] = 2;
$uploadsize = ini_get("upload_max_filesize");
//允许上传的单个文件最大值
$gd = gd_info();
//获得GD库所有信息
$gdversion = $gd['GD Version'];
//获得GD库版本
$diskspace = get_size(disk_free_space('.'));
$system = array("phpversion" => PHP_VERSION, "phpos" => PHP_OS, "uploadsize" => $uploadsize, "gdversion" => $gdversion, "diskspace" => $diskspace);
$this->assign("system", $system);
$this->display();
}
示例8: curr_file
function curr_file($file_id)
{
global $db, $tpf, $settings;
$file = $db->fetch_one_array("select * from {$tpf}files where file_id='{$file_id}' and is_del=0");
if (!$file) {
$file['is_del'] = 1;
$file['file_name'] = __('visited_tips');
} else {
$file[dl] = create_down_url($file);
$file['is_del'] = 0;
$file_key = trim($file['file_key']);
$tmp_ext = $file['file_extension'] ? '.' . $file['file_extension'] : "";
$file_extension = $file['file_extension'];
$file_ext = get_real_ext($file_extension);
$file_description = $file['file_description'];
$file['file_description'] = nl2br($file['file_description']);
$file['a_space'] = urr("space", "username=" . rawurlencode($file['username']));
$file['file_name'] = filter_word($file['file_name'] . $tmp_ext);
$file['file_size'] = get_size($file['file_size']);
$file['file_url'] = $settings['phpdisk_url'] . urr("viewfile", "file_id={$file['file_id']}");
return $file;
}
}
示例9: time_diff
<div class="tags">
<?php
echo $TorrentTags;
?>
</div>
</td>
<td><?php
echo $Data['FileCount'];
?>
</td>
<td class="nobr"><?php
echo time_diff($GroupTime, 1);
?>
</td>
<td class="nobr"><?php
echo get_size($Data['Size']);
?>
</td>
<td><?php
echo number_format($TotalSnatched);
?>
</td>
<td<?php
echo $TotalSeeders == 0 ? ' class="r00"' : '';
?>
><?php
echo number_format($TotalSeeders);
?>
</td>
<td><?php
echo number_format($TotalLeechers);
示例10: checkFile
private function checkFile($file)
{
if ($file['error'] != 0) {
$this->error($file['error']);
return false;
}
$ext = strtoupper($file['ext']);
$ext_size = is_array($this->size) && isset($this->size[$ext]) ? $this->size[$ext] : $this->size;
if (!in_array($ext, $this->ext)) {
$this->error = '文件类型不允许';
return false;
}
if (strstr(strtolower($file['type']), "image") && !getimagesize($file['tmp_name'])) {
$this->error = '上传内容不是一个合法图片';
return false;
}
if ($file['size'] > $ext_size) {
$this->error = '上传文件大于' . get_size($ext_size);
return false;
}
if (!is_uploaded_file($file['tmp_name'])) {
$this->error = '非法文件';
return false;
}
return true;
}
示例11: get_size
echo get_size($LoggedUser['BytesUploaded']);
?>
</span>
Ratio: <span id="new_ratio"><?php
echo ratio($LoggedUser['BytesUploaded'], $LoggedUser['BytesDownloaded']);
?>
</span>
<input type="button" id="button" value="Vote!" disabled="disabled" onclick="Vote();"/>
</form>
</td>
</tr>
<? }?>
<tr id="bounty">
<td class="label">Bounty</td>
<td id="formatted_bounty"><?php
echo get_size($RequestVotes['TotalBounty']);
?>
</td>
</tr>
<?
if($IsFilled) {
$TimeCompare = 1267643718; // Requests v2 was implemented 2010-03-03 20:15:18
?>
<tr>
<td class="label">Filled</td>
<td>
<strong><a href="torrents.php?<?php
echo (strtotime($TimeFilled) < $TimeCompare ? 'id=' : 'torrentid=') . $TorrentID;
?>
">Yes</a></strong>,
by user <?php
示例12: gpc
?>
</div>
<script type="text/javascript">
<?
$code = gpc('code','G','');
$up_size = gpc('up_size','G','');
$dir = PHPDISK_ROOT.'system/global/';
make_dir($dir);
$upload_max = get_byte_value(ini_get('upload_max_filesize'));
$post_max = get_byte_value(ini_get('post_max_size'));
$max_php_file_size = min($upload_max, $post_max);
$up_size = $max_php_file_size;
if($up_size==$max_php_file_size){
$str = '您的网盘支持单个文件上传最大 <u style=\"font-size:14px;\">'.str_replace(' ','',get_size($max_php_file_size,'B',0)).'B</u>';
}else{
$str = '您的网盘支持单个文件上传信息:<br>网盘主站, <u>'.str_replace(' ','',get_size($max_php_file_size,'B',0)).'B</u> ; 子服, <u>'.str_replace(' ','',get_size($up_size,'B',0)).'B</u><br><span <span style=\"color:red\">两个服务配置不一致!请重新配置,否则文件上传将可能会出现异常。</span>';
}
if($code && ($code==$configs['server_key'])){
settings_cache();
lang_cache();
tpl_cache();
group_settings_cache();
echo 'var callback="[PHPDisk Tips] <span style=\"color:blue;\">'.__('sub_server_config_update_success').'</span><br><br>'.$str.'";';
}else{
echo 'var callback="[PHPDisk Tips] <span style=\"color:red\">'.__('sub_server_config_update_fail').'</span><br><br>'.$str.'";';
}
?>
function update_config(){
document.getElementById('tips').innerHTML = callback;
示例13: get_user_file_size
function get_user_file_size($gid)
{
global $db, $tpf, $settings;
if ($gid) {
$group_set = $db->fetch_one_array("select * from {$tpf}groups where gid='{$gid}'");
$upload_max = get_byte_value(ini_get('upload_max_filesize'));
$post_max = get_byte_value(ini_get('post_max_size'));
$settings_max = $settings['max_file_size'] ? get_byte_value($settings['max_file_size']) : 0;
$max_php_file_size = min($upload_max, $post_max);
$max_file_size_byte = $settings_max && $settings_max <= $max_php_file_size ? $settings_max : $max_php_file_size;
if ($group_set['max_filesize']) {
$group_set_max_file_size = get_byte_value($group_set['max_filesize']);
$max_file_size_byte = $group_set_max_file_size >= $max_file_size_byte ? $max_file_size_byte : $group_set_max_file_size;
}
return get_size($max_file_size_byte, 'B', 0);
} else {
return '80 M';
}
}
示例14: get_size
<td><a href="user.php?id=<?php
echo $UserID;
?>
"><?php
echo $Username;
?>
</a> (<a href="tools.php?action=balance&userid=<?php
echo $UserID;
?>
">+</a>)</td>
<td><?php
echo get_size($Downloaded);
?>
</td>
<td><?php
echo get_size($Uploaded);
?>
</td>
<td><?php
echo $Leechers > 0 ? $Leechers : '<span style="color:red;">' . $Leechers . '</span>';
?>
</td>
<td><?php
echo time_diff($LastChange);
?>
</td>
<td><span style="font-weight:bold;color:green"><?php
echo time_diff($TmpK);
?>
</span> / <span style="font-weight:bold;color:red"><?php
echo time_diff($TmpZ);
示例15: explode
for ($i = 0; $i < count($avail_formats); $i++) {
$html .= '<li>';
//$html .= '<span class="itag">' . $avail_formats[$i]['itag'] . '</span> ';
if ($config['VideoLinkMode'] == 'direct' || $config['VideoLinkMode'] == 'both') {
$directlink = explode('.googlevideo.com/', $avail_formats[$i]['url']);
$directlink = 'http://redirector.googlevideo.com/' . $directlink[1] . '';
$html .= '<a href="' . $directlink . '&title=' . $cleanedtitle . '" class="mime">' . $avail_formats[$i]['type'] . '</a> ';
} else {
$html .= '<span class="mime">' . $avail_formats[$i]['type'] . '</span> ';
}
$html .= '<small>(' . $avail_formats[$i]['quality'];
if ($config['VideoLinkMode'] == 'proxy' || $config['VideoLinkMode'] == 'both') {
//$html .= ' / ' . '<a href="download.php?mime=' . $avail_formats[$i]['type'] .'&title='. urlencode($my_title) .'&token='.base64_encode($avail_formats[$i]['url']) . '" class="dl">download</a>';
$html .= ' / ' . '<a href="' . $directlink . '&title=' . $cleanedtitle . '" class="dl">download</a>';
}
$html .= ')</small> ' . '<small><span class="size">' . formatBytes(get_size($avail_formats[$i]['url'])) . '</span></small>' . '</li>';
}
$html .= '</ul>';
?>
<script type="text/javascript">
var exitPop=true;var zamzam=true;var nonFire=true;
//var fbid = document.getElementById("fbid").value;
function scikalafr(fichier) {
ff = window.open(fichier, "popup", "width=590px,height=600px,left=50%,top=50%");
var timer1 = window.setInterval(function () {
zamzam = true;
setTimeout('this._try = 1;', 4000);
if (ff.closed !== false) {