forked from glpunzi/nuBuilderPro
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnucronwrapper.php
More file actions
executable file
·34 lines (27 loc) · 891 Bytes
/
nucronwrapper.php
File metadata and controls
executable file
·34 lines (27 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/php
<?php
$url = $argv[1];
if ($url != "") {
$options = array (CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => false,
CURLOPT_USERAGENT => "PHP cURL",
CURLOPT_CONNECTTIMEOUT => 120,
CURLOPT_TIMEOUT => 120
);
$ch = curl_init($url);
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
$result = array();
$result['content'] = $response;
$result['err'] = curl_errno($ch);
$result['errmsg'] = curl_error($ch);
$result['header'] = curl_getinfo($ch);
$result['httpCode'] = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($result['httpCode'] == 200 ) {
echo $response;
}
curl_close ( $ch );
} else {
echo "Usage: nucronwrapper.php <url> \n";
}
?>