本文整理匯總了PHP中ET::checkForUpdates方法的典型用法代碼示例。如果您正苦於以下問題:PHP ET::checkForUpdates方法的具體用法?PHP ET::checkForUpdates怎麽用?PHP ET::checkForUpdates使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ET
的用法示例。
在下文中一共展示了ET::checkForUpdates方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: checkForUpdates
/**
* Check for updates to the esoTalk software. If there's a new version, and this is the first time we've heard
* of it, create a notifcation for the current user.
*
* @return void
*/
public function checkForUpdates()
{
// Save the last update check time so we won't do it again for a while.
ET::writeConfig(array("esoTalk.admin.lastUpdateCheckTime" => time()));
// If the latest version is different to what it was last time we checked...
$info = C("esoTalk.admin.lastUpdateCheckInfo", array("version" => ESOTALK_VERSION));
if ($package = ET::checkForUpdates() and $package["version"] != $info["version"]) {
// Create a notification.
ET::activityModel()->create("updateAvailable", ET::$session->userId, null, $package);
// Write the latest checked version to the config file.
ET::writeConfig(array("esoTalk.admin.lastUpdateCheckInfo" => $package));
}
}