ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\Init\StartupSequence\StartUpSequenceDispatcher Class Reference
+ Collaboration diagram for ILIAS\Init\StartupSequence\StartUpSequenceDispatcher:

Public Member Functions

 __construct (Container $dic)
 
 dispatch ()
 

Protected Member Functions

 initSequence ()
 
 storeRequest ()
 

Private Attributes

Container $dic
 
 $sequence = []
 

Detailed Description

Definition at line 39 of file StartUpSequenceDispatcher.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Init\StartupSequence\StartUpSequenceDispatcher::__construct ( Container  $dic)

Member Function Documentation

◆ dispatch()

ILIAS\Init\StartupSequence\StartUpSequenceDispatcher::dispatch ( )
Returns
bool

Definition at line 92 of file StartUpSequenceDispatcher.php.

References $_SERVER, ILIAS\Init\StartupSequence\StartUpSequenceLayoutProvider\FORCED_STARTUP_STEP, ilSession\get(), ilSession\set(), ILIAS\Init\StartupSequence\StartUpSequenceDispatcher\storeRequest(), and ilContext\supportsRedirects().

92  : bool
93  {
94  $this->dic->logger()->init()->debug('Started request interception checks ...');
95 
96  if (defined('IL_CERT_SSO')) {
97  $this->dic->logger()->init()->debug('ApacheAuthentication request. No interception.');
98  return false;
99  } elseif (!ilContext::supportsRedirects()) {
100  $this->dic->logger()->init()->debug('Context does not support redirects. No interception.');
101  return false;
102  } elseif ($this->dic->ctrl()->isAsynch()) {
103  $this->dic->logger()->init()->debug('Async request. No interception.');
104  return false;
105  } elseif (in_array(basename($_SERVER['PHP_SELF']), array('logout.php'))) {
106  $this->dic->logger()->init()->debug('Logout request. No interception.');
107  return false;
108  } elseif (!$this->dic->user()->getId() || $this->dic->user()->isAnonymous()) {
109  $this->dic->logger()->init()->debug('Anonymous request. No interception.');
110  return false;
111  } elseif (ilSession::get(__CLASS__ . '_passed')) {
112  $this->dic->logger()->init()->debug(__CLASS__ . ' already passed in the current user session.');
113  return false;
114  }
115 
116  $this->sequence->rewind();
117  while (!$this->sequence->isEmpty()) {
118  $step = $this->sequence->shift();
119 
120  if ($step->isInFulfillment()) {
121  $this->dic->globalScreen()->tool()->context()->current()->addAdditionalData(
123  true
124  );
125 
126  $this->dic->logger()->init()->debug('Step is in fulfillment:' . get_class($step));
127  return false;
128  }
129 
130  if ($step->shouldInterceptRequest()) {
131  $this->dic->logger()->init()->debug('Step required adjustment:' . get_class($step));
132  if ($step->shouldStoreRequestTarget()) {
133  $this->storeRequest();
134  }
135  $step->execute();
136  return true;
137  }
138  }
139 
140  ilSession::set(__CLASS__ . '_passed', 1);
141  return false;
142  }
static get(string $a_var)
Class ChatMainBarProvider .
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
static set(string $a_var, $a_val)
Set a value.
static supportsRedirects()
Are redirects supported?
+ Here is the call graph for this function:

◆ initSequence()

ILIAS\Init\StartupSequence\StartUpSequenceDispatcher::initSequence ( )
protected

Definition at line 51 of file StartUpSequenceDispatcher.php.

Referenced by ILIAS\Init\StartupSequence\StartUpSequenceDispatcher\__construct().

51  : void
52  {
53  $this->sequence = new SplQueue();
54  $this->sequence->push(new StartUpStep(
55  $this->dic->ctrl(),
56  $this->dic['legalDocuments']
57  ));
58  $this->sequence->push(new ilUserProfileStartUpStep(
59  $this->dic->user(),
60  $this->dic->ctrl()
61  ));
62  $this->sequence->push(new ilForcedUserPasswordChangeStartUpStep(
63  $this->dic->user(),
64  $this->dic->ctrl(),
65  $this->dic->http()->request()
66  ));
67  }
+ Here is the caller graph for this function:

◆ storeRequest()

ILIAS\Init\StartupSequence\StartUpSequenceDispatcher::storeRequest ( )
protected

Definition at line 69 of file StartUpSequenceDispatcher.php.

References $_SERVER, $url, ilSession\get(), ilSession\set(), and ILIAS\StaticURL\Builder\StandardURIBuilder\SHORT.

Referenced by ILIAS\Init\StartupSequence\StartUpSequenceDispatcher\dispatch().

69  : void
70  {
71  if (!ilSession::get('orig_request_target')) {
72  //#16324 don't use the complete REQUEST_URI
73 
74  $url = $_SERVER['REQUEST_URI'];
75  $short = strpos($url, StandardURIBuilder::SHORT);
76 
77  if (preg_match('@/([^/]+\\.php[?/].*)$@', $url, $matches)) {
78  $url = $matches[1];
79  } elseif ($short !== false) {
80  $url = substr($url, $short + 1);
81  } else {
82  $url = substr($url, strrpos($url, '/') + 1);
83  }
84 
85  ilSession::set('orig_request_target', $url);
86  }
87  }
static get(string $a_var)
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
$url
Definition: ltiregstart.php:35
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $dic

Container ILIAS\Init\StartupSequence\StartUpSequenceDispatcher::$dic
private

◆ $sequence

ILIAS\Init\StartupSequence\StartUpSequenceDispatcher::$sequence = []
private

Definition at line 43 of file StartUpSequenceDispatcher.php.


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