Sunnysideup\PHP2CommandLine\PHP2CommandLineSingleton
Synopsis
class PHP2CommandLineSingleton
{
- // members
- private static $_singleton;
- protected string $logFileLocation = '';
- protected null|bool $runImmediately = NULL;
- protected bool $breakOnAllErrors = false;
- // methods
- public static void create()
- public static null delete()
- public PHP2CommandLineSingleton setLogFileLocation()
- public PHP2CommandLineSingleton getLogFileLocation()
- public PHP2CommandLineSingleton setRunImmediately()
- public bool getRunImmediately()
- public bool getBreakOnAllErrors()
- public void setBreakOnAllErrors()
- public void __construct()
- public void __destruct()
- public [type] execMe()
- public null colourPrint()
- protected bool isCommandLine()
- protected bool isHTML()
- protected void startOutput()
- protected void endOutput()
- protected null newLine()
Tasks
Line | Task |
---|---|
219+ | add the ability to use colours like "warning", "notice", "error" |
Members
private
- $_singleton
protected
- $breakOnAllErrors
—
Sunnysideup\PHP2CommandLine\bool
should the script stop if any error occurs? - $logFileLocation
—
string
Where will the log file be stored. - $runImmediately
—
Sunnysideup\PHP2CommandLine\null|bool
If false then will output HTML version of a batch file for running this module If true runs the module immediately
Methods
protected
- endOutput() — For finishing off the programs output with some fixed output. Currently only used for closing off html at end of file.
- isCommandLine()
- isHTML()
- newLine() — Depending on if writing to command line or to browser as html, echo a line break or EOL (End of line)
- startOutput() — For printing some fixed data to output at beginning of output before the dynamic data is printed to console or html
public
- __construct() — Where to save the logfile to
- __destruct() — When program finishes execution end the output
- colourPrint() — echos out the resulting string after applying all parameters
- create()
- delete() — Deletes the current singleton by setting it null
- execMe()
- getBreakOnAllErrors()
- getLogFileLocation() — See where the location of the log file for writing all the printed output to is
- getRunImmediately()
- setBreakOnAllErrors()
- setLogFileLocation() — Determine the location of the log file for writing all the printed output to
- setRunImmediately()