Check Site Loading Speed using CURL curl_getinfo() in PHP.
Monday, June 22, 2009 10:06We use curl_getinfo() in to get the information of last transfer that made use of curl functions in PHP. Using the following code we can get the time taken to load a webpage.
$ch = curl_init('http://www.inetminds.com/parsing-xml-feeds-in-php-with-simplexml-111/');
// set cURL to return the contents in a variable instead of giving it to the browser.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Execute
$contents = curl_exec($ch);
// Check if any error occured
if(!curl_errno($ch)){
// $info = curl_getinfo($ch);
$total_time = curl_getinfo($ch, CURLINFO_TOTAL_TIME);
$url =curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
echo $ulr 'Took ' . $total_time . ' seconds to load ' ;
}
// Close handle
curl_close($ch);
Using curl_init(‘http://www.inetminds.com/parsing-xml-feeds-in-php-with-simplexml-111/’) we have Initialized the session to load ‘http://www.inetminds.com/parsing-xml-feeds-in-php-with-simplexml-111/’ and returns a cURL handle which can be passed to other cURL functions.
Using curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1) we loaded the page to variable $ch.
Using curl_getinfo($ch, CURLINFO_TOTAL_TIME) we retrieved the total time taken for the last CURL transfer.
Using curl_getinfo($ch, CURLINFO_EFFECTIVE_URL) we retrieved the url effected or used in the last CURL transfer.
Below are some more options that can be used whit curl_getinfo() for different requirements.
* CURLINFO_EFFECTIVE_URL – Last effective URL
* CURLINFO_HTTP_CODE – Last received HTTP code
* CURLINFO_FILETIME – Remote time of the retrieved document, if -1 is returned the time of the document is unknown
* CURLINFO_TOTAL_TIME – Total transaction time in seconds for last transfer
* CURLINFO_NAMELOOKUP_TIME – Time in seconds until name resolving was complete
* CURLINFO_CONNECT_TIME – Time in seconds it took to establish the connection
* CURLINFO_PRETRANSFER_TIME – Time in seconds from start until just before file transfer begins
* CURLINFO_STARTTRANSFER_TIME – Time in seconds until the first byte is about to be transferred
* CURLINFO_REDIRECT_TIME – Time in seconds of all redirection steps before final transaction was started
* CURLINFO_SIZE_UPLOAD – Total number of bytes uploaded
* CURLINFO_SIZE_DOWNLOAD – Total number of bytes downloaded
* CURLINFO_SPEED_DOWNLOAD – Average download speed
* CURLINFO_SPEED_UPLOAD – Average upload speed
* CURLINFO_HEADER_SIZE – Total size of all headers received
* CURLINFO_HEADER_OUT – The request string sent
* CURLINFO_REQUEST_SIZE – Total size of issued requests, currently only for HTTP requests
* CURLINFO_SSL_VERIFYRESULT – Result of SSL certification verification requested by setting CURLOPT_SSL_VERIFYPEER
* CURLINFO_CONTENT_LENGTH_DOWNLOAD – content-length of download, read from Content-Length: field
* CURLINFO_CONTENT_LENGTH_UPLOAD – Specified size of upload
* CURLINFO_CONTENT_TYPE – Content-Type: of downloaded object, NULL indicates server did not send valid Content-Type: header
Source : http://in2.php.net/manual/en/function.curl-getinfo.php





Step 3 Now go to Filter>Distort>Wave. use 3 for the Number of Generators, 10 and 346 for the Wavelength, and 5 and 35 for the Amplitude
Step 4 Go to Filter>Blur>Gaussian Blur. Use 10 pixels for the Radius. Then group the layer and rename the folder’s Blend Mode to Color Dodge. You will get a nice light effect
Step 5 Create a new layer on top of the others and go to Filter>Render>Clouds, make sure you had black and white for the background and foreground colors, then change the Blend Mode to Color Dodge and go to Layer>Layer Mask>Reveal All. With a very soft brush, 0% hardness and black color, hide some areas of the clouds layer. Use the image below for reference. 


