• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_dirsize函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_dirsize函数的典型用法代码示例。如果您正苦于以下问题:PHP get_dirsize函数的具体用法?PHP get_dirsize怎么用?PHP get_dirsize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: get_dirsize

function get_dirsize($dirname)
{
    $dirsize = 0;
    if ($dir = opendir($dirname)) {
        while ($file = readdir($dir)) {
            if ($file == "." || $file == "..") {
            } elseif (is_dir($dirname . '/' . $file)) {
                $dirsize = $dirsize + get_dirsize($dirname . "/" . $file);
            } else {
                $dirsize = $dirsize + filesize($dirname . "/" . $file);
            }
        }
        closedir($dir);
    }
    return $dirsize;
}
开发者ID:vmarci21,项目名称:storage-space-php,代码行数:16,代码来源:index.php


示例2: evc_fetch_remote_file

 function evc_fetch_remote_file($args)
 {
     if (!empty($args)) {
         extract($args);
     }
     //$post_date = date('Y-m-d H:i:s');
     $upload = wp_upload_dir();
     $upload = wp_upload_bits($file_name, 0, '');
     if ($upload['error']) {
         return new WP_Error('upload_dir_error', $upload['error']);
     }
     $headers = wp_get_http($url, $upload['file']);
     if (!$headers) {
         @unlink($upload['file']);
         return new WP_Error('import_file_error', __('Remote server did not respond', 'evc'));
     }
     if ($headers['response'] != '200') {
         @unlink($upload['file']);
         return new WP_Error('import_file_error', sprintf(__('Remote server says: %1$d %2$s', 'evc'), $headers['response'], get_status_header_desc($headers['response'])));
     } elseif (isset($headers['content-length']) && filesize($upload['file']) != $headers['content-length']) {
         @unlink($upload['file']);
         return new WP_Error('import_file_error', __('Remote file is incorrect size', 'evc'));
     }
     $max_size = (int) get_site_option('fileupload_maxk') * 1024;
     // fileupload_maxk for wpmu compatibility
     $file_size = filesize($upload['file']);
     if (!empty($max_size) && $file_size > $max_size) {
         @unlink($upload['file']);
         return new WP_Error('import_file_error', sprintf(__('Remote file is %1$d KB but limit is %2$d', 'evc'), $file_size / 1024, $max_size / 1024));
     }
     // This check is for wpmu compatibility
     if (function_exists('get_space_allowed')) {
         $space_allowed = 1048576 * get_space_allowed();
         $space_used = get_dirsize(BLOGUPLOADDIR);
         $space_left = $space_allowed - $space_used;
         if ($space_left < 0) {
             @unlink($upload['file']);
             return new WP_Error('not_enough_diskspace', sprintf(__('You have %1$d KB diskspace used but %2$d allowed.', 'evc'), $space_used / 1024, $space_allowed / 1024));
         }
     }
     $upload['content-type'] = $headers['content-type'];
     return $upload;
 }
开发者ID:prosenjit-itobuz,项目名称:upages,代码行数:43,代码来源:evc-api.php


示例3: wpmu_checkAvailableSpace

function wpmu_checkAvailableSpace()
{
    $spaceAllowed = get_space_allowed();
    $dirName = trailingslashit(BLOGUPLOADDIR);
    if (!(is_dir($dirName) && is_readable($dirName))) {
        return;
    }
    $dir = dir($dirName);
    $size = 0;
    while ($file = $dir->read()) {
        if ($file != '.' && $file != '..') {
            if (is_dir($dirName . $file)) {
                $size += get_dirsize($dirName . $file);
            } else {
                $size += filesize($dirName . $file);
            }
        }
    }
    $dir->close();
    $size = $size / 1024 / 1024;
    if ($spaceAllowed - $size <= 0) {
        define('DISABLE_UPLOADS', true);
        define('DISABLE_UPLOADS_MESSAGE', __('Sorry, you must delete files before you can upload any more.'));
    }
}
开发者ID:joelglennwright,项目名称:agencypress,代码行数:25,代码来源:mu.php


示例4: et_handle_upload_prefilter

