mirror of
https://github.com/Chouchen/Shikiryu_Backup.git
synced 2021-06-30 16:02:14 +02:00
37 lines
854 B
PHP
37 lines
854 B
PHP
<?php
|
|
namespace Shikiryu\Backup\Backup;
|
|
|
|
class Files extends BackupAbstract
|
|
{
|
|
|
|
/**
|
|
* @param array $filesToBackup
|
|
*/
|
|
function __construct($filesToBackup = array())
|
|
{
|
|
parent::__construct();
|
|
if(!empty($filesToBackup) && is_array($filesToBackup)){
|
|
$names = array_map("basename",$filesToBackup);
|
|
$this->_filesToBackup = array_combine($filesToBackup,$names);
|
|
}
|
|
}
|
|
|
|
/**
|
|
*
|
|
*
|
|
* @param string[] $filestobackup a list of file path
|
|
*
|
|
* @return $this
|
|
*/
|
|
function setFilePath($filesToBackup = array())
|
|
{
|
|
if(!empty($filesToBackup) && is_array($filesToBackup))
|
|
{
|
|
$names = array_map("basename",$filesToBackup);
|
|
$this->_filesToBackup = array_combine($filesToBackup,$names);
|
|
}
|
|
return $this;
|
|
}
|
|
}
|
|
?>
|