Elgg  Version 2.3
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Elgg\Application Class Reference

Public Member Functions

 __construct (ServiceProvider $services)
 Constructor. More...
 
 loadSettings ()
 Load settings.php. More...
 
 loadCore ()
 Load all Elgg procedural code and wire up boot events, but don't boot. More...
 
 bootCore ()
 Bootstrap the Elgg engine, loads plugins, and calls initial system events. More...
 
 getDb ()
 Get a Database wrapper for performing queries without booting Elgg. More...
 
 __get ($name)
 Get an undefined property. More...
 
 run ()
 Routes the request, booting core if not yet booted. More...
 

Static Public Member Functions

static start ()
 Replacement for loading engine/start.php. More...
 
static index ()
 Elgg's front controller. More...
 
static getDataPath ()
 Determine the Elgg data directory with trailing slash, save it to config, and return it. More...
 
static elggDir ()
 Returns a directory that points to the root of Elgg, but not necessarily the install root. More...
 
static install ()
 Renders a web UI for installing Elgg. More...
 
static upgrade ()
 Elgg upgrade script. More...
 
static setTestingApplication ($testing=true)
 Flag this application as running for testing (PHPUnit) More...
 
static isTestingApplication ()
 Checks if the application is running in PHPUnit. More...
 

Public Attributes

const GET_PATH_KEY = '__elgg_uri'
 
const REWRITE_TEST_TOKEN = '__testing_rewrite'
 
const REWRITE_TEST_OUTPUT = 'success'
 

Static Public Attributes

static static $_instance
 Reference to the loaded Application returned by elgg() More...
 

Detailed Description

Definition at line 21 of file Application.php.

Constructor & Destructor Documentation

Elgg\Application::__construct ( ServiceProvider  $services)

Constructor.

Upon construction, no actions are taken to load or boot Elgg.

Parameters
ServiceProvider$servicesElgg services provider

The time with microseconds when the Elgg engine was started.

float

This was introduced in 2.0 in order to remove all internal non-API state from $CONFIG. This will be a breaking change, but frees us to refactor in 2.x without fear of plugins depending on $CONFIG.

private

Definition at line 72 of file Application.php.

Member Function Documentation

Elgg\Application::__get (   $name)

Get an undefined property.

Parameters
string$nameThe property name accessed
Returns
mixed

Definition at line 348 of file Application.php.

Elgg\Application::bootCore ( )

Bootstrap the Elgg engine, loads plugins, and calls initial system events.

This method loads the full Elgg engine, checks the installation state, and triggers a series of events to finish booting Elgg:

  • { boot system}
  • { init system}
  • { ready system}

If Elgg is not fully installed, the browser will be redirected to an installation page.

Returns
void

Definition at line 241 of file Application.php.

static Elgg\Application::elggDir ( )
static

Returns a directory that points to the root of Elgg, but not necessarily the install root.

See self::root() for that.

Returns
Directory

Definition at line 472 of file Application.php.

static Elgg\Application::getDataPath ( )
static

Determine the Elgg data directory with trailing slash, save it to config, and return it.

Returns
string
Exceptions

Definition at line 449 of file Application.php.

Elgg\Application::getDb ( )

Get a Database wrapper for performing queries without booting Elgg.

If settings.php has not been loaded, it will be loaded to configure the DB connection.

Note
Do not type hint on , as this will fail in 3.0. If you must type hint, expect an .
Before boot, the Database instance will not yet be bound to a Logger.
Returns

Definition at line 336 of file Application.php.

static Elgg\Application::index ( )
static

Elgg's front controller.

Handles basically all incoming URL requests.

Returns
bool True if Elgg will handle the request, false if the server should (PHP-CLI server)

Definition at line 383 of file Application.php.

static Elgg\Application::install ( )
static

Renders a web UI for installing Elgg.

Returns
void

Definition at line 481 of file Application.php.

static Elgg\Application::isTestingApplication ( )
static

Checks if the application is running in PHPUnit.

Returns
bool

Definition at line 621 of file Application.php.

Elgg\Application::loadCore ( )

Load all Elgg procedural code and wire up boot events, but don't boot.

This is used for internal testing purposes

Returns
void private

Definition at line 121 of file Application.php.

Elgg\Application::loadSettings ( )

Load settings.php.

This is done automatically during the boot process or before requesting a database object

See also
Config::loadSettingsFile
Returns
void

Definition at line 108 of file Application.php.

Elgg\Application::run ( )

Routes the request, booting core if not yet booted.

Returns
bool False if Elgg wants the PHP CLI server to handle the request

Definition at line 392 of file Application.php.

static Elgg\Application::setTestingApplication (   $testing = true)
static

Flag this application as running for testing (PHPUnit)

Parameters
bool$testingIs testing application
Returns
void

Definition at line 613 of file Application.php.

static Elgg\Application::start ( )
static

Replacement for loading engine/start.php.

Returns
self

Definition at line 222 of file Application.php.

static Elgg\Application::upgrade ( )
static

Elgg upgrade script.

This script triggers any necessary upgrades. If the site has been upgraded to the most recent version of the code, no upgrades are run but the caches are flushed.

Upgrades use a table {db_prefix}upgrade_lock as a mutex to prevent concurrent upgrades.

The URL to forward to after upgrades are complete can be specified by setting $_GET['forward'] to a relative URL.

Returns
void

Definition at line 502 of file Application.php.

Member Data Documentation

static Elgg\Application::$_instance
static
Initial value:
=> true,
]

Reference to the loaded Application returned by elgg()

Definition at line 53 of file Application.php.

const Elgg\Application::GET_PATH_KEY = '__elgg_uri'

Definition at line 23 of file Application.php.

const Elgg\Application::REWRITE_TEST_OUTPUT = 'success'

Definition at line 25 of file Application.php.

const Elgg\Application::REWRITE_TEST_TOKEN = '__testing_rewrite'

Definition at line 24 of file Application.php.


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