Open Monograph Press  3.3.0
InstallTool Class Reference
Inheritance diagram for InstallTool:
CommandLineTool OMPInstallTool

Public Member Functions

 __construct ($argv=array())
 
 execute ()
 
 install ()
 
 log ($message)
 
 printTitle ($title)
 
 readInput ()
 
 readParam ($name, $prompt, $defaultValue=null)
 
 readParamBoolean ($name, $prompt, $default='N')
 
 readParamOptions ($name, $prompt, $options, $defaultValue=null, $allowMultiple=false)
 
 readParams ()
 
 usage ()
 

Data Fields

 $params
 
- Data Fields inherited from CommandLineTool
 $argv
 
 $scriptName
 

Detailed Description

Definition at line 22 of file InstallTool.inc.php.

Constructor & Destructor Documentation

◆ __construct()

InstallTool::__construct (   $argv = array())

Constructor.

Parameters
$argvarray command-line arguments

Reimplemented from CommandLineTool.

Reimplemented in OMPInstallTool.

Definition at line 34 of file InstallTool.inc.php.

References CommandLineTool\$argv.

Member Function Documentation

◆ execute()

InstallTool::execute ( )

Execute the script.

Definition at line 49 of file InstallTool.inc.php.

References install(), and readParams().

◆ install()

InstallTool::install ( )

Perform installation.

Definition at line 58 of file InstallTool.inc.php.

Referenced by execute().

◆ log()

InstallTool::log (   $message)

Log install message to stdout.

Parameters
$messagestring

Definition at line 253 of file InstallTool.inc.php.

◆ printTitle()

InstallTool::printTitle (   $title)

Print input section title.

Parameters
$titlestring

Definition at line 140 of file InstallTool.inc.php.

Referenced by readParams().

◆ readInput()

InstallTool::readInput ( )

Read a line of user input.

Returns
string

Definition at line 148 of file InstallTool.inc.php.

Referenced by readParam(), readParamBoolean(), and readParamOptions().

◆ readParam()

InstallTool::readParam (   $name,
  $prompt,
  $defaultValue = null 
)

Read a string parameter.

Parameters
$namestring
$promptstring
$defaultValuestring

Definition at line 163 of file InstallTool.inc.php.

References readInput().

Referenced by readParams().

◆ readParamBoolean()

InstallTool::readParamBoolean (   $name,
  $prompt,
  $default = 'N' 
)

Prompt user for yes/no input.

Parameters
$namestring
$promptstring
$defaultstring default value, 'Y' or 'N'

Definition at line 186 of file InstallTool.inc.php.

References readInput().

Referenced by OMPInstallTool\readParams(), and readParams().

◆ readParamOptions()

InstallTool::readParamOptions (   $name,
  $prompt,
  $options,
  $defaultValue = null,
  $allowMultiple = false 
)

Read a parameter from a set of options.

Parameters
$namestring
$promptstring
$optionsarray
$defaultOptionstring

Definition at line 205 of file InstallTool.inc.php.

References readInput().

Referenced by readParams().

◆ readParams()

InstallTool::readParams ( )

Read installation parameters from stdin. FIXME: May want to implement an abstract "CLIForm" class handling input/validation. FIXME: Use readline if available?

Reimplemented in OMPInstallTool.

Definition at line 91 of file InstallTool.inc.php.

References printTitle(), readParam(), readParamBoolean(), and readParamOptions().

Referenced by execute().

◆ usage()

InstallTool::usage ( )

Print command usage information.

Reimplemented from CommandLineTool.

Definition at line 41 of file InstallTool.inc.php.

Field Documentation

◆ $params

array InstallTool::$params

installation parameters

Definition at line 28 of file InstallTool.inc.php.


The documentation for this class was generated from the following file: