#!/usr/bin/php "Displays usage information.", 'all' => "Créer les WSDL à l'installation.", 'version=s' => "Re-Créer le WSDL associé à la version X.X.X", 'host=s' => "Le nom de domaine à requéter pour générer les WSDL correctement (sans http://)." ) ); $opts->parse(); } catch (Zend_Console_Getopt_Exception $e) { echo $e->getUsageMessage(); exit; } //Usage if(isset($opts->help)) { echo $opts->getUsageMessage(); exit; } //Génération des WSDL if (isset($opts->all) && isset($opts->host)) { $configServiceVersions = new Zend_Config_Ini('WsScore/Entreprise/Versions.ini'); foreach( $configServiceVersions->toArray() as $section => $params ){ $version = $section; echo "Version $version"; if ($params['actif']==1){ echo " Traitement...\n"; echo genereWSDL($opts->host, $version); } echo "\n"; } } if (isset($opts->version) && isset($opts->host)){ echo genereWSDL($opts->host, $opts->version); echo "\n"; } function genereWSDL($host, $version){ $uri = 'http://'.$host.'/entreprise/v'.$version.'?wsdl-generate'; $client = new Zend_Http_Client($uri, array( 'adapter' => 'Zend_Http_Client_Adapter_Curl', )); $response = $client->request('GET'); return $response->getBody(); }