Skip to content
Snippets Groups Projects

Sandbox#16008 test sigb connexion factorisation

Merged Patrick Barroca requested to merge sandbox#16008-test-sigb-connexion-factorisation into master
Compare and
+ 218
51
Preferences
Compare changes
Files
<?php
/**
* Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* AFI-OPAC 2.0 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Cosmo_IntegrationController extends Zend_Controller_Action{
public function preDispatch() {
$this->cosmoPath = $this->view->cosmoPath = new CosmoPaths();
}
public function testAction() {
Zend_Layout::getMvcInstance()->disableLayout();
if (!($type = $this->_getParam('type'))
|| !($options = $this->_getParam('options'))) {
$this->view->response = 'Paramètres insuffisants';
return;
}
if (!$service_name = Class_IntBib::detectService($type)) {
$this->view->response = 'Service de type ' . $type . ' inconnu';
return;
}
$service = call_user_func([$service_name, 'getService'], $options);
$this->view->response = $service->test();
if (!$this->view->response)
$this->view->response = 'Impossible de contacter le service';
}
}
?>
\ No newline at end of file