PHP Class Elgg\Application

To run as PHP CLI server: php -S localhost:8888 /full/path/to/elgg/index.php The full path is necessary to work around this: https://bugs.php.net/bug.php?id=55726
Since: 2.0.0
Afficher le fichier Open project: elgg/elgg Class Usage Examples

Méthodes publiques

Свойство Type Description
$_instance Application Reference to the loaded Application returned by elgg()

Méthodes publiques

Méthode Description
__construct ( ServiceProvider $services ) Constructor
__get ( string $name ) : mixed Get an undefined property
bootCore ( ) : void Bootstrap the Elgg engine, loads plugins, and calls initial system events
elggDir ( ) : Elgg\Filesystem\Directory Returns a directory that points to the root of Elgg, but not necessarily the install root. See self::root() for that.
getDataPath ( ) : string Determine the Elgg data directory with trailing slash, save it to config, and return it
getDb ( ) : Database Get a Database wrapper for performing queries without booting Elgg
index ( ) : boolean Elgg's front controller. Handles basically all incoming URL requests.
install ( ) : void Renders a web UI for installing Elgg.
isTestingApplication ( ) : boolean Checks if the application is running in PHPUnit
loadCore ( ) : void Load all Elgg procedural code and wire up boot events, but don't boot
loadSettings ( ) : void Load settings.php
run ( ) : boolean Routes the request, booting core if not yet booted
setTestingApplication ( boolean $testing = true ) : void Flag this application as running for testing (PHPUnit)
start ( ) : self Start and boot the core
upgrade ( ) : void Elgg upgrade script.

Private Methods

Méthode Description
allowPathRewrite ( ) : void Allow plugins to rewrite the path.
create ( ) : self Creates a new, trivial instance of Elgg\Application and set it as the singleton instance.
setupPath ( ) : string Get the request URI and store it in $_GET['__elgg_uri']

Method Details

__construct() public méthode

Upon construction, no actions are taken to load or boot Elgg.
public __construct ( ServiceProvider $services )
$services Elgg\Di\ServiceProvider Elgg services provider

__get() public méthode

Get an undefined property
public __get ( string $name ) : mixed
$name string The property name accessed
Résultat mixed

bootCore() public méthode

This method loads the full Elgg engine, checks the installation state, and triggers a series of events to finish booting Elgg: - {@elgg_event boot system} - {@elgg_event init system} - {@elgg_event ready system} If Elgg is not fully installed, the browser will be redirected to an installation page.
public bootCore ( ) : void
Résultat void

elggDir() public static méthode

Returns a directory that points to the root of Elgg, but not necessarily the install root. See self::root() for that.
public static elggDir ( ) : Elgg\Filesystem\Directory
Résultat Elgg\Filesystem\Directory

getDataPath() public static méthode

Determine the Elgg data directory with trailing slash, save it to config, and return it
public static getDataPath ( ) : string
Résultat string

getDb() public méthode

If settings.php has not been loaded, it will be loaded to configure the DB connection.
public getDb ( ) : Database
Résultat Elgg\Application\Database

index() public static méthode

Elgg's front controller. Handles basically all incoming URL requests.
public static index ( ) : boolean
Résultat boolean True if Elgg will handle the request, false if the server should (PHP-CLI server)

install() public static méthode

Renders a web UI for installing Elgg.
public static install ( ) : void
Résultat void

isTestingApplication() public static méthode

Checks if the application is running in PHPUnit
public static isTestingApplication ( ) : boolean
Résultat boolean

loadCore() public méthode

This is used for internal testing purposes
public loadCore ( ) : void
Résultat void

loadSettings() public méthode

This is done automatically during the boot process or before requesting a database object
See also: Config::loadSettingsFile
public loadSettings ( ) : void
Résultat void

run() public méthode

Routes the request, booting core if not yet booted
public run ( ) : boolean
Résultat boolean False if Elgg wants the PHP CLI server to handle the request

setTestingApplication() public static méthode

Flag this application as running for testing (PHPUnit)
public static setTestingApplication ( boolean $testing = true ) : void
$testing boolean Is testing application
Résultat void

start() public static méthode

Start and boot the core
public static start ( ) : self
Résultat self

upgrade() public static méthode

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.
public static upgrade ( ) : void
Résultat void

Property Details

$_instance public_oe static_oe property

Reference to the loaded Application returned by elgg()
public static Application,elgg $_instance
Résultat Application