Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/lib/clilib.php File Reference

Go to the source code of this file.

Namespaces

namespace  core

Functions

 cli_input ($prompt, $default='', array $options=null, $casesensitiveoptions=false)
 cli_get_params (array $longoptions, array $shortmapping=null)
 cli_separator ($return=false)
 cli_heading ($string, $return=false)
 cli_problem ($text)
 cli_error ($text, $errorcode=1)

Function Documentation

cli_error ( text,
errorcode = 1 
)

Write to standard out and error with exit in error.

Parameters:
string$text
int$errorcode
Returns:
void (does not return)

Definition at line 173 of file clilib.php.

Here is the caller graph for this function:

cli_get_params ( array longoptions,
array shortmapping = null 
)

Returns cli script parameters.

Parameters:
array$longoptionsarray of --style options ex:('verbose'=>false)
array$shortmappingarray describing mapping of short to long style options ex:('h'=>'help', 'v'=>'verbose')
Returns:
array array of arrays, options, unrecognised as optionlongname=>value

Definition at line 63 of file clilib.php.

cli_heading ( string,
return = false 
)

Print or return section heading string

Parameters:
string$stringtext
bool$returnfalse means print, true return as string
Returns:
mixed void or string

Definition at line 148 of file clilib.php.

Here is the caller graph for this function:

cli_input ( prompt,
default = '',
array options = null,
casesensitiveoptions = false 
)

Get input from user

Parameters:
string$prompttext prompt, should include possible options
string$defaultdefault value when enter pressed
array$optionslist of allowed options, empty means any text
bool$casesensitivetrue if options are case sensitive
Returns:
string entered text

Definition at line 37 of file clilib.php.

cli_problem ( text)

Write error notification

Parameters:
$text
Returns:
void

Definition at line 162 of file clilib.php.

cli_separator ( return = false)

Print or return section separator string

Parameters:
bool$returnfalse means print, true return as string
Returns:
mixed void or string

Definition at line 133 of file clilib.php.

Here is the caller graph for this function:

 All Data Structures Namespaces Files Functions Variables Enumerations