mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Cleanup
This commit is contained in:
@@ -2,7 +2,16 @@
|
||||
|
||||
class geonames
|
||||
{
|
||||
|
||||
protected static $NamesFromId = array();
|
||||
|
||||
protected static $CountryFromId = array();
|
||||
|
||||
protected static $CountryCodeFromId = array();
|
||||
|
||||
protected static $GeonameFromIp = array();
|
||||
|
||||
protected static $Searches = array();
|
||||
|
||||
public function name_from_id($geonameid)
|
||||
{
|
||||
$registry = registry::get_instance();
|
||||
|
@@ -25,26 +25,37 @@ class http_query
|
||||
*/
|
||||
public static function getHttpCodeFromUrl($url)
|
||||
{
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
|
||||
curl_setopt($ch, CURLOPT_NOBODY, true);
|
||||
curl_setopt($ch, CURLOPT_HEADER, true);
|
||||
if (!is_scalar($url))
|
||||
return null;
|
||||
|
||||
curl_exec($ch);
|
||||
$result = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
if (trim($url) === '')
|
||||
return null;
|
||||
|
||||
curl_close($ch);
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
|
||||
curl_setopt($ch, CURLOPT_NOBODY, true);
|
||||
curl_setopt($ch, CURLOPT_HEADER, true);
|
||||
|
||||
return $result;
|
||||
curl_exec($ch);
|
||||
$result = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
|
||||
curl_close($ch);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function getHttpHeaders($url)
|
||||
{
|
||||
if (!is_scalar($url))
|
||||
return null;
|
||||
|
||||
if (trim($url) === '')
|
||||
return null;
|
||||
$ch = curl_init();
|
||||
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
@@ -69,24 +80,30 @@ class http_query
|
||||
* @param array $post_data
|
||||
* @return string
|
||||
*/
|
||||
public static function getUrl($url, $post_data=false)
|
||||
public static function getUrl($url, $post_data = false)
|
||||
{
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
|
||||
if (!is_scalar($url))
|
||||
return null;
|
||||
|
||||
if ($post_data)
|
||||
{
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
||||
}
|
||||
if (trim($url) === '')
|
||||
return null;
|
||||
|
||||
$result = (curl_exec($ch));
|
||||
curl_close($ch);
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
|
||||
|
||||
if ($post_data)
|
||||
{
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
||||
}
|
||||
|
||||
$result = (curl_exec($ch));
|
||||
curl_close($ch);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
@@ -70,7 +70,6 @@ class module_report_sqldownload extends module_report_sql implements module_repo
|
||||
|
||||
$this->sql .= $this->filter->getOrderFilter() ? : '';
|
||||
|
||||
// var_dump(str_replace(array_keys($this->params), array_values($this->params), $this->sql), $this->sql, $this->params);
|
||||
$stmt = $this->connbas->prepare($this->sql);
|
||||
$stmt->execute($this->params);
|
||||
$this->total_row = $stmt->rowCount();
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1056,7 +1056,6 @@ class system_file extends SplFileObject
|
||||
{
|
||||
$value = $base64_encoded ? base64_decode($li->item($ili)->nodeValue) : $li->item($ili)->nodeValue;
|
||||
$utf8value = trim($this->guessCharset($value));
|
||||
var_dump($utf8value);
|
||||
$tfields[$src][] = $utf8value;
|
||||
}
|
||||
}
|
||||
@@ -1132,12 +1131,15 @@ class system_file extends SplFileObject
|
||||
$tmpval[] = $val;
|
||||
}
|
||||
|
||||
foreach ($tmpval as $val)
|
||||
{
|
||||
$ret[] = array(
|
||||
'meta_struct_id' => $meta->get_id(),
|
||||
'meta_id' => null,
|
||||
'value' => $tmpval
|
||||
'value' => $val
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$statBit = null;
|
||||
|
Reference in New Issue
Block a user