ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\FileDelivery\Setup\DeliveryMethodObjective Class Reference
+ Inheritance diagram for ILIAS\FileDelivery\Setup\DeliveryMethodObjective:
+ Collaboration diagram for ILIAS\FileDelivery\Setup\DeliveryMethodObjective:

Public Member Functions

 getArtifactName ()
 
 build ()
 
 isApplicable (Environment $environment)
 Get to know whether the objective is applicable. More...
 
- Public Member Functions inherited from ILIAS\Setup\Artifact\BuildArtifactObjective
 getArtifactName ()
 Get the filename where the builder wants to put its artifact. More...
 
 build ()
 Build the artifact based. More...
 
 buildIn (Setup\Environment $env)
 Builds an artifact in some given Environment. More...
 
 getPreconditions (Setup\Environment $environment)
 Defaults to no preconditions. More...
 
 getHash ()
 Uses hashed Path. More...
 
 getLabel ()
 Defaults to 'Build ' . More...
 
 isNotable ()
 Defaults to 'true'. More...
 
 achieve (Setup\Environment $environment)
 Builds the artifact and puts it in its location. More...
 
 isApplicable (Setup\Environment $environment)
 
- Public Member Functions inherited from ILIAS\Setup\Objective
 getPreconditions (Environment $environment)
 Objectives might depend on other objectives. More...
 
 achieve (Environment $environment)
 Objectives can be achieved. More...
 

Data Fields

const SETTINGS = 'delivery_method'
 
const XSENDFILE = 'xsendfile'
 
const XACCEL = 'xaccel'
 
const PHP = 'php'
 

Private Member Functions

 isModXSendFileLoaded ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ILIAS\Setup\Artifact\BuildArtifactObjective
static PATH ()
 
- Protected Member Functions inherited from ILIAS\Setup\Artifact\BuildArtifactObjective
 getPath ()
 
 makeDirectoryFor (string $path)
 
- Protected Attributes inherited from ILIAS\Setup\Artifact\BuildArtifactObjective
const ARTIFACTS = __DIR__ . "/../../../../../artifacts"
 

Detailed Description

Member Function Documentation

◆ build()

ILIAS\FileDelivery\Setup\DeliveryMethodObjective::build ( )

Definition at line 45 of file DeliveryMethodObjective.php.

References ILIAS\FileDelivery\Setup\DeliveryMethodObjective\isModXSendFileLoaded().

45  : Artifact
46  {
47  // check if mod_xsendfile is loaded
48  if ($this->isModXSendFileLoaded()) {
49  return new ArrayArtifact([
50  self::SETTINGS => self::XSENDFILE
51  ]);
52  }
53 
54  return new ArrayArtifact([
55  self::SETTINGS => self::PHP
56  ]);
57  }
+ Here is the call graph for this function:

◆ getArtifactName()

ILIAS\FileDelivery\Setup\DeliveryMethodObjective::getArtifactName ( )

Definition at line 38 of file DeliveryMethodObjective.php.

38  : string
39  {
40  return "delivery_method";
41  }

◆ isApplicable()

ILIAS\FileDelivery\Setup\DeliveryMethodObjective::isApplicable ( Environment  $environment)

Get to know whether the objective is applicable.

Don't change the environment or cause changes on services in the environment. Just check if this objective needs to be achieved, either currently or at all. In case of doubt whether the objective is applicable or not return true.

Implements ILIAS\Setup\Objective.

Definition at line 79 of file DeliveryMethodObjective.php.

References ILIAS\Setup\Artifact\BuildArtifactObjective\PATH().

79  : bool
80  {
81  return !file_exists(BuildArtifactObjective::PATH());
82  }
+ Here is the call graph for this function:

◆ isModXSendFileLoaded()

ILIAS\FileDelivery\Setup\DeliveryMethodObjective::isModXSendFileLoaded ( )
private

Definition at line 59 of file DeliveryMethodObjective.php.

References null.

Referenced by ILIAS\FileDelivery\Setup\DeliveryMethodObjective\build().

59  : bool
60  {
61  if (function_exists('apache_get_modules') && in_array('mod_xsendfile', apache_get_modules(), true)) {
62  return true;
63  }
64 
65  try {
66  $command_exists = shell_exec("which apache2ctl");
67  if ($command_exists === null || empty($command_exists)) {
68  return false;
69  }
70 
71  $loaded_modules = array_map(static fn($module): string => explode(" ", trim((string) $module))[0] ?? "", explode("\n", shell_exec("apache2ctl -M 2>/dev/null") ?? ''));
72  } catch (\Throwable) {
73  $loaded_modules = [];
74  }
75  return in_array('xsendfile_module', $loaded_modules, true);
76  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

Field Documentation

◆ PHP

const ILIAS\FileDelivery\Setup\DeliveryMethodObjective::PHP = 'php'

Definition at line 36 of file DeliveryMethodObjective.php.

◆ SETTINGS

const ILIAS\FileDelivery\Setup\DeliveryMethodObjective::SETTINGS = 'delivery_method'

Definition at line 33 of file DeliveryMethodObjective.php.

Referenced by ILIAS\FileDelivery\Init\init().

◆ XACCEL

const ILIAS\FileDelivery\Setup\DeliveryMethodObjective::XACCEL = 'xaccel'

Definition at line 35 of file DeliveryMethodObjective.php.

Referenced by ILIAS\FileDelivery\Init\init().

◆ XSENDFILE

const ILIAS\FileDelivery\Setup\DeliveryMethodObjective::XSENDFILE = 'xsendfile'

Definition at line 34 of file DeliveryMethodObjective.php.

Referenced by ILIAS\FileDelivery\Init\init().


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