ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Environment\Configuration\Server\PhpServerConfiguration Class Reference
+ Inheritance diagram for ILIAS\Environment\Configuration\Server\PhpServerConfiguration:
+ Collaboration diagram for ILIAS\Environment\Configuration\Server\PhpServerConfiguration:

Public Member Functions

 getPhpVersion ()
 
 getPhpSapi ()
 
 isFpm ()
 
 getPhpBinary ()
 Returns the escaped path to the PHP CLI binary. More...
 
 getErrorReportingLevel ()
 
 isErrorLoggingEnabled ()
 
 isErrorDisplayEnabled ()
 
 getMemoryLimit ()
 
 getUploadSizeLimit ()
 Effective upload size limit: min(post_max_size, upload_max_filesize). More...
 
 getPostMaxSize ()
 
 getUploadMaxFilesize ()
 
 getMaxExecutionTime ()
 Returns max_execution_time in seconds. More...
 
 getMaxInputVars ()
 
 getOperatingSystem ()
 
 getOperatingSystemFamily ()
 
 getPhpVersion ()
 
 getPhpSapi ()
 
 isFpm ()
 
 getPhpBinary ()
 Returns the escaped path to the PHP CLI binary. More...
 
 getErrorReportingLevel ()
 
 isErrorLoggingEnabled ()
 
 isErrorDisplayEnabled ()
 
 getMemoryLimit ()
 
 getUploadSizeLimit ()
 Effective upload size limit: min(post_max_size, upload_max_filesize). More...
 
 getPostMaxSize ()
 
 getUploadMaxFilesize ()
 
 getMaxExecutionTime ()
 Returns max_execution_time in seconds. More...
 
 getMaxInputVars ()
 
 getOperatingSystem ()
 
 getOperatingSystemFamily ()
 

Private Member Functions

 parseIniBytes (string $value)
 

Detailed Description

Member Function Documentation

◆ getErrorReportingLevel()

ILIAS\Environment\Configuration\Server\PhpServerConfiguration::getErrorReportingLevel ( )

Implements ILIAS\Environment\Configuration\Server\ServerConfiguration.

Definition at line 64 of file PhpServerConfiguration.php.

64 : int
65 {
66 return (int) ini_get('error_reporting');
67 }

◆ getMaxExecutionTime()

ILIAS\Environment\Configuration\Server\PhpServerConfiguration::getMaxExecutionTime ( )

Returns max_execution_time in seconds.

0 means no limit.

Implements ILIAS\Environment\Configuration\Server\ServerConfiguration.

Definition at line 107 of file PhpServerConfiguration.php.

107 : int
108 {
109 return (int) ini_get('max_execution_time');
110 }

◆ getMaxInputVars()

ILIAS\Environment\Configuration\Server\PhpServerConfiguration::getMaxInputVars ( )

Implements ILIAS\Environment\Configuration\Server\ServerConfiguration.

Definition at line 112 of file PhpServerConfiguration.php.

112 : int
113 {
114 return (int) ini_get('max_input_vars');
115 }

◆ getMemoryLimit()

ILIAS\Environment\Configuration\Server\PhpServerConfiguration::getMemoryLimit ( )

Implements ILIAS\Environment\Configuration\Server\ServerConfiguration.

Definition at line 81 of file PhpServerConfiguration.php.

81 : DataSize
82 {
83 return new DataSize($this->parseIniBytes(ini_get('memory_limit')), DataSize::Byte);
84 }

References ILIAS\Data\DataSize\Byte, and ILIAS\Environment\Configuration\Server\PhpServerConfiguration\parseIniBytes().

+ Here is the call graph for this function:

◆ getOperatingSystem()

ILIAS\Environment\Configuration\Server\PhpServerConfiguration::getOperatingSystem ( )

Implements ILIAS\Environment\Configuration\Server\ServerConfiguration.

Definition at line 119 of file PhpServerConfiguration.php.

119 : string
120 {
121 return PHP_OS;
122 }

◆ getOperatingSystemFamily()

ILIAS\Environment\Configuration\Server\PhpServerConfiguration::getOperatingSystemFamily ( )

Implements ILIAS\Environment\Configuration\Server\ServerConfiguration.

Definition at line 124 of file PhpServerConfiguration.php.

124 : string
125 {
126 return PHP_OS_FAMILY;
127 }

◆ getPhpBinary()

ILIAS\Environment\Configuration\Server\PhpServerConfiguration::getPhpBinary ( )

Returns the escaped path to the PHP CLI binary.

Implements ILIAS\Environment\Configuration\Server\ServerConfiguration.

Definition at line 47 of file PhpServerConfiguration.php.

47 : string
48 {
49 if (PHP_BINARY !== '') {
50 return escapeshellarg(PHP_BINARY);
51 }
52
53 foreach ([PHP_BINDIR . '/php', PHP_BINDIR . '/php-cli.exe', PHP_BINDIR . '/php.exe'] as $candidate) {
54 if (is_readable($candidate)) {
55 return escapeshellarg($candidate);
56 }
57 }
58
59 return 'php';
60 }

