SilverCart\Dev\CLITask

Trait to add some enhanced CLI based features to any BildTask.

Synopsis

trait CLITask {
}

Hierarchy

Members

protected

  • $default_help_docs — array
    Help docs.
  • $emailInfos — array
    List of infos to send by email.
  • $errors — array
    List of occured errors
  • $finishRunningActionsOnBeforeExit — array
    List of action callbacks to finish before self::exitIfRunningAction() is calling exit().
  • $infos — array
    List of occured infos
  • $lastProgressInfoLength — int
    Contains the length of the last progress string printed by $this->printProgressInfo()
  • $log_file_name — string
    Optional log file name.
  • $tmpFolder — string
    Folder for temporary files

public

  • $CLI_COLOR_BLACK
  • $CLI_COLOR_BLUE
  • $CLI_COLOR_CHANGE_BLACK
  • $CLI_COLOR_CHANGE_BLUE
  • $CLI_COLOR_CHANGE_CYAN
  • $CLI_COLOR_CHANGE_GREEN
  • $CLI_COLOR_CHANGE_MAGENTA
  • $CLI_COLOR_CHANGE_RED
  • $CLI_COLOR_CHANGE_WHITE
  • $CLI_COLOR_CHANGE_YELLOW
  • $CLI_COLOR_CYAN
  • $CLI_COLOR_GREEN
  • $CLI_COLOR_MAGENTA
  • $CLI_COLOR_RED
  • $CLI_COLOR_WHITE
  • $CLI_COLOR_YELLOW
  • $CLI_EMAIL_INFO_TYPE_ERROR
  • $CLI_EMAIL_INFO_TYPE_INFO
  • $CLI_EMAIL_INFO_TYPE_WARNING
  • $RUNNING_ACTION_FILE_PREFIX
  • $cli_args — array
    Default CLI arguments

Methods

protected

  • deleteFiles() — Deletes all files with the given extension out of the given directory.
  • exitIfRunningAction() — Will exit the currently running program if the requested $action is already running. If $markAsStarted is set to true, the $action will automatically be marked as started if not running yet. If $printInfoMessage is set to false, nothing will be printed to the output.
  • extractZipFile() — Extracts the given ZIP file into the given target folder.
  • getFilesInDirectory() — Returns an array with all filepaths of the given file types in the given directory.
  • getHelpDocs() — Returns the help docs.
  • getRunningActionFilename() — Returns the file name (including path) for the running action.
  • getRunningTaskActionFilename() — Returns the file name (including path) for the running $action of the given $task.
  • initArgs() — Initializes the given arguments.
  • is_process_running() — Checks whether a process with the given PID is running
  • run_process_in_background() — Runs a command in background and returns its PID
  • setLogFileNamePrefix() — Adds the given prefix to the log file name (separated with a ".").
  • setLogFileNameSuffix() — Adds the given suffix to the log file name (separated with a ".").

public