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