13 return \Elgg\Application::$_instance->public_services;
141 return _elgg_services()->events->unregisterHandler($event, $object_type, $callback);
310 _elgg_services()->hooks->unregisterHandler($hook, $entity_type, $callback);
432 return _elgg_services()->urls->buildUrl($parts, (
bool) $html_encode);
453 return _elgg_services()->urls->addActionTokensToUrl((
string)
$url, (
bool) $html_encode);
468 return _elgg_services()->urls->addQueryElementsToUrl((
string)
$url, [(
string) $element => null]);
500 if (!is_string($url1) || !is_string($url2)) {
504 return _elgg_services()->urls->isUrlIdentical($url1, $url2, (array) $ignore_params);
548 if (!is_array($array) && !$array instanceof
ArrayAccess) {
555 return (isset($array[
$key]) && !empty($array[$key])) ? $array[
$key] :
$default;
570 $existing = empty($existing) ? [] : (array) $existing;
572 $merge = (array)
elgg_extract($extract_key, $array, []);
574 array_splice($existing,
count($existing), 0, $merge);
576 return array_values(array_unique($existing));
609 $val = ini_get($setting);
612 $last = strtolower($val[
strlen($val) - 1]);
613 if (in_array($last, [
'g',
'm',
'k'])) {
614 $val =
substr($val, 0, -1);
641 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_http_add_url_query_elements($url, array $elements)
Sets elements in a URL's query string.
elgg_unregister_plugin_hook_handler($hook, $entity_type, $callback)
Unregister a callback as a plugin hook.
elgg_add_action_tokens_to_url($url, $html_encode=false)
Adds action tokens to URL.
$params
Saves global plugin settings.
elgg_set_http_header($header, $replace=true)
Set a response HTTP header.
if(!$user||!$user->canDelete()) $name
elgg_clear_plugin_hook_handlers($hook, $type)
Clears all callback registrations for a plugin hook.
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_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
elgg_extract_class(array $array, $existing=[], $extract_key= 'class')
Extract class names from an array, optionally merging into a preexisting set.
elgg_trigger_before_event($event, $object_type, $object=null)
Trigger a "Before event" indicating a process is about to begin.
elgg_get_ini_setting_in_bytes($setting)
Returns a PHP INI setting in bytes.
elgg_http_url_is_identical($url1, $url2, $ignore_params=['offset', 'limit'])
Test if two URLs are functionally identical.
elgg_http_remove_url_query_element($url, $element)
Removes an element from a URL's query string.
elgg_log($message, $level=\Psr\Log\LogLevel::NOTICE)
Log a message.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_dump($value)
Logs $value to PHP's error_log().
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
elgg_register_error_message($options)
Registers a error system message.
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
if($email instanceof\Elgg\Email) $object
elgg_http_build_url(array $parts, $html_encode=true)
Builds a URL from the a parts array like one returned by parse_url().
foreach($plugin_guids as $guid) if(empty($deactivated_plugins)) $url
elgg_clear_event_handlers($event, $object_type)
Clears all callback registrations for a event.
_elgg_services()
Get the global service provider.
elgg_trigger_after_event($event, $object_type, $object=null)
Trigger an "After event" indicating a process has finished.
elgg_http_get_signed_url($url, $expires=false)
Signs provided URL with a SHA256 HMAC key.
elgg_register_success_message($options)
Registers a success system message.
elgg_trigger_event($event, $object_type, $object=null)
elgg_unregister_event_handler($event, $object_type, $callback)
Unregisters a callback for an event.
elgg_http_validate_signed_url($url)
Validates if the HMAC signature of the URL is valid.