Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
environment_results Class Reference

Helper Class to return results to caller. More...

Public Member Functions

 __construct ($part)
 Constructor of the environment_result class.
 
 environment_results ($part)
 Old syntax of class constructor.
 
 getBypassStr ()
 Get the bypass string.
 
 getCurrentVersion ()
 Get the current version.
 
 getErrorCode ()
 Get the error code.
 
 getFeedbackStr ()
 Get the feedback string.
 
 getInfo ()
 Get the aux info.
 
 getLevel ()
 Get the level.
 
 getNeededVersion ()
 Get the needed version.
 
 getPart ()
 Get the part this result belongs to.
 
 getPluginName ()
 Get plugin name.
 
 getRestrictStr ()
 Get the restrict string.
 
 getStatus ()
 Get the status.
 
 setBypassStr ($str)
 Set the bypass string.
 
 setCurrentVersion ($current_version)
 Set the current version.
 
 setErrorCode ($error_code)
 Set the error_code.
 
 setFeedbackStr ($str)
 Set the feedback string.
 
 setInfo ($info)
 Set the auxiliary info.
 
 setLevel ($level)
 Set the level.
 
 setNeededVersion ($needed_version)
 Set the needed version.
 
 setRestrictStr ($str)
 Set the restrict string.
 
 setStatus ($testpassed)
 Set the status.
 
 strToReport ($string, $class)
 

Public Attributes

string $bypass_str
 String to show if some bypass has happened.
 
string $current_version
 current version detected
 
integer $error_code
 See constants at the beginning of the file.
 
string $feedback_str
 String to show on error|on check|on ok.
 
string $info
 Aux.
 
string $level
 required/optional
 
string $needed_version
 version needed
 
string $part
 Which are we checking (database, php, php_extension, php_extension)
 
string null $plugin = null
 full plugin name or null if main environment
 
string $restrict_str
 String to show if some restrict has happened.
 
bool $status
 true means the test passed and all is OK.
 

Detailed Description

Helper Class to return results to caller.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

environment_results::__construct ( $part)

Constructor of the environment_result class.

Just set default values

Parameters
string$part

Member Function Documentation

◆ environment_results()

environment_results::environment_results ( $part)

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated
since Moodle 3.1

◆ getBypassStr()

environment_results::getBypassStr ( )

Get the bypass string.

Return values
mixedbypass string (can be an array of params for get_string or a single string to fetch from admin.php lang file).

◆ getCurrentVersion()

environment_results::getCurrentVersion ( )

Get the current version.

Return values
stringcurrent version

◆ getErrorCode()

environment_results::getErrorCode ( )

Get the error code.

Return values
integererror code

◆ getFeedbackStr()

environment_results::getFeedbackStr ( )

Get the feedback string.

Return values
mixedfeedback string (can be an array of params for get_string or a single string to fetch from admin.php lang file).

◆ getInfo()

environment_results::getInfo ( )

Get the aux info.

Return values
stringinfo

◆ getLevel()

environment_results::getLevel ( )

Get the level.

Return values
stringlevel

◆ getNeededVersion()

environment_results::getNeededVersion ( )

Get the needed version.

Return values
stringneeded version

◆ getPart()

environment_results::getPart ( )

Get the part this result belongs to.

Return values
stringpart

◆ getPluginName()

environment_results::getPluginName ( )

Get plugin name.

Return values
stringplugin name

◆ getRestrictStr()

environment_results::getRestrictStr ( )

Get the restrict string.

Return values
mixedrestrict string (can be an array of params for get_string or a single string to fetch from admin.php lang file).

◆ getStatus()

environment_results::getStatus ( )

Get the status.

Return values
booltrue means the test passed and all is OK. false means it failed.

◆ setBypassStr()

environment_results::setBypassStr ( $str)

Set the bypass string.

Parameters
string$strthe bypass string that will be fetched from the admin lang file. pass just the string or pass an array of params for get_string You always should put your string in admin.php but a third param is useful to pass an $a object / string to get_string

◆ setCurrentVersion()

environment_results::setCurrentVersion ( $current_version)

Set the current version.

Parameters
string$current_versionthe current version

◆ setErrorCode()

environment_results::setErrorCode ( $error_code)

Set the error_code.

Parameters
integer$error_codethe error code (see constants above)

◆ setFeedbackStr()

environment_results::setFeedbackStr ( $str)

Set the feedback string.

Parameters
mixed$strthe feedback string that will be fetched from the admin lang file. pass just the string or pass an array of params for get_string You always should put your string in admin.php but a third param is useful to pass an $a object / string to get_string

◆ setInfo()

environment_results::setInfo ( $info)

Set the auxiliary info.

Parameters
string$infothe auxiliary info

◆ setLevel()

environment_results::setLevel ( $level)

Set the level.

Parameters
string$levelthe level (required, optional)

◆ setNeededVersion()

environment_results::setNeededVersion ( $needed_version)

Set the needed version.

Parameters
string$needed_versionthe needed version

◆ setRestrictStr()

environment_results::setRestrictStr ( $str)

Set the restrict string.

Parameters
string$strthe restrict string that will be fetched from the admin lang file. pass just the string or pass an array of params for get_string You always should put your string in admin.php but a third param is useful to pass an $a object / string to get_string

◆ setStatus()

environment_results::setStatus ( $testpassed)

Set the status.

Parameters
bool$testpassedtrue means the test passed and all is OK. false means it failed.

◆ strToReport()

environment_results::strToReport ( $string,
$class )
Todo
Document this function
Parameters
mixed$stringparams for get_string, either a string to fetch from admin.php or an array of params for get_string.
string$classcss class(es) for message.
Return values
stringfeedback string fetched from lang file wrapped in p tag with class $class or returns empty string if $string is empty.

Member Data Documentation

◆ $info

string environment_results::$info

Aux.

info (DB vendor, library...)

◆ $status

bool environment_results::$status

true means the test passed and all is OK.

false means it failed.


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