ILIAS  release_7 Revision v7.30-3-g800a261c036
ilContext Class Reference

Service context (factory) class. More...

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

Static Public Member Functions

static init ($a_type)
 Init context by type. More...
 
static directCall ($a_type, $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"
 
const CONTEXT_CRON = "ilContextCron"
 
const CONTEXT_RSS = "ilContextRss"
 
const CONTEXT_ICAL = "ilContextIcal"
 
const CONTEXT_SOAP = "ilContextSoap"
 
const CONTEXT_SOAP_NO_AUTH = 'ilContextSoapNoAuth'
 
const CONTEXT_WEBDAV = "ilContextWebdav"
 
const CONTEXT_RSS_AUTH = "ilContextRssAuth"
 
const CONTEXT_SESSION_REMINDER = "ilContextSessionReminder"
 
const CONTEXT_SOAP_WITHOUT_CLIENT = "ilContextSoapWithoutClient"
 
const CONTEXT_UNITTEST = "ilContextUnitTest"
 
const CONTEXT_REST = "ilContextRest"
 
const CONTEXT_SCORM = "ilContextScorm"
 
const CONTEXT_WAC = "ilContextWAC"
 
const CONTEXT_APACHE_SSO = 'ilContextApacheSSO'
 
const CONTEXT_SHIBBOLETH = 'ilContextShibboleth'
 
const CONTEXT_LTI_PROVIDER = 'ilContextLTIProvider'
 
const CONTEXT_SAML = 'ilContextSaml'
 

Static Protected Member Functions

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

Static Protected Attributes

static $class_name
 
static $type
 

Detailed Description

Member Function Documentation

◆ callContext()

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

Call current content.

Parameters
string$a_method
array$args
Returns
mixed

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

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

◆ directCall()

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

Call context method directly without internal handling.

Parameters
int$a_type
Returns
mixed

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

References $class_name.

Referenced by ilAwarenessUserCollector\getOnlineUsers().

61  {
62  $class_name = $a_type;
63  if ($class_name) {
64  include_once "Services/Context/classes/class." . $class_name . ".php";
65  if (method_exists($class_name, $a_method)) {
66  return call_user_func(array($class_name, $a_method));
67  }
68  }
69  }
static $class_name
+ Here is the caller graph for this function:

◆ doAuthentication()

static ilContext::doAuthentication ( )
static

Try authentication.

Returns
bool

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

164  {
165  return (bool) self::callContext("doAuthentication");
166  }

◆ getType()

◆ hasHTML()

static ilContext::hasHTML ( )
static

Has HTML output.

Returns
bool

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

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

134  {
135  return (bool) self::callContext("hasHTML");
136  }
+ Here is the caller graph for this function:

◆ hasUser()

static ilContext::hasUser ( )
static

Based on user authentication?

Returns
bool

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

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

114  {
115  return (bool) self::callContext("hasUser");
116  }
+ Here is the caller graph for this function:

◆ init()

static ilContext::init (   $a_type)
static

Init context by type.

Parameters
string$a_type
Returns
bool

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

References $type.

Referenced by ilSoapFunctions\__call(), ilCronStartUp\__construct(), ilWebAccessChecker\addAppliedCheckingMethod(), ilSoapAdministration\getClientInfoXML(), ilSoapAdministration\getInstallationInfoXML(), ilNusoapUserAdministrationAdapter\handleSoapPlugins(), XapiProxy\DataService\initIlias(), LTI\ilLTIConsumerDataService\initIlias(), ilCalendarRemoteAccessHandler\initIlias(), ilWebAccessChecker\initILIAS(), ILIAS\GlobalScreen\Client\ContentRenderer\run(), and ilContextTest\testInit().

46  {
47  include_once "Services/Context/classes/class." . $a_type . ".php";
48  self::$class_name = $a_type;
49  self::$type = $a_type;
50 
51  return true;
52  }
$type
+ Here is the caller graph for this function:

◆ initClient()

static ilContext::initClient ( )
static

Init client.

Returns
bool

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

Referenced by ilInitialisation\initILIAS().

154  {
155  return (bool) self::callContext("initClient");
156  }
+ 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)

Returns
bool

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

Referenced by ilSession\_writeData().

