Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F2753276
OperatingSystem.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
OperatingSystem.php
View Options
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of sebastian/environment.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace
SebastianBergmann\Environment
;
use
const
DIRECTORY_SEPARATOR
;
use
const
PHP_OS
;
use
const
PHP_OS_FAMILY
;
use
function
defined
;
final
class
OperatingSystem
{
/**
* Returns PHP_OS_FAMILY (if defined (which it is on PHP >= 7.2)).
* Returns a string (compatible with PHP_OS_FAMILY) derived from PHP_OS otherwise.
*/
public
function
getFamily
():
string
{
if
(
defined
(
'PHP_OS_FAMILY'
))
{
return
PHP_OS_FAMILY
;
}
if
(
DIRECTORY_SEPARATOR
===
'
\\
'
)
{
return
'Windows'
;
}
switch
(
PHP_OS
)
{
case
'Darwin'
:
return
'Darwin'
;
case
'DragonFly'
:
case
'FreeBSD'
:
case
'NetBSD'
:
case
'OpenBSD'
:
return
'BSD'
;
case
'Linux'
:
return
'Linux'
;
case
'SunOS'
:
return
'Solaris'
;
default
:
return
'Unknown'
;
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Jul 3, 21:01 (10 h, 14 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
89/5e/1de71660171fa894804d7af624b6
Default Alt Text
OperatingSystem.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment