mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 11:33:17 +00:00
Cleanup
This commit is contained in:
@@ -74,7 +74,6 @@ return call_user_func(
|
|||||||
{
|
{
|
||||||
/* @var $twig \Twig_Environment */
|
/* @var $twig \Twig_Environment */
|
||||||
$twig = $app['Core']->getTwig();
|
$twig = $app['Core']->getTwig();
|
||||||
// var_dump($twig->getLoader()->getPaths());
|
|
||||||
$browser = \Browser::getInstance();
|
$browser = \Browser::getInstance();
|
||||||
|
|
||||||
if (!$browser->isMobile())
|
if (!$browser->isMobile())
|
||||||
|
@@ -2,7 +2,16 @@
|
|||||||
|
|
||||||
class geonames
|
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)
|
public function name_from_id($geonameid)
|
||||||
{
|
{
|
||||||
$registry = registry::get_instance();
|
$registry = registry::get_instance();
|
||||||
|
@@ -25,26 +25,37 @@ class http_query
|
|||||||
*/
|
*/
|
||||||
public static function getHttpCodeFromUrl($url)
|
public static function getHttpCodeFromUrl($url)
|
||||||
{
|
{
|
||||||
$ch = curl_init();
|
if (!is_scalar($url))
|
||||||
curl_setopt($ch, CURLOPT_URL, $url);
|
return null;
|
||||||
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);
|
|
||||||
|
|
||||||
curl_exec($ch);
|
if (trim($url) === '')
|
||||||
$result = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
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)
|
public static function getHttpHeaders($url)
|
||||||
{
|
{
|
||||||
|
if (!is_scalar($url))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
if (trim($url) === '')
|
||||||
|
return null;
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_URL, $url);
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||||||
@@ -69,24 +80,30 @@ class http_query
|
|||||||
* @param array $post_data
|
* @param array $post_data
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function getUrl($url, $post_data=false)
|
public static function getUrl($url, $post_data = false)
|
||||||
{
|
{
|
||||||
$ch = curl_init();
|
if (!is_scalar($url))
|
||||||
curl_setopt($ch, CURLOPT_URL, $url);
|
return null;
|
||||||
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)
|
if (trim($url) === '')
|
||||||
{
|
return null;
|
||||||
curl_setopt($ch, CURLOPT_POST, true);
|
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = (curl_exec($ch));
|
$ch = curl_init();
|
||||||
curl_close($ch);
|
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;
|
return $result;
|
||||||
}
|
}
|
||||||
|
@@ -70,7 +70,6 @@ class module_report_sqldownload extends module_report_sql implements module_repo
|
|||||||
|
|
||||||
$this->sql .= $this->filter->getOrderFilter() ? : '';
|
$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 = $this->connbas->prepare($this->sql);
|
||||||
$stmt->execute($this->params);
|
$stmt->execute($this->params);
|
||||||
$this->total_row = $stmt->rowCount();
|
$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;
|
$value = $base64_encoded ? base64_decode($li->item($ili)->nodeValue) : $li->item($ili)->nodeValue;
|
||||||
$utf8value = trim($this->guessCharset($value));
|
$utf8value = trim($this->guessCharset($value));
|
||||||
var_dump($utf8value);
|
|
||||||
$tfields[$src][] = $utf8value;
|
$tfields[$src][] = $utf8value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1132,12 +1131,15 @@ class system_file extends SplFileObject
|
|||||||
$tmpval[] = $val;
|
$tmpval[] = $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ($tmpval as $val)
|
||||||
|
{
|
||||||
$ret[] = array(
|
$ret[] = array(
|
||||||
'meta_struct_id' => $meta->get_id(),
|
'meta_struct_id' => $meta->get_id(),
|
||||||
'meta_id' => null,
|
'meta_id' => null,
|
||||||
'value' => $tmpval
|
'value' => $val
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$statBit = null;
|
$statBit = null;
|
||||||
|
@@ -1154,7 +1154,6 @@ class ApiYamlApplication extends PhraseanetWebTestCaseAbstract
|
|||||||
*
|
*
|
||||||
* @todo
|
* @todo
|
||||||
*/
|
*/
|
||||||
// var_dump($record["technical_informations"]);
|
|
||||||
|
|
||||||
$this->assertTrue(is_array($record["technical_informations"]));
|
$this->assertTrue(is_array($record["technical_informations"]));
|
||||||
|
|
||||||
|
@@ -38,8 +38,7 @@ class Bridge_AccountSettingsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
}
|
}
|
||||||
catch (Exception $e)
|
catch (Exception $e)
|
||||||
{
|
{
|
||||||
var_dump($e->getMessage());
|
$this->fail($e->getMessage());
|
||||||
$this->fail();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -108,17 +108,6 @@ class EntityBasketTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$date = $this->basket->getUpdated();
|
$date = $this->basket->getUpdated();
|
||||||
$this->assertInstanceOf('\DateTime', $date);
|
$this->assertInstanceOf('\DateTime', $date);
|
||||||
|
|
||||||
// sleep(5);
|
|
||||||
// $this->basket->setName('hello COCOCOCO');
|
|
||||||
// $this->basket->setDescription('44WDFDFOLSDF');
|
|
||||||
// $this->em->persist($this->basket);
|
|
||||||
// $this->em->flush();
|
|
||||||
// var_dump($this->basket->getId());
|
|
||||||
// $basket = $this->em->getRepository('\Entities\Basket')->find($this->basket->getId());
|
|
||||||
// $dateUpdated = $basket->getUpdated();
|
|
||||||
// var_dump($date->format(DATE_ATOM), $dateUpdated->format(DATE_ATOM));
|
|
||||||
// $this->assertGreaterThan($dateUpdated, $date);
|
|
||||||
// $this->assertGreaterThan($dateUpdated, $this->basket->getCreated());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetElements()
|
public function testGetElements()
|
||||||
|
Reference in New Issue
Block a user