ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilSessionMaxIdleIsSetObjective Class Reference
+ Inheritance diagram for ilSessionMaxIdleIsSetObjective:
+ Collaboration diagram for ilSessionMaxIdleIsSetObjective:

Public Member Functions

 __construct (protected Setup\Config $config)
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Setup\Environment $environment)
 

Private Member Functions

 generateServerInfoFile (string $filename, string $token)
 
 getCurlConnection (ilSetting $settings, string $url, ?string $token=null)
 
 getPHPIniValuesByFileGetContents (string $url, ?string $token=null)
 
 infoNoConnection (Setup\CLI\IOWrapper $io)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilSessionMaxIdleIsSetObjective::__construct ( protected Setup\Config  $config)

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

27  {
28  }

Member Function Documentation

◆ generateServerInfoFile()

ilSessionMaxIdleIsSetObjective::generateServerInfoFile ( string  $filename,
string  $token 
)
private

Definition at line 180 of file class.ilSessionMaxIdleIsSetObjective.php.

References $_GET.

Referenced by getPreconditions().

180  : void
181  {
182  $content = <<<TEXT
183 <?php
184 if (!isset(\$_GET['token'])) {
185  return "";
186 }
187 
188 if (\$_GET['token'] !== "$token") {
189  return "";
190 }
191 
192 \$scl = ini_get('session.cookie_lifetime');
193 \$smlt = ini_get('session.gc_maxlifetime');
194 
195 echo \$scl . "&" . \$smlt;
196 TEXT;
197 
198  file_put_contents("public/$filename", $content);
199  }
$_GET["client_id"]
Definition: webdav.php:30
+ Here is the caller graph for this function:

◆ getCurlConnection()

ilSessionMaxIdleIsSetObjective::getCurlConnection ( ilSetting  $settings,
string  $url,
?string  $token = null 
)
private
Exceptions
ilCurlConnectionException

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

References $token.

Referenced by getPreconditions().

205  {
206  if (!is_null($token)) {
207  $url = $url . "?token=" . $token;
208  }
209 
210  $curl = new ilCurlConnection(
211  $url,
212  new ilProxySettings($settings)
213  );
214  $curl->init();
215  $curl->setOpt(CURLOPT_SSL_VERIFYPEER, 0);
216  $curl->setOpt(CURLOPT_SSL_VERIFYHOST, 0);
217  $curl->setOpt(CURLOPT_RETURNTRANSFER, 1);
218  $curl->setOpt(CURLOPT_FOLLOWLOCATION, 1);
219  $curl->setOpt(CURLOPT_MAXREDIRS, 1);
220 
221  return $curl;
222  }
class ilProxySettings
$url
Definition: shib_logout.php:66
$token
Definition: xapitoken.php:70
+ Here is the caller graph for this function:

◆ getHash()

ilSessionMaxIdleIsSetObjective::getHash ( )

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

30  : string
31  {
32  return hash('sha256', self::class);
33  }

◆ getLabel()

ilSessionMaxIdleIsSetObjective::getLabel ( )

Definition at line 35 of file class.ilSessionMaxIdleIsSetObjective.php.

35  : string
36  {
37  return "Ensures 'session_max_idle' is set properly";
38  }

◆ getPHPIniValuesByFileGetContents()

ilSessionMaxIdleIsSetObjective::getPHPIniValuesByFileGetContents ( string  $url,
?string  $token = null 
)
private
Exceptions
ErrorException

Definition at line 227 of file class.ilSessionMaxIdleIsSetObjective.php.

References Vendor\Package\$e, $message, and $token.

Referenced by getPreconditions().

227  : string
228  {
229  set_error_handler(static function (int $severity, string $message, string $file, int $line): never {
230  throw new ErrorException($message, $severity, $severity, $file, $line);
231  });
232 
233  if (!is_null($token)) {
234  $url = $url . "?token=" . $token;
235  }
236 
237  try {
238  return file_get_contents($url);
239  } catch (ErrorException $e) {
240  restore_error_handler();
241  throw $e;
242  }
243  }
$url
Definition: shib_logout.php:66
$token
Definition: xapitoken.php:70
$message
Definition: xapiexit.php:31
+ Here is the caller graph for this function:

◆ getPreconditions()

ilSessionMaxIdleIsSetObjective::getPreconditions ( Setup\Environment  $environment)

◆ infoNoConnection()

ilSessionMaxIdleIsSetObjective::infoNoConnection ( Setup\CLI\IOWrapper  $io)
private

Definition at line 245 of file class.ilSessionMaxIdleIsSetObjective.php.

References $message.

Referenced by getPreconditions().

245  : void
246  {
247  $message =
248  "ilSessionMaxIdleIsSetObjective:\n" .
249  "Cannot establish proper connection to webserver.\n" .
250  "In the event of an installation the value for session expire\n" .
251  "will be the default value.\n" .
252  "In the event of an update, the current value for session expire\n" .
253  "is retained."
254  ;
255 
256  $io->inform($message);
257  }
$message
Definition: xapiexit.php:31
+ Here is the caller graph for this function:

◆ isNotable()

ilSessionMaxIdleIsSetObjective::isNotable ( )

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

40  : bool
41  {
42  return true;
43  }

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