PHP Класс 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
С версии: 2.0.0
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$_instance Application Reference to the loaded Application returned by elgg()

Открытые методы

Метод Описание
__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.

Приватные методы

Метод Описание
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']

Описание методов

__construct() публичный Метод

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

__get() публичный Метод

Get an undefined property
public __get ( string $name ) : mixed
$name string The property name accessed
Результат mixed

bootCore() публичный Метод

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
Результат void

elggDir() публичный статический Метод

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
Результат Elgg\Filesystem\Directory

getDataPath() публичный статический Метод

Determine the Elgg data directory with trailing slash, save it to config, and return it
public static getDataPath ( ) : string
Результат string

getDb() публичный Метод

If settings.php has not been loaded, it will be loaded to configure the DB connection.
public getDb ( ) : Database
Результат Elgg\Application\Database

index() публичный статический Метод

Elgg's front controller. Handles basically all incoming URL requests.
public static index ( ) : boolean
Результат boolean True if Elgg will handle the request, false if the server should (PHP-CLI server)

install() публичный статический Метод

Renders a web UI for installing Elgg.
public static install ( ) : void
Результат void

isTestingApplication() публичный статический Метод

Checks if the application is running in PHPUnit
public static isTestingApplication ( ) : boolean
Результат boolean

loadCore() публичный Метод

This is used for internal testing purposes
public loadCore ( ) : void
Результат void

loadSettings() публичный Метод

This is done automatically during the boot process or before requesting a database object
См. также: Config::loadSettingsFile
public loadSettings ( ) : void
Результат void

run() публичный Метод

Routes the request, booting core if not yet booted
public run ( ) : boolean
Результат boolean False if Elgg wants the PHP CLI server to handle the request

setTestingApplication() публичный статический Метод

Flag this application as running for testing (PHPUnit)
public static setTestingApplication ( boolean $testing = true ) : void
$testing boolean Is testing application
Результат void

start() публичный статический Метод

Start and boot the core
public static start ( ) : self
Результат self

upgrade() публичный статический Метод

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
Результат void

Описание свойств

$_instance публичное статическое свойство

Reference to the loaded Application returned by elgg()
public static Application,elgg $_instance
Результат Application