51 $ia = $this->session->getIgnoreAccess();
53 $this->session->setIgnoreAccess(
true);
55 $this->session->setIgnoreAccess(
false);
58 $ha = $this->session->getDisabledEntityVisibility();
60 $this->session->setDisabledEntityVisibility(
true);
62 $this->session->setDisabledEntityVisibility(
false);
65 $system_log_enabled = null;
66 $system_log_service = null;
69 $system_log_service = \Elgg\SystemLog\SystemLog::instance();
70 $system_log_enabled = $system_log_service->isLoggingEnabled();
72 if ($flags & ELGG_ENABLE_SYSTEM_LOG) {
73 $system_log_service->enableLogging();
74 }
elseif ($flags & ELGG_DISABLE_SYSTEM_LOG) {
75 $system_log_service->disableLogging();
77 }
catch (\DI\NotFoundException $e) {
82 $restore =
function () use ($ia, $ha, $system_log_service, $system_log_enabled) {
83 $this->session->setIgnoreAccess($ia);
84 $this->session->setDisabledEntityVisibility($ha);
86 if (isset($system_log_service)) {
87 if ($system_log_enabled) {
88 $system_log_service->enableLogging();
90 $system_log_service->disableLogging();
96 $result = $this->dic->call($closure);
97 }
catch (\Throwable $e) {
const ELGG_DISABLE_SYSTEM_LOG
const ELGG_ENFORCE_ACCESS
const ELGG_HIDE_DISABLED_ENTITIES
const ELGG_IGNORE_ACCESS
elgg_call() flags
const ELGG_SHOW_DISABLED_ENTITIES
call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags...
const ELGG_ENABLE_SYSTEM_LOG
elgg_is_active_plugin(string $plugin_id)
Returns if a plugin is active for a current site.
if(isset($_COOKIE['elggperm'])) $session
if($item instanceof\ElggEntity) elseif($item instanceof\ElggRiverItem) elseif($item instanceof ElggRelationship) elseif(is_callable([$item, 'getType']))
__construct(ElggSession $session, PublicContainer $dic)
Constructor.