當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Updater::getUpdates方法代碼示例

本文整理匯總了PHP中Updater::getUpdates方法的典型用法代碼示例。如果您正苦於以下問題:PHP Updater::getUpdates方法的具體用法?PHP Updater::getUpdates怎麽用?PHP Updater::getUpdates使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Updater的用法示例。


在下文中一共展示了Updater::getUpdates方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: sConfig

    //sApp()
    $this->yeager_version = $versionp;
    //$this->yeager_revision = YEAGER_REVISION;
    //$this->yeager_date = YEAGER_DATE;
    $databaseInfo = sConfig()->getVars('CONFIG/DB');
    $databaseHost = $databaseInfo[0]['host'];
    $databaseHost = explode(':', $databaseHost);
    if (count($databaseHost) > 1) {
        $databasePort = $databaseHost[1];
        $databaseHost = $databaseHost[0];
    } else {
        $databasePort = '3306';
        $databaseHost = $databaseHost[0];
    }
    $_SESSION['APPINFO'] = array('VERSION' => $this->yeager_version, 'REVISION' => $this->yeager_revision, 'DATABASE_SERVER' => $databaseHost, 'DATABASE_PORT' => $databasePort, 'DATABASE_USER' => $databaseInfo[0]['user'], 'DATABASE_PASSWORD' => $databaseInfo[0]['password'], 'DATABASE_NAME' => $databaseInfo[0]['db'], 'PATH_BASE' => dirname($_SERVER['SCRIPT_FILENAME']) . '/');
    $updateMgr = new Updater();
    $updates = $updateMgr->getUpdates();
    $currVersion = $updateMgr->current_version_string;
    $currRevision = $this->yeager_revision;
    //$currDate = explode('-', substr(YEAGER_DATE, 6, 11));
    //$currDate = gmmktime(0, 0, 0, $currDate[1], $currDate[2], $currDate[0]);
    $currDate = '';
}
$winID = $this->request->parameters['win_no'];
$smarty->assign("adminAllowed", $adminAllowed);
$smarty->assign("win_no", $winID);
$smarty->assign("updates", $updates);
$smarty->assign("current_version", $currVersion);
$smarty->assign("current_revision", $currRevision);
$smarty->assign("current_date", $currDate);
$smarty->display('file:' . $this->page_template);
開發者ID:nrueckmann,項目名稱:yeager,代碼行數:31,代碼來源:updates.php

示例2: JSQueue

<?php

$jsQueue = new JSQueue(NULL);
switch ($action) {
    case 'checkUpdates':
        $winID = $this->params['winID'];
        $updateMgr = new Updater();
        $currentUpdates = $updateMgr->getUpdates();
        if (count($currentUpdates)) {
            $newVersionNo = $currentUpdates[0]['VERSION'];
            $newVersionDate = date($itext['DATE_FORMAT'], $currentUpdates[0]['DATE']);
            $newVersionText = $itext['TXT_NEW_UPDATE_AVAILABLE'];
            $koala->queueScript('Koala.yg_updaterNewVersion(\'' . $winID . '\', \'' . $newVersionNo . '\', \'' . $newVersionDate . '\', \'' . $newVersionText . '\');');
        }
        break;
    case 'updateInstalled':
        $updatePath = $this->approot . sConfig()->getVar('CONFIG/DIRECTORIES/UPDATES');
        $revision = $this->params['revision'];
        $matchingUpdates = glob($updatePath . 'yeager_*_r' . $revision . '.php');
        if (count($matchingUpdates) > 0) {
            foreach ($matchingUpdates as $matchingUpdate) {
                @unlink($matchingUpdate);
            }
        }
        break;
    case 'installUpdate':
        $installRevision = $this->params['installRevision'];
        $sigStart = "-----BEGIN YEAGER SIGNATURE-----\n";
        $sigEnd = "-----END YEAGER SIGNATURE-----";
        // Download, verify and trigger update installation
        $updatesDirectory = $this->approot . sConfig()->getVar('CONFIG/DIRECTORIES/UPDATES');
開發者ID:nrueckmann,項目名稱:yeager,代碼行數:31,代碼來源:updater.php


注:本文中的Updater::getUpdates方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。