Exemplo n.º 1
0
 protected function RetrieveFromService($strArgument, $strErrorMessage)
 {
     if (!ini_get('allow_url_fopen')) {
         QUpdateUtility::Error('allow_url_fopen is disabled in your php.ini, please enable it');
     }
     set_error_handler('QUpdateUtilityErrorHandler', E_ALL);
     $strToReturn = file_get_contents(QUpdateUtility::ServiceUrl . $strArgument);
     restore_error_handler();
     // Check for errors from within the response
     if (strpos($strToReturn, 'PHP Exception') !== false) {
         QUpdateUtility::Error($strErrorMessage);
     }
     return $strToReturn;
 }
Exemplo n.º 2
0
                    break;
                case QUpdateUtility::Force:
                    $strInteractionType = QUpdateUtility::Force;
                    break;
                case QUpdateUtility::ReportOnly:
                    $strInteractionType = QUpdateUtility::ReportOnly;
                    break;
                default:
                    QUpdateUtility::Error('Invalid Interaction Mode: ' . $strArgument);
                    break;
            }
            if ($intIndex == $_SERVER['argc'] - 1) {
                QUpdateUtility::Error('No Qcodo Version was specified');
            }
        } else {
            if ($strArgument == '--help') {
                QUpdateUtility::PrintUpdaterInstructions(true);
            } else {
                if ($intIndex != $_SERVER['argc'] - 1 || substr($strArgument, 0, 1) == '-') {
                    QUpdateUtility::Error('Invalid Option/Argument: ' . $strArgument);
                }
            }
        }
    }
}
if ($strInteractionType != QUpdateUtility::ReportOnly) {
    printf("Qcodo Update Utility - Performing '%s' Update...\r\n", $strInteractionType);
}
$strVersion = $_SERVER['argv'][$_SERVER['argc'] - 1];
$objUpdateUtility = new QUpdateUtility($strVersion);
$objUpdateUtility->RunUpdater($strInteractionType, $blnQuietMode);
Exemplo n.º 3
0
 protected function RetrieveFromService($strArgument, $strErrorMessage)
 {
     set_error_handler('QUpdateUtilityErrorHandler', E_ALL);
     $strToReturn = file_get_contents(QUpdateUtility::ServiceUrl . $strArgument);
     restore_error_handler();
     // Check for errors from within the response
     if (strpos($strToReturn, 'PHP Exception') !== false) {
         QUpdateUtility::Error($strErrorMessage);
     }
     return $strToReturn;
 }
Exemplo n.º 4
0
<?php

/* This includes library file is used by the qcodo_downloader.cli and qcodo_downloader.phpexe scripts
 * to perform the Qcodo Update Utility's File Downloading functionality.
 */
// Ensure that there are parameters
if ($_SERVER['argc'] != 6) {
    QUpdateUtility::PrintDownloaderInstructions();
}
$strVersion = trim(strtolower($_SERVER['argv'][2]));
if ($strVersion == 'stable' || $strVersion == 'development') {
    QUpdateUtility::Error('Invalid Version format: ' . $strVersion);
}
$objUpdateUtility = new QUpdateUtility($strVersion);
$objUpdateUtility->RunDownloader($_SERVER['argv'][3], $_SERVER['argv'][4], $_SERVER['argv'][5]);
Exemplo n.º 5
0
function QUpdateUtilityErrorHandler($intErrorNumber, $strErrorString, $strErrorFile, $intErrorLine)
{
    QUpdateUtility::Error('Could not connect to Qcodo Update webservice at ' . QUpdateUtility::ServiceUrl . ' (' . $strErrorString . ')');
}