206  {
207  return (bool) self::callContext('isSessionMainContext');
208  }
+ Here is the caller graph for this function:

◆ modifyHttpPath()

static ilContext::modifyHttpPath ( string  $httpPath)
static
Parameters
string$httpPath
Returns
string

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

Referenced by ilInitialisation\buildHTTPPath().

214  : string
215  {
216  return self::callContext('modifyHttpPath', [$httpPath]);
217  }
+ Here is the caller graph for this function:

◆ supportsPersistentSessions()

static ilContext::supportsPersistentSessions ( )
static

Check if context supports persistent session handling.

false for cli context

Returns
bool

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

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

196  {
197  return (bool) self::callContext('supportsPersistentSessions');
198  }
+ Here is the caller graph for this function:

◆ supportsPushMessages()

static ilContext::supportsPushMessages ( )
static

Supports push messages.

Returns
bool

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

174  {
175  return (bool) self::callContext("supportsPushMessages");
176  }

◆ supportsRedirects()

static ilContext::supportsRedirects ( )
static

Are redirects supported?

Returns
bool

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

References $DIC.

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

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

◆ usesHTTP()

static ilContext::usesHTTP ( )
static

Uses HTTP aka browser.

Returns
bool

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

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

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

◆ usesTemplate()

static ilContext::usesTemplate ( )
static

Uses template engine.

Returns
bool

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

Referenced by ilInitialisation\requireCommonIncludes().

144  {
145  return (bool) self::callContext("usesTemplate");
146  }
+ Here is the caller graph for this function:

Field Documentation

◆ $class_name

ilContext::$class_name
staticprotected

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

Referenced by directCall().

◆ $type

ilContext::$type
staticprotected

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

◆ CONTEXT_APACHE_SSO

const ilContext::CONTEXT_APACHE_SSO = 'ilContextApacheSSO'

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

Referenced by ilInitialisation\blockedAuthentication().

◆ CONTEXT_CRON

const ilContext::CONTEXT_CRON = "ilContextCron"

◆ CONTEXT_ICAL

const ilContext::CONTEXT_ICAL = "ilContextIcal"

◆ CONTEXT_LTI_PROVIDER

const ilContext::CONTEXT_LTI_PROVIDER = 'ilContextLTIProvider'

◆ CONTEXT_REST

const ilContext::CONTEXT_REST = "ilContextRest"

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

Referenced by ilContextTest\contextProvider().

◆ CONTEXT_RSS

const ilContext::CONTEXT_RSS = "ilContextRss"

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

Referenced by ilContextTest\contextProvider().

◆ CONTEXT_RSS_AUTH

const ilContext::CONTEXT_RSS_AUTH = "ilContextRssAuth"

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

Referenced by ilContextTest\contextProvider().

◆ CONTEXT_SAML

const ilContext::CONTEXT_SAML = 'ilContextSaml'

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

Referenced by ilInitialisation\blockedAuthentication().

◆ CONTEXT_SCORM

const ilContext::CONTEXT_SCORM = "ilContextScorm"

◆ CONTEXT_SESSION_REMINDER

const ilContext::CONTEXT_SESSION_REMINDER = "ilContextSessionReminder"

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

Referenced by ilContextTest\contextProvider().

◆ CONTEXT_SHIBBOLETH

const ilContext::CONTEXT_SHIBBOLETH = 'ilContextShibboleth'

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

Referenced by ilInitialisation\blockedAuthentication().

◆ CONTEXT_SOAP

◆ CONTEXT_SOAP_NO_AUTH

const ilContext::CONTEXT_SOAP_NO_AUTH = 'ilContextSoapNoAuth'

◆ CONTEXT_SOAP_WITHOUT_CLIENT

const ilContext::CONTEXT_SOAP_WITHOUT_CLIENT = "ilContextSoapWithoutClient"

◆ CONTEXT_UNITTEST

const ilContext::CONTEXT_UNITTEST = "ilContextUnitTest"

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

Referenced by ilContextTest\contextProvider().

◆ CONTEXT_WAC

◆ CONTEXT_WEB

const ilContext::CONTEXT_WEB = "ilContextWeb"

◆ CONTEXT_WEBDAV

const ilContext::CONTEXT_WEBDAV = "ilContextWebdav"

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