@@ 96-104 (lines=9) @@ | ||
93 | * |
|
94 | * @return bool True when PHP is running on a Unix platform, false otherwise. |
|
95 | */ |
|
96 | public static function isUnix() : bool |
|
97 | { |
|
98 | // Return the cached result if it's already available. |
|
99 | if (null !== static::$type) { |
|
100 | return static::$type === self::TYPE_UNIX; |
|
101 | } |
|
102 | ||
103 | return static::getType() === self::TYPE_UNIX; |
|
104 | } |
|
105 | ||
106 | /** |
|
107 | * Checks whether PHP is running on a Windows platform |
|
@@ 111-119 (lines=9) @@ | ||
108 | * |
|
109 | * @return bool True when PHP is running on a Windows platform, false otherwise. |
|
110 | */ |
|
111 | public static function isWindows() : bool |
|
112 | { |
|
113 | // Return the cached result if it's already available. |
|
114 | if (null !== static::$type) { |
|
115 | return static::$type === self::TYPE_WINDOWS; |
|
116 | } |
|
117 | ||
118 | return static::getType() === self::TYPE_WINDOWS; |
|
119 | } |
|
120 | ||
121 | /** |
|
122 | * Checks whether PHP is running on a BSD platform |
|
@@ 126-134 (lines=9) @@ | ||
123 | * |
|
124 | * @return bool True when PHP is running on a BSD platform, false otherwise. |
|
125 | */ |
|
126 | public static function isBsd() : bool |
|
127 | { |
|
128 | // Return the cached result if it's already available. |
|
129 | if (null !== static::$type) { |
|
130 | return static::$type === self::TYPE_BSD; |
|
131 | } |
|
132 | ||
133 | return static::getType() === self::TYPE_BSD; |
|
134 | } |
|
135 | ||
136 | /** |
|
137 | * Checks whether PHP is running on a Darwin platform |
|
@@ 141-149 (lines=9) @@ | ||
138 | * |
|
139 | * @return bool True when PHP is running on a Darwin platform, false otherwise. |
|
140 | */ |
|
141 | public static function isDarwin() : bool |
|
142 | { |
|
143 | // Return the cached result if it's already available. |
|
144 | if (null !== static::$type) { |
|
145 | return static::$type === self::TYPE_DARWIN; |
|
146 | } |
|
147 | ||
148 | return static::getType() === self::TYPE_DARWIN; |
|
149 | } |
|
150 | ||
151 | /** |
|
152 | * Checks whether PHP is running on a Cygwin platform |
|
@@ 156-164 (lines=9) @@ | ||
153 | * |
|
154 | * @return bool True when PHP is running on a Cygwin platform, false otherwise. |
|
155 | */ |
|
156 | public static function isCygwin() : bool |
|
157 | { |
|
158 | // Return the cached result if it's already available. |
|
159 | if (null !== static::$type) { |
|
160 | return static::$type === self::TYPE_CYGWIN; |
|
161 | } |
|
162 | ||
163 | return static::getType() === self::TYPE_CYGWIN; |
|
164 | } |
|
165 | ||
166 | /** |
|
167 | * Returns the path to the given shell's binary or null when it is not available. |