public function testGet() { $listName = 'bpteam'; $proxyIp = '127.0.0.1:8080'; $properties = ['anonym' => false, 'referer' => true, 'post' => true, 'get' => true, 'cookie' => false, 'country' => 'China', 'last_check' => 13255444887.0, 'starttransfer' => 21, 'upload_speed' => 1, 'download_speed' => 2, 'source' => ['proxy.net'], 'protocol' => ['http']]; $proxy = new Proxy(); $proxy->open($listName); $proxy->add($proxyIp, $properties); $getProxy = $proxy->get(); $this->assertTrue(is_array($getProxy)); $this->assertArrayHasKey('proxy', $getProxy); $this->assertEquals($proxyIp, $getProxy['proxy']); }
* User: EC_l * Date: 27.02.14 * Time: 9:05 * Email: bpteam22@gmail.com */ use bpteam\ProxyList\Proxy; ?> <form method="post"> <input type="text" name="list_name" value="<?php echo isset($_POST['list_name']) ? $_POST['list_name'] : ''; ?> "> List name<br/> <? if(isset($_POST['list_name'])){ $proxy = new Proxy(); $proxy->open($_POST['list_name']); if(isset($_POST['send_form'])){ $proxy->write($_POST['url'], 'url'); $proxy->write(explode("\n",$_POST['check_word']), 'check_word'); $functions = array(); foreach ($proxy->getProxyFunction() as $function) { if($function == 'country') continue; if(isset($_POST['function_'.$function])){ $functions[] = $function; } } if($_POST['country']){ $proxy->write(explode("\n",$_POST['country']), 'country'); } $proxy->write($functions, 'function'); $proxy->write(isset($_POST['need_update']), 'need_update');