ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilContext Class Reference

Service context (factory) class. More...

+ Collaboration diagram for ilContext:

Static Public Member Functions

static init ($a_type)
 Init context by type. 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 getType ()
 Get context type. More...
 

Data Fields

const CONTEXT_WEB = 1
 
const CONTEXT_CRON = 2
 
const CONTEXT_RSS = 3
 
const CONTEXT_ICAL = 4
 
const CONTEXT_SOAP = 5
 
const CONTEXT_WEBDAV = 6
 
const CONTEXT_RSS_AUTH = 7
 
const CONTEXT_WEB_ACCESS_CHECK = 8
 
const CONTEXT_SESSION_REMINDER = 9
 
const CONTEXT_SOAP_WITHOUT_CLIENT = 10
 
const CONTEXT_UNITTEST = 11
 
const CONTEXT_REST = 12
 
const CONTEXT_SCORM = 13
 
const CONTEXT_WAC = 14
 

Protected Member Functions

 getClassForType ($a_type)
 Get class name for type id. More...
 

Static Protected Member Functions

static callContext ($a_method)
 Call current content. More...
 

Static Protected Attributes

static $class_name
 
static $type
 

Detailed Description

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
Version
$Id$

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

Member Function Documentation

◆ callContext()

static ilContext::callContext (   $a_method)
staticprotected

Call current content.

Parameters
string$a_method
Returns
bool

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

113  {
114  if(!self::$class_name)
115  {
116  self::init(self::CONTEXT_WEB);
117  }
118  return call_user_func(array(self::$class_name, $a_method));
119  }

◆ doAuthentication()

static ilContext::doAuthentication ( )
static

Try authentication.

Returns
bool

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

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

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

◆ getClassForType()

ilContext::getClassForType (   $a_type)
protected

Get class name for type id.

Parameters
int$a_type
Returns
string

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

59  {
60  switch($a_type)
61  {
62  case self::CONTEXT_WEB:
63  return "ilContextWeb";
64 
65  case self::CONTEXT_CRON:
66  return "ilContextCron";
67 
68  case self::CONTEXT_RSS:
69  return "ilContextRss";
70 
71  case self::CONTEXT_ICAL:
72  return "ilContextIcal";
73 
74  case self::CONTEXT_SOAP:
75  return "ilContextSoap";
76 
77  case self::CONTEXT_WEBDAV:
78  return "ilContextWebdav";
79 
80  case self::CONTEXT_RSS_AUTH:
81  return "ilContextRssAuth";
82 
83  case self::CONTEXT_WEB_ACCESS_CHECK:
84  return "ilContextWebAccessCheck";
85 
86  case self::CONTEXT_SESSION_REMINDER:
87  return "ilContextSessionReminder";
88 
89  case self::CONTEXT_SOAP_WITHOUT_CLIENT:
90  return "ilContextSoapWithoutClient";
91 
92  case self::CONTEXT_UNITTEST:
93  return "ilContextUnitTest";
94 
95  case self::CONTEXT_REST:
96  return 'ilContextRest';
97 
98  case self::CONTEXT_SCORM:
99  return 'ilContextScorm';
100 
101  case self::CONTEXT_WAC:
102  return 'ilContextWAC';
103  }
104  }

◆ getType()

static ilContext::getType ( )
static

Get context type.

Returns
int

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

Referenced by ilAuthContainerMDB2\__construct(), ilFileDelivery\__construct(), ilInitialisation\authenticate(), ilSoapAdministration\initIlias(), ilLoggerFactory\isConsoleAvailable(), ilMail\isSOAPEnabled(), and ilECSTaskScheduler\start().

205  {
206  return self::$type;
207  }
+ Here is the caller graph for this function:

◆ hasHTML()

static ilContext::hasHTML ( )
static

Has HTML output.

Returns
bool

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

Referenced by ilInitialisation\handleMaintenanceMode(), ilInitialisation\initILIAS(), and ilInitialisation\redirect().

