cvs: pecl /http package.xml package2.xml /http/scripts bench_select_vs_event.php
| From: | Michael Wallner | Date: | Wed, 05 Sep 2007 17:15:03 +0000 |
| Subject: | cvs: pecl /http package.xml package2.xml /http/scripts bench_select_vs_event.php | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-8512@lists.php.net to get a copy of this message | ||
mike Wed Sep 5 17:15:03 2007 UTC
Added files:
/pecl/http/scripts bench_select_vs_event.php
Modified files:
/pecl/http package.xml package2.xml
Log:
- release 1.6.0b1
http://cvs.php.net/viewvc.cgi/pecl/http/package.xml?r1=1.100&r2=1.101&diff_format=u
Index: pecl/http/package.xml
diff -u pecl/http/package.xml:1.100 pecl/http/package.xml:1.101
--- pecl/http/package.xml:1.100 Sun Feb 25 18:01:44 2007
+++ pecl/http/package.xml Wed Sep 5 17:15:03 2007
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
-<package version="1.0" packagerversion="1.4.11">
+<package version="1.0" packagerversion="1.6.1">
<name>pecl_http</name>
<summary>Extended HTTP Support</summary>
<description>This HTTP extension aims to provide a convenient and powerful
@@ -23,15 +23,14 @@
</maintainer>
</maintainers>
<release>
- <version>1.5.2</version>
- <date>2007-02-25</date>
+ <version>1.6.0b1</version>
+ <date>2007-09-05</date>
<license>BSD, revised</license>
- <state>stable</state>
- <notes>* Fixed bug #10151 (build fails dynamic linking on Mac OS X)
-* Allow setting the "proxyhost" request option to an empty string,
- which lets curl ignore any environment settings
-* Allow unsetting request options by passing NULL:
- $request->setOptions(array("option" => NULL));
+ <state>beta</state>
+ <notes>+ Added 'retrycount' and 'retrydelay' request
options
++ Added libevent support for libcurl (>= 7.16.0):
+ o added --with-http-curl-libevent configure option
+ o added HttpRequestPool::enableEvents()
</notes>
<deps>
<dep type="php" rel="ge" version="4.3"/>
http://cvs.php.net/viewvc.cgi/pecl/http/package2.xml?r1=1.164&r2=1.165&diff_format=u
Index: pecl/http/package2.xml
diff -u pecl/http/package2.xml:1.164 pecl/http/package2.xml:1.165
--- pecl/http/package2.xml:1.164 Wed Sep 5 12:15:25 2007
+++ pecl/http/package2.xml Wed Sep 5 17:15:03 2007
@@ -28,7 +28,7 @@
<email>mike@php.net</email>
<active>yes</active>
</lead>
- <date>2007-06-12</date>
+ <date>2007-09-05</date>
<version>
<release>1.6.0b1</release>
<api>1.6.0</api>
http://cvs.php.net/viewvc.cgi/pecl/http/scripts/bench_select_vs_event.php?view=markup&rev=1.1
Index: pecl/http/scripts/bench_select_vs_event.php
+++ pecl/http/scripts/bench_select_vs_event.php
<?php
class pool extends HttpRequestPool {
private $url;
private $cnt;
static function fetch($url, $n, $c, $e) {
$pool = new pool;
$pool->url = $url;
$pool->cnt = $n;
$pool->enableEvents($e);
for ($i = 0; $i < $c; ++$i) {
$pool->push();
}
try {
$pool->send();
} catch (Exception $ex) {
echo $ex, "\n";
}
}
function push() {
if ($this->cnt > 0) {
request::init($this, $this->url)->id = $this->cnt--;
}
}
}
class request extends HttpRequest {
static $counter = 0;
public $id;
private $pool;
static function init(pool $pool, $url) {
$r = new request($url);
$r->pool = $pool;
$pool->attach($r);
return $r;
}
function onFinish() {
++self::$counter;
$this->pool->detach($this);
$this->pool->push();
}
}
function usage() {
global $argv;
fprintf(STDERR, "Usage: %s -u <URL> -n <requests> -c <concurrency> -e (use
libevent)\n", $argv[0]);
fprintf(STDERR, "\nDefaults: -u http://localhost/ -n 1000 -c
10\n\n");
exit(-1);
}
isset($argv) or $argv = $_SERVER['argv'];
defined('STDERR') or define('STDERR', fopen('php://stderr',
'w'));
$opts = getopt("u:c:n:e");
isset($opts["u"]) or $opts["u"] = "http://localhost/";
isset($opts["c"]) or $opts["c"] = 10;
isset($opts["n"]) or $opts["n"] = 1000;
http_parse_message(http_head($opts["u"]))->responseCode == 200 or usage();
$time = microtime(true);
pool::fetch($opts["u"], $opts["n"], $opts["c"],
isset($opts["e"]));
printf("\n> %10.6fs\n", microtime(true)-$time);
request::$counter == $opts["n"] or printf("\nOnly %d finished\n",
request::$counter);