|
Moodle
2.2.1
http://www.collinsharper.com
|
Go to the source code of this file.
| enum ANY_VERSION |
Special value that can be used in $plugin->dependencies in version.php files.
Definition at line 67 of file setuplib.php.
| enum DEBUG_ALL |
E_ALL without E_STRICT for now, do show recoverable fatal errors
Definition at line 40 of file setuplib.php.
| enum DEBUG_DEVELOPER |
DEBUG_ALL with extra Moodle debug messages - (DEBUG_ALL | 32768)
Definition at line 42 of file setuplib.php.
| enum DEBUG_MINIMAL |
E_ERROR | E_PARSE
Definition at line 36 of file setuplib.php.
| enum DEBUG_NONE |
| enum DEBUG_NORMAL |
E_ERROR | E_PARSE | E_WARNING | E_NOTICE
Definition at line 38 of file setuplib.php.
| enum MATURITY_ALPHA |
Software maturity levels used by the core and plugins
Definition at line 59 of file setuplib.php.
| enum MATURITY_BETA |
Definition at line 60 of file setuplib.php.
| enum MATURITY_RC |
Definition at line 61 of file setuplib.php.
| enum MATURITY_STABLE |
Definition at line 62 of file setuplib.php.
| enum MEMORY_EXTRA |
Large memory limit for given platform - used in cron, upgrade, and other places that need a lot of memory. Can be overridden with $CFG->extramemorylimit setting.
Definition at line 52 of file setuplib.php.
| enum MEMORY_HUGE |
Extremely large memory limit - not recommended for standard scripts
Definition at line 54 of file setuplib.php.
| enum MEMORY_STANDARD |
Standard memory limit for given platform
Definition at line 47 of file setuplib.php.
| enum MEMORY_UNLIMITED |
Remove any memory limits
Definition at line 45 of file setuplib.php.
Unconditionally abort all database transactions, this function should be called from exception handlers only.
Definition at line 375 of file setuplib.php.

| check_dir_exists | ( | $ | dir, |
| $ | create = true, |
||
| $ | recursive = true |
||
| ) |
Function to check if a directory exists and by default create it if not exists.
Previously this was accepting paths only from dataroot, but we now allow files outside of dataroot if you supply custom paths for some settings in config.php. This function does not verify that the directory is writable.
NOTE: this function uses current file stat cache, please use clearstatcache() before this if you expect that the directories may have been removed recently from a different request.
| string | $dir | absolute directory path |
| boolean | $create | directory if does not exist |
| boolean | $recursive | create directory recursively |
Definition at line 1089 of file setuplib.php.

| default_error_handler | ( | $ | errno, |
| $ | errstr, | ||
| $ | errfile, | ||
| $ | errline, | ||
| $ | errcontext | ||
| ) |
Default error handler, prevents some white screens.
| int | $errno | |
| string | $errstr | |
| string | $errfile | |
| int | $errline | |
| array | $errcontext |
Definition at line 362 of file setuplib.php.
| default_exception_handler | ( | $ | ex | ) |
Default exception handler, uncaught exceptions are equivalent to error() in 1.9 and earlier
| Exception | $ex |
Definition at line 308 of file setuplib.php.


Indicates whether we are in the middle of the initial Moodle install.
Very occasionally it is necessary avoid running certain bits of code before the Moodle installation has completed. The installed flag is set in admin/index.php after Moodle core and all the plugins have been installed, but just before the person doing the initial install is asked to choose the admin password.
Definition at line 875 of file setuplib.php.

| format_backtrace | ( | $ | callers, |
| $ | plaintext = false |
||
| ) |
Formats a backtrace ready for output.
| array | $callers | backtrace array, as returned by debug_backtrace(). |
| boolean | $plaintext | if false, generates HTML, if true generates plain text. |
Definition at line 570 of file setuplib.php.

| get_docs_url | ( | $ | path = null | ) |
Returns the Moodle Docs URL in the users language
object
| string | $path | the end of the URL. |
Definition at line 535 of file setuplib.php.


| get_exception_info | ( | $ | ex | ) |
Returns detailed information about specified exception.
| exception | $ex |
Definition at line 443 of file setuplib.php.


| get_real_size | ( | $ | size = 0 | ) |
Converts numbers like 10M into bytes.
| string | $size | The size to be converted |
Definition at line 993 of file setuplib.php.

| ini_get_bool | ( | $ | ini_get_arg | ) |
This function makes the return value of ini_get consistent if you are setting server directives through the .htaccess file in apache.
Current behavior for value set from php.ini On = 1, Off = [blank] Current behavior for value set from .htaccess On = On, Off = Off Contributed by jdell @ unr.edu
| string | $ini_get_arg | The argument to get |
Definition at line 615 of file setuplib.php.

