6 in_array("curl", http\Client\Factory::getAvailableDrivers()) or die ("skip CURL support missing");
12 class MyClient extends http\Curl\Client {}
13 class MyPool extends http\Curl\Client\Pool {}
14 class MyShare extends http\Curl\Client\DataShare {}
16 class MyFactory extends http\Client\Factory {
17 protected $driver = "curl";
18 protected $persistentHandleId = "My";
19 protected $clientClass = "MyClient";
20 protected $clientPoolClass = "MyPool";
21 protected $clientDataShareClass = "MyShare";
23 protected $dummy = "foo";
26 $f = new MyFactory(array("driver" => "curl"));
27 $r = $f->createClient();
28 $p = $f->createPool();
29 $s = $f->createDataShare();
31 $r->setRequest(new http\Client\Request("GET", "http://localhost/"));
32 $x = $f->createPool($r);
33 $y = $f->createDatashare($r);
36 array_map("get_class", array($f,$r,$p,$s,$x,$y)),
40 foreach (array("Client", "Pool", "DataShare") as $type) {
42 var_dump((new http\Client\Factory(array("driver" => "nonexistant")))->{"create$type"}());
43 } catch (Exception $e) {
44 echo $e->getMessage(), "\n";
67 clients are not supported by this driver
68 pools are not supported by this driver
69 datashares are not supported by this driver