(公司有个需求,防止人不停地下载,在别人的网站里看到的) 以下翻译来自Google 这个类可以用来限制下载文件的速度。 它拦截PHP脚本的输出提供给浏览器设置一个缓冲处理,被称为每次定的字节数。 类自最后一次测量的时间PHP输出缓冲液冲洗,并保持一段时间,
(公司有个需求,防止人不停地下载,在别人的网站里看到的)
源码与演示:源码出处 演示出处
追梦A系列(11.0版本,以下11.0均简称为A)是针对企业网站定制设计的,模板采用全新AS3.0代码编辑,拥有更快的运行和加载速度,A系列模板主要针对图片展示,拥有简洁大气展示效果,并且可以自由扩展图片分类,同时还拥有三个独立页面介绍栏目,一个新闻栏目,一个服务介绍栏目,一个幻灯片展示和flv视频播放栏目。A系列模板对一些加载效果进行了修改,包括背景的拉伸模式以及标题的展示方式等都进行了调整,同
0

<?php
//throttler类太长可以到:http://www.codepearl.com/files/160.html下载
require("./throttler.php");
// create new config
$config = new ThrottleConfig();
// enable burst rate for 30 seconds
$config->burstTimeout = 30;
// set burst transfer rate to 50000 bytes/second
$config->burstLimit = 50000;
// set standard transfer rate to 15.000 bytes/second (after initial 30 seconds of burst rate)
$config->rateLimit = 15000;
// enable module (this is a default value)
$config->enabled = true;
// start throttling
$x = new Throttle($config);
//http://www.codepearl.com
header("Content-type: application/force-download");
header("Content-Disposition: attachment; filename=\"test.txt\"");
header("Content-Length: 60000000");
// generate 60.000.000 bytes file.
for($i = 0; $i < 60000000; $i++) {
echo "A";
}
<?php
//throttler类太长可以到:http://www.codepearl.com/files/160.html下载
require("./throttler.php");
// create new config
$config = new ThrottleConfigBySize();
// enable burst rate for first 500000 bytes, after that revert to the standard transfer rate
$config->burstSize = 500000;
// set burst transfer rate to 50000 bytes/second
$config->burstLimit = 50000;
// set standard transfer rate to 15.000 bytes/second (after initial 30 seconds of burst rate)
$config->rateLimit = 15000;
// enable module (this is a default value)
$config->enabled = true;
// start throttling
$x = new Throttle($config);
//http://www.codepearl.com
header("Content-type: application/force-download");
header("Content-Disposition: attachment; filename=\"test.txt\"");
header("Content-Length: 60000000");
// generate 60.000.000 bytes file.
for($i = 0; $i < 60000000; $i++) {
echo "A";
}
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号