Definition at line 1236 of file setuplib.php.
| init_memcached | ( | ) |
Definition at line 1224 of file setuplib.php.
Initializes our performance info early.
Pairs up with get_performance_info() which is actually in moodlelib.php. This function is here so that we can call it before all the libs are pulled in.
$PERF
Definition at line 848 of file setuplib.php.
| initialise_cfg | ( | ) |
Initialises $FULLME and friends. Private function. Should only be called from setup.php.
Definition at line 669 of file setuplib.php.

Initialises $FULLME and friends for command line scripts. This is a private method for use by initialise_fullme.
Definition at line 745 of file setuplib.php.

| is_early_init | ( | $ | backtrace | ) |
This function encapsulates the tests for whether an exception was thrown in early init -- either during setup.php or during init of $OUTPUT.
If another exception is thrown then, and if we do not take special measures, we would just get a very cryptic message "Exception thrown without a stack frame in Unknown on line 0". That makes debugging very hard, so we do take special measures in default_exception_handler, with the help of this function.
| array | $backtrace | the stack trace to analyse. |
Definition at line 399 of file setuplib.php.

| is_web_crawler | ( | ) |
Checks if current user is a web crawler.
This list can not be made complete, this is not a security restriction, we make the list only to help these sites especially when automatic guest login is disabled.
If admin needs security they should enable forcelogin and disable guest access!!
Definition at line 1260 of file setuplib.php.

| make_cache_directory | ( | $ | directory, |
| $ | exceptiononerror = true |
||
| ) |
Create a directory under cachedir and make sure it is writable.
| string | $directory | the full path of the directory to be created under $CFG->cachedir |
| bool | $exceptiononerror | throw exception if error encountered |
Definition at line 1212 of file setuplib.php.


| make_temp_directory | ( | $ | directory, |
| $ | exceptiononerror = true |
||
| ) |
Create a directory under tempdir and make sure it is writable. Temporary files should be used during the current request only!
| string | $directory | the full path of the directory to be created under $CFG->tempdir |
| bool | $exceptiononerror | throw exception if error encountered |
Definition at line 1194 of file setuplib.php.


| make_upload_directory | ( | $ | directory, |
| $ | exceptiononerror = true |
||
| ) |
Create a directory under dataroot and make sure it is writable. Do not use for temporary and cache files - see make_temp_directory() and make_cache_directory().
| string | $directory | the full path of the directory to be created under $CFG->dataroot |
| bool | $exceptiononerror | throw exception if error encountered |
Definition at line 1172 of file setuplib.php.


| print_error | ( | $ | errorcode, |
| $ | module = 'error', |
||
| $ | link = '', |
||
| $ | a = null, |
||
| $ | debuginfo = null |
||
| ) |
Abort execution by throwing of a general exception, default exception handler displays the error message in most cases.
| string | $errorcode | The name of the language string containing the error message. Normally this should be in the error.php lang file. |
| string | $module | The language file to get the error message from. |
| string | $link | The url where the user will be prompted to continue. If no url is provided the user will be directed to the site index page. |
| object | $a | Extra words and phrases that might be required in the error string |
| string | $debuginfo | optional debugging information |
Definition at line 434 of file setuplib.php.
| raise_memory_limit | ( | $ | newlimit | ) |
Function to raise the memory limit to a new value. Will respect the memory limit if it is higher, thus allowing settings in php.ini, apache conf or command line switches to override it.
The memory limit should be expressed with a constant MEMORY_STANDARD, MEMORY_EXTRA or MEMORY_HUGE. It is possible to use strings or integers too (eg:'128M').
| mixed | $newlimit | the new memory limit |
Definition at line 893 of file setuplib.php.


Check whether a major upgrade is needed. That is defined as an upgrade that changes something really fundamental in the database, so nothing can possibly work until the database has been updated, and that is defined by the hard-coded version number in this function.
Definition at line 1055 of file setuplib.php.

| reduce_memory_limit | ( | $ | newlimit | ) |
Function to reduce the memory limit to a new value. Will respect the memory limit if it is lower, thus allowing settings in php.ini, apache conf or command line switches to override it
The memory limit should be expressed with a string (eg:'64M')
| string | $newlimit | the new memory limit |
Definition at line 962 of file setuplib.php.


Get the URL that PHP/the web server thinks it is serving. Private function used by initialise_fullme. In your code, use $PAGE->url, $SCRIPT, etc.
Definition at line 771 of file setuplib.php.

This function verifies the sanity of PHP configuration and stops execution if anything critical found.
Definition at line 628 of file setuplib.php.
