YaWK
24.1
Yet another WebKit
|
The update class - handles yawk's system update functions. More...
Public Member Functions | |
__construct () | |
update constructor. Check if allow_url_fopen is enabled More... | |
fetchFiles (object $db, string $currentVersion, string $updateVersion, array $lang) | |
read system/update/updateFiles.ini and fetch files from remote (GitHub) server More... | |
generateLocalFilebase (object $db, array $lang) | |
Read all files of current YaWK installation and write each file with path + MD5 hash to ini file to compare it later with the possible update files. This is used to verify the integrity of the files. More... | |
getUpdateSettings () | |
get update settings from local update folder (system/update/update.ini) and return array|false More... | |
isServerReachable (string $url) | |
check if update server is reachable More... | |
readUpdateFilebaseFromServer () | |
read filebase.ini from update server (https://update.yawk.io/filebase.ini) and return array|false More... | |
readUpdateIniFromServer () | |
read update.ini from update server (https://update.yawk.io/update.ini) and return array|false More... | |
recordMigration ($db, $successfulMigrations) | |
record migration in database More... | |
runMigrations (object $db, array $lang) | |
Run the migration SQL files. More... | |
Public Attributes | |
string | $base_dir = '' |
string | $currentVersion = '' |
string | $githubServer = 'https://raw.githubusercontent.com/YaWK/yawk.io/master/' |
string | $localUpdateSystemPath = 'system/update/' |
bool | $migrationSuccessful = false |
string | $updateFile = 'update.ini' |
string | $updateFilebase = 'filebase.ini' |
array | $updateFiles = array() |
string | $updateFilesFile = 'updateFiles.ini' |
string | $updateServer = 'https://update.yawk.io/' |
array | $updateSettings = array() |
string | $updateVersion = '' |
The update class - handles yawk's system update functions.
YaWK System Updater Class
The YaWK System Updater Class provides methods to facilitate the updating process of the system. It includes features such as checking for new versions, verifying and comparing files to ensure a stable and reliable update. This class aims to simplify the update process and minimize the risk of any errors or issues during the update.
Definition at line 20 of file update.php.
YAWK\update::__construct | ( | ) |
update constructor. Check if allow_url_fopen is enabled
will be called by xhr request from admin/js/update-generateLocalFilebase.php
Definition at line 78 of file update.php.
References YAWK\update\isServerReachable().
bool $migrationSuccessful true false indicates if migration was successful call YAWK\update::fetchFiles | ( | object | $db, |
string | $currentVersion, | ||
string | $updateVersion, | ||
array | $lang | ||
) |
read system/update/updateFiles.ini and fetch files from remote (GitHub) server
will be called by xhr request from admin/js/update-fetchFiles.php
$db | object database connection |
$updateVersion | string update version |
$lang | array language array |
Definition at line 365 of file update.php.
References YAWK\update\$currentVersion, $db, YAWK\update\$githubServer, $lang, $response, YAWK\update\$updateVersion, $value, YAWK\settings\getSetting(), and YAWK\settings\setSetting().
YAWK\update::generateLocalFilebase | ( | object | $db, |
array | $lang | ||
) |
Read all files of current YaWK installation and write each file with path + MD5 hash to ini file to compare it later with the possible update files. This is used to verify the integrity of the files.
$db | object global db object |
$lang | array global language array |
Definition at line 546 of file update.php.
References YAWK\update\$base_dir, $lang, and die.
YAWK\update::getUpdateSettings | ( | ) |
get update settings from local update folder (system/update/update.ini) and return array|false
will be called by xhr request from admin/js/update-generateLocalFilebase.php
Definition at line 131 of file update.php.
References YAWK\update\$updateSettings.
YAWK\update::isServerReachable | ( | string | $url | ) |
check if update server is reachable
returns true if server is reachable, false if not
$url | string url to check |
Definition at line 103 of file update.php.
References $response, and $url.
Referenced by YAWK\update\__construct().
YAWK\update::readUpdateFilebaseFromServer | ( | ) |
read filebase.ini from update server (https://update.yawk.io/filebase.ini) and return array|false
will be called by xhr request from admin/js/update-readUpdateFilebase.php The filebase.ini contains a list of all files with their md5 hash. This function returns the filebase as array. (to compare it later with the local filebase)
Definition at line 702 of file update.php.
References YAWK\update\$updateFilebase, $url, and $value.
YAWK\update::readUpdateIniFromServer | ( | ) |
read update.ini from update server (https://update.yawk.io/update.ini) and return array|false
Definition at line 513 of file update.php.
YAWK\update::recordMigration | ( | $db, | |
$successfulMigrations | |||
) |
record migration in database
will be called from runMigrations() if migration was successful
$db | |
$successfulMigrations |
Definition at line 159 of file update.php.
References $db.
Referenced by YAWK\update\runMigrations().
YAWK\update::runMigrations | ( | object | $db, |
array | $lang | ||
) |
Run the migration SQL files.
If update.ini contains migration files between the current version and the update version, this function will be called
$db | object the database object |
$lang | array the language array |
$db | db |
Definition at line 194 of file update.php.
References $db, $i, $lang, and YAWK\update\recordMigration().
string YAWK\update::$base_dir = '' |
Definition at line 23 of file update.php.
Referenced by YAWK\update\generateLocalFilebase().
string YAWK\update::$currentVersion = '' |
Definition at line 37 of file update.php.
Referenced by YAWK\update\fetchFiles().
string YAWK\update::$githubServer = 'https://raw.githubusercontent.com/YaWK/yawk.io/master/' |
Definition at line 29 of file update.php.
Referenced by YAWK\update\fetchFiles().
string YAWK\update::$localUpdateSystemPath = 'system/update/' |
Definition at line 47 of file update.php.
bool YAWK\update::$migrationSuccessful = false |
Definition at line 72 of file update.php.
string YAWK\update::$updateFile = 'update.ini' |
Definition at line 32 of file update.php.
string YAWK\update::$updateFilebase = 'filebase.ini' |
Definition at line 52 of file update.php.
Referenced by YAWK\update\readUpdateFilebaseFromServer().
array YAWK\update::$updateFiles = array() |
Definition at line 67 of file update.php.
string YAWK\update::$updateFilesFile = 'updateFiles.ini' |
Definition at line 62 of file update.php.
string YAWK\update::$updateServer = 'https://update.yawk.io/' |
Definition at line 26 of file update.php.
array YAWK\update::$updateSettings = array() |
Definition at line 57 of file update.php.
Referenced by YAWK\update\getUpdateSettings().
string YAWK\update::$updateVersion = '' |
Definition at line 42 of file update.php.
Referenced by YAWK\update\fetchFiles().