ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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...
 
 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 85 of file class.ilRuntime.php.

86 {
87 return $this->getName() . ' ' . $this->getVersion();
88 }

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 ilApc\getMemoryLimit(), ilErrorHandling\handleRuntimeErrors(), and ilErrorHandling\ilErrorHandling().

+ Here is the caller graph for this function:

◆ getName()

ilRuntime::getName ( )
Returns
string

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

71 {
72 if($this->isHHVM())
73 {
74 return 'HHVM';
75 }
76 else
77 {
78 return 'PHP';
79 }
80 }
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 93 of file class.ilRuntime.php.

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

References isHHVM().

+ Here is the call graph for this function:

◆ getVersion()

ilRuntime::getVersion ( )
Returns
string

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

56 {
57 if($this->isHHVM())
58 {
59 return HHVM_VERSION;
60 }
61 else
62 {
63 return PHP_VERSION;
64 }
65 }

References isHHVM().

Referenced by __toString().

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

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

124 {
125 if($this->isHHVM())
126 {
127 return (bool)ini_get('hhvm.debug.server_error_message');
128 }
129 else
130 {
131 return (bool)ini_get('display_errors');
132 }
133 }

References isHHVM().

+ Here is the call graph for this function:

◆ shouldLogErrors()

ilRuntime::shouldLogErrors ( )
Returns
boolean

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

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

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: