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

Go to the source code of this file.

Namespaces

namespace  core

Variables

$CFG

Holds the core settings that affect how Moodle works. Some of its fields are set in config.php, and the rest are loaded from the config table.

Some typical settings in the $CFG global:

  • $CFG->wwwroot - Path to moodle index directory in url format.
  • $CFG->dataroot - Path to moodle data files directory on server's filesystem.
  • $CFG->dirroot - Path to moodle's library folder on server's filesystem.
  • $CFG->libdir - Path to moodle's library folder on server's filesystem.
  • $CFG->tempdir - Path to moodle's temp file directory on server's filesystem.
  • $CFG->cachedir - Path to moodle's cache directory on server's filesystem.

object $CFG

global $CFG
if(!isset($CFG)) $CFG dirroot = dirname(dirname(__FILE__))
if(!isset($CFG->dataroot)) $CFG dataroot = realpath($CFG->dataroot)
if($CFG->dataroot===false)
else if(!is_writable($CFG->
dataroot)) if(!isset($CFG->
wwwroot) or $CFG->wwwroot===
'http://example.com/moodle')
if(!isset($CFG->admin)) $CFG 
libdir = $CFG->dirroot .'/lib'
$CFG yui2version = '2.9.0'
$CFG yui3version = '3.4.1'
$DB

Used by library scripts to check they are being called by Moodle Database connection. Used for all access to the database. moodle_database $DB

global $DB
$SESSION

Moodle's wrapper round PHP's $_SESSION.

object $SESSION

global $SESSION = &$_SESSION['SESSION']
$USER

Holds the user table record for the current user. Will be the 'guest' user record for people who are not logged in.

$USER is stored in the session.

Items found in the user record:

  • $USER->email - The user's email address.
  • $USER->id - The unique integer identified of this user in the 'user' table.
  • $USER->email - The user's email address.
  • $USER->firstname - The user's first name.
  • $USER->lastname - The user's last name.
  • $USER->username - The user's login username.
  • $USER->secret - The user's ?.
  • $USER->lang - The user's language choice.

object $USER

global $USER = &$_SESSION['USER']
global $SITE
$PAGE

A central store of information about the current page we are generating in response to the user's request.

moodle_page $PAGE

global $PAGE
$COURSE

The current course. An alias for $PAGE->course. object $COURSE

global $COURSE
$OUTPUT

$OUTPUT is an instance of core_renderer or one of its subclasses. Use it to generate HTML for output.

$OUTPUT is initialised the first time it is used. See bootstrap_renderer for the magic that does that. After $OUTPUT has been initialised, any attempt to change something that affects the current theme ($PAGE->course, logged in use, httpsrequried ... will result in an exception.)

Please note the $OUTPUT is replacing the old global $THEME object.

object $OUTPUT

global $OUTPUT = new bootstrap_renderer()
$MCACHE

Shared memory cache. object $MCACHE

global $MCACHE
$FULLME

Full script path including all params, slash arguments, scheme and host.

Note: Do NOT use for getting of current page URL or detection of https, instead use $PAGE->url or strpos($CFG->httpswwwroot, 'https:') === 0

string $FULLME

global $FULLME
$ME

Script path including query string and slash arguments without host. string $ME

global $ME
$FULLSCRIPT

$FULLME without slasharguments and query string. string $FULLSCRIPT

global $FULLSCRIPT

$SCRIPT

Relative moodle script path '/course/view.php' string $SCRIPT

enum  SITEID
global $SCRIPT
$CFG config_php_settings = (array)$CFG
if(!isset($CFG->
forced_plugin_settings)) $CFG 
httpswwwroot = $CFG->wwwroot
$CFG wordlist = $CFG->libdir .'/wordlist.txt'
$CFG moddata = 'moddata'

Enumeration Type Documentation

enum SITEID
Deprecated:
Id of the frontpage course, use $SITE->id instead

Definition at line 672 of file setup.php.


Variable Documentation

global $CFG

Definition at line 45 of file setup.php.

global $COURSE

Definition at line 317 of file setup.php.

global $DB

Definition at line 267 of file setup.php.

global $FULLME

Definition at line 351 of file setup.php.

global $FULLSCRIPT

Definition at line 365 of file setup.php.

global $MCACHE

Definition at line 340 of file setup.php.

global $ME

Definition at line 358 of file setup.php.

$OUTPUT = new bootstrap_renderer()

Definition at line 333 of file setup.php.

global $PAGE

Definition at line 310 of file setup.php.

global $SCRIPT

Definition at line 372 of file setup.php.

$SESSION = &$_SESSION['SESSION']

Definition at line 275 of file setup.php.

global $SITE

Frontpage course record

Definition at line 301 of file setup.php.

$USER = &$_SESSION['USER']

Definition at line 296 of file setup.php.

$CFG config_php_settings = (array)$CFG

Definition at line 375 of file setup.php.

if (!isset($CFG->dataroot)) $CFG dataroot = realpath($CFG->dataroot)

Definition at line 69 of file setup.php.

if (!isset($CFG)) $CFG dirroot = dirname(dirname(__FILE__))

Definition at line 59 of file setup.php.

if (!isset($CFG->forced_plugin_settings)) $CFG httpswwwroot = $CFG->wwwroot

Definition at line 383 of file setup.php.

if ($CFG->dataroot===false) else if (!is_writable($CFG->dataroot)) if (!isset($CFG->wwwroot) or $CFG->wwwroot=== 'http://example.com/moodle') if (!isset($CFG->admin)) $CFG libdir = $CFG->dirroot .'/lib'

Definition at line 99 of file setup.php.

$CFG moddata = 'moddata'

Definition at line 604 of file setup.php.

$CFG wordlist = $CFG->libdir .'/wordlist.txt'

Definition at line 603 of file setup.php.

$CFG yui2version = '2.9.0'

Definition at line 225 of file setup.php.

$CFG yui3version = '3.4.1'

Definition at line 226 of file setup.php.

 All Data Structures Namespaces Files Functions Variables Enumerations