ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilContext Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilContext:
+ Collaboration diagram for ilContext:

Static Public Member Functions

static init (string $a_type)
 Init context by type. More...
 
static directCall (string $a_type, string $a_method)
 Call context method directly without internal handling. More...
 
static supportsRedirects ()
 Are redirects supported? More...
 
static hasUser ()
 Based on user authentication? More...
 
static usesHTTP ()
 Uses HTTP aka browser. More...
 
static hasHTML ()
 Has HTML output. More...
 
static usesTemplate ()
 Uses template engine. More...
 
static initClient ()
 Init client. More...
 
static doAuthentication ()
 Try authentication. More...
 
static supportsPushMessages ()
 Supports push messages. More...
 
static getType ()
 Get context type. More...
 
static supportsPersistentSessions ()
 Check if context supports persistent session handling. More...
 
static isSessionMainContext ()
 Context that are not only temporary in a session (e.g. More...
 
static modifyHttpPath (string $httpPath)
 

Data Fields

const CONTEXT_WEB = ilContextWeb::class
 
const CONTEXT_CRON = ilContextCron::class
 
const CONTEXT_RSS = ilContextRss::class
 
const CONTEXT_ICAL = ilContextIcal::class
 
const CONTEXT_SOAP = ilContextSoap::class
 
const CONTEXT_SOAP_NO_AUTH = ilContextSoapNoAuth::class
 
const CONTEXT_WEBDAV = ilContextWebdav::class
 
const CONTEXT_RSS_AUTH = ilContextRssAuth::class
 
const CONTEXT_SESSION_REMINDER = ilContextSessionReminder::class
 
const CONTEXT_SOAP_WITHOUT_CLIENT = ilContextSoapWithoutClient::class
 
const CONTEXT_UNITTEST = ilContextUnitTest::class
 
const CONTEXT_REST = ilContextRest::class
 
const CONTEXT_SCORM = ilContextScorm::class
 
const CONTEXT_WAC = ilContextWAC::class
 
const CONTEXT_APACHE_SSO = ilContextApacheSSO::class
 
const CONTEXT_SHIBBOLETH = ilContextShibboleth::class
 
const CONTEXT_LTI_PROVIDER = ilContextLTIProvider::class
 
const CONTEXT_SAML = ilContextSaml::class
 

Static Protected Member Functions

static callContext (string $a_method, array $args=[])
 Call current content. More...
 

Static Protected Attributes

static string $class_name = ""
 
static string $type = ""
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Service context (factory) class

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Stefan Hecken stefa.nosp@m.n.he.nosp@m.cken@.nosp@m.conc.nosp@m.epts-.nosp@m.and-.nosp@m.train.nosp@m.ing..nosp@m.de

Definition at line 25 of file class.ilContext.php.

Member Function Documentation

◆ callContext()

static ilContext::callContext ( string  $a_method,
array  $args = [] 
)
staticprotected

Call current content.

Returns
mixed

Definition at line 78 of file class.ilContext.php.

79  {
80  if (!self::$class_name) {
81  self::init(self::CONTEXT_WEB);
82  }
83  return call_user_func_array([self::$class_name, $a_method], $args);
84  }

◆ directCall()

static ilContext::directCall ( string  $a_type,
string  $a_method 
)
static

Call context method directly without internal handling.

Returns
mixed

Definition at line 64 of file class.ilContext.php.

Referenced by ILIAS\Awareness\User\Collector\getOnlineUsers().

65  {
66  $class_name = $a_type;
67  if ($class_name && method_exists($class_name, $a_method)) {
68  return call_user_func(array($class_name, $a_method));
69  }
70 
71  return null;
72  }
static string $class_name
+ Here is the caller graph for this function:

◆ doAuthentication()

static ilContext::doAuthentication ( )
static

Try authentication.

Definition at line 149 of file class.ilContext.php.

149  : bool
150  {
151  return (bool) self::callContext("doAuthentication");
152  }

◆ getType()

◆ hasHTML()

static ilContext::hasHTML ( )
static

Has HTML output.

Definition at line 125 of file class.ilContext.php.

Referenced by ilForumAuthorInformation\getUserImagePath(), ilInitialisation\handleMaintenanceMode(), ilInitialisation\initILIAS(), ilInitialisation\redirect(), and ilBadgeHandler\sendNotification().

125  : bool
126  {
127  return (bool) self::callContext("hasHTML");
128  }
+ Here is the caller graph for this function:

◆ hasUser()

static ilContext::hasUser ( )
static

Based on user authentication?

Definition at line 109 of file class.ilContext.php.

Referenced by ilInitialisation\initHTML(), ilInitialisation\initILIAS(), and ilInitialisation\reInitUser().

109  : bool
110  {
111  return (bool) self::callContext("hasUser");
112  }
+ Here is the caller graph for this function:

◆ init()

static ilContext::init ( string  $a_type)
static

◆ initClient()

static ilContext::initClient ( )
static

Init client.

Definition at line 141 of file class.ilContext.php.

Referenced by ilInitialisation\initILIAS(), and ilInitialisation\reInitUser().

141  : bool
142  {
143  return (bool) self::callContext("initClient");
144  }
+ Here is the caller graph for this function:

◆ isSessionMainContext()

static ilContext::isSessionMainContext ( )
static

Context that are not only temporary in a session (e.g.

WAC is, Cron is not)

Definition at line 183 of file class.ilContext.php.

Referenced by ilSession\lookupExpireTime().

183  : bool
184  {
185  return (bool) self::callContext('isSessionMainContext');
186  }
+ Here is the caller graph for this function:

◆ modifyHttpPath()

static ilContext::modifyHttpPath ( string  $httpPath)
static

Definition at line 188 of file class.ilContext.php.

Referenced by ilInitialisation\buildHTTPPath(), and ilObjLTIConsumer\getIliasHttpPath().

188  : string
189  {
190  return (string) self::callContext('modifyHttpPath', [$httpPath]);
191  }
+ Here is the caller graph for this function:

◆ supportsPersistentSessions()

static ilContext::supportsPersistentSessions ( )
static

Check if context supports persistent session handling.

false for cli context

Definition at line 175 of file class.ilContext.php.

Referenced by ilInitialisation\initILIAS(), ilInitialisation\reInitUser(), and ilInitialisation\setClientIdCookie().

175  : bool
176  {
177  return (bool) self::callContext('supportsPersistentSessions');
178  }
+ Here is the caller graph for this function:

◆ supportsPushMessages()

static ilContext::supportsPushMessages ( )
static

Supports push messages.

Definition at line 157 of file class.ilContext.php.

157  : bool
158  {
159  return (bool) self::callContext("supportsPushMessages");
160  }

◆ supportsRedirects()

static ilContext::supportsRedirects ( )
static

Are redirects supported?

Definition at line 89 of file class.ilContext.php.

References $DIC.

Referenced by ILIAS\Init\StartupSequence\StartUpSequenceDispatcher\dispatch(), ilInitialisation\redirect(), and ilAuthFrontendCredentialsApache\tryAuthenticationOnLoginPage().

89  : bool
90  {
91  global $DIC;
92 
93  $ilCtrl = null;
94  if (isset($DIC["ilCtrl"])) {
95  $ilCtrl = $DIC->ctrl();
96  }
97 
98  // asynchronous calls must never be redirected
99  if ($ilCtrl && $ilCtrl->isAsynch()) {
100  return false;
101  }
102 
103  return (bool) self::callContext("supportsRedirects");
104  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ usesHTTP()

static ilContext::usesHTTP ( )
static

Uses HTTP aka browser.

Definition at line 117 of file class.ilContext.php.

Referenced by ilUtil\_getHttpPath(), ilLanguageDetectorFactory\getValidInstances(), ilInitialisation\initClient(), ilInitialisation\initSettings(), and ilInitialisation\redirect().

117  : bool
118  {
119  return (bool) self::callContext("usesHTTP");
120  }
+ Here is the caller graph for this function:

◆ usesTemplate()

static ilContext::usesTemplate ( )
static

Uses template engine.

Definition at line 133 of file class.ilContext.php.

133  : bool
134  {
135  return (bool) self::callContext("usesTemplate");
136  }

Field Documentation

◆ $class_name

string ilContext::$class_name = ""
staticprotected

Definition at line 27 of file class.ilContext.php.

◆ $type

string ilContext::$type = ""
staticprotected

Definition at line 28 of file class.ilContext.php.

◆ CONTEXT_APACHE_SSO

const ilContext::CONTEXT_APACHE_SSO = ilContextApacheSSO::class

Definition at line 44 of file class.ilContext.php.

Referenced by ilInitialisation\blockedAuthentication().

◆ CONTEXT_CRON

◆ CONTEXT_ICAL

const ilContext::CONTEXT_ICAL = ilContextIcal::class

◆ CONTEXT_LTI_PROVIDER

const ilContext::CONTEXT_LTI_PROVIDER = ilContextLTIProvider::class

◆ CONTEXT_REST

const ilContext::CONTEXT_REST = ilContextRest::class

Definition at line 41 of file class.ilContext.php.

Referenced by ilContextTest\contextProvider().

◆ CONTEXT_RSS

const ilContext::CONTEXT_RSS = ilContextRss::class

Definition at line 32 of file class.ilContext.php.

Referenced by ilContextTest\contextProvider().

◆ CONTEXT_RSS_AUTH

const ilContext::CONTEXT_RSS_AUTH = ilContextRssAuth::class

Definition at line 37 of file class.ilContext.php.

Referenced by ilContextTest\contextProvider().

◆ CONTEXT_SAML

const ilContext::CONTEXT_SAML = ilContextSaml::class

Definition at line 47 of file class.ilContext.php.

Referenced by ilInitialisation\blockedAuthentication().

◆ CONTEXT_SCORM

const ilContext::CONTEXT_SCORM = ilContextScorm::class

◆ CONTEXT_SESSION_REMINDER

const ilContext::CONTEXT_SESSION_REMINDER = ilContextSessionReminder::class

Definition at line 38 of file class.ilContext.php.

Referenced by ilContextTest\contextProvider().

◆ CONTEXT_SHIBBOLETH

const ilContext::CONTEXT_SHIBBOLETH = ilContextShibboleth::class

Definition at line 45 of file class.ilContext.php.

Referenced by ilInitialisation\blockedAuthentication().

◆ CONTEXT_SOAP

◆ CONTEXT_SOAP_NO_AUTH

const ilContext::CONTEXT_SOAP_NO_AUTH = ilContextSoapNoAuth::class

◆ CONTEXT_SOAP_WITHOUT_CLIENT

const ilContext::CONTEXT_SOAP_WITHOUT_CLIENT = ilContextSoapWithoutClient::class

Definition at line 39 of file class.ilContext.php.

Referenced by ilContextTest\contextProvider().

◆ CONTEXT_UNITTEST

const ilContext::CONTEXT_UNITTEST = ilContextUnitTest::class

Definition at line 40 of file class.ilContext.php.

Referenced by ilContextTest\contextProvider().

◆ CONTEXT_WAC

◆ CONTEXT_WEB

const ilContext::CONTEXT_WEB = ilContextWeb::class

◆ CONTEXT_WEBDAV

const ilContext::CONTEXT_WEBDAV = ilContextWebdav::class

The documentation for this class was generated from the following file: