Draft for Tasks/Cronjobs factory

This commit is contained in:
Dennis Eichhorn 2016-03-09 23:13:39 +01:00
parent 7d8a25afe6
commit 78e0d51c92
2 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,32 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace phpOMS\System;
final class OperatingSystem {
public static function getSystem() : int
{
switch(PHP_OS) {
case stristr(PHP_OS, 'DAR'):
return SystemType::OSX;
case stristr(PHP_OS, 'WIN'):
return SystemType::WIN;
case stristr(PHP_OS, 'LINIX'):
return SystemType::LINUX;
default:
return SystemType::UNKNOWN;
}
}
}

39
System/SystemType.php Normal file
View File

@ -0,0 +1,39 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace phpOMS\System;
use phpOMS\Datatypes\Enum;
/**
* Database type enum.
*
* Database types that are supported by the application
*
* @category Framework
* @package phpOMS\DataStorage\Database
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
abstract class SystemType extends Enum
{
const UNKNOWN = 1;
const WIN = 2;
const LINUX = 3;
const OSX = 4;
}