[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/lib/ -> environmentlib.php (summary)

(no description)

File Size: 1234 lines (44 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

environment_results:: (25 methods):
  environment_results()
  setStatus()
  setErrorCode()
  setLevel()
  setCurrentVersion()
  setNeededVersion()
  setInfo()
  setFeedbackStr()
  setBypassStr()
  setRestrictStr()
  getStatus()
  getErrorCode()
  getLevel()
  getCurrentVersion()
  getNeededVersion()
  getInfo()
  getPart()
  getFeedbackStr()
  getBypassStr()
  getRestrictStr()
  strToReport()
  bypass_mysql416_reqs()
  restrict_php50_version()
  get_level()
  process_environment_result()

Defines 25 functions

  check_moodle_environment()
  print_moodle_environment()
  normalize_version()
  load_environment_xml()
  get_list_of_environment_versions()
  get_latest_version_available()
  get_environment_for_version()
  environment_check()
  environment_check_php_extensions()
  environment_custom_checks()
  environment_check_moodle()
  environment_check_php()
  environment_check_unicode()
  environment_check_database()
  process_environment_bypass()
  process_environment_restrict()
  process_environment_messages()

Class: environment_results  - X-Ref

This class is used to return the results of the environment
main functions (environment_check_xxxx)

environment_results($part)   X-Ref
Constructor of the environment_result class. Just set default values


setStatus($status)   X-Ref
Set the status

param: boolean the status (true/false)

setErrorCode($error_code)   X-Ref
Set the error_code

param: integer the error code (see constants above)

setLevel($level)   X-Ref
Set the level

param: string the level (required, optional)

setCurrentVersion($current_version)   X-Ref
Set the current version

param: string the current version

setNeededVersion($needed_version)   X-Ref
Set the needed version

param: string the needed version

setInfo($info)   X-Ref
Set the auxiliary info

param: string the auxiliary info

setFeedbackStr($str)   X-Ref
Set the feedback string

param: mixed the feedback string that will be fetched from the admin lang file.

setBypassStr($str)   X-Ref
Set the bypass string

param: string the bypass string that will be fetched from the admin lang file.

setRestrictStr($str)   X-Ref
Set the restrict string

param: string the restrict string that will be fetched from the admin lang file.

getStatus()   X-Ref
Get the status

return: boolean result

getErrorCode()   X-Ref
Get the error code

return: integer error code

getLevel()   X-Ref
Get the level

return: string level

getCurrentVersion()   X-Ref
Get the current version

return: string current version

getNeededVersion()   X-Ref
Get the needed version

return: string needed version

getInfo()   X-Ref
Get the aux info

return: string info

getPart()   X-Ref
Get the part this result belongs to

return: string part

getFeedbackStr()   X-Ref
Get the feedback string

return: mixed feedback string (can be an array of params for get_string or a single string to fetch from

getBypassStr()   X-Ref
Get the bypass string

return: mixed bypass string (can be an array of params for get_string or a single string to fetch from

getRestrictStr()   X-Ref
Get the restrict string

return: mixed restrict string (can be an array of params for get_string or a single string to fetch from

strToReport($string, $class)   X-Ref

param: mixed $string params for get_string, either a string to fetch from admin.php or an array of
param: string $class css class(es) for message.
return: string feedback string fetched from lang file wrapped in p tag with class $class or returns

bypass_mysql416_reqs($result)   X-Ref
This function will bypass MySQL 4.1.16 reqs if:
- We are using MySQL > 4.1.12, informing about problems with non latin chars in the future

param: object result object to handle
return: boolean true/false to determinate if the bypass has to be performed (true) or no (false)

restrict_php50_version($result)   X-Ref
This function will restrict PHP reqs if:
- We are using PHP 5.0.x, informing about the buggy version

param: object result object to handle
return: boolean true/false to determinate if the restrict has to be performed (true) or no (false)

get_level($element)   X-Ref

param: array $element the element from the environment.xml file that should have

process_environment_result($element, &$result)   X-Ref
Once the result has been determined, look in the XML for any
messages, or other things that should be done depending on the outcome.

param: array $element the element from the environment.xml file which
param: object $result the result of the test, which may be modified by

Functions
Functions that are not part of a class:

check_moodle_environment($version, &$environment_results, $print_table=true)   X-Ref
This function will perform the whole check, returning
true or false as final result. Also, he full array of
environment_result will be returned in the parameter list.
The function looks for the best version to compare and
everything. This is the only function that should be called
ever from the rest of Moodle.

param: string version version to check.
param: array results array of results checked.
param: boolean true/false, whether to print the table or just return results array
return: boolean true/false, depending of results

print_moodle_environment($result, $environment_results)   X-Ref
This function will print one beautiful table with all the environmental
configuration and how it suits Moodle needs.

param: boolean final result of the check (true/false)
param: array environment_results array of results gathered

normalize_version($version)   X-Ref
This function will normalize any version to just a serie of numbers
separated by dots. Everything else will be removed.

param: string $version the original version
return: string the normalized version

load_environment_xml()   X-Ref
This function will load the environment.xml file and xmlize it

return: mixed the xmlized structure or false on error

get_list_of_environment_versions($contents)   X-Ref
This function will return the list of Moodle versions available

return: mixed array of versions. False on error.

get_latest_version_available($version)   X-Ref
This function will return the most recent version in the environment.xml
file previous or equal to the version requested

param: string version top version from which we start to look backwards
return: string more recent version or false if not found

get_environment_for_version($version)   X-Ref
This function will return the xmlized data belonging to one Moodle version

return: mixed the xmlized structure or false on error

environment_check($version)   X-Ref
This function will check for everything (DB, PHP and PHP extensions for now)
returning an array of environment_result objects.

param: string $version xml version we are going to use to test this server
return: array array of results encapsulated in one environment_result object

environment_check_php_extensions($version)   X-Ref
This function will check if php extensions requirements are satisfied

param: string $version xml version we are going to use to test this server
return: array array of results encapsulated in one environment_result object

environment_custom_checks($version)   X-Ref
This function will do the custom checks.

param: string $version xml version we are going to use to test this server.
return: array array of results encapsulated in environment_result objects.

environment_check_moodle($version)   X-Ref
This function will check if Moodle requirements are satisfied

param: string $version xml version we are going to use to test this server
return: object results encapsulated in one environment_result object

environment_check_php($version)   X-Ref
This function will check if php requirements are satisfied

param: string $version xml version we are going to use to test this server
return: object results encapsulated in one environment_result object

environment_check_unicode($version)   X-Ref
This function will check if unicode database requirements are satisfied

param: string $version xml version we are going to use to test this server
return: object results encapsulated in one environment_result object

environment_check_database($version)   X-Ref
This function will check if database requirements are satisfied

param: string $version xml version we are going to use to test this server
return: object results encapsulated in one environment_result object

process_environment_bypass($xml, &$result)   X-Ref
This function will post-process the result record by executing the specified
function, modifying it as necessary, also a custom message will be added
to the result object to be printed by the display layer.
Every bypass function must be defined in this file and it'll return
true/false to decide if the original test is bypassed or no. Also
such bypass functions are able to directly handling the result object
although it should be only under exceptional conditions.

param: string xmldata containing the bypass data
param: object result object to be updated

process_environment_restrict($xml, &$result)   X-Ref
This function will post-process the result record by executing the specified
function, modifying it as necessary, also a custom message will be added
to the result object to be printed by the display layer.
Every restrict function must be defined in this file and it'll return
true/false to decide if the original test is restricted or no. Also
such restrict functions are able to directly handling the result object
although it should be only under exceptional conditions.

param: string xmldata containing the restrict data
param: object result object to be updated

process_environment_messages($xml, &$result)   X-Ref
This function will detect if there is some message available to be added to the
result in order to clarify enviromental details.

param: string xmldata containing the feedback data
param: object reult object to be updated



Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7