désactivation autoblog (test)
This commit is contained in:
parent
edb75a5f4b
commit
7030352d24
|
@ -350,16 +350,19 @@ class VroumVroum_Blog
|
||||||
{
|
{
|
||||||
if (!$this->mustUpdate())
|
if (!$this->mustUpdate())
|
||||||
return false;
|
return false;
|
||||||
|
if(isset($this->config->off)) {
|
||||||
try {
|
throw new VroumVroum_Feed_Exception('This autoblog has been turned off');
|
||||||
$body = file_get_contents($this->config->feed_url, false, $this->_getStreamContext());
|
}
|
||||||
}
|
else {
|
||||||
catch (ErrorException $e)
|
try {
|
||||||
{
|
$body = file_get_contents($this->config->feed_url, false, $this->_getStreamContext());
|
||||||
$this->log_update(false, $e->getMessage() . "\n\n" . (!empty($http_response_header) ? implode("\n", $http_response_header) : ''));
|
}
|
||||||
throw new VroumVroum_Feed_Exception("Can't retrieve feed: ".$e->getMessage());
|
catch (ErrorException $e)
|
||||||
}
|
{
|
||||||
|
$this->log_update(false, $e->getMessage() . "\n\n" . (!empty($http_response_header) ? implode("\n", $http_response_header) : ''));
|
||||||
|
throw new VroumVroum_Feed_Exception("Can't retrieve feed: ".$e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
libxml_use_internal_errors(true);
|
libxml_use_internal_errors(true);
|
||||||
$xml = @simplexml_load_string($body);
|
$xml = @simplexml_load_string($body);
|
||||||
|
|
||||||
|
|
|
@ -236,6 +236,7 @@ function svg_status($fill, $text, $back)
|
||||||
}
|
}
|
||||||
|
|
||||||
$svg_ok=svg_status('#008000', 'ok', '');
|
$svg_ok=svg_status('#008000', 'ok', '');
|
||||||
|
$svg_off=svg_status('#00158F', 'off', '');
|
||||||
$svg_mv=svg_status('#0000ff', 'mv', '<rect width="100%" height="100%" fill="#ffd800"/>');
|
$svg_mv=svg_status('#0000ff', 'mv', '<rect width="100%" height="100%" fill="#ffd800"/>');
|
||||||
$svg_err=svg_status('#000000', 'err', '<rect width="100%" height="100%" fill="#ff0000"/>');
|
$svg_err=svg_status('#000000', 'err', '<rect width="100%" height="100%" fill="#ff0000"/>');
|
||||||
|
|
||||||
|
@ -253,6 +254,7 @@ function svg_status($fill, $text, $back)
|
||||||
else /* ..sinon, lancer la procédure de contrôle */
|
else /* ..sinon, lancer la procédure de contrôle */
|
||||||
{
|
{
|
||||||
$ini = parse_ini_file("./". escape( $_GET['check'] ) ."/vvb.ini") or die;
|
$ini = parse_ini_file("./". escape( $_GET['check'] ) ."/vvb.ini") or die;
|
||||||
|
if(isset($ini['OFF'])) { die($svg_off); }
|
||||||
$headers = get_headers($ini['FEED_URL']);
|
$headers = get_headers($ini['FEED_URL']);
|
||||||
|
|
||||||
if(!empty($headers))
|
if(!empty($headers))
|
||||||
|
|
Loading…
Reference in a new issue