forked from ZwiiCMS-Team/ZwiiCMS
Récupérer backup auto dans file manager
This commit is contained in:
parent
0bcd1c527c
commit
ec91858263
@ -18,6 +18,7 @@ class config extends common {
|
|||||||
|
|
||||||
public static $actions = [
|
public static $actions = [
|
||||||
'backup' => self::GROUP_ADMIN,
|
'backup' => self::GROUP_ADMIN,
|
||||||
|
'copyBackups'=> self::GROUP_ADMIN,
|
||||||
'configMetaImage' => self::GROUP_ADMIN,
|
'configMetaImage' => self::GROUP_ADMIN,
|
||||||
'generateFiles' => self::GROUP_ADMIN,
|
'generateFiles' => self::GROUP_ADMIN,
|
||||||
'index' => self::GROUP_ADMIN,
|
'index' => self::GROUP_ADMIN,
|
||||||
@ -28,7 +29,8 @@ class config extends common {
|
|||||||
'logReset' => self::GROUP_ADMIN,
|
'logReset' => self::GROUP_ADMIN,
|
||||||
'logDownload'=> self::GROUP_ADMIN,
|
'logDownload'=> self::GROUP_ADMIN,
|
||||||
'blacklistReset' => self::GROUP_ADMIN,
|
'blacklistReset' => self::GROUP_ADMIN,
|
||||||
'blacklistDownload' => self::GROUP_ADMIN
|
'blacklistDownload' => self::GROUP_ADMIN,
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
public static $timezones = [
|
public static $timezones = [
|
||||||
@ -746,6 +748,23 @@ class config extends common {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Récupération des backups auto dans le gestionnaire de fichiers
|
||||||
|
*/
|
||||||
|
public function copyBackups() {
|
||||||
|
// Créer le répertoire manquant
|
||||||
|
if (!is_dir(self::FILE_DIR.'source/backup')) {
|
||||||
|
mkdir(self::FILE_DIR.'source/backup');
|
||||||
|
}
|
||||||
|
$this->custom_copy(self::BACKUP_DIR, self::FILE_DIR . 'source/backup' );
|
||||||
|
// Valeurs en sortie
|
||||||
|
$this->addOutput([
|
||||||
|
'redirect' => helper::baseUrl() . 'config/advanced',
|
||||||
|
'notification' => 'Copie terminée',
|
||||||
|
'state' => true
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fonction de parcours des données de module
|
* Fonction de parcours des données de module
|
||||||
@ -767,4 +786,31 @@ class config extends common {
|
|||||||
}
|
}
|
||||||
return $newArray;
|
return $newArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copie récursive de dossiers
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private function custom_copy($src, $dst) {
|
||||||
|
// open the source directory
|
||||||
|
$dir = opendir($src);
|
||||||
|
// Make the destination directory if not exist
|
||||||
|
if (!is_dir($dst)) {
|
||||||
|
mkdir($dst);
|
||||||
|
}
|
||||||
|
// Loop through the files in source directory
|
||||||
|
while( $file = readdir($dir) ) {
|
||||||
|
if (( $file != '.' ) && ( $file != '..' )) {
|
||||||
|
if ( is_dir($src . '/' . $file) ){
|
||||||
|
// Recursively calling custom copy function
|
||||||
|
// for sub directory
|
||||||
|
$this -> custom_copy($src . '/' . $file, $dst . '/' . $file);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
copy($src . '/' . $file, $dst . '/' . $file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($dir);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,25 +16,35 @@
|
|||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>Maintenance</h4>
|
<h4>Maintenance</h4>
|
||||||
<div class="col4">
|
<div class="row">
|
||||||
|
<div class="col12">
|
||||||
<?php echo template::checkbox('configAdvancedMaintenance', true, 'Site en maintenance', [
|
<?php echo template::checkbox('configAdvancedMaintenance', true, 'Site en maintenance', [
|
||||||
'checked' => $this->getData(['config', 'maintenance'])
|
'checked' => $this->getData(['config', 'maintenance'])
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col3 offset1">
|
</div>
|
||||||
<?php echo template::button('configManageButton', [
|
<div class="row">
|
||||||
|
<div class="col4">
|
||||||
|
<?php echo template::button('configBackupButton', [
|
||||||
'href' => helper::baseUrl() . 'config/backup',
|
'href' => helper::baseUrl() . 'config/backup',
|
||||||
'value' => 'Sauvegarder',
|
'value' => 'Sauvegarder',
|
||||||
'ico' => 'download'
|
'ico' => 'download-cloud'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col3">
|
<div class="col4">
|
||||||
<?php echo template::button('configRestoreButton', [
|
<?php echo template::button('configRestoreButton', [
|
||||||
'href' => helper::baseUrl() . 'config/restore',
|
'href' => helper::baseUrl() . 'config/restore',
|
||||||
'value' => 'Restaurer',
|
'value' => 'Restaurer',
|
||||||
'ico' => 'upload'
|
'ico' => 'upload-cloud'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col4">
|
||||||
|
<?php echo template::button('configBackupCopyButton', [
|
||||||
|
'href' => helper::baseUrl() . 'config/copyBackups',
|
||||||
|
'value' => 'Backups Auto ➜ FileManager'
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>Paramètre</h4>
|
<h4>Paramètres de la sauvegarde</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<?php echo template::checkbox('configBackupOption', true, 'Inclure le contenu du gestionnaire de fichiers', [
|
<?php echo template::checkbox('configBackupOption', true, 'Inclure le contenu du gestionnaire de fichiers', [
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>Paramètres</h4>
|
<h4>Archive à restaurer</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col10 offset1">
|
<div class="col10 offset1">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -40,7 +40,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>Conversion des URL <?php echo template::help('Conversion des URL des ressources multimédia après le transfert d\'une archive entre deux sites aux adresses différentes.');?></h4>
|
<h4>Conversion après la restauration<?php echo template::help('Conversion des URL des ressources multimédia entre deux sites aux arborescences différentes.');?></h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col4 offset1">
|
<div class="col4 offset1">
|
||||||
<?php
|
<?php
|
||||||
@ -58,15 +58,14 @@
|
|||||||
'label' => 'Dossier de l\'archive' ,
|
'label' => 'Dossier de l\'archive' ,
|
||||||
'value' => $baseUrlValue,
|
'value' => $baseUrlValue,
|
||||||
'readonly' => true,
|
'readonly' => true,
|
||||||
'help' => 'Dossier de base du site stockée dans la sauvegarde.'
|
'help' => 'Le dossier de base du site est stockée dans la sauvegarde.'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
<?php echo template::text('configRestoreCurrentURL', [
|
<?php echo template::text('configRestoreCurrentURL', [
|
||||||
'label' => 'Dossier du site actuel',
|
'label' => 'Dossier du site actuel',
|
||||||
'value' => helper::baseUrl(false,false),
|
'value' => helper::baseUrl(false,false),
|
||||||
'readonly' => true,
|
'readonly' => true
|
||||||
'help' => 'Dossier du base site actuel.'
|
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col2 verticalAlignMiddle">
|
<div class="col2 verticalAlignMiddle">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user