◆ getPhpSapi()

ILIAS\Environment\Configuration\Server\PhpServerConfiguration::getPhpSapi ( )

Implements ILIAS\Environment\Configuration\Server\ServerConfiguration.

Definition at line 37 of file PhpServerConfiguration.php.

37 : string
38 {
39 return PHP_SAPI;
40 }

◆ getPhpVersion()

ILIAS\Environment\Configuration\Server\PhpServerConfiguration::getPhpVersion ( )

Implements ILIAS\Environment\Configuration\Server\ServerConfiguration.

Definition at line 32 of file PhpServerConfiguration.php.

32 : string
33 {
34 return PHP_VERSION;
35 }

◆ getPostMaxSize()

ILIAS\Environment\Configuration\Server\PhpServerConfiguration::getPostMaxSize ( )

Implements ILIAS\Environment\Configuration\Server\ServerConfiguration.

Definition at line 95 of file PhpServerConfiguration.php.

95 : DataSize
96 {
97 return new DataSize($this->parseIniBytes(ini_get('post_max_size')), DataSize::Byte);
98 }

References ILIAS\Data\DataSize\Byte, and ILIAS\Environment\Configuration\Server\PhpServerConfiguration\parseIniBytes().

+ Here is the call graph for this function:

◆ getUploadMaxFilesize()

ILIAS\Environment\Configuration\Server\PhpServerConfiguration::getUploadMaxFilesize ( )

Implements ILIAS\Environment\Configuration\Server\ServerConfiguration.

Definition at line 100 of file PhpServerConfiguration.php.

100 : DataSize
101 {
102 return new DataSize($this->parseIniBytes(ini_get('upload_max_filesize')), DataSize::Byte);
103 }

References ILIAS\Data\DataSize\Byte, and ILIAS\Environment\Configuration\Server\PhpServerConfiguration\parseIniBytes().

+ Here is the call graph for this function:

◆ getUploadSizeLimit()

ILIAS\Environment\Configuration\Server\PhpServerConfiguration::getUploadSizeLimit ( )

Effective upload size limit: min(post_max_size, upload_max_filesize).

Implements ILIAS\Environment\Configuration\Server\ServerConfiguration.

Definition at line 86 of file PhpServerConfiguration.php.

86 : DataSize
87 {
88 $bytes = min(
89 $this->parseIniBytes(ini_get('post_max_size')),
90 $this->parseIniBytes(ini_get('upload_max_filesize')),
91 );
92 return new DataSize($bytes, DataSize::Byte);
93 }

References ILIAS\Data\DataSize\Byte, and ILIAS\Environment\Configuration\Server\PhpServerConfiguration\parseIniBytes().

+ Here is the call graph for this function:

◆ isErrorDisplayEnabled()

ILIAS\Environment\Configuration\Server\PhpServerConfiguration::isErrorDisplayEnabled ( )

Implements ILIAS\Environment\Configuration\Server\ServerConfiguration.

Definition at line 74 of file PhpServerConfiguration.php.

74 : bool
75 {
76 return filter_var(ini_get('display_errors'), FILTER_VALIDATE_BOOLEAN);
77 }

◆ isErrorLoggingEnabled()

ILIAS\Environment\Configuration\Server\PhpServerConfiguration::isErrorLoggingEnabled ( )

Implements ILIAS\Environment\Configuration\Server\ServerConfiguration.

Definition at line 69 of file PhpServerConfiguration.php.

69 : bool
70 {
71 return filter_var(ini_get('log_errors'), FILTER_VALIDATE_BOOLEAN);
72 }

◆ isFpm()

ILIAS\Environment\Configuration\Server\PhpServerConfiguration::isFpm ( )

Implements ILIAS\Environment\Configuration\Server\ServerConfiguration.

Definition at line 42 of file PhpServerConfiguration.php.

42 : bool
43 {
44 return PHP_SAPI === 'fpm-fcgi';
45 }

◆ parseIniBytes()

ILIAS\Environment\Configuration\Server\PhpServerConfiguration::parseIniBytes ( string  $value)
private

Definition at line 131 of file PhpServerConfiguration.php.

131 : int
132 {
133 if (is_numeric($value)) {
134 return (int) $value;
135 }
136
137 $suffix = strtoupper(substr($value, -1));
138 $number = (int) substr($value, 0, -1);
139
140 return match ($suffix) {
141 'P' => $number * 1024 ** 5,
142 'T' => $number * 1024 ** 4,
143 'G' => $number * 1024 ** 3,
144 'M' => $number * 1024 ** 2,
145 'K' => $number * 1024,
146 default => (int) $value,
147 };
148 }

References ILIAS\Repository\int().

Referenced by ILIAS\Environment\Configuration\Server\PhpServerConfiguration\getMemoryLimit(), ILIAS\Environment\Configuration\Server\PhpServerConfiguration\getPostMaxSize(), ILIAS\Environment\Configuration\Server\PhpServerConfiguration\getUploadMaxFilesize(), and ILIAS\Environment\Configuration\Server\PhpServerConfiguration\getUploadSizeLimit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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