Elgg
Version 6.0
|
Go to the source code of this file.
Functions | |
elgg () | |
Bootstrapping and helper procedural code available for use in Elgg core and plugins. More... | |
elgg_set_http_header (string $header, bool $replace=true) | |
Set a response HTTP header. More... | |
elgg_register_success_message (string|array $options) | |
Registers a success system message. More... | |
elgg_register_error_message (string|array $options) | |
Registers a error system message. More... | |
elgg_log ($message, $level=\Psr\Log\LogLevel::NOTICE) | |
Log a message. More... | |
elgg_dump ($value) | |
Logs $value to PHP's error_log(). More... | |
elgg_deprecated_notice (string $msg, string $dep_version) | |
Log a notice about deprecated use of a function, view, etc. More... | |
elgg_http_build_url (array $parts, bool $html_encode=true) | |
Builds a URL from the a parts array like one returned by parse_url(). More... | |
elgg_add_action_tokens_to_url (string $url, bool $html_encode=false) | |
Adds action tokens to URL. More... | |
elgg_http_remove_url_query_element (string $url, string $element) | |
Removes an element from a URL's query string. More... | |
elgg_http_add_url_query_elements (string $url, array $elements) | |
Sets elements in a URL's query string. More... | |
elgg_http_url_is_identical (string $url1, string $url2, array $ignore_params=['offset', 'limit']) | |
Test if two URLs are functionally identical. More... | |
elgg_http_get_signed_url (string $url, string $expires=null) | |
Signs provided URL with a SHA256 HMAC key. More... | |
elgg_http_validate_signed_url (string $url) | |
Validates if the HMAC signature of the URL is valid. More... | |
elgg_get_http_client (array $options=[]) | |
Returns a Guzzle HTTP client. More... | |
elgg_extract ($key, $array, $default=null, bool $strict=true) | |
Checks for $array[$key] and returns its value if it exists, else returns $default. More... | |
elgg_extract_class (array $array, array|string $existing=[], string $extract_key= 'class') | |
Extract class names from an array, optionally merging into a preexisting set. More... | |
elgg_call (int $flags, Closure $closure) | |
Calls a callable autowiring the arguments using public DI services and applying logic based on flags. More... | |
elgg_get_ini_setting_in_bytes (string $setting) | |
Returns a PHP INI setting in bytes. More... | |
_elgg_services () | |
Get the global service provider. More... | |
_elgg_services | ( | ) |
Get the global service provider.
Definition at line 351 of file elgglib.php.
elgg | ( | ) |
Bootstrapping and helper procedural code available for use in Elgg core and plugins.
Get a reference to the public service provider
Definition at line 12 of file elgglib.php.
elgg_add_action_tokens_to_url | ( | string | $url, |
bool | $html_encode = false |
||
) |
Adds action tokens to URL.
As of 1.7.0 action tokens are required on all actions. Use this function to append action tokens to a URL's GET parameters. This will preserve any existing GET parameters.
string | $url | Full action URL |
bool | $html_encode | HTML encode the url? (default: false) |
Definition at line 152 of file elgglib.php.
elgg_call | ( | int | $flags, |
Closure | $closure | ||
) |
Calls a callable autowiring the arguments using public DI services and applying logic based on flags.
int | $flags | Bitwise flags ELGG_IGNORE_ACCESS ELGG_ENFORCE_ACCESS ELGG_SHOW_DISABLED_ENTITIES ELGG_HIDE_DISABLED_ENTITIES ELGG_DISABLE_SYSTEM_LOG ELGG_ENABLE_SYSTEM_LOG ELGG_SHOW_DELETED_ENTITIES ELGG_HIDE_DELETED_ENTITIES |
Closure | $closure | Callable to call |
Definition at line 304 of file elgglib.php.
elgg_deprecated_notice | ( | string | $msg, |
string | $dep_version | ||
) |
Log a notice about deprecated use of a function, view, etc.
string | $msg | Message to log |
string | $dep_version | Human-readable release version: 1.7, 1.8, ... |
Definition at line 115 of file elgglib.php.
elgg_dump | ( | $value | ) |
Logs $value to PHP's error_log().
A 'debug', log' event is triggered. If a handler returns false, it will stop the default logging method.
mixed | $value | The value |
Definition at line 102 of file elgglib.php.
elgg_extract | ( | $key, | |
$array, | |||
$default = null , |
|||
bool | $strict = true |
||
) |
Checks for $array[$key] and returns its value if it exists, else returns $default.
Shorthand for $value = (isset($array['key'])) ? $array['key'] : 'default';
string | int | $key | Key to check in the source array |
array | $array | Source array |
mixed | $default | Value to return if key is not found |
bool | $strict | Return array key if it's set, even if empty. If false, return $default if the array key is unset or empty. |
Definition at line 254 of file elgglib.php.
elgg_extract_class | ( | array | $array, |
array|string | $existing = [] , |
||
string | $extract_key = 'class' |
||
) |
Extract class names from an array, optionally merging into a preexisting set.
array | $array | Source array |
string|string[] | $existing Existing name(s) | |
string | $extract_key | Key to extract new classes from |
Definition at line 277 of file elgglib.php.
elgg_get_http_client | ( | array | $options = [] | ) |
Returns a Guzzle HTTP client.
array | $options | Options for the client |
Definition at line 235 of file elgglib.php.
elgg_get_ini_setting_in_bytes | ( | string | $setting | ) |
Returns a PHP INI setting in bytes.
Use this for arithmetic when determining if a file can be uploaded.
string | $setting | The php.ini setting |
Definition at line 319 of file elgglib.php.
elgg_http_add_url_query_elements | ( | string | $url, |
array | $elements | ||
) |
Sets elements in a URL's query string.
string | $url | The URL |
array | $elements | Key/value pairs to set in the URL. If the value is null, the element is removed from the URL. |
Definition at line 181 of file elgglib.php.
elgg_http_build_url | ( | array | $parts, |
bool | $html_encode = true |
||
) |
Builds a URL from the a parts array like one returned by parse_url().
array | $parts | Associative array of URL components like parse_url() returns 'user' and 'pass' parts are ignored because of security reasons |
bool | $html_encode | HTML Encode the url? |
Definition at line 131 of file elgglib.php.
elgg_http_get_signed_url | ( | string | $url, |
string | $expires = null |
||
) |
Signs provided URL with a SHA256 HMAC key.
string | $url | URL to sign |
string | $expires | Expiration time A string suitable for strtotime() Null value indicate non-expiring URL |
Definition at line 214 of file elgglib.php.
elgg_http_remove_url_query_element | ( | string | $url, |
string | $element | ||
) |
Removes an element from a URL's query string.
string | $url | Full URL |
string | $element | The element to remove |
Definition at line 167 of file elgglib.php.
elgg_http_url_is_identical | ( | string | $url1, |
string | $url2, | ||
array | $ignore_params = ['offset' , |
||
'limit'] | |||
) |
Test if two URLs are functionally identical.
If $ignore_params is used, neither the name nor its value will be considered when comparing.
The order of GET params doesn't matter.
string | $url1 | First URL |
string | $url2 | Second URL |
array | $ignore_params | GET params to ignore in the comparison |
Definition at line 199 of file elgglib.php.
elgg_http_validate_signed_url | ( | string | $url | ) |
Validates if the HMAC signature of the URL is valid.
string | $url | URL to validate |
Definition at line 224 of file elgglib.php.
elgg_log | ( | $message, | |
$level = \Psr\Log\LogLevel::NOTICE |
|||
) |
Log a message.
If $level is >= to the debug setting in ->debug, the message will be sent to elgg_dump(). Messages with lower priority than ->debug are ignored.
string | $message | User message |
string | $level | NOTICE | WARNING | ERROR |
Definition at line 86 of file elgglib.php.
elgg_register_error_message | ( | string|array | $options | ) |
Registers a error system message.
string | array | $options | a single string or an array of system message options |
Definition at line 62 of file elgglib.php.
elgg_register_success_message | ( | string|array | $options | ) |
Registers a success system message.
string | array | $options | a single string or an array of system message options |
Definition at line 43 of file elgglib.php.
elgg_set_http_header | ( | string | $header, |
bool | $replace = true |
||
) |
Set a response HTTP header.
string | $header | Header |
bool | $replace | Replace existing header |
Definition at line 26 of file elgglib.php.