function et_handle_upload_prefilter($file)
{
    if (!is_multisite()) {
        return $file;
    }
    if (get_site_option('upload_space_check_disabled')) {
        return $file;
    }
    if ($file['error'] != '0') {
        // there's already an error
        return $file;
    }
    if (defined('WP_IMPORTING')) {
        return $file;
    }
    $space_allowed = 1048576 * get_space_allowed();
    $space_used = get_dirsize(BLOGUPLOADDIR);
    $space_left = $space_allowed - $space_used;
    $file_size = filesize($file['tmp_name']);
    if ($space_left < $file_size) {
        $file['error'] = sprintf(__('Not enough space to upload. %1$s KB needed.', ET_DOMAIN), number_format(($file_size - $space_left) / 1024));
    }
    if ($file_size > 1024 * get_site_option('fileupload_maxk', 1500)) {
        $file['error'] = sprintf(__('This file is too big. Files must be less than %1$s KB in size.', ET_DOMAIN), get_site_option('fileupload_maxk', 1500));
    }
    if (function_exists('upload_is_user_over_quota') && upload_is_user_over_quota(false)) {
        $file['error'] = __('You have used your space quota. Please delete files before uploading.', ET_DOMAIN);
    }
    // if ( $file['error'] != '0' && !isset($_POST['html-upload']) )
    // 	wp_die( $file['error'] . ' <a href="javascript:history.go(-1)">' . __( 'Back' ) . '</a>' );
    return $file;
}
开发者ID:rinodung,项目名称:wp-question,代码行数:32,代码来源:functions.php


示例5: rigr_fetch_remote_file

function rigr_fetch_remote_file($post, $url)
{
    $url2 = str_replace('&amp;', '&', str_replace('https://', 'http://', $url));
    preg_match('/[a-z0-9;=_%\\Q?&.-+[]\\E]+\\.(jpg|jpeg|gif|png|rar|zip|mp3|mp4|flv|pdf|swf)/i', $url2, $pu);
    $file_name = str_replace('%25', '-', $pu[0]);
    $file_name = preg_replace('/[;=%\\Q?&-+\\E]+/i', '-', $file_name);
    $file_name = strlen($file_name) > 255 ? substr($file_name, 180) : $file_name;
    $upload = wp_upload_bits($file_name, 0, '', $post['post_date']);
    if ($upload['error']) {
        echo $upload['error'];
        return new WP_Error('upload_dir_error', $upload['error']);
    }
    $headers = wp_get_http($url2, $upload['file']);
    if (!$headers) {
        @unlink($upload['file']);
        return new WP_Error('import_file_error', __('<p class="help"><img src="images/no.png"> <span style="color: #ff0000;">Remote server did not respond</span></p>', 'rigr'));
    }
    if ($headers['response'] != '200') {
        @unlink($upload['file']);
        return new WP_Error('import_file_error', sprintf(__('Remote server says: %1$d %2$s', 'rigr'), $headers['response'], get_status_header_desc($headers['response'])));
    } elseif (isset($headers['content-length']) && filesize($upload['file']) != $headers['content-length']) {
        @unlink($upload['file']);
        return new WP_Error('import_file_error', __('<p class="help"><img src="images/no.png"> <span style="color: #ff0000;">Remote file can not be downloaded</span></p>', 'rigr'));
    }
    $min_size = max((double) $_POST['rigr_min_size'], 0) * 1024;
    $max_size = max((int) $_POST['rigr_max_size'], (int) get_site_option('fileupload_maxk')) * 1024;
    /* -- fileupload_maxk for wpmu compatibility -- */
    $file_size = filesize($upload['file']);
    if (!empty($max_size) && $file_size > $max_size) {
        @unlink($upload['file']);
        return new WP_Error('import_file_error', sprintf(__('Remote file is %1$d KB but limit is %2$d', 'rigr'), $file_size / 1024, $max_size / 1024));
    } elseif (!empty($min_size) && $file_size < $min_size) {
        @unlink($upload['file']);
        return new WP_Error('import_file_error', sprintf(__('Remote file size is less then %1$d KB', 'rigr'), $min_size / 1024));
    }
    /* -- This check is for wpmu compatibility -- */
    if (function_exists('get_space_allowed')) {
        $space_allowed = 1048576 * get_space_allowed();
        $space_used = get_dirsize(BLOGUPLOADDIR);
        $space_left = $space_allowed - $space_used;
        if ($space_left < 0) {
            @unlink($upload['file']);
            return new WP_Error('not_enough_diskspace', sprintf(__('You have %1$d KB diskspace used but %2$d allowed.', 'rigr'), $space_used / 1024, $space_allowed / 1024));
        }
    }
    $upload['content-type'] = $headers['content-type'];
    return $upload;
}
开发者ID:shehab-bn,项目名称:wpremoteuploader,代码行数:48,代码来源:remote-upload.php


