|
| __construct (string $url, string $subject, string $version, string $cache_dir) |
|
| check (string $version, bool $nocache=false) |
|
| getVersionInfo (bool $nocache=false) |
|
| getVersion () |
|
| getFileURL () |
|
| getInfoURL () |
|
| getChecksum () |
|
| getPHPVersion () |
|
| getWarning () |
|
| getNotify () |
|
| getForcedFiles () |
|
| setForcedFiles (... $args) |
|
| setNotify ($n) |
|
| checkIntegrity (string $digests_file, string $root) |
|
| getBadFiles () |
|
| download (string $dest) |
|
| checkDownload (string $zip) |
|
| backup (string $zip_file, string $zip_digests, string $root, string $root_digests, string $dest) |
|
| performUpgrade (string $zip_file, string $zip_digests, string $zip_root, string $root, string $root_digests) |
|
|
static | md5_check (string $filename, string $md5) |
|
◆ __construct()
__construct |
( |
string |
$url, |
|
|
string |
$subject, |
|
|
string |
$version, |
|
|
string |
$cache_dir |
|
) |
| |
Constructor
- Parameters
-
string | $url | Versions file URL |
string | $subject | Subject to check |
string | $version | Version channel |
string | $cache_dir | Directory cache path |
References $subject, $url, and $version.
◆ check()
check |
( |
string |
$version, |
|
|
bool |
$nocache = false |
|
) |
| |
Checks for Dotclear updates. Returns latest version if available or false.
- Parameters
-
string | $version | Current version to compare |
bool | $nocache | Force checking |
- Returns
- mixed Latest version if available
References $version, getVersion(), and getVersionInfo().
◆ getVersionInfo()
getVersionInfo |
( |
bool |
$nocache = false | ) |
|
◆ getVersion()
Gets the version.
- Returns
- string|null The version.
Referenced by check().
◆ getFileURL()
Gets the file url.
- Returns
- string|null The file url.
Referenced by download().
◆ getInfoURL()
Gets the information url.
- Returns
- string|null The information url.
◆ getChecksum()
Gets the checksum.
- Returns
- string|null The checksum.
Referenced by checkDownload().
◆ getPHPVersion()
Gets the php version.
- Returns
- string|null The php version.
◆ getWarning()
Gets the warning flag.
- Returns
- bool The warning.
◆ getNotify()
Gets the notify flag.
- Returns
- bool The notify.
◆ getForcedFiles()
Gets the forced files.
- Returns
- array The forced files.
References $forced_files.
◆ setForcedFiles()
Sets the forced files.
- Parameters
-
mixed | ...$args The arguments |
◆ setNotify()
Sets the notify flag.
- Parameters
-
◆ checkIntegrity()
checkIntegrity |
( |
string |
$digests_file, |
|
|
string |
$root |
|
) |
| |
Check integrity
- Parameters
-
string | $digests_file | The digests file |
string | $root | The root |
- Exceptions
-
Exception | If some files have changed |
- Returns
- bool
References md5sum().
◆ getBadFiles()
Gets the bad files.
- Returns
- array The bad files.
References $bad_files.
◆ download()
◆ checkDownload()
checkDownload |
( |
string |
$zip | ) |
|
Check downloaded file
- Parameters
-
- Returns
- bool
References getChecksum().
◆ backup()
backup |
( |
string |
$zip_file, |
|
|
string |
$zip_digests, |
|
|
string |
$root, |
|
|
string |
$root_digests, |
|
|
string |
$dest |
|
) |
| |
Backups changed files before an update.
- Parameters
-
string | $zip_file | The zip file |
string | $zip_digests | The zip digests |
string | $root | The root |
string | $root_digests | The root digests |
string | $dest | The destination |
- Exceptions
-
- Returns
- bool
References getNewFiles().
◆ performUpgrade()
performUpgrade |
( |
string |
$zip_file, |
|
|
string |
$zip_digests, |
|
|
string |
$zip_root, |
|
|
string |
$root, |
|
|
string |
$root_digests |
|
) |
| |
Performs an upgrade.
- Parameters
-
string | $zip_file | The zip file |
string | $zip_digests | The zip digests |
string | $zip_root | The zip root |
string | $root | The root |
string | $root_digests | The root digests |
- Exceptions
-
References getNewFiles().
◆ getNewFiles()
getNewFiles |
( |
array |
$cur_digests, |
|
|
array |
$new_digests |
|
) |
| |
|
protected |
Gets the new files.
- Parameters
-
array | $cur_digests | The current digests |
array | $new_digests | The new digests |
- Returns
- array The new files.
Referenced by backup(), and performUpgrade().
◆ readVersion()
readVersion |
( |
string |
$str | ) |
|
|
protected |
Reads a version information from string.
- Parameters
-
Referenced by getVersionInfo().
◆ md5sum()
md5sum |
( |
string |
$root, |
|
|
string |
$digests_file |
|
) |
| |
|
protected |
Return list of changed files
- Parameters
-
string | $root | The root |
string | $digests_file | The digests file |
- Exceptions
-
- Returns
- array
Referenced by checkIntegrity().
◆ parseLine()
parseLine |
( |
& |
$v, |
|
|
|
$k, |
|
|
|
$n |
|
) |
| |
|
protected |
Parse digests file line
- Parameters
-
mixed | $v | The value |
mixed | $k | The key/index |
mixed | $n | array_walk() 3rd arg |
◆ md5_check()
static md5_check |
( |
string |
$filename, |
|
|
string |
$md5 |
|
) |
| |
|
staticprotected |
Check the MD5 of a file
- Parameters
-
string | $filename | The filename |
string | $md5 | The MD5 checksum |
- Returns
- bool
◆ ERR_FILES_CHANGED
const ERR_FILES_CHANGED = 101 |
◆ ERR_FILES_UNREADABLE
const ERR_FILES_UNREADABLE = 102 |
◆ ERR_FILES_UNWRITALBE
const ERR_FILES_UNWRITALBE = 103 |
◆ $url
◆ $subject
◆ $version
◆ $cache_file
◆ $version_info
Initial value:= [
'version' => null,
'href' => null,
'checksum' => null,
'info' => null,
'php' => '7.4',
'warning' => false,
'notify' => true,
]
◆ $cache_ttl
◆ $forced_files
◆ $bad_files
The documentation for this class was generated from the following file: