ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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...
 

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)
 Call current content. More...
 

Static Protected Attributes

static $class_name
 
static $type
 

Detailed Description

Member Function Documentation

◆ callContext()

static ilContext::callContext (   $a_method)
staticprotected

Call current content.

Parameters
string$a_method
Returns
bool

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

References init().

78  {
79  if (!self::$class_name) {
80  self::init(self::CONTEXT_WEB);
81  }
82  return call_user_func(array(self::$class_name, $a_method));
83  }
while(count($oldTaskList) > 0) foreach(array_keys($newTaskList) as $task) init()
Definition: build.php:77
+ Here is the call graph for this function:

◆ 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 $a_type, and $class_name.

Referenced by ilAwarenessUserCollector\getOnlineUsers().

61  {
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  }
$a_type
Definition: workflow.php:92
static $class_name
+ Here is the caller graph for this function:

◆ doAuthentication()

static ilContext::doAuthentication ( )
static

Try authentication.

Returns
bool

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

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

◆ getType()

◆ hasHTML()

static ilContext::hasHTML ( )
static

Has HTML output.

Returns
bool

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

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

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

◆ hasUser()

static ilContext::hasUser ( )
static

Based on user authentication?

Returns
bool

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

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

113  {
114  return (bool) self::callContext("hasUser");
115  }
+ 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 $a_type, and $type.

Referenced by ilSoapFunctions\__call(), ilCronStartUp\__construct(), ilWebAccessChecker\addAppliedCheckingMethod(), ilSoapAdministration\getClientInfoXML(), ilSoapAdministration\getInstallationInfoXML(), ilNusoapUserAdministrationAdapter\handleSoapPlugins(), ilCalendarRemoteAccessHandler\initIlias(), ilWebAccessChecker\initILIAS(), and ilContextTest\testInit().

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

◆ initClient()

static ilContext::initClient ( )
static

Init client.

Returns
bool

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

Referenced by ilInitialisation\initILIAS().

153  {
154  return (bool) self::callContext("initClient");
155  }
+ 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 204 of file class.ilContext.php.

Referenced by ilSession\_writeData().

205  {
206  return (bool) self::callContext('isSessionMainContext');
207  }
+ 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 194 of file class.ilContext.php.

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

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

◆ supportsPushMessages()

static ilContext::supportsPushMessages ( )
static

Supports push messages.

Returns
bool

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

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

◆ supportsRedirects()

static ilContext::supportsRedirects ( )
static

Are redirects supported?

Returns
bool

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

References $DIC, and $ilCtrl.

Referenced by ilUserRequestTargetAdjustment\adjust(), ilInitialisation\redirect(), and ilAuthFrontendCredentialsApache\tryAuthenticationOnLoginPage().

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

◆ usesHTTP()

static ilContext::usesHTTP ( )
static

Uses HTTP aka browser.

Returns
bool

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

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

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

◆ usesTemplate()

static ilContext::usesTemplate ( )
static

Uses template engine.

Returns
bool

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

Referenced by ilInitialisation\requireCommonIncludes().

143  {
144  return (bool) self::callContext("usesTemplate");
145  }
+ 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'

◆ 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'

◆ CONTEXT_SCORM

const ilContext::CONTEXT_SCORM = "ilContextScorm"

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

Referenced by ilContextTest\contextProvider().

◆ 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: