PHP Class Crontab\CrontabFileHandler

Author: Jacob Kiers ([email protected])
Mostra file Open project: yzalis/crontab Class Usage Examples

Public Properties

Property Type Description
$crontabExecutable string Location of the crontab executable

Protected Properties

Property Type Description
$error string The error when using the command 'crontab'
$output string The output when using the command 'crontab'

Public Methods

Method Description
getCrontabExecutable ( ) : string Get crontab executable location
getError ( ) : string Get crontab error
getOutput ( ) : string Get crontab output
parseExistingCrontab ( Crontab $crontab ) : CrontabFileHandler Parse an existing crontab
parseFromFile ( Crontab $crontab, string $filename ) : CrontabFileHandler Reads cron jobs from a file.
setCrontabExecutable ( string $crontabExecutable ) : Crontab Set unix user to add crontab
write ( Crontab $crontab ) : CrontabFileHandler Write the current crons in the cron table
writeToFile ( Crontab $crontab, string $filename ) : CrontabFileHandler Write the current crons to a file.

Protected Methods

Method Description
crontabCommand ( Crontab $crontab ) : string Calcuates crontab command
parseString ( string $input ) : array Returns an array of Cron Jobs based on the contents of a file.

Method Details

crontabCommand() protected method

Calcuates crontab command
protected crontabCommand ( Crontab $crontab ) : string
$crontab Crontab
return string

getCrontabExecutable() public method

Get crontab executable location
public getCrontabExecutable ( ) : string
return string

getError() public method

Get crontab error
public getError ( ) : string
return string

getOutput() public method

Get crontab output
public getOutput ( ) : string
return string

parseExistingCrontab() public method

Parse an existing crontab
public parseExistingCrontab ( Crontab $crontab ) : CrontabFileHandler
$crontab Crontab
return CrontabFileHandler

parseFromFile() public method

Reads cron jobs from a file.
public parseFromFile ( Crontab $crontab, string $filename ) : CrontabFileHandler
$crontab Crontab
$filename string
return CrontabFileHandler

parseString() protected method

Returns an array of Cron Jobs based on the contents of a file.
protected parseString ( string $input ) : array
$input string
return array of Variable and Job instances

setCrontabExecutable() public method

Set unix user to add crontab
public setCrontabExecutable ( string $crontabExecutable ) : Crontab
$crontabExecutable string
return Crontab

write() public method

Write the current crons in the cron table
public write ( Crontab $crontab ) : CrontabFileHandler
$crontab Crontab
return CrontabFileHandler

writeToFile() public method

Write the current crons to a file.
public writeToFile ( Crontab $crontab, string $filename ) : CrontabFileHandler
$crontab Crontab
$filename string
return CrontabFileHandler

Property Details

$crontabExecutable public_oe property

Location of the crontab executable
public string $crontabExecutable
return string

$error protected_oe property

The error when using the command 'crontab'
protected string $error
return string

$output protected_oe property

The output when using the command 'crontab'
protected string $output
return string