當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Folder::getSize方法代碼示例

本文整理匯總了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\"" : "";
            ?>
開發者ID:gkathir15,項目名稱:catmis,代碼行數:31,代碼來源:browseFilesForm.php

示例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;
     }
 }
開發者ID:gkathir15,項目名稱:catmis,代碼行數:25,代碼來源:Folder.class.php

示例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 "-";
            }
            ?>
開發者ID:gkathir15,項目名稱:catmis,代碼行數:31,代碼來源:fileIndexForm.php


注:本文中的Folder::getSize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。