ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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.

References getName(), and getVersion().

90  {
91  return $this->getName() . ' ' . $this->getVersion();
92  }
+ Here is the call graph for this function:

◆ getInstance()

static ilRuntime::getInstance ( )
static
Returns
self

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

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

27  {
28  if (self::$instance === null) {
29  self::$instance = new self();
30  }
31 
32  return self::$instance;
33  }
+ Here is the caller graph for this function:

◆ getName()

ilRuntime::getName ( )
Returns
string

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

References isHHVM().

Referenced by __toString().

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

References isHHVM().

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  }
isHHVM()
Returns true when the runtime used is HHVM.
+ Here is the call graph for this function:

◆ getVersion()

ilRuntime::getVersion ( )
Returns
string

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

References isHHVM().

Referenced by __toString().

66  {
67  if ($this->isHHVM()) {
68  return HHVM_VERSION;
69  } else {
70  return PHP_VERSION;
71  }
72  }
isHHVM()
Returns true when the runtime used is HHVM.
+ 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.

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

40  {
41  return defined('HHVM_VERSION');
42  }
+ 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.

References isHHVM().

49  {
50  return !$this->isHHVM();
51  }
isHHVM()
Returns true when the runtime used is HHVM.
+ Here is the call graph for this function:

◆ shouldDisplayErrors()

ilRuntime::shouldDisplayErrors ( )
Returns
boolean

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

References isHHVM().

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  }
isHHVM()
Returns true when the runtime used is HHVM.
+ Here is the call graph for this function:

◆ shouldLogErrors()

ilRuntime::shouldLogErrors ( )
Returns
boolean

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

References isHHVM().

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  }
isHHVM()
Returns true when the runtime used is HHVM.
+ Here is the call graph for this function:

Field Documentation

◆ $instance

ilRuntime::$instance = null
staticprivate

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


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