示例6: details

 function details()
 {
     // take default seetings
     $settings = array('remain' => array('color_text' => 'white', 'color_bar' => '#0D324F', 'color_bg' => '#a0a0a0', 'decimals' => 2, 'unit' => 'm', 'display' => true, 'graph' => false), 'used' => array('color_text' => 'white', 'color_bar' => '#0D324F', 'color_bg' => '#a0a0a0', 'decimals' => 2, 'unit' => 'm', 'display' => true, 'graph' => true));
     $quota = ngg_SpaceManager::getQuota() * 1024 * 1024;
     $used = get_dirsize(constant("ABSPATH") . constant("UPLOADS"));
     //		$used = get_dirsize( ABSPATH."wp-content/blogs.dir/".$blog_id."/files" );
     if ($used > $quota) {
         $percentused = '100';
     } else {
         $percentused = $used / $quota * 100;
     }
     $remaining = $quota - $used;
     $percentremain = 100 - $percentused;
     $out = "";
     $out .= '<div id="spaceused"> <h3>' . __('Storage Space', 'nggallery') . '</h3>';
     if ($settings['used']['display']) {
         $out .= __('Upload Space Used:', 'nggallery') . "\n";
         $out .= ngg_SpaceManager::buildGraph($settings['used'], $used, $quota, $percentused);
         $out .= "<br />";
     }
     if ($settings['remain']['display']) {
         $out .= __('Upload Space Remaining:', 'nggallery') . "\n";
         $out .= ngg_SpaceManager::buildGraph($settings['remain'], $remaining, $quota, $percentremain);
     }
     $out .= "</div>";
     echo $out;
 }
开发者ID:pravinhirmukhe,项目名称:flow1,代码行数:28,代码来源:overview.php


示例7: wp_dashboard_quota

function wp_dashboard_quota()
{
    if (!is_multisite() || !current_user_can('upload_files') || get_site_option('upload_space_check_disabled')) {
        return true;
    }
    $quota = get_space_allowed();
    $used = get_dirsize(BLOGUPLOADDIR) / 1024 / 1024;
    if ($used > $quota) {
        $percentused = '100';
    } else {
        $percentused = $used / $quota * 100;
    }
    $used_color = $percentused >= 70 ? ' spam' : '';
    $used = round($used, 2);
    $percentused = number_format($percentused);
    ?>
	<p class="sub musub"><?php 
    _e('Storage Space');
    ?>
</p>
	<div class="table table_content musubtable">
	<table>
		<tr class="first">
			<td class="first b b-posts"><?php 
    printf(__('<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB</a>'), esc_url(admin_url('upload.php')), $quota);
    ?>
</td>
			<td class="t posts"><?php 
    _e('Space Allowed');
    ?>
</td>
		</tr>
	</table>
	</div>
	<div class="table table_discussion musubtable">
	<table>
		<tr class="first">
			<td class="b b-comments"><?php 
    printf(__('<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB (%3$s%%)</a>'), esc_url(admin_url('upload.php')), $used, $percentused);
    ?>
</td>
			<td class="last t comments<?php 
    echo $used_color;
    ?>
"><?php 
    _e('Space Used');
    ?>
</td>
		</tr>
	</table>
	</div>
	<br class="clear" />
	<?php 
}
开发者ID:nouphet,项目名称:rata,代码行数:54,代码来源:dashboard.php


示例8: get_space_used

/**
 * Returns the space used by the current blog.
 *
 * @since 3.5.0
 *
 * @return int Used space in megabytes
 */
