forked from ZwiiCMS-Team/ZwiiCMS
13.1.08 miseà jour automatisée
This commit is contained in:
parent
10083e7ee8
commit
e811660d7c
@ -6,6 +6,7 @@
|
||||
### Amélioration
|
||||
|
||||
- Sauvegarde de l'état des sélecteurs dans les tables des fontes et des utilisateurs.
|
||||
- Fournit un outil de mise à jour automatisé.
|
||||
|
||||
## Version 13.1.07
|
||||
|
||||
|
26
core/module/config/tool/autobackup.php
Normal file
26
core/module/config/tool/autobackup.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
// Creation du ZIP
|
||||
$filter = $filter = ['backup', 'tmp'];
|
||||
$fileName = date('Y-m-d-H-i-s', time()) . '-rolling-backup.zip';
|
||||
$zip = new ZipArchive();
|
||||
$zip->open('../../../../site/backup/' . $fileName, ZipArchive::CREATE | ZipArchive::OVERWRITE);
|
||||
$directory = '../../../../site';
|
||||
$files = new RecursiveIteratorIterator(
|
||||
new RecursiveCallbackFilterIterator(
|
||||
new RecursiveDirectoryIterator(
|
||||
$directory,
|
||||
RecursiveDirectoryIterator::SKIP_DOTS
|
||||
),
|
||||
function ($fileInfo, $key, $iterator) use ($filter) {
|
||||
return $fileInfo->isFile() || !in_array($fileInfo->getBaseName(), $filter);
|
||||
}
|
||||
)
|
||||
);
|
||||
foreach ($files as $name => $file) {
|
||||
if (!$file->isDir()) {
|
||||
$filePath = $file->getRealPath();
|
||||
$relativePath = substr($filePath, strlen(realpath($directory)) + 1);
|
||||
$zip->addFile($filePath, $relativePath);
|
||||
}
|
||||
}
|
||||
$zip->close();
|
Loading…
Reference in New Issue
Block a user