ILIAS  release_7 Revision v7.30-3-g800a261c036
ilRuntime Class Reference
+ Collaboration diagram for ilRuntime:

Public Member Functions

 isHHVM ()
 Returns true when the runtime used is HHVM. More...
 
 isPHP ()
 Returns true when the runtime used is PHP. More...
 
 isFPM ()
 
 getVersion ()
 
 getName ()
 
 __toString ()
 A string representation of the runtime. More...
 
 getReportedErrorLevels ()
 
 shouldLogErrors ()
 
 shouldDisplayErrors ()
 

Static Public Member Functions

static getInstance ()
 

Private Member Functions

 __construct ()
 The runtime is a constant state during one request, so please use the public static getInstance() to instantiate the runtime. More...
 

Static Private Attributes

static $instance = null
 

Detailed Description

Definition at line 9 of file class.ilRuntime.php.

Constructor & Destructor Documentation

◆ __construct()

ilRuntime::__construct ( )
private

The runtime is a constant state during one request, so please use the public static getInstance() to instantiate the runtime.

Definition at line 19 of file class.ilRuntime.php.

20 {
21 }

Member Function Documentation

◆ __toString()

ilRuntime::__toString ( )

A string representation of the runtime.

Definition at line 89 of file class.ilRuntime.php.

90 {
91 return $this->getName() . ' ' . $this->getVersion();
92 }

References getName(), and getVersion().

+ Here is the call graph for this function:

◆ getInstance()

static ilRuntime::getInstance ( )
static
Returns
self

Definition at line 26 of file class.ilRuntime.php.

27 {
28 if (self::$instance === null) {
29 self::$instance = new self();
30 }
31
32 return self::$instance;
33 }
static $instance

References $instance.

Referenced by ILIAS\FileDelivery\Delivery\detemineDeliveryType(), ilErrorHandling\getIlRuntime(), and ilApc\getMemoryLimit().

+ Here is the caller graph for this function:

◆ getName()

ilRuntime::getName ( )
Returns
string

Definition at line 77 of file class.ilRuntime.php.

78 {
79 if ($this->isHHVM()) {
80 return 'HHVM';
81 } else {
82 return 'PHP';
83 }
84 }
isHHVM()
Returns true when the runtime used is HHVM.

References isHHVM().

Referenced by __toString().

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

◆ getReportedErrorLevels()

ilRuntime::getReportedErrorLevels ( )
Returns
int

Definition at line 97 of file class.ilRuntime.php.

98 {
99 if ($this->isHHVM()) {
100 return ini_get('hhvm.log.runtime_error_reporting_level');
101 } else {
102 return ini_get('error_reporting');
103 }
104 }

References isHHVM().

+ Here is the call graph for this function:

◆ getVersion()

ilRuntime::getVersion ( )
Returns
string

Definition at line 65 of file class.ilRuntime.php.

66 {
67 if ($this->isHHVM()) {
68 return HHVM_VERSION;
69 } else {
70 return PHP_VERSION;
71 }
72 }

References isHHVM().

Referenced by __toString().

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

◆ isFPM()

ilRuntime::isFPM ( )
Returns
bool

Definition at line 57 of file class.ilRuntime.php.

58 {
59 return (php_sapi_name() == 'fpm-fcgi');
60 }

◆ isHHVM()

ilRuntime::isHHVM ( )

Returns true when the runtime used is HHVM.

Returns
bool

Definition at line 39 of file class.ilRuntime.php.

40 {
41 return defined('HHVM_VERSION');
42 }

Referenced by getName(), getReportedErrorLevels(), getVersion(), isPHP(), shouldDisplayErrors(), and shouldLogErrors().

+ Here is the caller graph for this function:

◆ isPHP()

ilRuntime::isPHP ( )

Returns true when the runtime used is PHP.

Returns
bool

Definition at line 48 of file class.ilRuntime.php.

49 {
50 return !$this->isHHVM();
51 }

References isHHVM().

+ Here is the call graph for this function:

◆ shouldDisplayErrors()

ilRuntime::shouldDisplayErrors ( )
Returns
boolean

Definition at line 121 of file class.ilRuntime.php.

122 {
123 if ($this->isHHVM()) {
124 return (bool) ini_get('hhvm.debug.server_error_message');
125 } else {
126 return (bool) ini_get('display_errors');
127 }
128 }

References isHHVM().

+ Here is the call graph for this function:

◆ shouldLogErrors()

ilRuntime::shouldLogErrors ( )
Returns
boolean

Definition at line 109 of file class.ilRuntime.php.

110 {
111 if ($this->isHHVM()) {
112 return (bool) ini_get('hhvm.log.use_log_file');
113 } else {
114 return (bool) ini_get('log_errors');
115 }
116 }

References isHHVM().

+ Here is the call graph for this function:

Field Documentation

◆ $instance

ilRuntime::$instance = null
staticprivate

Definition at line 14 of file class.ilRuntime.php.

Referenced by getInstance().


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