19declare(strict_types=1);
38 public const PHP =
'php';
45 return 'delivery_method';
51 parent::getPreconditions($environment),
63 $this->ext_data_dir =
$ini->readVariable(
'clients',
'datadir');
66 'Could not determine external data directory from ILIAS ini file'
71 if (
$io instanceof IOWrapper) {
75 return parent::achieve($environment);
82 if (file_exists(self::PATH())) {
92 self::SETTINGS => $delivery_method,
93 self::SETTINGS_EXTERNAL_DATA_DIR => $this->ext_data_dir
99 if (\function_exists(
'apache_get_modules') && \in_array(
'mod_xsendfile', apache_get_modules(),
true)) {
104 $command_exists = shell_exec(
'which apache2ctl');
105 if (empty($command_exists)) {
109 $loaded_modules = array_map(
110 static fn(
string $module):
string => explode(
' ', trim($module))[0] ??
'',
111 explode(
"\n", shell_exec(
'apache2ctl -M 2>/dev/null') ??
'')
113 }
catch (\Throwable
$e) {
114 $this->io?->error(
$e->getMessage());
115 $this->io?->error(
$e->getTraceAsString());
116 $loaded_modules = [];
119 return \in_array(
'xsendfile_module', $loaded_modules,
true);
achieve(Environment $environment)
Objectives can be achieved.
isApplicable(Environment $environment)
Get to know whether the objective is applicable.
getPreconditions(Environment $environment)
Objectives might depend on other objectives.
const SETTINGS_EXTERNAL_DATA_DIR
Wrapper around symfonies input and output facilities to provide just the functionality required for t...
Signals that some goal won't be achievable by actions of the system ever.
INIFile Parser Early access in init proceess! Avoid further dependencies like logging or other servic...
An artifact is some file that is build on demand per installation and is not shipped with the ILIAS s...
An environment holds resources to be used in the setup process.
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
const RESOURCE_ADMIN_INTERACTION