function get_space_used()
{
    /**
     * Filter the amount of storage space used by the current site.
     *
     * @since 3.5.0
     *
     * @param int|bool $space_used The amount of used space, in megabytes. Default false.
     */
    $space_used = apply_filters('pre_get_space_used', false);
    if (false === $space_used) {
        $upload_dir = wp_upload_dir();
        $space_used = get_dirsize($upload_dir['basedir']) / 1024 / 1024;
    }
    return $space_used;
}
开发者ID:Jitsufreak,项目名称:PJ,代码行数:23,代码来源:ms-functions.php


示例9: wpmu_checkAvailableSpace

function wpmu_checkAvailableSpace()
{
    if (get_site_option('upload_space_check_disabled')) {
        return true;
    }
    $spaceAllowed = get_space_allowed();
    $dirName = trailingslashit(BLOGUPLOADDIR);
    if (!(is_dir($dirName) && is_readable($dirName))) {
        return;
    }
    $dir = dir($dirName);
    $size = 0;
    while ($file = $dir->read()) {
        if ($file != '.' && $file != '..') {
            if (is_dir($dirName . $file)) {
                $size += get_dirsize($dirName . $file);
            } else {
                $size += filesize($dirName . $file);
            }
        }
    }
    $dir->close();
    $size = $size / 1024 / 1024;
    if ($spaceAllowed - $size <= 0) {
        wp_die(__('Sorry, you must delete files before you can upload any more.'));
    }
}
开发者ID:ericandrewlewis,项目名称:wordpress-mu,代码行数:27,代码来源:mu.php


示例10: cpm_wpmu_get_available_disk_space

/**
 * Get the available disk space for this account.
 */
function cpm_wpmu_get_available_disk_space()
{
    $space_allowed = 1048576 * get_space_allowed();
    $space_used = get_dirsize(constant("ABSPATH") . constant("UPLOADS"));
    return $space_allowed - $space_used;
}
开发者ID:johnbintz,项目名称:comicpress-2.8,代码行数:9,代码来源:comicpress_manager_wpmu.php


示例11: fix_import_form_size

/**
 * Get the remaining upload space for this blog.
 *
 * @since MU
 * @uses upload_is_user_over_quota()
 * @uses get_space_allowed()
 * @uses get_dirsize()
 *
 * @param int $size
 * @return int
 */
function fix_import_form_size( $size ) {
	if ( upload_is_user_over_quota( false ) == true )
		return 0;

	$spaceAllowed = 1024 * 1024 * get_space_allowed();
	$dirsize = get_dirsize( BLOGUPLOADDIR );
	if ( $size > $spaceAllowed - $dirsize )
		return $spaceAllowed - $dirsize; // remaining space
	else
		return $size; // default
}
开发者ID:ramo01,项目名称:1kapp,代码行数:22,代码来源:ms-functions.php


示例12: get_space_used

/**
 * Returns the space used by the current blog.
 *
 * @since 3.5.0
 *
 * @return int Used space in megabytes
 */
function get_space_used()
{
    // Allow for an alternative way of tracking storage space used
    $space_used = apply_filters('pre_get_space_used', false);
    if (false === $space_used) {
        $space_used = get_dirsize(BLOGUPLOADDIR) / 1024 / 1024;
    }
    return $space_used;
}
开发者ID:dcatontopcorp,项目名称:wordpress,代码行数:16,代码来源:ms.php


示例13: _get_space

 function _get_space()
 {
     $space = get_space_allowed();
     //echo "space<pre>"; print_r($space); echo "</pre>";
     $_used_bytes = apply_filters('embi_upload_storage_used_bytes', get_dirsize(BLOGUPLOADDIR));
     $used = apply_filters('embi_upload_storage_used_mb', $_used_bytes / 1024 / 1024);
     $available = $space - $used;
     $percentused = sprintf("%.2f", $used / $space * 100);
     $space = $space > 1000 ? sprintf("%.2f", $space / 1024) . __('GB') : sprintf("%.2f", $space) . __('MB');
     $used = $used > 1000 ? sprintf("%.2f", $used / 1024) . __('GB') : sprintf("%.2f", $used) . __('MB');
     $available = $available > 1000 ? sprintf("%.2f", $available / 1024) . __('GB') : sprintf("%.2f", $available) . __('MB');
     return array('total' => $space, 'used' => $used, 'percent' => $percentused, 'available' => $available);
 }
开发者ID:hscale,项目名称:webento,代码行数:13,代码来源:class_embi_admin_pages.php