165  {
166  return (bool)self::callContext("hasHTML");
167  }
+ Here is the caller graph for this function:

◆ hasUser()

static ilContext::hasUser ( )
static

Based on user authentication?

Returns
bool

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

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

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

◆ init()

static ilContext::init (   $a_type)
static

Init context by type.

Parameters
int$a_type
Returns
bool

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

References $class_name.

Referenced by ilSoapAdministration\getClientInfoXML(), ilSoapAdministration\getInstallationInfoXML(), ilCalendarRemoteAccessHandler\initIlias(), and ilWebAccessChecker\initILIAS().

40  {
41  $class_name = self::getClassForType($a_type);
42  if($class_name)
43  {
44  include_once "Services/Context/classes/class.".$class_name.".php";
45  self::$class_name = $class_name;
46  self::$type = $a_type;
47  return true;
48  }
49  return false;
50  }
static $class_name
+ Here is the caller graph for this function:

◆ initClient()

static ilContext::initClient ( )
static

Init client.

Returns
bool

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

Referenced by ilInitialisation\initILIAS().

185  {
186  return (bool)self::callContext("initClient");
187  }
+ Here is the caller graph for this function:

◆ supportsRedirects()

static ilContext::supportsRedirects ( )
static

Are redirects supported?

Returns
bool

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

References $ilCtrl.

Referenced by ilUserRequestTargetAdjustment\adjust(), ilAuthApache\login(), and ilInitialisation\redirect().

127  {
128  global $ilCtrl;
129 
130  // asynchronous calls must never be redirected
131  if($ilCtrl && $ilCtrl->isAsynch())
132  {
133  return false;
134  }
135 
136  return (bool)self::callContext("supportsRedirects");
137  }
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 154 of file class.ilContext.php.

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

155  {
156  return (bool)self::callContext("usesHTTP");
157  }
+ Here is the caller graph for this function:

◆ usesTemplate()

static ilContext::usesTemplate ( )
static

Uses template engine.

Returns
bool

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

Referenced by ilInitialisation\requireCommonIncludes().

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

Field Documentation

◆ $class_name

ilContext::$class_name
staticprotected

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

Referenced by init().

◆ $type

ilContext::$type
staticprotected

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

◆ CONTEXT_CRON

const ilContext::CONTEXT_CRON = 2

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

Referenced by ilMail\isSOAPEnabled().

◆ CONTEXT_ICAL

const ilContext::CONTEXT_ICAL = 4

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

Referenced by ilCalendarRemoteAccessHandler\initIlias().

◆ CONTEXT_REST

const ilContext::CONTEXT_REST = 12

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

◆ CONTEXT_RSS

const ilContext::CONTEXT_RSS = 3

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

◆ CONTEXT_RSS_AUTH

const ilContext::CONTEXT_RSS_AUTH = 7

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

◆ CONTEXT_SCORM

const ilContext::CONTEXT_SCORM = 13

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

◆ CONTEXT_SESSION_REMINDER

const ilContext::CONTEXT_SESSION_REMINDER = 9

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

◆ CONTEXT_SOAP

const ilContext::CONTEXT_SOAP = 5

◆ CONTEXT_SOAP_WITHOUT_CLIENT

const ilContext::CONTEXT_SOAP_WITHOUT_CLIENT = 10

◆ CONTEXT_UNITTEST

const ilContext::CONTEXT_UNITTEST = 11

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

◆ CONTEXT_WAC

const ilContext::CONTEXT_WAC = 14

◆ CONTEXT_WEB

const ilContext::CONTEXT_WEB = 1

◆ CONTEXT_WEB_ACCESS_CHECK

const ilContext::CONTEXT_WEB_ACCESS_CHECK = 8

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

◆ CONTEXT_WEBDAV

const ilContext::CONTEXT_WEBDAV = 6

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


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