public static function installPluginsThemesResponseProcessor($historyID, $responseData)
 {
     $errorDetail = array();
     $errorDetail['download_failed'] = 'Download failed: ';
     $errorDetail['folder_exists'] = 'Folder exists: ';
     $errorDetail['mkdir_failed'] = 'Create directory failed: ';
     $errorDetail['incompatible_archive'] = 'Incompatible archive: ';
     $errorDetail['copy_failed'] = 'Copy failed: ';
     responseDirectErrorHandler($historyID, $responseData);
     if (empty($responseData['success'])) {
         return false;
     }
     $successUniqueName = array();
     $siteID = DB::getField("?:history", "siteID", "historyID='" . $historyID . "'");
     if (!empty($responseData['success']['error'])) {
         DB::update("?:history_additional_data", array('status' => 'error', 'errorMsg' => $responseData['success']['error'], 'error' => $responseData['success']['error_code']), "historyID='" . $historyID . "'");
         return false;
     }
     $pluginsThemes = $responseData['success'];
     $successUniqueName = array();
     foreach ($pluginsThemes as $name => $nameResponse) {
         if (gettype($nameResponse) == 'object' && !is_object($nameResponse)) {
             $nameResponse = fixObject($nameResponse);
         }
         if (gettype($nameResponse) == 'object' || gettype($nameResponse) == 'array') {
             if (gettype($nameResponse) == 'object') {
                 $nameResponse = get_object_vars($nameResponse);
             }
             if (isset($nameResponse['errors']) && !empty($nameResponse['errors'])) {
                 $errors = $nameResponse['errors'];
                 $errorData = $nameResponse['error_data'];
                 $errorCode = $nameResponse['error_codes'][0];
                 DB::update("?:history_additional_data", array('status' => 'error', 'error' => $errorCode, 'errorMsg' => $errorDetail[$errorCode] . $errorData), "historyID='" . $historyID . "' AND uniqueName = '" . $name . "'");
                 // DB::update("?:history_additional_data", array('status' => 'error', 'error' => key($errorData), 'errorMsg' => $errorDetail[key($errorData)].reset($errorData) ), "historyID='".$historyID."' AND uniqueName = '".$name."'");
             } else {
                 $successUniqueName[] = $name;
             }
         } elseif (!empty($pluginsThemes[$name]['source'])) {
             $successUniqueName[] = $name;
         }
     }
     if (!empty($successUniqueName)) {
         DB::update("?:history_additional_data", array('status' => 'success'), "historyID='" . $historyID . "' AND uniqueName IN ('" . implode("', '", $successUniqueName) . "')");
     }
     $allParams = array('action' => 'getStats', 'args' => array('siteIDs' => array($siteID), 'extras' => array('sendAfterAllLoad' => false, 'doNotShowUser' => true)));
     panelRequestManager::handler($allParams);
 }
Exemple #2
0
//echo '<pre>';
//print_r( get_include_path() );
//print_r( getcwd() );
drupal_session_start();
//echo "Da";
//print_r($_SESSION); exit;
include_once $econtrol_path . '/' . 'soap/classDef.php';
include_once $econtrol_path . '/' . 'soap/login.php';
include $econtrol_path . '/' . 'soap/GetTariffDetailsService.php';
// go back
chdir($dir_before);
//session_start();
//echo "Da";
//print_r($_SESSION); exit;
$result = $_SESSION['current-tariff'];
$result = fixObject($result);
//print_r($result);
/*
$result = preg_replace('!\s*\w+\:\:__set_state\(!', '', $result);
$result = preg_replace('!\)\),\s*(\n|$)!', '),', $result);
$result = preg_replace('!\)\)\s*(\n|$)!', ')', $result);
$result = eval('return '  . $result . ';');
*/
$supplier = $result->supplier;
$kwh = $_SESSION['current-tariff-kwh'];
$postcode = $_SESSION['current-tariff-postcode'];
$productname = $_SESSION['current-tariff-name'];
$productbindingperiod = $_SESSION['current-tariff-binding'];
$productcancellationperiod = $_SESSION['current-tariff-cancellation'];
$energytype = $_SESSION['current-tariff-et'];
$product = $result->product;