示例14: dashboard_quota

    function dashboard_quota()
    {
        if (get_site_option('upload_space_check_disabled')) {
            return;
        }
        if (!wpmu_enable_function('wpmuQuotaCheck')) {
            return;
        }
        $settings = C_NextGen_Settings::get_instance();
        $fs = C_Fs::get_instance();
        $dir = $fs->join_paths($fs->get_document_root('content'), $settings->gallerypath);
        $quota = get_space_allowed();
        $used = get_dirsize($dir) / 1024 / 1024;
        if ($used > $quota) {
            $percentused = '100';
        } else {
            $percentused = $used / $quota * 100;
        }
        $used_color = $percentused < 70 ? $percentused >= 40 ? 'yellow' : 'green' : 'red';
        $used = round($used, 2);
        $percentused = number_format($percentused);
        ?>
        <p><?php 
        print __('Storage Space');
        ?>
</p>
        <ul>
            <li><?php 
        printf(__('%1$sMB Allowed', 'nggallery'), $quota);
        ?>
</li>
            <li class="<?php 
        print $used_color;
        ?>
"><?php 
        printf(__('%1$sMB (%2$s%%) Used', 'nggallery'), $used, $percentused);
        ?>
</li>
        </ul>
        <?php 
    }
开发者ID:kixortillan,项目名称:dfosashworks,代码行数:41,代码来源:overview.php


示例15: ngg_dashboard_quota

function ngg_dashboard_quota()
{
    if (get_site_option('upload_space_check_disabled')) {
        return;
    }
    if (!wpmu_enable_function('wpmuQuotaCheck')) {
        return;
    }
    $quota = get_space_allowed();
    $used = get_dirsize(BLOGUPLOADDIR) / 1024 / 1024;
    if ($used > $quota) {
        $percentused = '100';
    } else {
        $percentused = $used / $quota * 100;
    }
    $used_color = $percentused < 70 ? $percentused >= 40 ? 'waiting' : 'approved' : 'spam';
    $used = round($used, 2);
    $percentused = number_format($percentused);
    ?>
	<p class="sub musub" style="position:static" ><?php 
    _e('Storage Space');
    ?>
</p>
	<div class="table table_content musubtable">
	<table>
		<tr class="first">
			<td class="first b b-posts"><?php 
    printf(__('<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB</a>'), esc_url(admin_url('admin.php?page=nggallery-manage-gallery')), $quota);
    ?>
</td>
			<td class="t posts"><?php 
    _e('Space Allowed');
    ?>
</td>
		</tr>
	</table>
	</div>
	<div class="table table_discussion musubtable">
	<table>
		<tr class="first">
			<td class="b b-comments"><?php 
    printf(__('<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB (%3$s%%)</a>'), esc_url(admin_url('admin.php?page=nggallery-manage-gallery')), $used, $percentused);
    ?>
</td>
			<td class="last t comments <?php 
    echo $used_color;
    ?>
"><?php 
    _e('Space Used');
    ?>
</td>
		</tr>
	</table>
	</div>
	<br class="clear" />
	<?php 
}
开发者ID:ahsaeldin,项目名称:projects,代码行数:57,代码来源:overview.php


示例16: dashboard_quota

function dashboard_quota() {
	if ( get_site_option( 'upload_space_check_disabled' ) )
		return true;

	$quota = get_space_allowed();
	$used = get_dirsize( BLOGUPLOADDIR ) / 1024 / 1024;

	if ( $used > $quota )
		$percentused = '100';
	else
		$percentused = ( $used / $quota ) * 100;
	$used_color = ( $percentused < 70 ) ? ( ( $percentused >= 40 ) ? 'waiting' : 'approved' ) : 'spam';
	$used = round( $used, 2 );
	$percentused = number_format( $percentused );

	?>
	<p class="sub musub"><?php _e( 'Storage Space' ); ?></p>
	<div class="table table_content musubtable">
	<table>
		<tr class="first">
			<td class="first b b-posts"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB</a>' ), esc_url( admin_url( 'upload.php' ) ), $quota ); ?></td>
			<td class="t posts"><?php _e( 'Space Allowed' ); ?></td>
		</tr>
	</table>
	</div>
	<div class="table table_discussion musubtable">
	<table>
		<tr class="first">
			<td class="b b-comments"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB (%3$s%%)</a>' ), esc_url( admin_url( 'upload.php' ) ), $used, $percentused ); ?></td>
			<td class="last t comments <?php echo $used_color;?>"><?php _e( 'Space Used' );?></td>
		</tr>
	</table>
	</div>
	<br class="clear" />
	<?php
}
开发者ID:realfluid,项目名称:umbaugh,代码行数:36,代码来源:ms.php


