Skip to content
Snippets Groups Projects
Commit cddebbb9 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

hotline #91081 : Cache serveur calls in Inspector Gadget Webservice calls button

parent ae1e4ae8
Branches
Tags
No related merge requests found
Pipeline #6954 failed with stage
in 31 minutes and 33 seconds
- ticket #91081 : Inspecteur Gadget : Les appels au serveur de cache AFI s'affiche par le bouton "Appels webservices"
\ No newline at end of file
......@@ -23,7 +23,14 @@
class Class_Notice_Thumbnail_ProviderCacheServer
extends Class_Notice_Thumbnail_ProviderAbstract {
protected static $_seen = [];
public function updateNotice() {
if (in_array($this->_record->getId(), static::$_seen))
return $this;
static::$_seen[] = $this->_record->getId();
if (!$urls = $this->_getUrls())
return $this->noWebThumbRecord();
......
......@@ -184,26 +184,12 @@ class Class_WebService_AllServices {
$response = json_decode(self::httpGet($url_service, $args), true);
static::_addInspectorGadget($url_service, $args, $response);
return $response;
}
protected static function _addInspectorGadget($url, $args, $response) {
if (!$ig = Zend_Controller_Front::getInstance()
xdebug_break();
if ($ig = Zend_Controller_Front::getInstance()
->getPlugin('ZendAfi_Controller_Plugin_InspectorGadget'))
return;
if(!$ig->isEnabled())
return;
$ig->log();
$ig->addButton(new Class_Entity(['Label' => 'Serveur de cache',
'Content' => 'URL : ' . $url
. BR
. 'args : ' . implode(BR, $args)
. BR
. 'response : ' . implode(BR, $response)]));
return $response;
}
......
......@@ -192,9 +192,11 @@ create: function(event, ui) { if (ui.panel.hasClass(\'ig-accordion\')) ui.panel.
public function log() {
if (!$httpClient = Class_HttpClientFactory::getInstance()->getLastHttpClient()) {
if (!$this->isEnabled())
return $this;
if (!$httpClient = Class_HttpClientFactory::getInstance()->getLastHttpClient())
return $this;
}
$response_code = $response_body = null;
if ($response = $httpClient->getLastResponse()) {
......@@ -246,10 +248,10 @@ create: function(event, ui) { if (ui.panel.hasClass(\'ig-accordion\')) ui.panel.
if (!$this->isEnabled())
return $this;
if(!$instance)
if (!$instance)
return $this;
$this->_buttons []= $instance;
$this->_buttons[]= $instance;
return $this;
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment