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

94 {
95 return $this->getName() . ' ' . $this->getVersion();
96 }

References getName(), and getVersion().

+ Here is the call graph for this function:

◆ getInstance()

static ilRuntime::getInstance ( )
static
Returns
self

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

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

References $instance.

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

+ Here is the caller graph for this function:

◆ getName()

ilRuntime::getName ( )
Returns
string

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

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.

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 101 of file class.ilRuntime.php.

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 }

References isHHVM().

+ Here is the call graph for this function:

◆ getVersion()

ilRuntime::getVersion ( )
Returns
string

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

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

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 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.

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

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 47 of file class.ilRuntime.php.

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

References isHHVM().

+ Here is the call graph for this function:

◆ shouldDisplayErrors()

ilRuntime::shouldDisplayErrors ( )
Returns
boolean

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

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 }

References isHHVM().

+ Here is the call graph for this function:

◆ shouldLogErrors()

ilRuntime::shouldLogErrors ( )
Returns
boolean

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

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 }

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: