本文整理汇总了PHP中Folder::getSize方法的典型用法代码示例。如果您正苦于以下问题:PHP Folder::getSize方法的具体用法?PHP Folder::getSize怎么用?PHP Folder::getSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Folder
的用法示例。
在下文中一共展示了Folder::getSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFormattedSize
echo scriptUrl . "/" . folderFiles . "/browseFiles.php?folderId=" . $subFolder->id;
echo showPopup ? "&popup=1" : "";
echo !empty($fileTypes) ? "&fileTypes=" . $fileTypes : "";
?>
"><?php
echo $subFolder->name;
?>
</a>
</td>
<td width="50%" align="right" <?php
echo $i % 2 == 0 ? " style=\"background:#ebebeb\"" : "";
?>
>
<?php
echo getFormattedSize($subFolder->getSize());
?>
</td>
</tr>
<?php
$old = $i;
}
}
if ($files->rows()) {
for ($i = $old + 1; list($id) = $files->fetchrow_array(); $i++) {
$file = new File($id);
?>
<tr>
<td height="25" width="16"<?php
echo $i % 2 == 0 ? " style=\"background:#ebebeb\"" : "";
?>
示例2: getSize
/**
* Get total size of subfolders and files of this folder
* @return size of this folder in bytes
*/
function getSize()
{
if (!empty($this->id)) {
global $dbi;
$totalSize = 0;
/* Get size of subfolders */
$result = $dbi->query("SELECT id FROM " . folderTableName . " WHERE parentId=" . $this->id);
for ($j = 0; list($id) = $result->fetchrow_array(); $j++) {
$folder = new Folder($id);
$totalSize += $folder->getSize();
}
/* Get size of files */
$result = $dbi->query("SELECT id FROM " . fileTableName . " WHERE folderId=" . $this->id);
for ($j = 0; list($id) = $result->fetchrow_array(); $j++) {
$file = new File($id);
$totalSize += $file->getSize();
}
/* Return size of folder in bytes */
return $totalSize;
}
}
示例3: validateTextLength
">
<a href="index.php?folderId=<?php
echo $subFolder->id;
?>
"><?php
echo validateTextLength($subFolder->name, 30);
?>
</a>
</td>
<td nowrap="nowrap" align="right" class="small1 <?php
echo $class;
?>
">
<?php
$site->printFormattedSize($subFolder->getSize());
?>
</td>
<td nowrap="nowrap" class="small1 <?php
echo $class;
?>
">
<?php
$lastModified = $subFolder->getLastModified();
if ($lastModified != 0) {
$site->printTimestamp($lastModified);
} else {
echo "-";
}
?>