本文整理汇总了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));
}
}