当前位置: 首页>>代码示例>>PHP>>正文


PHP fs_director::GetDirectorySize方法代码示例

本文整理汇总了PHP中fs_director::GetDirectorySize方法的典型用法代码示例。如果您正苦于以下问题:PHP fs_director::GetDirectorySize方法的具体用法?PHP fs_director::GetDirectorySize怎么用?PHP fs_director::GetDirectorySize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在fs_director的用法示例。


在下文中一共展示了fs_director::GetDirectorySize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: while

<?php

global $zdbh;
/*
 * Calculate the home directory size for each 'active' user account on the server.
 */
$userssql = $zdbh->query("SELECT ac_id_pk, ac_user_vc FROM x_accounts WHERE ac_deleted_ts IS NULL");
echo fs_filehandler::NewLine() . "START Calculating disk Usage for all client accounts.." . fs_filehandler::NewLine();
while ($userdir = $userssql->fetch()) {
    $homedirectory = ctrl_options::GetSystemOption('hosted_dir') . $userdir['ac_user_vc'];
    if (fs_director::CheckFolderExists($homedirectory)) {
        $size = fs_director::GetDirectorySize($homedirectory);
    } else {
        $size = 0;
    }
    $currentuser = ctrl_users::GetUserDetail($userdir['ac_id_pk']);
    //$checksql = $zdbh->query("SELECT COUNT(*) AS total FROM x_bandwidth WHERE bd_month_in = " . date("Ym") . " AND bd_acc_fk = " . $userdir['ac_id_pk'] . "")->fetch();
    $numrows = $zdbh->prepare("SELECT COUNT(*) AS total FROM x_bandwidth WHERE bd_month_in = :date AND bd_acc_fk = :ac_id_pk");
    $date = date("Ym");
    $numrows->bindParam(':date', $date);
    $numrows->bindParam(':ac_id_pk', $userdir['ac_id_pk']);
    $numrows->execute();
    $checksql = $numrows->fetch();
    if ($checksql['total'] == 0) {
        //      $zdbh->query("INSERT INTO x_bandwidth (bd_acc_fk, bd_month_in, bd_transamount_bi, bd_diskamount_bi, bd_diskover_in, bd_diskcheck_in, bd_transover_in, bd_transcheck_in ) VALUES (" . $userdir['ac_id_pk'] . "," . date("Ym") . ",0,0,0,0,0,0);");
        $numrows3 = $zdbh->prepare("INSERT INTO x_bandwidth (bd_acc_fk, bd_month_in, bd_transamount_bi, bd_diskamount_bi, bd_diskover_in, bd_diskcheck_in, bd_transover_in, bd_transcheck_in ) VALUES (:ac_id_pk,:date,0,0,0,0,0,0);");
        //removed ;from end of statments
        $date = date("Ym");
        $numrows3->bindParam(':date', $date);
        $numrows3->bindParam(':ac_id_pk', $userdir['ac_id_pk']);
        $numrows3->execute();
开发者ID:TGates71,项目名称:Sentora-Windows-Upgrade,代码行数:31,代码来源:OnDaemonRun.hook.php


注:本文中的fs_director::GetDirectorySize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。