function upgrade_app_by_app_id($app_id, $app_name) { // Invoke Web Services $webServiceAddress = getWebServiceAddress(); //ini_set("soap.wsdl_cache_enabled", "0"); $client = new SoapClient($webServiceAddress, array('encoding' => 'UTF-8')); try { $vin = getVIN(); $param = array('arg0' => $vin, 'arg1' => $app_id); $ret = $client->upgrade($param); //print_r($ret); } catch (SoapFault $exception) { print $exception; } // Synchronize DB //$user = wp_get_current_user(); //$field_name = "INSTALLED_APPS"; //$apps = get_cimyFieldValue(getVIN(), $field_name); /*$apps = getInstalledApps(getVIN()); if (strpos($apps, ',') !== false) { $apps_array = explode(',', $apps); } else { $apps_array = array($apps); } foreach($apps_array as $key => $value) { if ($value == $app_id) { unset($apps_array[$key]); break; } } $new_app_id = get_newest_app_id($app_name); $apps_array[] = $new_app_id; $size = count($apps_array); if( $size == 1) { $result = $new_app_id; } else { $result = implode(',', $apps_array); } removeInstalledApp($result); */ }