82 if ( !empty( $sDir ) ) {
83 $this->_sBaseDirectory = $sDir;
104 if ( !empty( $sVersion ) ) {
105 $this->_sVersion = $sVersion;
126 if ( !empty( $sEdition ) ) {
127 $this->_sEdition = $sEdition;
148 if ( !empty( $sRevision ) ) {
149 $this->_sRevision = $sRevision;
170 if ( !empty( $sUrl ) ) {
171 $this->_sWebServiceUrl = $sUrl;
212 $this->_oCurlHandler =
oxNew(
"oxCurl" );
215 $this->_blError =
true;
216 $this->_sErrorMessage .=
"Error: requirements are not met.";
246 $this->_oCurlHandler->setUrl( $this->_sWebServiceUrl );
247 $this->_oCurlHandler->setMethod(
"GET");
248 $this->_oCurlHandler->setOption(
"CURLOPT_CONNECTTIMEOUT", 30);
249 $this->_oCurlHandler->setParameters( $aParams );
250 $sXML = $this->_oCurlHandler->execute();
252 if (empty( $sXML ) ) {
253 $this->_blError =
true;
254 $this->_sErrorMessage =
oxRegistry::getLang()->translateString(
'OXDIAG_ERRORMESSAGEWEBSERVICEISNOTREACHABLE' );
258 $oXML =
new SimpleXMLElement( $sXML );
260 $this->_blError =
true;
261 $this->_sErrorMessage .=
oxRegistry::getLang()->translateString(
'OXDIAG_ERRORMESSAGEWEBSERVICERETURNEDNOXML' );
264 if (!is_object( $oXML ) ) {
265 $this->_blError =
true;
266 $this->_sErrorMessage .=
oxRegistry::getLang()->translateString(
'OXDIAG_ERRORMESSAGEVERSIONDOESNOTEXIST' );
280 'job' =>
'existsversion',
286 $sURL = $this->_sWebServiceUrl .
"?" . http_build_query( $aParams );
288 if ( $sXML = @file_get_contents( $sURL ) ) {
289 $oXML =
new SimpleXMLElement( $sXML );
290 if ( is_object( $oXML ) ) {
291 if ( $oXML->exists == 1) {
297 $this->_blError =
true;
298 $sError = sprintf(
oxRegistry::getLang()->translateString(
'OXDIAG_ERRORMESSAGEVERSIONDOESNOTEXIST' ),
301 $this->_sErrorMessage .= $sError;
317 if ($this->_oCurlHandler == null) {
321 if ( !file_exists( $this->_sBaseDirectory . $sFile ) ) {
325 $sMD5 = md5_file ( $this->_sBaseDirectory . $sFile );
333 if (is_object( $oXML ) ) {
335 if ( $oXML->res ==
'OK' ) {
339 if (preg_match (
'/(SOURCE|SNAPSHOT)/', $oXML->pkg, $aMatch ) ) {
341 $sMessage =
'SOURCE|SNAPSHOT';
347 } elseif ( $oXML->res ==
'VERSIONMISMATCH' ) {
351 } elseif ( $oXML->res ==
'MODIFIED' ) {
355 } elseif ( $oXML->res ==
'OBSOLETE' ) {
359 } elseif ( $oXML->res ==
'UNKNOWN' ) {
367 "result" => strval( $oXML->res),
371 "message" => $sMessage
397 $this->_oCurlHandler->setUrl( $this->_sWebServiceUrl );
398 $this->_oCurlHandler->setMethod(
"GET");
399 $this->_oCurlHandler->setOption(
"CURLOPT_CONNECTTIMEOUT", 30);
400 $this->_oCurlHandler->setParameters( $aParams );
401 $sXML = $this->_oCurlHandler->execute();
404 $oXML =
new SimpleXMLElement( $sXML );