/**
 * Created by PhpStorm.
 * User: EC_l
 * Date: 31.01.14
 * Time: 13:02
 * Email: bpteam22@gmail.com
 */
use bpteam\ProxyList\ProxyUpdate;
register_shutdown_function('sendMessage');
$start = time();
echo date('[H:i:s Y/m/d]', $start);
$proxy = new ProxyUpdate();
$proxy->updateAllList();
$end = time();
$text = "\n";
$proxy->open($proxy->getDefaultListName());
$list = $proxy->read();
$subject = count($list['content']);
foreach ($proxy->getAllNameList() as $nameList) {
    $proxy->open($nameList);
    $list = $proxy->read();
    $text .= "{$nameList} " . count($list['content']) . "\n";
}
echo date('[H:i:s Y/m/d]', $end);
$time = round(($end - $start) / 60);
echo $text = $time . " m  {$text}";
function sendMessage()
{
    global $text;
    mail("*****@*****.**", "update proxy", $text);
}
 * User: EC_l
 * Date: 31.01.14
 * Time: 13:02
 * Email: bpteam22@gmail.com
 */
use bpteam\ProxyList\ProxyUpdate;
register_shutdown_function('sendMessage');
$countStream = 1000;
$start = microtime(true);
echo date('[H:i:s Y/m/d]', $start);
$proxy = new ProxyUpdate('http://hamstersgangsters.com/proxy_check.php', 8888);
$proxy->updateArchive();
$proxyList = $proxy->downloadArchiveProxy();
$countChallengers = count($proxyList['content']);
unset($proxyList);
$proxy->updateDefaultList($countStream);
$end = microtime(true);
$text = "\n";
$nameList = $proxy->getDefaultListName();
$proxy->open($nameList);
$list = $proxy->read();
$countResult = count($list['content']);
$text .= "{$nameList} " . $countResult . " of {$countChallengers} " . round($countResult / $countChallengers * 100) . "%\n";
echo date('[H:i:s Y/m/d]', $end);
$time = $end - $start;
echo $text = $time . " sec \n count stream {$countStream} \n {$text}";
function sendMessage()
{
    global $text;
    mail("*****@*****.**", "update default proxy", $text);
}