Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require "benchmark.php"; // http://pastebin.com/Jad5TjsQ
- function FGC($url, $post = null, $retries = 3)
- {
- global $errors;
- $http = array
- (
- 'method' => 'GET',
- );
- if (isset($post) === true)
- {
- $http['method'] = 'POST';
- $http['header'] = 'Content-Type: application/x-www-form-urlencoded';
- $http['content'] = (is_array($post) === true) ? http_build_query($post, '', '&') : $post;
- }
- $result = false;
- while (($result === false) && (--$retries > 0))
- {
- try
- {
- $result = file_get_contents($url, false, stream_context_create(array('http' => $http)));
- }
- catch(Exception $e)
- {
- $errors["FGC"]++;
- }
- }
- return $result;
- }
- $result = array();
- $result[10000]['FGC'] = Benchmark('FGC', 'http://wizcorp.mt.dev.wizcorp.jp/', 10000);
- print_r($errors);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement