Modification pour intégration nouvelle méthode graydon

This commit is contained in:
Michael RICOIS 2009-10-27 11:19:10 +00:00
parent cfb39f2303
commit 5797885404

View File

@ -1,12 +1,15 @@
#!/usr/bin/php -q
<?php
$version = '0.2';
$version = '0.3';
$argc = $_SERVER['argc'];
$argv = $_SERVER['argv'];
if($argc > 1){
foreach($argv as $value){
switch($value){
if($argc > 1)
{
foreach($argv as $value)
{
switch($value)
{
case 'availability':
$availability = FALSE;
break;
@ -44,7 +47,7 @@ require_once '../config/prepend.php';
//Inclure la base de données
require_once 'dbbootstrap.php';
//Inclure la config graydon
require_once 'graydon/graydonws.php';
require_once 'graydon/graydon.php';
setDbConn('graydon');
@ -59,20 +62,15 @@ if($availability == TRUE)
//Enregistrement de l'action dans les logs
$transactionIdentifier = $result->Service_Log->TransactionIdentifier;
$sessionID = $result->Service_Log->SessionID;
foreach($result->CountryAvailablity->CountryAndProduct as $item){
foreach($result->CountryAvailablity->CountryAndProduct as $item)
{
$availability = array();
$count = count($item->Products->Product);
if ($count>1){
$availability = $item->Products->Product;
}elseif($count==1){
$availability[] = $item->Products->Product;
}
$availability = $item->Products->Product;
//Enregistrement pour chaque pays de la disponibilité des services
$countryavailability = new Countryavailability();
$countryavailability->country = $item->Country;
$countryavailability->availability = serialize($availability);
$countryavailability->replace();
}
}catch( SoapFault $fault ){}
}