ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
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.

19 {}

Member Function Documentation

◆ __toString()

ilRuntime::__toString ( )

A string representation of the runtime.

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

References getName(), and getVersion().

94  {
95  return $this->getName() . ' ' . $this->getVersion();
96  }
+ Here is the call graph for this function:

◆ getInstance()

static ilRuntime::getInstance ( )
static
Returns
self

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

Referenced by ilFileDelivery\detemineDeliveryType(), ilErrorHandling\getIlRuntime(), and ilApc\getMemoryLimit().

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

◆ getName()

ilRuntime::getName ( )
Returns
string

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

References isHHVM().

Referenced by __toString().

79  {
80  if($this->isHHVM())
81  {
82  return 'HHVM';
83  }
84  else
85  {
86  return 'PHP';
87  }
88  }
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 101 of file class.ilRuntime.php.

References isHHVM().

102  {
103  if($this->isHHVM())
104  {
105  return ini_get('hhvm.log.runtime_error_reporting_level');
106  }
107  else
108  {
109  return ini_get('error_reporting');
110  }
111  }
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 63 of file class.ilRuntime.php.

References isHHVM().

Referenced by __toString().

64  {
65  if($this->isHHVM())
66  {
67  return HHVM_VERSION;
68  }
69  else
70  {
71  return PHP_VERSION;
72  }
73  }
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 56 of file class.ilRuntime.php.

56  {
57  return (php_sapi_name() == 'fpm-fcgi');
58  }

◆ isHHVM()

ilRuntime::isHHVM ( )

Returns true when the runtime used is HHVM.

Returns
bool

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

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

39  {
40  return defined('HHVM_VERSION');
41  }
+ Here is the caller graph for this function:

◆ isPHP()

ilRuntime::isPHP ( )

Returns true when the runtime used is PHP.

Returns
bool

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

References isHHVM().

48  {
49  return !$this->isHHVM();
50  }
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 131 of file class.ilRuntime.php.

References isHHVM().

132  {
133  if($this->isHHVM())
134  {
135  return (bool)ini_get('hhvm.debug.server_error_message');
136  }
137  else
138  {
139  return (bool)ini_get('display_errors');
140  }
141  }
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 116 of file class.ilRuntime.php.

References isHHVM().

117  {
118  if($this->isHHVM())
119  {
120  return (bool)ini_get('hhvm.log.use_log_file');
121  }
122  else
123  {
124  return (bool)ini_get('log_errors');
125  }
126  }
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: