13 return \Elgg\Application::$_instance->public_services;
27 if (!
preg_match(
'~^HTTP/\\d\\.\\d~', $header)) {
44 if (!is_array($options)) {
48 $options[
'type'] =
'success';
63 if (!is_array($options)) {
67 $options[
'type'] =
'error';
116 _elgg_services()->logger->warning(
"Deprecated in {$dep_version}: {$msg}");
153 return _elgg_services()->urls->addActionTokensToUrl($url, $html_encode);
168 return _elgg_services()->urls->addQueryElementsToUrl($url, [$element => null]);
182 return _elgg_services()->urls->addQueryElementsToUrl($url, $elements);
200 return _elgg_services()->urls->isUrlIdentical($url1, $url2, (array) $ignore_params);
236 return new \Elgg\Http\Client(
$options);
255 if (!is_array($array) && !$array instanceof ArrayAccess) {
263 return (isset($array[
$key]) && !empty($array[$key])) ? $array[
$key] :
$default;
277 function elgg_extract_class(array $array, array|
string $existing = [],
string $extract_key =
'class'): array {
278 $existing = empty($existing) ? [] : (array) $existing;
280 $merge = (array)
elgg_extract($extract_key, $array, []);
282 array_splice($existing,
count($existing), 0, $merge);
284 return array_values(array_filter(array_unique($existing)));
321 $val = ini_get($setting);
324 $last = strtolower($val[
strlen($val) - 1]);
325 if (in_array($last, [
'g',
'm',
'k'])) {
326 $val =
substr($val, 0, -1);
354 return \Elgg\Application::$_instance->internal_services;
elgg_call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags...
elgg_deprecated_notice(string $msg, string $dep_version)
Log a notice about deprecated use of a function, view, etc.
if(!$user||!$user->canDelete()) $name
elgg_register_success_message(string|array $options)
Registers a success system message.
elgg_add_action_tokens_to_url(string $url, bool $html_encode=false)
Adds action tokens to URL.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
elgg()
Bootstrapping and helper procedural code available for use in Elgg core and plugins.
elgg_http_remove_url_query_element(string $url, string $element)
Removes an element from a URL's query string.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_set_http_header(string $header, bool $replace=true)
Set a response HTTP header.
if($who_can_change_language=== 'nobody') elseif($who_can_change_language=== 'admin_only'&&!elgg_is_admin_logged_in()) $options
elgg_get_ini_setting_in_bytes(string $setting)
Returns a PHP INI setting in bytes.
elgg_log($message, $level=\Psr\Log\LogLevel::NOTICE)
Log a message.
elgg_http_build_url(array $parts, bool $html_encode=true)
Builds a URL from the a parts array like one returned by parse_url().
elgg_http_add_url_query_elements(string $url, array $elements)
Sets elements in a URL's query string.
elgg_dump($value)
Logs $value to PHP's error_log().
elgg_register_error_message(string|array $options)
Registers a error system message.
elgg_http_url_is_identical(string $url1, string $url2, array $ignore_params=['offset', 'limit'])
Test if two URLs are functionally identical.
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
foreach($periods as $period) $header
foreach($plugin_guids as $guid) if(empty($deactivated_plugins)) $url
_elgg_services()
Get the global service provider.
elgg_http_validate_signed_url(string $url)
Validates if the HMAC signature of the URL is valid.
elgg_extract_class(array $array, array|string $existing=[], string $extract_key= 'class')
Extract class names from an array, optionally merging into a preexisting set.
elgg_get_http_client(array $options=[])
Returns a Guzzle HTTP client.
elgg_http_get_signed_url(string $url, string $expires=null)
Signs provided URL with a SHA256 HMAC key.