Delete
This commit is contained in:
parent
056145779f
commit
05ab346c94
@ -1,157 +0,0 @@
|
||||
<?php
|
||||
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||
{
|
||||
protected function _initConfig()
|
||||
{
|
||||
$config = new Zend_Config($this->getOptions());
|
||||
Zend_Registry::set('config', $config);
|
||||
|
||||
//Load old config
|
||||
require_once 'WsScore/Configure.php';
|
||||
$oldconfig = new Configure();
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
//Initialisation global des paramètres de vue
|
||||
protected function _initViewSettings()
|
||||
{
|
||||
$this->bootstrap('view');
|
||||
|
||||
$view = $this->getResource('view');
|
||||
$view->setEncoding('UTF-8');
|
||||
$view->doctype('HTML5');
|
||||
|
||||
$view->headMeta()
|
||||
->appendHttpEquiv('viewport', 'width=device-width, initial-scale=1.0')
|
||||
->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
|
||||
->appendHttpEquiv('Content-Language', 'fr-FR');
|
||||
|
||||
$view->headLink()
|
||||
->appendStylesheet('/libs/bootstrap-v3.0.0/css/bootstrap.min.css', 'all')
|
||||
->appendStylesheet('/themes/default/css/docs.css', 'all')
|
||||
->appendStylesheet('/themes/default/css/main.css', 'all');
|
||||
|
||||
$view->headScript()
|
||||
->appendFile('/libs/html5shiv.js', 'text/javascript', array('conditional' => 'lt IE 9'))
|
||||
->appendFile('/libs/respond.min.js', 'text/javascript', array('conditional' => 'lt IE 9'));
|
||||
|
||||
$view->inlineScript()
|
||||
->appendFile('/themes/default/js/jquery.js', 'text/javascript')
|
||||
->appendFile('/libs/bootstrap-v3.0.0/js/bootstrap.min.js', 'text/javascript')
|
||||
->appendFile('/themes/default/js/scripts.js', 'text/javascript');
|
||||
|
||||
$view->headTitle()->setSeparator(' - ');
|
||||
$view->headTitle('Web Service API - Scores & Decisions');
|
||||
}
|
||||
|
||||
//Initialisation global des paramètres de log
|
||||
protected function _initLogging()
|
||||
{
|
||||
/*$c = Zend_Registry::get('config');
|
||||
$WsLogger = new Zend_Log();
|
||||
$WsFileWriter = new Zend_Log_Writer_Stream($c->profil->path->log.'/wsentreprise.log');
|
||||
$WsFileWriter->addFilter(Zend_Log::INFO);
|
||||
$WsLogger->addWriter($WsFileWriter);
|
||||
Zend_Registry::set('WsLogger', $WsLogger);*/
|
||||
}
|
||||
|
||||
protected function _initRouter()
|
||||
{
|
||||
$this->bootstrap('frontController');
|
||||
$front = $this->getResource('frontController');
|
||||
$router = $front->getRouter();
|
||||
|
||||
//Lire les services disponibles et créer les routes
|
||||
$services = require_once APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
foreach( $services as $section => $params )
|
||||
{
|
||||
if ($params['actif']) {
|
||||
$route = new Zend_Controller_Router_Route($section.'/:version', array(
|
||||
'controller' => 'service',
|
||||
'action' => 'index',
|
||||
'service' => $section,
|
||||
'version' => '',
|
||||
));
|
||||
$router->addRoute($section, $route);
|
||||
|
||||
$route = new Zend_Controller_Router_Route('jsonrpc/'.$section.'/:version', array(
|
||||
'controller' => 'jsonrpc',
|
||||
'action' => 'index',
|
||||
'service' => $section,
|
||||
'version' => '',
|
||||
));
|
||||
$router->addRoute('jsonrpc-'.$section, $route);
|
||||
}
|
||||
}
|
||||
|
||||
//Route pour WS Clients
|
||||
$route = new Zend_Controller_Router_Route('clients/:client/:version', array(
|
||||
'controller' => 'service',
|
||||
'action' => 'index',
|
||||
'service' => 'clients',
|
||||
'client' => '',
|
||||
'version' => ''
|
||||
));
|
||||
$router->addRoute('client', $route);
|
||||
|
||||
$fichierRoute = new Zend_Controller_Router_Route('fichier/:action/:fichier', array(
|
||||
'controller' => 'fichier',
|
||||
'fichier' => '',
|
||||
));
|
||||
$router->addRoute('fichier', $fichierRoute);
|
||||
return $router;
|
||||
}
|
||||
|
||||
protected function _initDb()
|
||||
{
|
||||
$c = Zend_Registry::get('config');
|
||||
try {
|
||||
$db = Zend_Db::factory($c->profil->db->metier);
|
||||
} catch ( Exception $e ) {
|
||||
if (APPLICATION_ENV == 'development') {
|
||||
echo '<pre>'; print_r($e); echo '</pre>';
|
||||
} else {
|
||||
echo "Le service rencontre actuellement un problème technique.";
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the default adapter to use with all model
|
||||
*/
|
||||
Zend_Db_Table::setDefaultAdapter($db);
|
||||
}
|
||||
|
||||
protected function _initWsDebug()
|
||||
{
|
||||
$autoloader = Zend_Loader_Autoloader::getInstance();
|
||||
$autoloader->registerNamespace('WsDebug');
|
||||
|
||||
$options = array(
|
||||
'plugins' => array(
|
||||
'Exception',
|
||||
),
|
||||
);
|
||||
|
||||
$debug = new WsDebug_Controller_Plugin_Debug($options);
|
||||
|
||||
$this->bootstrap('frontController');
|
||||
$frontController = $this->getResource('frontController');
|
||||
$frontController->registerPlugin($debug);
|
||||
}
|
||||
|
||||
protected function _initCache()
|
||||
{
|
||||
if ( APPLICATION_ENV!='development' ) {
|
||||
//MetadataCache pour la base de données
|
||||
$frontendOptions = array(
|
||||
'lifetime' => 14400,
|
||||
'automatic_serialization' => true
|
||||
);
|
||||
$backendOptions = array();
|
||||
$cache = Zend_Cache::factory('Core','Apc', $frontendOptions, $backendOptions);
|
||||
Zend_Db_Table_Abstract::setDefaultMetadataCache($cache);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
[production]
|
||||
webservice.scores.wsdl = ""
|
||||
webservice.scores.options.location = "http://192.168.3.2/ws2/"
|
||||
webservice.scores.options.uri = "http://192.168.3.2/"
|
||||
webservice.scores.options.trace = 1
|
||||
webservice.scores.options.soap_version = SOAP_1_1
|
||||
|
||||
[staging]
|
||||
webservice.scores.wsdl = ""
|
||||
webservice.scores.options.location = "http://78.31.45.206/ws2/"
|
||||
webservice.scores.options.uri = "http://78.31.45.206/"
|
||||
webservice.scores.options.trace = 1
|
||||
webservice.scores.options.soap_version = SOAP_1_1
|
||||
|
||||
[development]
|
||||
webservice.scores.wsdl = ""
|
||||
webservice.scores.options.location = "http://78.31.45.206/ws2/"
|
||||
webservice.scores.options.uri = "http://78.31.45.206/"
|
||||
webservice.scores.options.trace = 1
|
||||
webservice.scores.options.soap_version = SOAP_1_1
|
@ -1,110 +0,0 @@
|
||||
<?php
|
||||
class DemoController extends Zend_Controller_Action
|
||||
{
|
||||
protected $_username;
|
||||
protected $_hash;
|
||||
|
||||
protected $methods = array(
|
||||
'getIdentite' => array(
|
||||
'ws' => 'entreprise/v0.7?wsdl',
|
||||
'form' => 'getIdentite',
|
||||
),
|
||||
);
|
||||
|
||||
public function init()
|
||||
{
|
||||
require_once 'Web/demo/getIdentite.php';
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$this->_username = $auth->getIdentity()->username;
|
||||
$this->_hash = $auth->getIdentity()->hash;
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
//Liste
|
||||
|
||||
|
||||
$tabMethods = array();
|
||||
foreach($this->methods as $method => $element){
|
||||
$url = $this->view->url(array(
|
||||
'controller' => 'demo',
|
||||
'action' => 'method',
|
||||
'name' => $method,
|
||||
));
|
||||
$tabMethods[] = array(
|
||||
'nom' => $method,
|
||||
'url' => $url,
|
||||
);
|
||||
}
|
||||
|
||||
$this->view->assign('methods', $tabMethods);
|
||||
}
|
||||
|
||||
public function methodAction()
|
||||
{
|
||||
$method = $this->_getParam('name','');
|
||||
$this->view->assign('method', $method);
|
||||
//Affichage du formulaire
|
||||
if (array_key_exists($method, $this->methods)){
|
||||
$class = 'Form_'.$method;
|
||||
if (class_exists($class)){
|
||||
$form = new $class;
|
||||
$form->addElement('hidden', 'method', array(
|
||||
'value' => $method,
|
||||
));
|
||||
if ($this->_request->isPost()) {
|
||||
$formData = $this->_request->getPost();
|
||||
$form->populate($formData);
|
||||
}
|
||||
$this->view->assign('form', $form);
|
||||
} else {
|
||||
$this->view->assign('message',"Impossible d'afficher le formulaire !");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function requeteAction()
|
||||
{
|
||||
if ($this->_request->isPost()) {
|
||||
$formData = $this->_request->getPost();
|
||||
$method = $formData['method'];
|
||||
$class = 'Form_'.$method;
|
||||
if (class_exists($class)) {
|
||||
$form = new $class;
|
||||
if ($form->isValid($formData)) {
|
||||
$method = $formData['method'];
|
||||
$siret = $formData['siret'];
|
||||
$accesWs = $this->methods[$method]['ws'];
|
||||
$hostName = $this->getRequest()->getHttpHost();
|
||||
$options = array(
|
||||
'login' => $this->_username,
|
||||
'password' => $this->_hash,
|
||||
'features' => SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS
|
||||
);
|
||||
$client = new Zend_Soap_Client('http://'.$hostName.'/'.$accesWs, $options);
|
||||
$params = new StdClass();
|
||||
$params->siret = $siret;
|
||||
try {
|
||||
$reponse = $client->getIdentite($params);
|
||||
} catch (Zend_Soap_Client_Exception $e) {
|
||||
$reponse = $e->getMessage();
|
||||
}
|
||||
$soap = array(
|
||||
'requete' => $params,
|
||||
'reponse' => $reponse,
|
||||
);
|
||||
$this->view->assign('soap',$soap);
|
||||
$xml = array(
|
||||
'requete' => $client->getLastRequest(),
|
||||
'reponse' => $client->getLastResponse()
|
||||
);
|
||||
$this->view->assign('xml',$xml);
|
||||
} else {
|
||||
$this->_forward('method', 'demo', null, array('name'=> 'getIdentite'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,226 +0,0 @@
|
||||
<?php
|
||||
class DocumentationController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
/**
|
||||
* Affichage de la documentation des webservices
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
//Do nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* Liste des services
|
||||
*/
|
||||
public function servicesAction()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Liste des version par service
|
||||
*/
|
||||
public function servicevAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$name = $request->getParam('name');
|
||||
|
||||
$this->view->key = $name;
|
||||
}
|
||||
|
||||
public function serviceAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$type = $request->getParam('type', 'sd');
|
||||
$ws = strtolower($request->getParam('name','entreprise'));
|
||||
|
||||
// Gestion des versions
|
||||
$serviceVersions = array();
|
||||
$configServiceVersions = $this->view->WsServices[$ws]['versions'];
|
||||
foreach( $configServiceVersions as $section => $params ){
|
||||
$serviceVersions[$section] = $params;
|
||||
if ($params['defaut']) {
|
||||
$defautVersion = $section;
|
||||
}
|
||||
}
|
||||
$version = $request->getParam('version', $defautVersion);
|
||||
|
||||
$this->view->assign('serviceName', $this->view->WsServices[$ws]['name']);
|
||||
$this->view->assign('serviceVersion', $version);
|
||||
|
||||
if ( $type == 'client') {
|
||||
$client = $ws;
|
||||
$ws = 'entreprise';
|
||||
}
|
||||
|
||||
// Charger les classes et les types pour le service suivant la version
|
||||
if ( $type == 'client') {
|
||||
$pathClassService = 'WsScore/Clients/'.ucfirst($client).'/v'.$version.'/';
|
||||
} else {
|
||||
$pathClassService = 'WsScore/'.ucfirst($ws).'/v'.$version.'/';
|
||||
}
|
||||
|
||||
//Génération du tableau de mapping
|
||||
$classmap = include $pathClassService.'Config.php';
|
||||
|
||||
//Définir l'url d'accès au WSDL
|
||||
$wsdl_url = $this->view->baseUrl();
|
||||
if ( $type == 'client') {
|
||||
$wsdl_url.= '/clients/'.$client.'/v'.$version;
|
||||
} else {
|
||||
$wsdl_url.= '/'.$ws.'/v'.$version;
|
||||
}
|
||||
if (APPLICATION_ENV == 'production'){
|
||||
$wsdl_url.= '?wsdl';
|
||||
} else {
|
||||
$wsdl_url.= '?wsdl-auto';
|
||||
}
|
||||
|
||||
// Affichage de la documentation
|
||||
$doc = new Scores_WebClassDoc(ucfirst($ws), $classmap, $pathClassService);
|
||||
$tabServiceMethods = $doc->getServiceMethods();
|
||||
// Tri des méthodes par ordre alphabétique
|
||||
$tabServiceMethodsK = array();
|
||||
foreach($tabServiceMethods as $method) {
|
||||
$tabServiceMethodsK[$method['name']] = $method;
|
||||
}
|
||||
ksort($tabServiceMethodsK);
|
||||
$tabServiceTypes = $doc->getServiceTypes();
|
||||
|
||||
$this->view->assign('wsdl', $wsdl_url);
|
||||
$this->view->assign('serviceMethods', $tabServiceMethodsK);
|
||||
$this->view->assign('serviceTypes', $tabServiceTypes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Liste les exemples de code disponible pour chaque méthode
|
||||
*/
|
||||
public function exemplesAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$ws = strtolower($request->getParam('ws','Entreprise'));
|
||||
$auth = Zend_Auth::getInstance();
|
||||
|
||||
//Si client possède un webservice particulier alors on redirige vers la doc clients
|
||||
$clients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||
foreach( $clients as $section => $params ){
|
||||
if ($params['actif']) {
|
||||
$wsClients[$params['idClient']] = $section;
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists($auth->getIdentity()->idClient, $wsClients)){
|
||||
|
||||
$this->_forward('clients', 'documentation', null, array(
|
||||
'nom' => $wsClients[$auth->getIdentity()->idClient]
|
||||
));
|
||||
|
||||
} else {
|
||||
|
||||
// Liste des webservices
|
||||
$services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
foreach( $services as $section => $params )
|
||||
{
|
||||
if ($params['actif']) {
|
||||
$wsServices[$section] = $params;
|
||||
}
|
||||
}
|
||||
|
||||
// On vérifie que l'utilisateur peut accèder à la documentation
|
||||
$username = $auth->getIdentity()->username;
|
||||
$idClient = $auth->getIdentity()->idClient;
|
||||
if ( array_key_exists($ws, $wsServices) )
|
||||
{
|
||||
if ( isset($wsServices['idClient']) && $idClient!=$wsServices['idClient'] )
|
||||
{
|
||||
$this->renderScript('documentation/nodoc.phtml');
|
||||
exit;
|
||||
}
|
||||
if ( isset($wsServices['user']) && !in_array($username, $wsServices['user']) )
|
||||
{
|
||||
$this->renderScript('documentation/nodoc.phtml');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// Gestion des versions
|
||||
$serviceVersions = array();
|
||||
$configServiceVersions = $wsServices[$ws]['versions'];
|
||||
foreach( $configServiceVersions as $section => $params ){
|
||||
$serviceVersions[$section] = $params;
|
||||
if ($params['defaut']) {
|
||||
$defautVersion = $section;
|
||||
}
|
||||
}
|
||||
$version = $request->getParam('version', $defautVersion);
|
||||
|
||||
// Charger les classes et les types pour le service suivant la version
|
||||
$pathClassService = 'WsScore/'.ucfirst($ws).'/v'.$version.'/';
|
||||
|
||||
//Génération du tableau de mapping
|
||||
$classmap = include $pathClassService.'Config.php';
|
||||
|
||||
//Définir l'url d'accès au WSDL
|
||||
$wsdl_url = $this->view->baseUrl();
|
||||
if (APPLICATION_ENV == 'production'){
|
||||
$wsdl_url.= '/'.$ws.'/v'.$version.'?wsdl';
|
||||
} else {
|
||||
$wsdl_url.= '/'.$ws.'/v'.$version.'?wsdl-auto';
|
||||
}
|
||||
// Affichage de la documentation
|
||||
$doc = new Scores_WebClassDoc(ucfirst($ws), $classmap, $pathClassService);
|
||||
$tabServiceMethods = $doc->getServiceMethods();
|
||||
// Tri des méthodes par ordre alphabétique
|
||||
$tabServiceMethodsK = array();
|
||||
foreach($tabServiceMethods as $method) {
|
||||
$tabServiceMethodsK[$method['name']] = $method;
|
||||
}
|
||||
ksort($tabServiceMethodsK);
|
||||
$tabServiceTypes = $doc->getServiceTypes();
|
||||
$this->view->assign('wsdl', $wsdl_url);
|
||||
$this->view->assign('serviceMethods', $tabServiceMethodsK);
|
||||
$this->view->assign('serviceTypes', $tabServiceTypes);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Affichage exemple de code avec coloration syntaxique
|
||||
* Le code doit être placé dans public/code et doit être nommé
|
||||
* [nom de la méthode]-langage.txt
|
||||
*/
|
||||
public function codeAction()
|
||||
{
|
||||
$langage = strtolower($this->_getParam('langage',''));
|
||||
$element = $this->_getParam('element','');
|
||||
|
||||
$fichier = APPLICATION_PATH . '/../public/assets/code/' . $element . '-' . $langage . '.txt';
|
||||
if (file_exists($fichier)){
|
||||
$sourceCode = file_get_contents($fichier);
|
||||
|
||||
require_once 'Vendors/geshi/geshi.php';
|
||||
$geshi = new GeSHi($sourceCode, $langage);
|
||||
$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
|
||||
$sourceHighlight = $geshi->parse_code();
|
||||
|
||||
$this->view->assign('langage', strtoupper($langage));
|
||||
$this->view->assign('code', $sourceHighlight);
|
||||
} else {
|
||||
$this->view->assign('langage',
|
||||
'Element non traités, Vous pouvez aussi nous fournir des exemples.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Affichage de la liste des erreurs avec leur code
|
||||
*/
|
||||
public function erreurAction()
|
||||
{
|
||||
require_once 'WsScore/WsScore.php';
|
||||
$ws = new WsScore();
|
||||
$erreurs = $ws->listError;
|
||||
$this->view->assign('erreurs', $erreurs);
|
||||
}
|
||||
}
|
||||
|
@ -1,47 +0,0 @@
|
||||
<?php
|
||||
class ErrorController extends Zend_Controller_Action
|
||||
{
|
||||
public function errorAction()
|
||||
{
|
||||
$errors = $this->_getParam('error_handler');
|
||||
|
||||
switch ($errors->type) {
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
|
||||
|
||||
// 404 error -- controller or action not found
|
||||
$this->getResponse()->setHttpResponseCode(404);
|
||||
$this->view->message = 'Page not found';
|
||||
break;
|
||||
default:
|
||||
// application error
|
||||
$this->getResponse()->setHttpResponseCode(500);
|
||||
$this->view->message = 'Application error';
|
||||
break;
|
||||
}
|
||||
|
||||
// Log exception, if logger available
|
||||
if ($log = $this->getLog()) {
|
||||
$log->crit($this->view->message, $errors->exception);
|
||||
}
|
||||
|
||||
// conditionally display exceptions
|
||||
if ($this->getInvokeArg('displayExceptions') == true) {
|
||||
$this->view->exception = $errors->exception;
|
||||
}
|
||||
|
||||
$this->view->request = $errors->request;
|
||||
}
|
||||
|
||||
public function getLog()
|
||||
{
|
||||
$bootstrap = $this->getInvokeArg('bootstrap');
|
||||
if (!$bootstrap->hasPluginResource('Log')) {
|
||||
return false;
|
||||
}
|
||||
$log = $bootstrap->getResource('Log');
|
||||
return $log;
|
||||
}
|
||||
}
|
||||
|
@ -1,20 +0,0 @@
|
||||
<?php
|
||||
class ExportController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
echo "Export";
|
||||
}
|
||||
|
||||
protected function checkFile($path)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,139 +0,0 @@
|
||||
<?php
|
||||
class FichierController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
}
|
||||
|
||||
public function bodaccAction()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if ( $auth->hasIdentity() ) {
|
||||
|
||||
$directory = '/mnt/bodacc';
|
||||
|
||||
$q = $this->getRequest()->getParam('q');
|
||||
$file = base64_decode($q);
|
||||
|
||||
$output_file = $directory.'/'.$file;
|
||||
|
||||
if (file_exists($output_file) && filesize($output_file)>0) {
|
||||
$content_type = 'application/pdf';
|
||||
header('Content-type: '.$content_type.'');
|
||||
header('Content-Length: '.filesize($output_file));
|
||||
header('Content-MD5: '.base64_encode(md5_file($output_file)));
|
||||
header('Content-Disposition: inline; filename="'.basename($output_file).'"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
ini_set('zlib.output_compression','0');
|
||||
echo file_get_contents($output_file);
|
||||
|
||||
//Log de la requete
|
||||
$tabInsert = array(
|
||||
'login' => $auth->getIdentity()->username,
|
||||
'idClient' => $auth->getIdentity()->idClient,
|
||||
'page' => 'histobodacc',
|
||||
'siren' => '',
|
||||
'nic' => '',
|
||||
'params' => $file,
|
||||
'test' => 0,
|
||||
'raisonSociale' => '',
|
||||
'cp' => '',
|
||||
'ville' => '',
|
||||
'ipClient' => $_SERVER['REMOTE_ADDR'],
|
||||
);
|
||||
require_once 'framework/common/mysql.php';
|
||||
$iDbCrm = new WDB('sdv1');
|
||||
$rep = $iDbCrm->insert('logs', array_merge($tabInsert,$tabRdvInsee), false, true);
|
||||
|
||||
} else {
|
||||
echo "Erreur lors de l'affichage du fichier.";
|
||||
}
|
||||
} else {
|
||||
echo "Authentification échoué.";
|
||||
}
|
||||
}
|
||||
|
||||
public function logsAction()
|
||||
{
|
||||
$file = $this->getRequest()->getParam('fichier');
|
||||
$content_type = 'application/csv-tab-delimited-table';
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = realpath($c->profil->path->files).'/';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($path.$file) ) {
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($path.$file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
|
||||
header('Content-Disposition: filename="' . basename($path.$file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
ini_set('zlib.output_compression', '0');
|
||||
echo file_get_contents($path.$file);
|
||||
}
|
||||
}
|
||||
|
||||
public function csvAction()
|
||||
{
|
||||
$file = $this->getRequest()->getParam('fichier');
|
||||
$content_type = 'application/csv-tab-delimited-table';
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = realpath($c->profil->path->files).'/';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($path.$file) ) {
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($path.$file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
|
||||
header('Content-Disposition: filename="' . basename($path.$file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
ini_set('zlib.output_compression', '0');
|
||||
echo file_get_contents($path.$file);
|
||||
}
|
||||
}
|
||||
|
||||
public function kbisAction()
|
||||
{
|
||||
$file = $this->getRequest()->getParam('fichier');
|
||||
$content_type = 'application/pdf';
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = realpath($c->profil->path->secure).'/kbis/';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($path.$file) ) {
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($path.$file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
|
||||
header('Content-Disposition: filename="' . basename($path.$file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
ini_set('zlib.output_compression', '0');
|
||||
echo file_get_contents($path.$file);
|
||||
}
|
||||
}
|
||||
|
||||
public function associationsAction()
|
||||
{
|
||||
$file = $this->getRequest()->getParam('fichier');
|
||||
$content_type = 'application/pdf';
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = realpath($c->profil->path->files).'/associations/';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($path.$file) ) {
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($path.$file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
|
||||
header('Content-Disposition: filename="' . basename($path.$file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
ini_set('zlib.output_compression', '0');
|
||||
echo file_get_contents($path.$file);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
<?php
|
||||
class ImportController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function fileformAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$this->view->inlineScript()->appendFile('/scripts/jquery.form.js');
|
||||
$this->view->inlineScript()->appendFile('/scripts/jqueryprogressbar.js');
|
||||
|
||||
$this->view->assign('filesize', ini_get('upload_max_filesize'));
|
||||
|
||||
$request = $this->getRequest();
|
||||
$idClient = $request->getParam('idClient', null);
|
||||
$login = $request->getParam('login', null);
|
||||
|
||||
$this->view->assign('idClient', $idClient);
|
||||
$this->view->assign('login', $login);
|
||||
}
|
||||
|
||||
public function fileuploadAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$request = $this->getRequest();
|
||||
$idClient = $request->getParam('idClient');
|
||||
$login = $request->getParam('login');
|
||||
|
||||
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'path');
|
||||
$path = realpath($config->data).'/validation';
|
||||
if(!file_exists($path)) mkdir($path);
|
||||
|
||||
if ( isset($_FILES) && count($_FILES)==1 ){
|
||||
$n = $_FILES['fichier']['name'];
|
||||
$s = $_FILES['fichier']['size'];
|
||||
$tmp_name = $_FILES['fichier']['tmp_name'];
|
||||
|
||||
$extValide = array('csv');
|
||||
$extension = strrchr($n,'.');
|
||||
$extension = substr($extension,1);
|
||||
//Vérifier l'extension du fichier
|
||||
if(!in_array($extension, $extValide)){
|
||||
echo "Extension de fichier incorrect !";
|
||||
} elseif (move_uploaded_file($tmp_name, $path.'/'.$idClient.'-'.$name.'.'.$extension)){
|
||||
echo "Fichier envoyé, <a href=\"".
|
||||
$this->view->url(array(
|
||||
'controller' => 'import',
|
||||
'action' => 'checkfile',
|
||||
'file' => $idClient.'-'.$name.'.'.$extension,
|
||||
))."\">Vérifier le format</a>";
|
||||
} else {
|
||||
echo "Erreur : ".$_FILES['fichier']['error'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Etat de progression de l'upload du fichier
|
||||
*/
|
||||
public function fileprogressAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('key', '');
|
||||
if (!empty($key)) {
|
||||
//$rep sera égal à false si la clef n'existe pas dans le cache apc
|
||||
$rep = apc_fetch('upload_'.$key);
|
||||
echo json_encode($rep);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
class IndexController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function contactAction()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,108 +0,0 @@
|
||||
<?php
|
||||
class JsonrpcController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
//Nom du service
|
||||
$serviceName = strtolower($request->getParam('service', 'Entreprise'));
|
||||
|
||||
//Service spécifique client
|
||||
if ($serviceName == 'clients') {
|
||||
$client = $request->getParam('client', '');
|
||||
//Liste des clients
|
||||
$clients = array();
|
||||
$listeClients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||
foreach ( $listeClients as $section => $params ) {
|
||||
if ($params['actif']){
|
||||
$clients[] = $section;
|
||||
}
|
||||
}
|
||||
if (!in_array($client, $clients)){
|
||||
echo 'Service clients introuvable !';
|
||||
exit;
|
||||
}
|
||||
$configServiceVersions = $clients[$client]['versions'];
|
||||
}
|
||||
else
|
||||
{
|
||||
//Service versions
|
||||
$services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
$configServiceVersions = $services[$serviceName]['versions'];
|
||||
}
|
||||
|
||||
//Liste des versions
|
||||
foreach( $configServiceVersions as $section => $params ) {
|
||||
$serviceVersions[$section] = $params;
|
||||
if ($params['defaut']) {
|
||||
$defautVersion = $section;
|
||||
}
|
||||
}
|
||||
$version = $request->getParam('version', 'v'.$defautVersion);
|
||||
$version = substr($version, 1);
|
||||
|
||||
// Version inexistante
|
||||
if ( !array_key_exists($version, $serviceVersions) ) {
|
||||
echo "Version inexistante.";
|
||||
exit;
|
||||
}
|
||||
// Version désactivé
|
||||
if ( !$serviceVersions[$version]['actif'] ) {
|
||||
echo "Version désactivée.";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Charger les classes et les types pour le service suivant la version
|
||||
if ($serviceName == 'clients') {
|
||||
$pathServiceClassIni = 'WsScore/Clients/'.ucfirst($client).'/v'.$version.'/Entreprise.ini';
|
||||
$pathServiceClassPhp = 'WsScore/Clients/'.ucfirst($client).'/v'.$version.'/Entreprise.php';
|
||||
$pathServiceUrl = 'clients/'.$client.'/v'.$version.'?wsdl-auto';
|
||||
//On redéfini le nom du service
|
||||
$serviceName = 'Entreprise';
|
||||
$fichierWsdl = ucfirst($client).'-'.$serviceName.'-'.$version.'.wsdl';
|
||||
} else {
|
||||
$pathServiceClassIni = 'WsScore/'.ucfirst($serviceName).'/v'.$version.'/'.ucfirst($serviceName).'.ini';
|
||||
$pathServiceClassPhp = 'WsScore/'.ucfirst($serviceName).'/v'.$version.'/'.ucfirst($serviceName).'.php';
|
||||
$pathServiceUrl = $serviceName.'/v'.$version.'?wsdl-auto';
|
||||
$fichierWsdl = ucfirst($serviceName).'-'.$version.'.wsdl';
|
||||
}
|
||||
|
||||
//Génération du tableau de mapping
|
||||
$wsConfig = new Zend_Config_Ini($pathServiceClassIni);
|
||||
foreach($wsConfig->Type->toArray() as $Type){
|
||||
$classmap[$Type] = $Type;
|
||||
}
|
||||
|
||||
//Inclusion des classes de données
|
||||
require_once $pathServiceClassPhp;
|
||||
|
||||
// Instance du server
|
||||
$server = new Zend_Json_Server();
|
||||
// Define class name
|
||||
$server->setClass(ucfirst($serviceName));
|
||||
|
||||
// Gestion du SMD
|
||||
if($this->getRequest()->isGet()){
|
||||
// Indiquer URL endpoint
|
||||
//$this->getHelper('url')->url(array('controller'=>'', 'action'=>'' ));
|
||||
$server->setTarget('/jsonrpc/'.$serviceName.'/'.$version.'/')
|
||||
->setEnvelope(Zend_Json_Server_Smd::ENV_JSONRPC_2);
|
||||
// Grab the SMD
|
||||
$smd = $server->getServiceMap();
|
||||
|
||||
//Return the SMD to the client
|
||||
if (!headers_sent()) {
|
||||
header('Content-Type: application/json');
|
||||
}
|
||||
echo $smd;
|
||||
return;
|
||||
} else {
|
||||
$server->setAutoEmitResponse(true);
|
||||
$server->handle();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,119 +0,0 @@
|
||||
<?php
|
||||
class RefController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction ()
|
||||
{
|
||||
//Ne fait rien...
|
||||
}
|
||||
|
||||
/**
|
||||
* Donne accès au fichier
|
||||
*/
|
||||
public function fichierAction ()
|
||||
{
|
||||
//Lecture du nom du fichier
|
||||
$fichier = $this->_getParam('q','');
|
||||
$fichier = $fichier . '.csv';
|
||||
if (!empty($fichier) && file_exists('fichiers/'.$fichier))
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
list($nomFichier, $extFichier) = explode('.',$fichier);
|
||||
//Distribution du fichier sur la sortie standard
|
||||
switch ($extFichier) {
|
||||
case 'png' : $content_type = 'image/png'; break;
|
||||
case 'gif' : $content_type = 'image/gif'; break;
|
||||
case 'jpeg':
|
||||
case 'jpg' : $content_type = 'image/jpeg'; break;
|
||||
case 'pdf' : $content_type = 'application/pdf'; break;
|
||||
case 'csv' : $content_type = 'application/csv-tab-delimited-table'; break;
|
||||
}
|
||||
$this->getResponse()->setHeader('Content-Type', $content_type);
|
||||
$contentDisposition = 'attachment';
|
||||
switch ($contentDisposition) {
|
||||
case 'inline':
|
||||
$this->getResponse()->setHeader('Content-Disposition', 'inline');
|
||||
break;
|
||||
case 'attachment':
|
||||
$this->getResponse()->setHeader('Content-Disposition', "attachment; filename=\"$fichier\"");
|
||||
break;
|
||||
}
|
||||
|
||||
$data = file_get_contents('assets/fichiers/'.$fichier);
|
||||
|
||||
$this->getResponse()->setHeader('Content-Length', strlen($data))
|
||||
->setHeader('Cache-Control', 'private, max-age=0, must-revalidate')
|
||||
->setHeader('Pragma', 'public')
|
||||
->setBody($data);
|
||||
} else {
|
||||
$this->view->assign('message', 'Fichier introuvable !');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Donne accès aux données contenues dans une table de base de données
|
||||
*/
|
||||
public function tableAction ()
|
||||
{
|
||||
$requetesql = $this->_getParam('q','');
|
||||
$fichierCsv = $requetesql.'.csv';
|
||||
$fichierSql = $requetesql.'.sql';
|
||||
|
||||
//Emplacement des fichiers générés - lien symbolique en PRODUCTION
|
||||
$path = DOC_WEB_LOCAL . 'fichiers/';
|
||||
if (!is_dir($path)) { mkdir($path); }
|
||||
if (!empty($requetesql))
|
||||
{
|
||||
if (!file_exists($path . $fichierCsv))
|
||||
{
|
||||
if (file_exists('assets/sql/'.$fichierSql))
|
||||
{
|
||||
//Connexion mysql
|
||||
$sql = file_get_contents('assets/sql/'.$fichierSql);
|
||||
require_once 'framework/common/mysql.php';
|
||||
$db = new WDB();
|
||||
$db->exportCSV($sql, $path . $fichierCsv, ',', "\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (file_exists($path . $fichierCsv))
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
//Distribution du fichier sur la sortie standard
|
||||
list($nomFichier, $extFichier) = explode('.',$fichierCsv);
|
||||
switch ($extFichier)
|
||||
{
|
||||
case 'png' : $content_type = 'image/png'; break;
|
||||
case 'gif' : $content_type = 'image/gif'; break;
|
||||
case 'jpeg':
|
||||
case 'jpg' : $content_type = 'image/jpeg'; break;
|
||||
case 'pdf' : $content_type = 'application/pdf'; break;
|
||||
case 'csv' : $content_type = 'application/csv-tab-delimited-table'; break;
|
||||
}
|
||||
$this->getResponse()->setHeader('Content-Type', $content_type);
|
||||
$contentDisposition = 'attachment';
|
||||
switch ($contentDisposition)
|
||||
{
|
||||
case 'inline':
|
||||
$this->getResponse()->setHeader('Content-Disposition', 'inline');
|
||||
break;
|
||||
case 'attachment':
|
||||
$this->getResponse()->setHeader('Content-Disposition', "attachment; filename=\"$fichierCsv\"");
|
||||
break;
|
||||
}
|
||||
|
||||
$data = file_get_contents($path . $fichierCsv);
|
||||
|
||||
$this->getResponse()->setHeader('Content-Length', strlen($data))
|
||||
->setHeader('Cache-Control', 'private, max-age=0, must-revalidate')
|
||||
->setHeader('Pragma', 'public')
|
||||
->setBody($data);
|
||||
}
|
||||
} else {
|
||||
$this->view->assign('message', 'Paramètres incorrects !');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,178 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Distribute all SOAP based Web Services
|
||||
*
|
||||
*/
|
||||
class ServiceController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
/**
|
||||
* Be sure we don't make any render
|
||||
*/
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
//Get the service name, make sure the string is in lower case
|
||||
$serviceName = strtolower($request->getParam('service', 'Entreprise'));
|
||||
|
||||
//ClassName and Directory with first letter capitalized
|
||||
$serviceClassName = ucfirst($serviceName);
|
||||
|
||||
//Customize service for customers
|
||||
if ('clients' == $serviceName ) {
|
||||
$client = strtolower($request->getParam('client', ''));
|
||||
$clientClassName = ucfirst($client);
|
||||
//Get list of customers
|
||||
$clients = array();
|
||||
$listeClients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||
foreach ( $listeClients as $section => $params ){
|
||||
if ($params['actif']) {
|
||||
$clients[$section] = $params;
|
||||
}
|
||||
}
|
||||
if (!array_key_exists($client, $clients)){
|
||||
echo 'Service clients introuvable !';
|
||||
exit;
|
||||
}
|
||||
$configServiceVersions = $clients[$client]['versions'];
|
||||
}
|
||||
else
|
||||
{
|
||||
//Service versions
|
||||
$services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
$configServiceVersions = $services[$serviceName]['versions'];
|
||||
}
|
||||
|
||||
// Check versions
|
||||
foreach( $configServiceVersions as $section => $params ) {
|
||||
$serviceVersions[$section] = $params;
|
||||
if ($params['defaut']) {
|
||||
$defautVersion = $section;
|
||||
}
|
||||
}
|
||||
$version = $request->getParam('version', 'v'.$defautVersion);
|
||||
$version = substr($version, 1);
|
||||
|
||||
// Version inexistante
|
||||
if ( !array_key_exists($version, $serviceVersions) ) {
|
||||
echo "Version inexistante.";
|
||||
exit;
|
||||
}
|
||||
// Version désactivé
|
||||
if ( !$serviceVersions[$version]['actif'] ) {
|
||||
echo "Version désactivée.";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Charger les classes et les types pour le service suivant la version
|
||||
if ('clients' == $serviceName) {
|
||||
|
||||
$pathServiceClassIni = 'WsScore/Clients/'.$clientClassName.'/v'.$version.'/Config.php';
|
||||
$pathServiceClassPhp = 'WsScore/Clients/'.$clientClassName.'/v'.$version.'/Entreprise.php';
|
||||
//Gestion du mode de génération du wsdl
|
||||
if ( APPLICATION_ENV == 'development'
|
||||
|| array_key_exists('mode', $serviceVersions[$version])
|
||||
&& $serviceVersions[$version]['mode']=='auto') {
|
||||
$pathServiceUrl = 'clients/'.$client.'/v'.$version.'?wsdl-auto';
|
||||
} else {
|
||||
$pathServiceUrl = 'clients/'.$client.'/v'.$version.'?wsdl';
|
||||
}
|
||||
//On redéfini le nom du service
|
||||
$serviceClassName = 'Entreprise';
|
||||
$fichierWsdl = $clientClassName.'-'.$serviceClassName.'-'.$version.'.wsdl';
|
||||
|
||||
} else {
|
||||
|
||||
$pathServiceClassIni = 'WsScore/'.$serviceClassName.'/v'.$version.'/Config.php';
|
||||
$pathServiceClassPhp = 'WsScore/'.$serviceClassName.'/v'.$version.'/'.$serviceClassName.'.php';
|
||||
//Gestion du mode de génération du wsdl
|
||||
if ( APPLICATION_ENV == 'development'
|
||||
|| array_key_exists('mode', $serviceVersions[$version])
|
||||
&& $serviceVersions[$version]['mode']=='auto') {
|
||||
$pathServiceUrl = $serviceName.'/v'.$version.'?wsdl-auto';
|
||||
} else {
|
||||
$pathServiceUrl = $serviceName.'/v'.$version.'?wsdl';
|
||||
}
|
||||
$fichierWsdl = $serviceClassName.'-'.$version.'.wsdl';
|
||||
|
||||
}
|
||||
|
||||
//Get map of WSDL type to PHP Classes
|
||||
$classmap = include $pathServiceClassIni;
|
||||
|
||||
//Inclusion des classes de données
|
||||
require_once $pathServiceClassPhp;
|
||||
|
||||
// Fourniture du wsdl
|
||||
if ( isset($_GET['wsdl']) && file_exists($fichierWsdl) ) {
|
||||
|
||||
if (!headers_sent()) {
|
||||
header('Content-Type: text/xml');
|
||||
}
|
||||
echo file_get_contents($fichierWsdl);
|
||||
|
||||
} elseif ( isset($_GET['wsdl']) && !file_exists($fichierWsdl)
|
||||
|| isset($_GET['wsdl-generate'])
|
||||
|| isset($_GET['wsdl-auto']) ) {
|
||||
|
||||
// Définition du webservice
|
||||
$wsdl = new Zend_Soap_AutoDiscover();
|
||||
$wsdl->setComplexTypeStrategy('Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence');
|
||||
$wsdl->setOperationBodyStyle( array('use' => 'literal') );
|
||||
$wsdl->setBindingStyle( array('style' => 'document') );
|
||||
$wsdl->setClass($serviceClassName);
|
||||
|
||||
// Enregistrement du WSDL dans un fichier
|
||||
if ( isset($_GET['wsdl-generate']) ) {
|
||||
if (file_exists($fichierWsdl)) {
|
||||
unlink($fichierWsdl);
|
||||
}
|
||||
$wsdl->dump($fichierWsdl);
|
||||
echo "Le fichier $fichierWsdl a été généré";
|
||||
|
||||
//Génération/Fourniture du wsdl
|
||||
} elseif (isset($_GET['wsdl']) && !file_exists($fichierWsdl)) {
|
||||
$wsdl->dump($fichierWsdl);
|
||||
if (!headers_sent()) {
|
||||
header('Content-Type: text/xml');
|
||||
}
|
||||
echo file_get_contents($fichierWsdl);
|
||||
|
||||
// Envoi sur la sortie standard le wsdl sans enregistrement dans un fichier
|
||||
} elseif ( isset($_GET['wsdl-auto']) ){
|
||||
$wsdl->handle();
|
||||
}
|
||||
|
||||
// Fourniture du service
|
||||
} else {
|
||||
|
||||
// Traitement
|
||||
if (APPLICATION_ENV == 'production' && file_exists($fichierWsdl)) {
|
||||
$server = new Zend_Soap_Server($fichierWsdl);
|
||||
} else {
|
||||
$hostName = $this->getRequest()->getHttpHost();
|
||||
$server = new Zend_Soap_Server('http://'.$hostName.'/'.$pathServiceUrl);
|
||||
}
|
||||
|
||||
$server->setSoapFeatures(SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS);
|
||||
$server->setClassmap($classmap);
|
||||
$server->setEncoding('UTF-8');
|
||||
$server->registerFaultException(array('WsScores_Exception'));
|
||||
$server->setWsiCompliant(true);
|
||||
$server->setObject(new $serviceClassName());
|
||||
$server->handle();
|
||||
|
||||
//Pour débuggage ultime
|
||||
$debug = false;
|
||||
if ($debug){
|
||||
$request = $server->getLastRequest();
|
||||
file_put_contents(APPLICATION_PATH . '/../request.log', $request);
|
||||
$response = $server->getLastResponse();
|
||||
file_put_contents(APPLICATION_PATH . '/../response.log', $response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,73 +0,0 @@
|
||||
<?php
|
||||
class UserController extends Zend_Controller_Action {
|
||||
|
||||
public function init()
|
||||
{
|
||||
$activeNav = $this->view->navigation();
|
||||
$activeNav->removePages();
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function loginAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$this->view->headLink()
|
||||
->appendStylesheet('/themes/default/css/signin.css', 'all');
|
||||
|
||||
$this->view->headTitle()->append('Connexion');
|
||||
$form = new Application_Form_Login();
|
||||
$this->view->form = $form;
|
||||
$request = $this->getRequest();
|
||||
if ($request->isPost()) {
|
||||
$formData = $request->getPost();
|
||||
if ($form->isValid($formData)) {
|
||||
$login = $form->getValue('login');
|
||||
$pass = $form->getValue('pass');
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$authAdapter = new Scores_AuthAdapter($login, $pass);
|
||||
$result = $auth->authenticate($authAdapter);
|
||||
if (!$result->isValid()){
|
||||
$this->view->message = '';
|
||||
foreach ($result->getMessages() as $message) {
|
||||
$this->view->message.= $message."<br/>";
|
||||
}
|
||||
} else {
|
||||
$timeout = $auth->getIdentity()->timeout;
|
||||
|
||||
//Ecrit un cookie persistant valide pendant le temps definit
|
||||
Zend_Session::rememberMe($timeout);
|
||||
|
||||
$storage = new Zend_Auth_Storage_Session();
|
||||
$sessionNamespace = new Zend_Session_Namespace($storage->getNamespace());
|
||||
$sessionNamespace->setExpirationSeconds($timeout);
|
||||
$auth->setStorage($storage);
|
||||
$url = '';
|
||||
if (Zend_Session::namespaceIsset('login')){
|
||||
$session = new Zend_Session_Namespace('login');
|
||||
if (isset($session->url)) {
|
||||
$url = $session->url;
|
||||
}
|
||||
}
|
||||
if (!empty($url)){
|
||||
$this->_redirect($url);
|
||||
}
|
||||
|
||||
$this->_redirect('/');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function logoutAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
Zend_Auth::getInstance()->clearIdentity();
|
||||
}
|
||||
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_AssoActes extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'asso_actes';
|
||||
protected $_schema = 'jo';
|
||||
|
||||
public function insert(array $data)
|
||||
{
|
||||
// Ajout d'un timestamp
|
||||
if (empty($data['dateInsert'])) {
|
||||
$data['dateInsert'] = date('Y-m-d H:i:s');
|
||||
}
|
||||
return parent::insert($data);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_BopiMarques extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'marques';
|
||||
protected $_schema = 'bopi';
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Commandes extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes';
|
||||
|
||||
protected $_dependentTables = array(
|
||||
'Application_Model_CommandesEven',
|
||||
'Application_Model_CommandesPieces',
|
||||
);
|
||||
|
||||
public function insert(array $data)
|
||||
{
|
||||
// Ajout d'un timestamp
|
||||
if (empty($data['date_added'])) {
|
||||
$data['date_added'] = date('Y-m-d H:i:s');
|
||||
}
|
||||
return parent::insert($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_CommandesActe extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes_acte';
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_CommandesAsso extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes_asso';
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_CommandesBilan extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes_bilan';
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_CommandesEven extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes_even';
|
||||
|
||||
protected $_referenceMap = array(
|
||||
'CommandesEven' => array(
|
||||
'columns' => array('commande_id'),
|
||||
'refTableClass' => 'Application_Model_Commandes',
|
||||
'refColumns' => array('id'),
|
||||
),
|
||||
);
|
||||
|
||||
public function insert(array $data)
|
||||
{
|
||||
if (empty($data['date_added'])) {
|
||||
$data['date_added'] = date('Y-m-d H:i:s');
|
||||
}
|
||||
return parent::insert($data);
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_CommandesKbis extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes_kbis';
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_CommandesPieces extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes_pieces';
|
||||
|
||||
protected $_referenceMap = array(
|
||||
'CommandesPieces' => array(
|
||||
'columns' => array('commande_id'),
|
||||
'refTableClass' => 'Application_Model_Commandes',
|
||||
'refColumns' => array('id'),
|
||||
),
|
||||
);
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_CommandesStatut extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes_statut';
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_ExtractionCommandes extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes';
|
||||
|
||||
public function insert(array $data)
|
||||
{
|
||||
// Ajout d'un timestamp
|
||||
if (empty($data['dateAdded'])) {
|
||||
$data['dateAdded'] = date('Y-m-d H:i:s');
|
||||
}
|
||||
return parent::insert($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_FedasoBilans extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'fedaso_bilans';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_HistoriquesBilans extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'bilans';
|
||||
protected $_schema = 'historiques';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoAssoBilans extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'asso_bilans';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoBilans extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'bilans';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoBilansUser extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'bilans_user';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoBoampLots extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'boamp_lots';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoBodaccDetail extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'bodacc_detail';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoBodaccFonctions extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'bodacc_fonctions';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoGreffesActes extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'greffes_actes';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoGreffesBilans extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'greffes_bilans';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoLiens extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'liens2';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoLiensDoc extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'liensDoc';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoLiensRef extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'liensRef';
|
||||
protected $_schema = 'jo';
|
||||
|
||||
public function insert(array $data)
|
||||
{
|
||||
// Ajout d'un timestamp
|
||||
if (empty($data['dateInsert'])) {
|
||||
$data['dateInsert'] = date('YmdHis');
|
||||
}
|
||||
return parent::insert($data);
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoRncsDirigeants extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'rncs_dirigeants';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoScoresCutoff extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'scores_cutoff';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoScoresCutoffMvt extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'scores_cutoff_mvt';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoScoresSurveillance extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'scores_surveillance';
|
||||
protected $_schema = 'jo';
|
||||
protected $_primary = 'siren';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoSurveillancesSite extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'surveillances_site';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoTabDevises extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'tabDevises';
|
||||
protected $_schema = 'jo';
|
||||
protected $_primary = 'devIso';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoTabEvenements extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'tabEvenements';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoTabFJur extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'tabFJur';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoTabNaf5 extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'tabNaf5';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoTabPays extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'tabPays';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoTelephonie extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'telephonie';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1BourseIsin extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'bourse_isin';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1Clients extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'clients';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1ClientsServices extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'clients_services';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1ClientsTarifs extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'clients_tarifs';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1GreffeCommandes extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'greffe_commandes';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1Prestations extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'prestations';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1TabIdLocal extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'tabIdLocal';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1Utilisateurs extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'utilisateurs';
|
||||
protected $_schema = 'sdv1';
|
||||
protected $_referenceMap = array(
|
||||
'Client' => array(
|
||||
'columns' => 'idClient',
|
||||
'refTableClass' => 'Sdv1Clients',
|
||||
'refColumns' => 'id'
|
||||
),
|
||||
'ServiceCode' => array(
|
||||
'columns' => 'login',
|
||||
'refTableClass' => 'Sdv1ClientsServicesUsers',
|
||||
'refColumns' => 'login'
|
||||
),
|
||||
);
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1UtilisateursService extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'utilisateurs_service';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
class Zend_View_Helper_DocComplement extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function docComplement($method)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
class Zend_View_Helper_DocDescription extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function docDescription($method)
|
||||
{
|
||||
return $method['desc'];
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
<?php
|
||||
class Zend_View_Helper_DocExemple extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function docExemple($method)
|
||||
{
|
||||
$exemple = '';
|
||||
$langages = array(
|
||||
'php' => 'PHP',
|
||||
'java' => 'Java',
|
||||
'perl' => 'Perl',
|
||||
'python' => 'Python',
|
||||
'csharp' => 'C#'
|
||||
);
|
||||
|
||||
foreach ($langages as $langage => $lib){
|
||||
$fichier = 'assets/code/'.$method.'-'.$langage.'.txt';
|
||||
if (file_exists($fichier)){
|
||||
$url = $this->view->url(
|
||||
array(
|
||||
'controller' => 'documentation',
|
||||
'action' => 'code',
|
||||
'langage' => $langage,
|
||||
'element' => $method,
|
||||
), null, true);
|
||||
$exemple.= '<a href="'.$url.'">' . $lib . '</a>';
|
||||
$exemple.= ' ';
|
||||
}
|
||||
}
|
||||
return $exemple;
|
||||
}
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
<?php
|
||||
class Zend_View_Helper_DocMethod extends Zend_View_Helper_Abstract
|
||||
{
|
||||
|
||||
protected $_transcodeType = array(
|
||||
'str' => 'string',
|
||||
'bool' => 'boolean',
|
||||
'integer' => 'int',
|
||||
);
|
||||
|
||||
public function docMethod($method)
|
||||
{
|
||||
$output = '';
|
||||
|
||||
$returnType = $method['return'];
|
||||
$methodName = $method['name'];
|
||||
|
||||
$cptParameters = 0;
|
||||
$parameters = '';
|
||||
foreach ($method['params'] as $param) {
|
||||
if (isset($param['optional'])) {
|
||||
$parameters.= '[';
|
||||
}
|
||||
$parameters.= '<i>' . $this->transcodeType($param['type']) . '</i>';
|
||||
$parameters.= ' ';
|
||||
$parameters.= '<b>' . $param['name'] . '</b>';
|
||||
|
||||
if (isset($param['optional'])) {
|
||||
if (isset($param['defaultValue'])) {
|
||||
$parameters.= ' = ';
|
||||
if (is_bool($param['defaultValue'])){
|
||||
$parameters.= ($param['defaultValue'] === false) ? 'false' : 'true' ;
|
||||
} elseif (is_string($param['defaultValue']) && $param['defaultValue']==''){
|
||||
$parameters.= "''";
|
||||
} else {
|
||||
$parameters.= $param['defaultValue'];
|
||||
}
|
||||
}
|
||||
$parameters.= ']';
|
||||
}
|
||||
$cptParameters++;
|
||||
if ($cptParameters < count($method['params'])){
|
||||
$parameters.= ', ';
|
||||
}
|
||||
}
|
||||
$output = '<i>' . $this->transcodeType($returnType) . '</i>';
|
||||
$output.= ' ';
|
||||
$output.= '<b>' . $methodName . '</b>' . ' <b>(</b> ' . $parameters . ' <b>)</b>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function transcodeType($type)
|
||||
{
|
||||
if(array_key_exists($type, $this->_transcodeType)){
|
||||
return $this->_transcodeType[$type];
|
||||
} else {
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
<?php
|
||||
class Zend_View_Helper_DocParameter extends Zend_View_Helper_Abstract
|
||||
{
|
||||
protected $serviceTypes;
|
||||
|
||||
protected $types = array(
|
||||
'string', 'str',
|
||||
'boolean', 'bool',
|
||||
'int', 'integer', 'long',
|
||||
'float', 'double',
|
||||
'array', 'object', 'mixed'
|
||||
);
|
||||
|
||||
protected $_transcodeType = array(
|
||||
'str' => 'string',
|
||||
'bool' => 'boolean',
|
||||
'integer' => 'int',
|
||||
);
|
||||
|
||||
public function docParameter($params, $serviceTypes)
|
||||
{
|
||||
$this->serviceTypes = $serviceTypes;
|
||||
$output = '';
|
||||
if (count($params)>0) {
|
||||
$output.= '<ul>';
|
||||
foreach ($params as $param) {
|
||||
$output.= $this->formatParam($param);
|
||||
}
|
||||
$output.= '</ul>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function parseType($type)
|
||||
{
|
||||
$output = '';
|
||||
$type = str_replace('[]', '', $type);
|
||||
if (array_key_exists($type, $this->serviceTypes)) {
|
||||
$types = $this->serviceTypes[$type];
|
||||
$output.= '<ul>';
|
||||
foreach ($types as $param) {
|
||||
$output.= $this->formatParam($param);
|
||||
}
|
||||
$output.= '</ul>';
|
||||
} elseif (in_array($type, $this->types)) {
|
||||
$output.= '';
|
||||
} elseif ($type == 'void'){
|
||||
$output.= 'Void';
|
||||
} else {
|
||||
$output.= ' => <b>Type '.$type.' inconnu</b>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function formatParam($param)
|
||||
{
|
||||
$output = '';
|
||||
$output.= '<li>';
|
||||
$output.= '<i>' . $this->transcodeType($param['type']) . '</i>';
|
||||
$output.= ' ';
|
||||
$output.= '<b>' . $param['name'] . '</b>';
|
||||
if (isset($param['description']) && !empty($param['description'])) {
|
||||
$output.= ' - '.$param['description'];
|
||||
}
|
||||
if (!in_array($param['type'], $this->types)) {
|
||||
$output.= $this->parseType($param['type']);
|
||||
}
|
||||
$output.= '</li>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function transcodeType($type)
|
||||
{
|
||||
if(array_key_exists($type, $this->_transcodeType)){
|
||||
return $this->_transcodeType[$type];
|
||||
} else {
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
<?php
|
||||
class Zend_View_Helper_DocReturn extends Zend_View_Helper_Abstract
|
||||
{
|
||||
protected $serviceTypes;
|
||||
|
||||
protected $types = array(
|
||||
'string', 'str',
|
||||
'boolean', 'bool',
|
||||
'integer', 'int', 'long',
|
||||
'float', 'double',
|
||||
'array', 'object', 'mixed'
|
||||
);
|
||||
|
||||
protected $_transcodeType = array(
|
||||
'str' => 'string',
|
||||
'bool' => 'boolean',
|
||||
'integer' => 'int',
|
||||
);
|
||||
|
||||
public function docReturn($type, $serviceTypes)
|
||||
{
|
||||
$this->serviceTypes = $serviceTypes;
|
||||
return $this->parseType($type);
|
||||
}
|
||||
|
||||
private function parseType($type)
|
||||
{
|
||||
$output = '';
|
||||
$type = str_replace('[]', '', $type);
|
||||
if (array_key_exists($type, $this->serviceTypes)) {
|
||||
$types = $this->serviceTypes[$type];
|
||||
$output.= '<ul>';
|
||||
foreach ($types as $param) {
|
||||
$output.= $this->formatParam($param);
|
||||
}
|
||||
$output.= '</ul>';
|
||||
} elseif (in_array($type, $this->types)) {
|
||||
$output.= '<i>' . $type . '</i> ';
|
||||
} elseif ($type == 'void'){
|
||||
$output.= 'Void';
|
||||
} else {
|
||||
$output.= ' => <b>Type '.$type.' inconnu</b>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function formatParam($param)
|
||||
{
|
||||
$output = '';
|
||||
$output.= '<li>';
|
||||
$output.= '<i>' . $this->transcodeType($param['type']) . '</i>';
|
||||
$output.= ' ';
|
||||
$output.= '<b>'. $param['name'] . '</b>';
|
||||
if (isset($param['description']) && !empty($param['description'])) {
|
||||
$output.= ' - '.$param['description'];
|
||||
}
|
||||
$type = str_replace('[]', '', $param['type']);
|
||||
if (!in_array($type, $this->types)) {
|
||||
$output.= $this->parseType($param['type']);
|
||||
}
|
||||
$output.= '</li>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function transcodeType($type)
|
||||
{
|
||||
if(array_key_exists($type, $this->_transcodeType)){
|
||||
return $this->_transcodeType[$type];
|
||||
} else {
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Zend_View_Helper_ProfileLink extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function profileLink()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if ($auth->hasIdentity()) {
|
||||
$username = $auth->getIdentity()->username;
|
||||
$logoutUrl = $this->view->url(array(
|
||||
'controller' => 'user',
|
||||
'action' => 'logout'
|
||||
), null, true);
|
||||
return '<a href="'.$logoutUrl.'" title="Se déconnecter" class="navbar-link">Déconnexion : ' . $username . '</a>';
|
||||
}
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
<h1>Démonstration - Liste des méthodes</h1>
|
||||
<ul>
|
||||
<?php
|
||||
foreach($this->methods as $method){
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $method['url'];?>">
|
||||
<?php echo $method['nom'];?></a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
@ -1,5 +0,0 @@
|
||||
<h2><?php echo $this->method;?></h2>
|
||||
<p><?php echo $this->message;?></p>
|
||||
<div>
|
||||
<?php echo $this->form;?>
|
||||
</div>
|
@ -1,20 +0,0 @@
|
||||
<h2>SOAP</h2>
|
||||
|
||||
<p>Requete</p>
|
||||
<textarea rows="10" cols="100" name="soap-requete">
|
||||
<?php print_r($this->soap['requete']);?>
|
||||
</textarea>
|
||||
<p>Réponse</p>
|
||||
<textarea rows="10" cols="100" name="soap-reponse">
|
||||
<?php print_r($this->soap['reponse']);?>
|
||||
</textarea>
|
||||
|
||||
<h2>XML</h2>
|
||||
<p>Requete</p>
|
||||
<textarea rows="10" cols="100" name="xml-requete">
|
||||
<?php echo $this->xml['requete'];?>
|
||||
</textarea>
|
||||
<p>Réponse</p>
|
||||
<textarea rows="10" cols="100" name="xml-reponse">
|
||||
<?php echo $this->xml['reponse'];?>
|
||||
</textarea>
|
@ -1,42 +0,0 @@
|
||||
<div id="wsdl">
|
||||
<h1>WSDL</h1>
|
||||
<p><a href="<?=$this->wsdl?>">Télécharger le WSDL</a></p>
|
||||
<i>Le fichier est accessible sans authentification.</i>
|
||||
</div>
|
||||
|
||||
<div class="op-list">
|
||||
<h1>Liste des opérations :</h1>
|
||||
<ol>
|
||||
<?php foreach ($this->serviceMethods as $method) {?>
|
||||
<li>
|
||||
<b><?php echo $method['name'];?></b>
|
||||
<a href="#<?php echo $method['name'];?>"><i>Détail</i></a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="op-detail">
|
||||
<h1>Détails :</h1>
|
||||
<?php foreach ($this->serviceMethods as $method) {?>
|
||||
<div class="function">
|
||||
<a name="<?php echo $method['name'];?>"> </a>
|
||||
<h2><?php echo $method['name'];?></h2>
|
||||
<div><u>Description : </u></div>
|
||||
<div class="description"><?=$this->docDescription($method)?></div>
|
||||
<div class="complement"><?=$this->docComplement($method)?></div>
|
||||
<div class="function-detail" id="<?=$method['name']?>">
|
||||
<p><?php echo $this->docMethod($method);?></p>
|
||||
<div><u>Paramètres : </u></div>
|
||||
<div class="parameters">
|
||||
<?php echo $this->docParameter($method['params'], $this->serviceTypes);?>
|
||||
</div>
|
||||
<div><u>Retour : </u></div>
|
||||
<div class="return">
|
||||
<?php echo $this->docReturn($method['return'], $this->serviceTypes);?>
|
||||
</div>
|
||||
</div>
|
||||
<p>Exemple : <?php echo $this->docExemple($method['name']);?></p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
@ -1,2 +0,0 @@
|
||||
<h2><?=$this->langage?></h2>
|
||||
<?=$this->code?>
|
@ -1,10 +0,0 @@
|
||||
<div>
|
||||
<h1>Liste des code erreurs/messages :</h1>
|
||||
<ul>
|
||||
<?php foreach ($this->erreurs as $code => $message) {?>
|
||||
<li>
|
||||
<b><?php echo $code?></b> : <?php echo $message?>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
@ -1,2 +0,0 @@
|
||||
<h2>Liste des exemples</h2>
|
||||
|
@ -1,40 +0,0 @@
|
||||
<div class="page-header"><h1>Authentification</h1></div>
|
||||
<p>
|
||||
Le WebService utilise une authentification http basic.
|
||||
Il s'agit donc de transmettre comme paramètres d'authentification
|
||||
</p>
|
||||
<p><code>http://{login}:{password}@url</code></p>
|
||||
<p>
|
||||
- <code>{password}</code> est une chaine construite de cette façon md5({login}|{pass}) <br/>
|
||||
- <code>{login}</code> est l'identifiant fournit <br/>
|
||||
- <code>{pass}</code> le mot de passe fournit.
|
||||
</p>
|
||||
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
Info sur le fonctionnement authentification basic
|
||||
</div>
|
||||
|
||||
<p>
|
||||
Vous trouverez dans ces exemples les prérequis pour s'authentifier et suivant
|
||||
les outils et langage la possibilité de générer le code à partir du WSDL.<br/>
|
||||
Exemple : <?=$this->docExemple('authentication')?>
|
||||
</p>
|
||||
|
||||
|
||||
<div class="page-header"><h1>Compatibilité</h1></div>
|
||||
<p>Notre service web a été testé avec ces langages/librairies</p>
|
||||
<ul>
|
||||
<li>PHP : PHP5 SOAP Extension</li>
|
||||
<li>Perl : SOAP::Lite</li>
|
||||
<li>Java : JAX-WS</li>
|
||||
<li>(En cours de test) - Python : SOAPpy</li>
|
||||
<li>(En cours de test) - C# : .Net Framework</li>
|
||||
<li>(En cours de test) - VB.Net : .Net Framework</li>
|
||||
<li>(En cours de test) - C++ : gSOAP</li>
|
||||
</ul>
|
||||
|
||||
<br/>
|
||||
<p>
|
||||
Pour toutes remarques ou question merci d'adresser un email à
|
||||
<a href="mailto:support@scores-decisions.com">support@scores-decisions.com</a>
|
||||
</p>
|
@ -1 +0,0 @@
|
||||
Erreur
|
@ -1,63 +0,0 @@
|
||||
<div class="page-header"><h1>Service <?=$this->serviceName?> v<?=$this->serviceVersion?></h1></div>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">WSDL</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p><a href="<?=$this->wsdl?>">Télécharger le WSDL</a></p>
|
||||
<i>Le fichier est accessible sans authentification.</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Liste des opérations</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<ol>
|
||||
<?php foreach ($this->serviceMethods as $method) {?>
|
||||
<li>
|
||||
<b><?php echo $method['name'];?></b>
|
||||
<a href="#<?php echo $method['name'];?>"><i>Détail</i></a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Détails</h3>
|
||||
</div>
|
||||
<ul class="list-group">
|
||||
<?php foreach ($this->serviceMethods as $method) {?>
|
||||
<li class="list-group-item">
|
||||
<a id="<?=$method['name']?>"></a><h4><?=$method['name']?></h4>
|
||||
|
||||
<h5>Description</h5>
|
||||
<div class="bs-callout bs-callout-php">
|
||||
<h4><code><?=$this->docMethod($method)?></code></h4>
|
||||
<p><?=$this->docComplement($method)?></p>
|
||||
<p><?=$this->docDescription($method)?></p>
|
||||
</div>
|
||||
|
||||
<h5>Paramètres</h5>
|
||||
<div class="bs-callout bs-callout-php">
|
||||
<?=$this->docParameter($method['params'], $this->serviceTypes);?>
|
||||
</div>
|
||||
|
||||
<h5>Retour</h5>
|
||||
<div class="bs-callout bs-callout-php">
|
||||
<?=$this->docReturn($method['return'], $this->serviceTypes);?>
|
||||
</div>
|
||||
|
||||
<h5>Exemple</h5>
|
||||
<div class="bs-callout bs-callout-php">
|
||||
<?=$this->docExemple($method['name'])?>
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
@ -1,43 +0,0 @@
|
||||
<div class="page-header"><h1>Liste des services disponibles</h1></div>
|
||||
<p class="lead">Ci-dessous la liste des services disponibles, personnalisés ou standards.</code>.</p>
|
||||
|
||||
<?php foreach ($this->WsServices as $service => $params) {?>
|
||||
<div class="panel panel-default">
|
||||
<!-- Default panel contents -->
|
||||
<div class="panel-heading">
|
||||
<a href="<?=$this->url(array(
|
||||
'controller'=>'documentation',
|
||||
'action'=>'servicev',
|
||||
'name'=>$service,
|
||||
'type'=>$params['type']),null,true)?>">
|
||||
<?=$params['name']?>
|
||||
</a>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p>Informations</p>
|
||||
</div>
|
||||
<?php if (isset($params['versions'])) { ?>
|
||||
<ul class="list-group">
|
||||
<?php foreach ($params['versions'] as $version => $versionElement) { ?>
|
||||
<li class="list-group-item">
|
||||
<a href="<?=$this->url(array(
|
||||
'controller'=>'documentation',
|
||||
'action'=>'service',
|
||||
'name'=>$service,
|
||||
'type'=>$params['type'],
|
||||
'version'=>$version),null,true)?>">
|
||||
Version <?=$version?></a>
|
||||
<?php if ( $versionElement['defaut'] === true ) { ?>
|
||||
<span style="float:right;" class="label label-success">Défaut</span>
|
||||
<?php } elseif ( $versionElement['defaut'] === false ) {?>
|
||||
<span style="float:right;" class="label label-danger">Déprécié</span>
|
||||
<?php } elseif ( $versionElement['defaut'] == 'beta') {?>
|
||||
<span style="float:right;" class="label label-warning">Beta</span>
|
||||
<?php }?>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
<?php } ?>
|
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
$service = null;
|
||||
if ( array_key_exists($this->key, $this->WsServices) ) {
|
||||
$service = $this->WsServices[$this->key];
|
||||
}
|
||||
?>
|
||||
<?php if ( $service === null ) {?>
|
||||
|
||||
<?php } else {?>
|
||||
|
||||
<div class="page-header"><h1>Versions du service <?=$service['name']?></h1></div>
|
||||
<p class="lead">...</p>
|
||||
|
||||
<?php if (isset($service['versions'])) { ?>
|
||||
<?php foreach ($service['versions'] as $version => $versionElement) { ?>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<a href="<?=$this->url(array(
|
||||
'controller'=>'documentation',
|
||||
'action'=>'service',
|
||||
'name'=>$this->key,
|
||||
'type'=>$service['type'],
|
||||
'version'=>$version))?>">
|
||||
Version <?=$version?></a>
|
||||
<?php if ( $versionElement['defaut'] === true ) { ?>
|
||||
<span style="float:right;" class="label label-success">Défaut</span>
|
||||
<?php } elseif ( $versionElement['defaut'] === false ) {?>
|
||||
<span style="float:right;" class="label label-danger">Déprécié</span>
|
||||
<?php } elseif ( $versionElement['defaut'] == 'beta') {?>
|
||||
<span style="float:right;" class="label label-warning">Beta</span>
|
||||
<?php }?>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p>Information</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
|
||||
<?php } ?>
|
@ -1,28 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Zend Framework Default Application</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>An error occurred</h1>
|
||||
<h2><?php echo $this->message ?></h2>
|
||||
|
||||
<?php if (isset($this->exception)): ?>
|
||||
|
||||
<h3>Exception information:</h3>
|
||||
<p>
|
||||
<b>Message:</b> <?php echo $this->exception->getMessage() ?>
|
||||
</p>
|
||||
|
||||
<h3>Stack trace:</h3>
|
||||
<pre><?php echo $this->exception->getTraceAsString() ?>
|
||||
</pre>
|
||||
|
||||
<h3>Request Parameters:</h3>
|
||||
<pre><?php echo var_export($this->request->getParams(), true) ?>
|
||||
</pre>
|
||||
<?php endif ?>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,3 +0,0 @@
|
||||
<div class="container">
|
||||
<p class="text-muted credit"> © <?=date('Y')?> <a href="http://www.scores-decisions.com">Scores & Décisions</a>.</p>
|
||||
</div>
|
@ -1,35 +0,0 @@
|
||||
<!-- Fixed navbar -->
|
||||
<div class="navbar navbar-default navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#">Web Service API</a>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="active"><a href="<?=$this->url(array('controller'=>'index', 'action'=>'index'),null,true)?>">Accueil</a></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="<?=$this->url(array('controller'=>'documentation','action'=>'index'),null,true)?>">Information Général</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="<?=$this->url(array('controller'=>'documentation','action'=>'services'),null,true)?>">Liste des services</a></li>
|
||||
<li class="divider"></li>
|
||||
<?php if ( count($this->WsServices)>0 ) {?>
|
||||
<?php foreach ( $this->WsServices as $service => $params) {?>
|
||||
<li><a href="<?=$this->url(array('controller'=>'documentation','action'=>'service','name'=>$service,'type'=>$params['type']),null,true)?>"><?=$params['name']?></a></li>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="<?=$this->url(array('controller'=>'demo', 'action'=>'index'), null, true)?>">Démonstration</a></li>
|
||||
<li><a href="<?=$this->url(array('controller'=>'index', 'action'=>'contact'), null, true)?>">Contact</a></li>
|
||||
</ul>
|
||||
<p class="navbar-text pull-right"><?=$this->profileLink()?></p>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
@ -1,53 +0,0 @@
|
||||
<div>
|
||||
|
||||
<h2>Intégration d'un fichier</h2>
|
||||
|
||||
<p>Taille maximale d'un fichier : <?=$this->filesize?></p>
|
||||
|
||||
<form enctype="multipart/form-data" name="sendfile" action="<?=$this->url(array('controller'=>'import','action'=>'fileupload'))?>" method="post">
|
||||
<input type="hidden" name="APC_UPLOAD_PROGRESS" id="key" value="<?=uniqid()?>"/>
|
||||
<input type="hidden" name="idClient" value="<?=$this->idClient?>" />
|
||||
<input type="hidden" name="login" value="<?=$this->login?>" />
|
||||
|
||||
<div class="fieldgrp">
|
||||
<label>Fichier</label>
|
||||
<div class="field">
|
||||
<input type="file" id="fichier" name="fichier"/>
|
||||
<input type="submit" value="Envoi"/>
|
||||
|
||||
<div id="progressbar"></div>
|
||||
<div id="output"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<?=$this->inlineScript()?>
|
||||
|
||||
<script>
|
||||
var timer;
|
||||
|
||||
$('form[name=sendfile]').ajaxForm({
|
||||
beforeSubmit: function() {
|
||||
timer = setInterval(checkProgress,200);
|
||||
$('#progressbar').reportprogress(0);
|
||||
$('#output').html('Envoi en cours...');
|
||||
},
|
||||
success: function(data) {
|
||||
clearInterval(timer);
|
||||
$('#progressbar').remove();
|
||||
$('#output').html('<strong>' + data + '</strong>');
|
||||
}
|
||||
});
|
||||
|
||||
function checkProgress() {
|
||||
$.get('<?=$this->url(array('controller'=>'import', 'action'=>'fileprogress'))?>',
|
||||
{key: $('#key').val()}, function(data) {
|
||||
var percent = data.current/data.total*100;
|
||||
$('#progressbar').reportprogress(percent);
|
||||
}, 'json');
|
||||
}
|
||||
</script>
|
@ -1,6 +0,0 @@
|
||||
<div class="page-header"><h1>Contact</h1></div>
|
||||
<p class="lead"></p>
|
||||
<p>Pour toutes questions concernant les paramètres techniques ou une explication des données, vous pouvez contactez
|
||||
votre commercial ou le service support (support@scores-decisions.com).</p>
|
||||
|
||||
<p>Merci de rappeler pour référence le login utilisé pour l'accès au WebService.</p>
|
@ -1,7 +0,0 @@
|
||||
<div class="page-header"><h1>Web Service API</h1></div>
|
||||
<p class="lead">Scores & Décisions fournit un ensemble d'information sous la forme d'une API
|
||||
compatible avec le protocole SOAP permettant la communication et l'échange de données avec vos
|
||||
applications métier.
|
||||
</p>
|
||||
<p>La documentation vous fournira les éléments techniques relatifs aux <em>paramètres de connexion</em>,
|
||||
<em>structure des données</em>, ...</p>
|
@ -1,26 +0,0 @@
|
||||
<?php echo $this->doctype(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<?php echo $this->headMeta(); ?>
|
||||
<?php echo $this->headTitle(); ?>
|
||||
<?php echo $this->headStyle(); ?>
|
||||
<?php echo $this->headLink(); ?>
|
||||
<?php echo $this->headScript(); ?>
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrap">
|
||||
<?php echo $this->render('header.phtml') ?>
|
||||
|
||||
<div class="container">
|
||||
<?php echo $this->layout()->content; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
<?php echo $this->render('footer.phtml'); ?>
|
||||
</div>
|
||||
|
||||
<?php echo $this->inlineScript(); ?>
|
||||
</body>
|
||||
</html>
|
@ -1 +0,0 @@
|
||||
<?= $this->message ?>
|
@ -1 +0,0 @@
|
||||
<?php
|
@ -1 +0,0 @@
|
||||
<?= $this->message ?>
|
@ -1 +0,0 @@
|
||||
|
@ -1,32 +0,0 @@
|
||||
<?php echo $this->doctype(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<?php echo $this->headMeta(); ?>
|
||||
<?php echo $this->headTitle(); ?>
|
||||
<?php echo $this->headStyle(); ?>
|
||||
<?php echo $this->headLink(); ?>
|
||||
<?php echo $this->headScript(); ?>
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrap">
|
||||
|
||||
<div class="container">
|
||||
|
||||
<form class="form-signin" method="<?=$this->form->getMethod()?>" action="<?=$this->form->getAction()?>">
|
||||
<h2 class="form-signin-heading">Web Service API</h2>
|
||||
<input name="login" value="<?=$this->form->getValue('login')?>" type="text" class="form-control" placeholder="Identifiant" autofocus>
|
||||
<input name="pass" value="<?=$this->form->getValue('pass')?>" type="password" class="form-control" placeholder="Mot de passe">
|
||||
<button class="btn btn-lg btn-primary btn-block" type="submit">Connexion</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
<?php echo $this->render('footer.phtml'); ?>
|
||||
</div>
|
||||
|
||||
<?php echo $this->inlineScript(); ?>
|
||||
</body>
|
||||
</html>
|
@ -1,24 +0,0 @@
|
||||
<?php echo $this->doctype(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<?php echo $this->headMeta(); ?>
|
||||
<?php echo $this->headTitle(); ?>
|
||||
<?php echo $this->headStyle(); ?>
|
||||
<?php echo $this->headLink(); ?>
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrap">
|
||||
|
||||
<div class="container">
|
||||
<p>Vous avez été déconnecté.</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
<?php echo $this->render('footer.phtml'); ?>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
181
docs/README.txt
181
docs/README.txt
@ -1,181 +0,0 @@
|
||||
README
|
||||
======
|
||||
|
||||
Display the documentation of our services, manage the SOAP services
|
||||
Based on ZendFramework version 1.x
|
||||
|
||||
Fichier de configuration
|
||||
========================
|
||||
La configuration est décomposé en plusieurs fichiers,
|
||||
avec adaptation suivant la machine
|
||||
- mysql.php
|
||||
- smtp.php
|
||||
- sphinx.php
|
||||
- stockage.php
|
||||
|
||||
sans adaptation suivant la machine
|
||||
- partenaires.php
|
||||
|
||||
Fonctionnement
|
||||
==============
|
||||
Obtenir les WSDL
|
||||
Pour le service Entreprise
|
||||
|
||||
- En mode développement : http://hostname/entreprise/version?wsdl-auto
|
||||
- Générer le WSDL : http://hostname/entreprise/version?wsdl-generate
|
||||
- Utiliser le WSDL généré : http://hostname/entreprise/version?wsdl
|
||||
|
||||
Pour le service Interne
|
||||
|
||||
http://hostname/interne/version?wsdl
|
||||
|
||||
Pour les clients
|
||||
|
||||
http://hostname/clients/nom_du_client/version?wsdl
|
||||
|
||||
N.B : Le fichier WSDL est généré automatiquement en appelant
|
||||
http://hostname/service?wsdl afin de ne pas provoquer d'erreur
|
||||
après une mise en production
|
||||
|
||||
Pour définir le mode (vhost d'apache)
|
||||
SetEnv APPLICATION_ENV "development"
|
||||
SetEnv APPLICATION_ENV "production"
|
||||
SetEnv APPLICATION_ENV "staging"
|
||||
|
||||
En appelant l'url http://hostname/service, le contoller de l'application,
|
||||
"service" est automatiquement utiliser.
|
||||
Tout ce qui est visible dans la class est utilisé par le controller et se
|
||||
retrouve visible dans le service (wsdl, requête)
|
||||
|
||||
Si des fonctions ne doivent pas être rendu visible il faut donc les séparer
|
||||
dans un autre controller utilisant une autre class.
|
||||
|
||||
|
||||
Documentation des méthodes et ajout spécial
|
||||
===========================================
|
||||
|
||||
La documentation est géneré en automatique.
|
||||
|
||||
Voici comment définir simplement la documentation d'une méthode
|
||||
|
||||
/**
|
||||
* Retourne les informations identitaires de l'entreprise ou de l'établissement demandé
|
||||
* @param string $key Siren de l'entreprise ou siret de l'établissement
|
||||
* @return Identite
|
||||
*/
|
||||
public function test($key)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Attention ces informations servent aussi pour la structure du WSDL
|
||||
|
||||
Pour spécifier un lien vers un fichier ou pour générer un fichier depuis une
|
||||
requête SQL à partir de la documentation du service.
|
||||
Ajouter dans le docblock :
|
||||
- Pour un fichier
|
||||
@ref fichier:libellé:{nom_du_fichier.ext}
|
||||
- Pour une requête SQL
|
||||
@ref mysql:libellé:{nom_du_fichier.sql}
|
||||
|
||||
Les fichiers a télécharger sont à placer dans le répértoire public/fichier et
|
||||
les fichiers sql dans public/sql
|
||||
|
||||
Pour spécifier des éléments de taille (non pris en compte sur le WSDL)
|
||||
@xsd minLength=9
|
||||
@xsd maxLength=15
|
||||
|
||||
Configuration PHP
|
||||
=================
|
||||
apt-get install php5-mysql
|
||||
apt-get install php-apc
|
||||
apt-get install php5-curl
|
||||
apt-get install php5-xmlrpc
|
||||
|
||||
Paquet PEAR
|
||||
- Mail
|
||||
- Mail_Mime
|
||||
|
||||
WKHTMLTOPDF
|
||||
===========
|
||||
apt-get install libXrender1
|
||||
apt-get install libfontconfig
|
||||
|
||||
Configuration VHOST
|
||||
===================
|
||||
a2enmod rewrite
|
||||
|
||||
Exemple de vhost en mode développement
|
||||
|
||||
<VirtualHost *:80>
|
||||
ServerName scoresws.sd.dev
|
||||
AddDefaultCharset utf-8
|
||||
|
||||
# Pour la gestion des ports : $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT']
|
||||
UseCanonicalName On
|
||||
UseCanonicalPhysicalPort On
|
||||
|
||||
DocumentRoot "D:/www/webservice/public"
|
||||
SetEnv APPLICATION_ENV "development"
|
||||
<Directory "D:/www/webservice/public/">
|
||||
DirectoryIndex index.php
|
||||
AllowOverride All
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_URI} ^/favicon.ico$ [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -s [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -l [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^.*$ - [NC,L]
|
||||
RewriteRule ^.*$ index.php [NC,L]
|
||||
</IfModule>
|
||||
</Directory>
|
||||
|
||||
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
|
||||
LogLevel debug
|
||||
ErrorLog "logs/scoresws.sd.dev-error.log"
|
||||
CustomLog "logs/scoresws.sd.dev-access.log" common
|
||||
</VirtualHost>
|
||||
|
||||
|
||||
Vhost réel
|
||||
|
||||
<VirtualHost *:8081>
|
||||
ServerName wse.scores-decisions.com
|
||||
ServerAlias wse1.scores-decisions.com
|
||||
|
||||
# Pour la gestion des ports : $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT']
|
||||
UseCanonicalName On
|
||||
UseCanonicalPhysicalPort On
|
||||
|
||||
ServerSignature Off
|
||||
AddDefaultCharset utf-8
|
||||
DocumentRoot /home/vhosts/webservice/public
|
||||
SetEnv APPLICATION_ENV "production"
|
||||
<Directory /home/vhosts/webservice/public/>
|
||||
DirectoryIndex index.php
|
||||
AllowOverride All
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_URI} ^/favicon.ico$ [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -s [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -l [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^.*$ - [NC,L]
|
||||
RewriteRule ^.*$ index.php [NC,L]
|
||||
</IfModule>
|
||||
</Directory>
|
||||
|
||||
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
|
||||
LogLevel error
|
||||
ErrorLog /var/log/apache2/webservice-error.log
|
||||
CustomLog /var/log/apache2/webservice-access.log common
|
||||
</VirtualHost>
|
||||
|
||||
|
||||
|
||||
|
@ -1,8 +0,0 @@
|
||||
Créer un fichier "webservice" dans /etc/logrotate.d
|
||||
|
||||
/var/log/webservice/*.log {
|
||||
weekly
|
||||
missingok
|
||||
compress
|
||||
notifempty
|
||||
}
|
@ -1,100 +0,0 @@
|
||||
<?php
|
||||
class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
|
||||
{
|
||||
/**
|
||||
* Vérifie les autorisations
|
||||
* Utilise _request et _response hérités et injectés par le FC
|
||||
*
|
||||
* @param Zend_Controller_Request_Abstract $request : non utilisé, mais demandé par l'héritage
|
||||
*/
|
||||
public function preDispatch(Zend_Controller_Request_Abstract $request)
|
||||
{
|
||||
$controller = $request->getControllerName();
|
||||
$action = $request->getActionName();
|
||||
|
||||
$checkAuth = true;
|
||||
//Pas d'authentification sur la demande d'authentification
|
||||
if ( $controller == 'user' && $action == 'login' ) {
|
||||
$checkAuth = false;
|
||||
}
|
||||
|
||||
// Pas d'authentification sur ces services
|
||||
if ( in_array($controller, array('service', 'import'))
|
||||
|| ( $controller == 'fichier' && $action == 'logs' )
|
||||
|| ( $controller == 'fichier' && $action == 'kbis' )
|
||||
|| ( $controller == 'fichier' && $action == 'csv' )
|
||||
|| ( $controller == 'fichier' && $action == 'associations' )) {
|
||||
$checkAuth = false;
|
||||
}
|
||||
|
||||
$checkWs = true;
|
||||
if ( $controller == 'fichier' ) {
|
||||
$checkWs = false;
|
||||
}
|
||||
|
||||
if ($checkAuth) {
|
||||
$login = $request->getParam('login');
|
||||
$pass = $request->getParam('pass', '');
|
||||
|
||||
$hach = $request->getParam('hach');
|
||||
if (!empty($hach)) {
|
||||
$pass = $hach;
|
||||
}
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
|
||||
//On vérifie le tout lors d'une connexion par url
|
||||
if ( !empty($login) && !empty($pass) ) {
|
||||
|
||||
$authAdapter = new Scores_AuthAdapter($login, $pass, $checkWs);
|
||||
$result = $auth->authenticate($authAdapter);
|
||||
if (!$result->isValid()) {
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
if ( !$layout->isEnabled() ){
|
||||
echo "Identification incorrect ou périmé.";
|
||||
} else {
|
||||
$request->setModuleName('default')
|
||||
->setControllerName('user')
|
||||
->setActionName('logout');
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$storage = new Zend_Auth_Storage_Session();
|
||||
$session = new Zend_Session_Namespace($storage->getNamespace());
|
||||
//$session->setExpirationSeconds(86400);
|
||||
$auth->setStorage($storage);
|
||||
|
||||
}
|
||||
|
||||
//Sinon on reste sur le standard
|
||||
} else {
|
||||
//Pas authentifié
|
||||
if ( !$auth->hasIdentity() || time() > $auth->getIdentity()->time ) {
|
||||
|
||||
$auth->clearIdentity();
|
||||
$session = new Zend_Session_Namespace('login');
|
||||
$session->url = $_SERVER['REQUEST_URI'];
|
||||
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
if (!$layout->isEnabled()){
|
||||
echo "Identification incorrect ou périmé.";
|
||||
} else {
|
||||
$this->_response->setRedirect('/user/login')->sendResponse();
|
||||
}
|
||||
//Authentifié => on met à jour la session
|
||||
} else {
|
||||
|
||||
$identity = $auth->getIdentity();
|
||||
$identity->time = time() + $identity->timeout;
|
||||
$auth->getStorage()->write($identity);
|
||||
|
||||
if (Zend_Session::namespaceIsset('login')){
|
||||
Zend_Session::namespaceUnset('login');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,71 +0,0 @@
|
||||
<?php
|
||||
class Application_Controller_Plugin_Services extends Zend_Controller_Plugin_Abstract
|
||||
{
|
||||
/**
|
||||
* Vérifie les autorisations
|
||||
* Utilise _request et _response hérités et injectés par le FC
|
||||
*
|
||||
* @param Zend_Controller_Request_Abstract $request : non utilisé, mais demandé par l'héritage
|
||||
*/
|
||||
public function preDispatch(Zend_Controller_Request_Abstract $request)
|
||||
{
|
||||
$controller = $request->getControllerName();
|
||||
$action = $request->getActionName();
|
||||
|
||||
if ( $controller === 'service' ) {
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$username = $auth->getIdentity()->username;
|
||||
$idClient = $auth->getIdentity()->idClient;
|
||||
|
||||
$wsServices = array();
|
||||
|
||||
//Get all webservice client
|
||||
$clients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||
foreach( $clients as $section => $params ) {
|
||||
if ( $params['actif']
|
||||
&& (isset($params['idClient']) && in_array($idClient,$params['idClient'])) ) {
|
||||
|
||||
$params['name'] = $section;
|
||||
$params['type'] = 'client';
|
||||
if ( $idClient == 1 ) {
|
||||
$params['name'] = 'Client - '.ucfirst($section);
|
||||
}
|
||||
$wsServices[$section] = $params;
|
||||
}
|
||||
}
|
||||
|
||||
//Standard service
|
||||
if ( count($wsServices)==0 || $idClient==1 ) {
|
||||
$services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
foreach( $services as $section => $params )
|
||||
{
|
||||
if ( $params['actif'] ) {
|
||||
$params['name'] = ucfirst($section);
|
||||
$params['type'] = 'sd';
|
||||
if ( isset($params['idClient']) && in_array($idClient,$params['idClient']) ) {
|
||||
if ( $idClient == 1 ) {
|
||||
$params['name'] = 'SD - '.ucfirst($section);
|
||||
}
|
||||
$wsServices[$section] = $params;
|
||||
}
|
||||
elseif ( !isset($params['idClient']) ) {
|
||||
if ( $idClient == 1 ) {
|
||||
$params['name'] = 'SD - '.ucfirst($section);
|
||||
}
|
||||
$wsServices[$section] = $params;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
$view = $layout->getView();
|
||||
$view->WsServices = $wsServices;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
<?php
|
||||
class Application_Form_Login extends Zend_Form {
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->setName('login');
|
||||
$this->setAction('login');
|
||||
$this->setMethod('post');
|
||||
$this->addElement('text', 'login', array(
|
||||
'filters' => array('StringTrim'),
|
||||
'label' => 'Identifiant : ',
|
||||
'required' => 'true',
|
||||
)
|
||||
);
|
||||
$this->addElement('password', 'pass',
|
||||
array(
|
||||
'label' => 'Mot de passe : ',
|
||||
'required' => 'true',
|
||||
)
|
||||
);
|
||||
$this->addElement('submit', 'submit',
|
||||
array(
|
||||
'label' => 'Identification',
|
||||
'ignore' => true,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
@ -1,399 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Infogreffe provider
|
||||
*/
|
||||
class Metier_Infogreffe
|
||||
{
|
||||
|
||||
/**
|
||||
* Activate debug mode
|
||||
* @var boolean
|
||||
*/
|
||||
public $debug = false;
|
||||
|
||||
/**
|
||||
* Config definition
|
||||
* @var Zend_Config
|
||||
*/
|
||||
public $config;
|
||||
|
||||
/**
|
||||
* Reference client - customer reference
|
||||
* G[Number]
|
||||
* @var string
|
||||
*/
|
||||
public $reference_client;
|
||||
|
||||
/**
|
||||
* Type de document
|
||||
* @var string
|
||||
*/
|
||||
public $type_document;
|
||||
|
||||
/**
|
||||
* Mode de diffusion
|
||||
* XL : XML
|
||||
* M : Mail
|
||||
* C : Courrier
|
||||
* T : Téléchargement
|
||||
* @var string
|
||||
*/
|
||||
public $mode_diffusion;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $greffe;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $dossier_millesime;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $dossier_statut;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $dossier_chrono;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var unknown
|
||||
*/
|
||||
public $date_depot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $num_depot;
|
||||
|
||||
/**
|
||||
* BI : Date de cloture
|
||||
* @var string
|
||||
*/
|
||||
public $date_cloture;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var unknown
|
||||
*/
|
||||
public $date_acte;
|
||||
|
||||
/**
|
||||
* AC : Numéro de l'acte
|
||||
* @var string
|
||||
*/
|
||||
public $num;
|
||||
|
||||
/**
|
||||
* SIREN
|
||||
* @var string
|
||||
*/
|
||||
public $siren;
|
||||
|
||||
/**
|
||||
* Request XML
|
||||
* @var string
|
||||
*/
|
||||
protected $xml = '';
|
||||
|
||||
|
||||
/**
|
||||
* Initialize configuration
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//Load configuration
|
||||
$c = Zend_Registry::get('config');
|
||||
$this->config = $c->profil->infogreffe;
|
||||
if ( null === $this->config ) {
|
||||
throw new Exception('Unable to load configuration file.');
|
||||
}
|
||||
}
|
||||
|
||||
public function callRequest()
|
||||
{
|
||||
$fromCache = false;
|
||||
if ( $this->mode_diffusion == 'XL' && $this->fileIsCache($name) ){
|
||||
$fromCache = true;
|
||||
}
|
||||
|
||||
if ($fromCache) {
|
||||
$xml = $this->fileFromCache();
|
||||
} else {
|
||||
$xml = $this->getProduitsXML();
|
||||
$this->error($xml);
|
||||
}
|
||||
|
||||
if ( $this->mode_diffusion == 'XL' ){
|
||||
$this->fileTocache($xml);
|
||||
}
|
||||
|
||||
$this->error($xml);
|
||||
|
||||
return $xml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save data in cache
|
||||
* @param string $xml
|
||||
*/
|
||||
protected function fileTocache($xml)
|
||||
{
|
||||
$filename = $this->type_document . '-' . $this->siren . '.xml';
|
||||
$file = $this->config->cache->path . DIRECTORY_SEPARATOR . $filename;
|
||||
file_put_contents($file, $xml);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $xml
|
||||
* @return string
|
||||
*/
|
||||
protected function fileFromCache()
|
||||
{
|
||||
$filename = $this->type_document . '-' . $this->siren . '.xml';
|
||||
$file = $file = $this->config->cache->path . DIRECTORY_SEPARATOR . $filename;
|
||||
return file_get_contents($file);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $xml
|
||||
* @return boolean
|
||||
*/
|
||||
protected function fileIsCache($xml)
|
||||
{
|
||||
$filename = $this->type_document . '-' . $this->siren . '.xml';
|
||||
$file = $file = $this->config->cache->path . DIRECTORY_SEPARATOR . $filename;
|
||||
if ( !file_exists($file) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$dateFile = filemtime($file);
|
||||
$now = mktime(date('G'), date('i'), date('s'), date('m') , date('d'), date('Y'));
|
||||
$maxTime = mktime(
|
||||
date('G',$dateFile)+$this->cacheFiletime,
|
||||
date('i',$dateFile),
|
||||
date('s',$dateFile),
|
||||
date("m",$dateFile),
|
||||
date("d",$dateFile),
|
||||
date("Y",$dateFile)
|
||||
);
|
||||
|
||||
if ( $now>$maxTime ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect error
|
||||
* @param string $xml
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function error($xml)
|
||||
{
|
||||
if (!empty($xml))
|
||||
{
|
||||
$doc = new DOMDocument();
|
||||
$load = $doc->loadXML($xml, LIBXML_NOERROR | LIBXML_NOWARNING);
|
||||
if (!$load) {
|
||||
$tmp = explode('-', $xml);
|
||||
$errNum = intval($tmp[0]);
|
||||
$errMsg = $tmp[1];
|
||||
if( $errNum == '5' ){
|
||||
$errMsg = 'Service partenaire indisponible.';
|
||||
}
|
||||
throw new Exception($errNum . '-' . $errMsg);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception('Fichier vide');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Download file from URL
|
||||
* @param string $url
|
||||
* @param string $filename
|
||||
* @throws Exception
|
||||
* @return string
|
||||
*/
|
||||
protected function download($url, $filename)
|
||||
{
|
||||
$file = $file = $this->config->storage->path . DIRECTORY_SEPARATOR . $filename;
|
||||
$fp = fopen($file, 'w');
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_FILE, $fp);
|
||||
$data = curl_exec($ch);
|
||||
if( curl_errno($ch) ) {
|
||||
throw new Exception( curl_error($ch) );
|
||||
}
|
||||
curl_close($ch);
|
||||
fclose($fp);
|
||||
return $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pdf information
|
||||
* @param string $pdf
|
||||
* @return array
|
||||
* pages => number of pages
|
||||
* version => pdf version
|
||||
* size => pdf filesize
|
||||
*/
|
||||
public function pdfInfos($pdf)
|
||||
{
|
||||
if ( false !== ( $file = file_get_contents( $pdf ) ) ) {
|
||||
//Number of page
|
||||
$pages = preg_match_all( "/\/Page\W/", $file, $matches );
|
||||
|
||||
//Pdf Version
|
||||
preg_match("/^\%PDF\-(.*)\s/U", $file, $matches);
|
||||
$version = $matches[1];
|
||||
|
||||
//Pdf size
|
||||
$size = filesize($pdf);
|
||||
|
||||
return array(
|
||||
'pages' => $pages,
|
||||
'version' => $version,
|
||||
'size' => $size,
|
||||
);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Define XML for the request
|
||||
*/
|
||||
protected function setXML()
|
||||
{
|
||||
//Construct the request
|
||||
$xml = new SimpleXMLElement('<demande></demande>');
|
||||
$emetteur = $xml->addChild('emetteur');
|
||||
$emetteur->addChild('code_abonne', $this->config->user);
|
||||
$emetteur->addChild('mot_passe', $this->config->password);
|
||||
|
||||
//Set Command ID
|
||||
$emetteur->addChild('reference_client', $this->reference_client);
|
||||
$code_requete = $emetteur->addChild('code_requete');
|
||||
$code_requete->addChild('type_profil', 'A');
|
||||
$code_requete->addChild('origine_emetteur', 'IC');
|
||||
|
||||
// C = Commande de documents
|
||||
$code_requete->addChild('nature_requete', 'C');
|
||||
|
||||
$code_requete->addChild('type_document', $this->type_document);
|
||||
$code_requete->addChild('type_requete', 'S'); // S = Simple
|
||||
|
||||
// Mode de diffusion : C = Courrier, T = Téléchargement, M = Mail, XL = XML
|
||||
$mode_diffusion = $code_requete->addChild('mode_diffusion');
|
||||
if ( $this->mode_diffusion=='XL' )
|
||||
{
|
||||
//On ajoute tout les types de diffusions pour XL
|
||||
$mode_diffusion->addChild('mode')->addAttribute('type', 'C');
|
||||
$mode_diffusion->addChild('mode')->addAttribute('type', 'T');
|
||||
}
|
||||
$mode_diffusion->addChild('mode')->addAttribute('type', $this->mode_diffusion);
|
||||
|
||||
$code_requete->addChild('media', 'WS');
|
||||
|
||||
$commande = $xml->addChild('commande');
|
||||
$commande->addChild('num_siren', $this->siren);
|
||||
|
||||
if ( $this->mode_diffusion!='XL' )
|
||||
{
|
||||
// Commande de documents : bilan saisie ou bilan complet
|
||||
if ( ($this->type_document=='BS' || $this->type_document=='BI') )
|
||||
{
|
||||
$commande->addChild('greffe',$this->greffe);
|
||||
$commande->addChild('dossier_millesime',$this->dossier_millesime);
|
||||
$commande->addChild('dossier_statut',$this->dossier_statut);
|
||||
$commande->addChild('dossier_chrono',$this->dossier_chrono);
|
||||
$commande->addChild('num_depot',$this->num_depot);
|
||||
$commande->addChild('date_cloture', $this->date_cloture);
|
||||
}
|
||||
// Commande de documents : actes
|
||||
elseif ( $this->type_document=='AC' )
|
||||
{
|
||||
$commande->addChild('greffe',$this->greffe);
|
||||
$commande->addChild('dossier_millesime',$this->dossier_millesime);
|
||||
$commande->addChild('dossier_statut',$this->dossier_statut);
|
||||
$commande->addChild('dossier_chrono',$this->dossier_chrono);
|
||||
$commande->addChild('num_depot',$this->num_depot);
|
||||
$liste_actes = $commande->addChild('liste_actes');
|
||||
$liste_actes->addChild('acte')->addAttribute('num', $this->num);
|
||||
}
|
||||
}
|
||||
|
||||
$xml = str_replace('<?xml version="1.0"?>', '', $xml->asXML());
|
||||
|
||||
$this->xml = $xml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send XML Request
|
||||
* We have some problem to use SOAP so we use CURL
|
||||
* @throws Exception
|
||||
* @return string XML Response
|
||||
*/
|
||||
protected function getProduitsXML()
|
||||
{
|
||||
$this->setXML();
|
||||
|
||||
//Be sure it's in UTF-8
|
||||
$req = utf8_encode($this->xml);
|
||||
|
||||
if ($this->debug) {
|
||||
file_put_contents($this->type_document.'-'.$this->siren.'-'.$this->mode_diffusion.'.query');
|
||||
}
|
||||
|
||||
//Create XML request
|
||||
$post = '<?xml version="1.0" encoding="UTF-8"?>'.
|
||||
'<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" '.
|
||||
'xmlns:ns1="https://webservices.infogreffe.fr/" '.
|
||||
'xmlns:xsd="http://www.w3.org/2001/XMLSchema" '.
|
||||
'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '.
|
||||
'xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" '.
|
||||
'SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'.
|
||||
'<SOAP-ENV:Body>'.
|
||||
'<ns1:getProduitsWebServicesXML>'.
|
||||
'<param0 xsi:type="xsd:string">'.$req.'</param0>'.
|
||||
'</ns1:getProduitsWebServicesXML>'.
|
||||
'</SOAP-ENV:Body>'.
|
||||
'</SOAP-ENV:Envelope>';
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $this->config->url);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
curl_setopt($ch, CURLOPT_COOKIEFILE,TRUE);
|
||||
curl_setopt($ch, CURLOPT_POST, TRUE);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
|
||||
$response = curl_exec($ch);
|
||||
|
||||
if ( curl_errno($ch) ) {
|
||||
throw new Exception( curl_error($ch) );
|
||||
}
|
||||
|
||||
//Remove SOAP part of XML
|
||||
$response = str_replace("<?xml version='1.0' encoding='UTF-8'?><SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'><SOAP-ENV:Body><ns0:getProduitsWebServicesXMLResponse xmlns:ns0='urn:local' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'><return xsi:type='xsd:string'>", '', $response);
|
||||
$response = str_replace('</return></ns0:getProduitsWebServicesXMLResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>','', $response);
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
<?php
|
@ -1,54 +0,0 @@
|
||||
|
||||
INFOGREFFE
|
||||
----------
|
||||
|
||||
Document
|
||||
AC =>
|
||||
BI =>
|
||||
ST =>
|
||||
|
||||
File name pattern
|
||||
|
||||
AC => acte-[siren]-[type]-[YYYYMMdd]-[num].pdf
|
||||
siren = [0-9]{9}
|
||||
type =
|
||||
num = [0-9]{2}
|
||||
|
||||
Files are store in actes/YYYY/MM/filename.pdf
|
||||
|
||||
BI => bilan-[siren]-[type]-[YYYYMMdd].pdf
|
||||
siren = [0-9]{9}
|
||||
type = [consolide|sociaux]
|
||||
|
||||
Files are store in bilans/[type]/[YYYY];
|
||||
|
||||
ST => statut-
|
||||
|
||||
Files are store in status/
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
Add to the main configuration (application.ini), these keys :
|
||||
- infogreffe.cache.path => path for storing cache file
|
||||
- infogreffe.cache.time => define end of life for the cache in hours
|
||||
- infogreffe.storage.path =>
|
||||
|
||||
- infogreffe.wsdl = infogreffe.wsdl
|
||||
- infogreffe.url = https://webservices.infogreffe.fr/WSContextInfogreffe/INFOGREFFE
|
||||
- infogreffe.uri = https://webservices.infogreffe.fr/
|
||||
- infogreffe.user = 85000109
|
||||
- infogreffe.password = 166
|
||||
|
||||
|
||||
|
||||
- Rattraper l'historique des documents et les liés à jo.greffes_bilans et jo.greffes_actes
|
||||
Attention : Type de document 1 et 2
|
||||
Vérifier que nous possèdons le maximum d'infos sur l'association type 1 et 2
|
||||
Sinon passer une moulinette, pour chaque siren, récupérer la liste et analyse avec la table actes_files
|
||||
|
||||
jo.greffes_actes : Ajout d'une colonne type_acte2
|
||||
|
||||
Il est possible sans le type de trouver le fichier
|
||||
|
||||
SELECT siren, count(siren) as nb FROM `actes_files` WHERE `type_libelle` = '' GROUP BY siren ORDER BY nb DESC
|
@ -1,80 +0,0 @@
|
||||
|
||||
<definitions
|
||||
targetNamespace="java:com.experian.webserv.infogreffe"
|
||||
xmlns="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:tns="java:com.experian.webserv.infogreffe"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
>
|
||||
<types>
|
||||
<schema targetNamespace='java:com.experian.webserv.infogreffe'
|
||||
xmlns='http://www.w3.org/2001/XMLSchema'>
|
||||
</schema>
|
||||
</types>
|
||||
<message name="getProduitsWebServicesXMLRequest">
|
||||
<part name="arg0" type="xsd:string" />
|
||||
</message>
|
||||
<message name="getProduitsWebServicesXMLResponse">
|
||||
<part name="return" type="xsd:string" />
|
||||
</message>
|
||||
<message name="getProduitsWebServicesRequest">
|
||||
<part name="arg0" type="xsd:string" />
|
||||
<part name="arg1" type="xsd:string" />
|
||||
<part name="arg2" type="xsd:string" />
|
||||
<part name="arg3" type="xsd:string" />
|
||||
<part name="arg4" type="xsd:string" />
|
||||
<part name="arg5" type="xsd:string" />
|
||||
<part name="arg6" type="xsd:string" />
|
||||
<part name="arg7" type="xsd:string" />
|
||||
<part name="arg8" type="xsd:string" />
|
||||
<part name="arg9" type="xsd:string" />
|
||||
<part name="arg10" type="xsd:string" />
|
||||
</message>
|
||||
<message name="getProduitsWebServicesResponse">
|
||||
<part name="return" type="xsd:string" />
|
||||
</message>
|
||||
<message name="getVersionRequest">
|
||||
</message>
|
||||
<message name="getVersionResponse">
|
||||
<part name="return" type="xsd:string" />
|
||||
</message>
|
||||
<portType name="WebServicesProduitsPortType">
|
||||
<operation name="getProduitsWebServicesXML">
|
||||
<input message="tns:getProduitsWebServicesXMLRequest"/>
|
||||
<output message="tns:getProduitsWebServicesXMLResponse"/>
|
||||
</operation>
|
||||
<operation name="getProduitsWebServices">
|
||||
<input message="tns:getProduitsWebServicesRequest"/>
|
||||
<output message="tns:getProduitsWebServicesResponse"/>
|
||||
</operation>
|
||||
<operation name="getVersion">
|
||||
<input message="tns:getVersionRequest"/>
|
||||
<output message="tns:getVersionResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<binding name="WebServicesProduitsBinding" type="tns:WebServicesProduitsPortType">
|
||||
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="getProduitsWebServicesXML">
|
||||
<soap:operation soapAction="urn:getProduitsWebServicesXML"/>
|
||||
<input><soap:body use="encoded" namespace='urn:WebServicesProduits' encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
|
||||
<output><soap:body use="encoded" namespace='urn:WebServicesProduits' encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
|
||||
</operation>
|
||||
<operation name="getProduitsWebServices">
|
||||
<soap:operation soapAction="urn:getProduitsWebServices"/>
|
||||
<input><soap:body use="encoded" namespace='urn:WebServicesProduits' encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
|
||||
<output><soap:body use="encoded" namespace='urn:WebServicesProduits' encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
|
||||
</operation>
|
||||
<operation name="getVersion">
|
||||
<soap:operation soapAction="urn:getVersion"/>
|
||||
<input><soap:body use="encoded" namespace='urn:Version' encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
|
||||
<output><soap:body use="encoded" namespace='urn:Version' encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="WebServicesProduits">
|
||||
<documentation>Service Soap Experian, Service Produit</documentation>
|
||||
<port name="WebServicesProduitsPort" binding="tns:WebServicesProduitsBinding">
|
||||
<soap:address location="https://webservices.infogreffe.fr:443/WSContextInfogreffe/INFOGREFFE"/>
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
@ -1 +0,0 @@
|
||||
<?php
|
@ -1 +0,0 @@
|
||||
<?php
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user