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


PHP Get::dir_size方法代碼示例

本文整理匯總了PHP中Get::dir_size方法的典型用法代碼示例。如果您正苦於以下問題:PHP Get::dir_size方法的具體用法?PHP Get::dir_size怎麽用?PHP Get::dir_size使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Get的用法示例。


在下文中一共展示了Get::dir_size方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _scorm_deleteitem

function _scorm_deleteitem($idscorm_package, $idscorm_organization, $erasetrackcontent = FALSE)
{
    /* remove items: based on organizations */
    //$rs = sql_query("SELECT idscorm_organization FROM ".$prefix."_scorm_organizations WHERE idscorm_package=".$idscorm_package);
    //while(list($idscorm_organization) = sql_fetch_row($rs)) {
    if ($erasetrackcontent) {
        // selected tracking remove
        $rsItems = sql_query("SELECT idscorm_item FROM " . $GLOBALS['prefix_lms'] . "_scorm_items WHERE idscorm_organization=" . $idscorm_organization);
        while (list($idscorm_item) = sql_fetch_row($rsItems)) {
            sql_query("DELETE FROM " . $GLOBALS['prefix_lms'] . "_scorm_tracking WHERE idscorm_resource=" . $idscorm_item);
        }
    }
    sql_query("DELETE FROM " . $GLOBALS['prefix_lms'] . "_scorm_items WHERE idscorm_organization=" . $idscorm_organization);
    //}
    /* remove organizations */
    sql_query("DELETE FROM " . $GLOBALS['prefix_lms'] . "_scorm_organizations WHERE idscorm_organization=" . $idscorm_organization);
    // detect if there are other organization in package
    $rs = sql_query("SELECT idscorm_organization FROM " . $GLOBALS['prefix_lms'] . "_scorm_organizations WHERE idscorm_package=" . $idscorm_package);
    if (mysql_num_rows($rs) == 0) {
        $rs = sql_query("SELECT path FROM " . $GLOBALS['prefix_lms'] . "_scorm_package WHERE idscorm_package='" . (int) $idscorm_package . "'") or die(mysql_error());
        list($path) = sql_fetch_row($rs);
        $scopath = str_replace('\\', '/', $GLOBALS['where_files_relative'] . '/appLms/' . Get::sett('pathscorm'));
        /* remove all zip directory */
        if (file_exists($scopath . $path)) {
            /* if is the only occurrence of path in db delete files */
            $rs = sql_query("SELECT idscorm_package FROM " . $GLOBALS['prefix_lms'] . "_scorm_package" . " WHERE path = '" . $path . "'");
            if (mysql_num_rows($rs) == 1) {
                $size = Get::dir_size($scopath . $path);
                require_once dirname(__FILE__) . '/scorm_utils.php';
                // for del tree
                delDirTree($scopath . $path);
                if (isset($_SESSION['idCourse']) && defined("LMS")) {
                    $GLOBALS['course_descriptor']->subFileToUsedSpace(false, $size);
                }
            }
        }
        /* remove resources */
        sql_query("DELETE FROM " . $GLOBALS['prefix_lms'] . "_scorm_resources WHERE idscorm_package=" . $idscorm_package);
        /* remove packages */
        sql_query("DELETE FROM " . $GLOBALS['prefix_lms'] . "_scorm_package WHERE idscorm_package=" . $idscorm_package);
    }
}
開發者ID:abhinay100,項目名稱:forma_app,代碼行數:42,代碼來源:scorm.php

示例2: exceed_quota

 public static function exceed_quota($file_path, $quota, $used, $manual_file_size = false)
 {
     if ($quota == 0) {
         return false;
     }
     $quota = $quota * 1024 * 1024;
     if ($manual_file_size === false) {
         $filesize = Get::dir_size($file_path);
     } else {
         $filesize = $manual_file_size;
     }
     return $used + $filesize > $quota;
 }
開發者ID:abhinay100,項目名稱:forma_app,代碼行數:13,代碼來源:lib.utils.php


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