本文整理匯總了PHP中Updater::GetUpdateData方法的典型用法代碼示例。如果您正苦於以下問題:PHP Updater::GetUpdateData方法的具體用法?PHP Updater::GetUpdateData怎麽用?PHP Updater::GetUpdateData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Updater
的用法示例。
在下文中一共展示了Updater::GetUpdateData方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: PushUpdates
public static function PushUpdates()
{
$Updates = Updater::GenerateUpdateList();
$UpdateData = Updater::GetUpdateData();
if (empty($Updates)) {
Updater::UpdateDatabaseVersion($UpdateData['updating_to']['sha'], $UpdateData['updating_to']['date']);
} else {
$Iteration = 0;
$Length = count($Updates);
foreach ($Updates as $Update) {
if ($Iteration == $Length - 1) {
Updater::ApplyUpdate($Update['FileLink'], true, $UpdateData['updating_to']['sha'], $UpdateData['updating_to']['date']);
} else {
Updater::ApplyUpdate($Update['FileLink'], false, $UpdateData['updating_to']['sha'], $UpdateData['updating_to']['date']);
}
$Iteration++;
}
}
}
示例2: getcwd
<?php
require_once 'header.php';
$UpdateData = Updater::GetUpdateData();
$UpdatesList = Manager::GetUrlData("https://project.freedomcore.ru/freedomcore.php?action=post_install&version=" . $UpdateData['updating_to']['id']);
$UpdatesList = json_decode($UpdatesList, true);
$DownloadDirectory = getcwd() . DS . 'Update' . DS . 'data' . DS;
$Count = count($UpdatesList['updates']);
$Iterations = 0;
foreach ($UpdatesList['updates'] as $Update) {
$LoadedData = Manager::GetUrlData($Update['download']);
$FileHandler = fopen($DownloadDirectory . str_replace('.freedomcore', '.php', $Update['filename']), 'w');
fwrite($FileHandler, $LoadedData);
fclose($FileHandler);
if ($Iterations == $Count - 1) {
header('Location: /Update/complete');
}
}
示例3:
<?php
require_once 'header.php';
$Smarty->assign('UpdateData', Updater::GetUpdateData());
$Smarty->display('updater/welcome');