示例17: get_used_space

 /**
  * Calculate the Used space by a component
  * 
  * @see mpp_get_used_space
  * 
  * @access private do not call it directly, use mpp_get_used_space instead
  * 
  * @param type $component
  * @param type $component_id
  * @return int
  */
 public function get_used_space($component, $component_id)
 {
     //let us check for the transient as space calculation is bad everytime
     $key = "mpp_space_used_by_{$component}_{$component_id}";
     //transient key
     $used_space = get_transient($key);
     if (!$used_space) {
         $dir_name = trailingslashit($this->get_component_base_dir($component, $component_id));
         //base gallery directory for owner
         if (!is_dir($dir_name) || !is_readable($dir_name)) {
             return 0;
             //we don't know the usage or no usage
         }
         $dir = dir($dir_name);
         $size = 0;
         while ($file = $dir->read()) {
             if ($file != '.' && $file != '..') {
                 if (is_dir($dir_name . $file)) {
                     $size += get_dirsize($dir_name . $file);
                 } else {
                     $size += filesize($dir_name . $file);
                 }
             }
         }
         $dir->close();
         set_transient($key, $size, DAY_IN_SECONDS);
         $used_space = $size;
     }
     $used_space = $used_space / 1024 / 1024;
     return $used_space;
 }
开发者ID:markc,项目名称:mediapress,代码行数:42,代码来源:class-mpp-local-storage.php


示例18: fix_import_form_size

function fix_import_form_size($size)
{
    if (upload_is_user_over_quota(false) == true) {
        return 0;
    }
    $spaceAllowed = 1024 * 1024 * get_space_allowed();
    $dirName = constant("ABSPATH") . constant("UPLOADS");
    $dirsize = get_dirsize($dirName);
    if ($size > $spaceAllowed - $dirsize) {
        return $spaceAllowed - $dirsize;
        // remaining space
    } else {
        return $size;
        // default
    }
}
开发者ID:alx,项目名称:blogsfera,代码行数:16,代码来源:wpmu-functions.php


示例19: multisite_get_spaced_used

 /**
  * Used to give a realistic total of storage space used on a Multisite subsite,
  * when there have been attachments uploaded to S3 but removed from server
  *
  * @param $space_used bool
  *
  * @return float|int
  */
 function multisite_get_spaced_used($space_used)
 {
     global $wpdb;
     // Sum the total file size (including image sizes) for all S3 attachments
     $sql = "SELECT SUM( meta_value ) AS bytes_total\n\t\t\t\tFROM {$wpdb->postmeta}\n\t\t\t\tWHERE meta_key = 'wpos3_filesize_total'";
     $space_used = $wpdb->get_var($sql);
     // Get local upload sizes
     $upload_dir = wp_upload_dir();
     $space_used += get_dirsize($upload_dir['basedir']);
     if ($space_used > 0) {
         // Convert to bytes to MB
         $space_used = $space_used / 1024 / 1024;
     }
     return $space_used;
 }
开发者ID:sohel4r,项目名称:wordpress_4_1_1,代码行数:23,代码来源:amazon-s3-and-cloudfront.php


示例20: get_space_used

/**
 * Returns the space used by the current blog.
 *
 * @since 3.5.0
 *
 * @return int Used space in megabytes
 */
function get_space_used()
{
    // Allow for an alternative way of tracking storage space used
    $space_used = apply_filters('pre_get_space_used', false);
    if (false === $space_used) {
        $upload_dir = wp_upload_dir();
        $space_used = get_dirsize($upload_dir['basedir']) / 1024 / 1024;
    }
    return $space_used;
}
开发者ID:neopunisher,项目名称:WordPress,代码行数:17,代码来源:ms-functions.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_discount函数代码示例发布时间:2022-05-15
下一篇:
PHP get_dirname函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap