BackupFile
in package
Simple file diff backup
Tags
Table of Contents
Constants
- VERSION = 0.87
Properties
- $fileSize : int
- $maxSize : int
- $openFiles : int
- $dirRoot : string
- $ignoreDir : array<string, bool>
- $ignoreFile : array<string, bool>
- $maxTime : int
- $timeLast : int
- $timeStart : int
Methods
- __construct() : mixed
- create() : void
- setIgnoreDirs() : void
- Sets a list of directories to be ignored
- setIgnoreFiles() : void
- Sets a list of files to be ignored
- compress() : bool
- exportFiles() : void
- getArchiveContent() : array<string, int>
- readDirContent() : array<string, mixed>|null
- Search for all NEW files and sub-directories
- readDirs() : array<string, mixed>
- Load files inside directory
- convertUnits() : int
- Convert string size to int
Constants
VERSION
public
float
VERSION
= 0.87
Properties
$fileSize
public
static int
$fileSize
= 9000000
Max filesize or zero to ignore
$maxSize
public
static int
$maxSize
= null
Maximum file archive
$openFiles
public
static int
$openFiles
= 3800
Too many open files > 0 !!!
$dirRoot
protected
string
$dirRoot
$ignoreDir
protected
array<string, bool>
$ignoreDir
$ignoreFile
protected
array<string, bool>
$ignoreFile
$maxTime
protected
int
$maxTime
$timeLast
protected
int
$timeLast
$timeStart
protected
int
$timeStart
Methods
__construct()
public
__construct(string $dirRoot[, array<string, bool> $ignoreDir = [] ][, array<string, bool> $ignoreFile = [] ]) : mixed
Parameters
- $dirRoot : string
- $ignoreDir : array<string, bool> = []
- $ignoreFile : array<string, bool> = []
create()
public
create(string $fileName[, array<string|int, string> $dirs = [''] ]) : void
Parameters
- $fileName : string
- $dirs : array<string|int, string> = ['']
Tags
setIgnoreDirs()
Sets a list of directories to be ignored
public
setIgnoreDirs(array<string, bool> $list) : void
Parameters
- $list : array<string, bool>
Tags
setIgnoreFiles()
Sets a list of files to be ignored
public
setIgnoreFiles(array<string, bool> $list) : void
Parameters
- $list : array<string, bool>
Tags
compress()
protected
compress(string $name, array<string, int> $files) : bool
Parameters
- $name : string
- $files : array<string, int>
Return values
boolexportFiles()
protected
exportFiles(array<string, int> &$files, int $maxSize, int $maxTime) : void
Parameters
- $files : array<string, int>
- $maxSize : int
- $maxTime : int
getArchiveContent()
protected
getArchiveContent(array<string, int> &$files, int $maxSize[, int $count = 10 ]) : array<string, int>
Parameters
- $files : array<string, int>
- $maxSize : int
- $count : int = 10
Return values
array<string, int>readDirContent()
Search for all NEW files and sub-directories
protected
readDirContent(string $dir) : array<string, mixed>|null
Parameters
- $dir : string
Return values
array<string, mixed>|nullreadDirs()
Load files inside directory
protected
readDirs(array<string|int, string> $dirs) : array<string, mixed>
Parameters
- $dirs : array<string|int, string>
Return values
array<string, mixed>convertUnits()
Convert string size to int
private
static convertUnits(string $num) : int
Parameters
- $num : string