LogFilesService

Implements \LogFilesServiceInterface

Class LogFilesService

package

Default

Methods

LogFilesService constructor.

__construct(\IntType $thresholdAsDays, \ExistingDirectory $root, array $blacklist) 

Arguments

$thresholdAsDays

\IntType

Maximum age in days of logfile until it gets removed.

$root

\ExistingDirectory

Log files root directory.

$blacklist

array

List of blacklisted file names (e.g. .htaccess). Gets merged with "." and "..".

Checks and returns true if given file is blacklisted.

_isBlacklisted(\DirectoryIterator $file) : boolean

Arguments

$file

\DirectoryIterator

File to be checked.

Response

boolean

True if file is blacklisted.

Checks and returns true if given file is NOT deprecated (Never than $threshold days).

_isNotDeprecated(\DirectoryIterator $file) : boolean

Arguments

$file

\DirectoryIterator

File to be checked.

Response

boolean

True if file is NOT deprecated.

Returns the deleted log files.

deleteOldLogFiles() : array<mixed,string>

Response

array<mixed,string>

List of removed file names.

Properties

blacklist

blacklist : array
var

Type(s)

array

threshold

threshold : integer
var

Type(s)

integer

root

root : string
var

Type(s)

string