/
Linux.php
70 lines (62 loc) · 1.82 KB
/
Linux.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/* vim: set noai expandtab tabstop=4 softtabstop=4 shiftwidth=4: */
/**
* System_Daemon turns PHP-CLI scripts into daemons.
*
* PHP version 5
*
* @category System
* @package System_Daemon
* @author Kevin van Zonneveld <kevin@vanzonneveld.net>
* @copyright 2008 Kevin van Zonneveld (http://kevin.vanzonneveld.net)
* @license http://www.opensource.org/licenses/bsd-license.php New BSD Licence
* @version SVN: Release: $Id$
* @link http://trac.plutonia.nl/projects/system_daemon
*/
/**
* A System_Daemon_OS driver for Linux based Operating Systems
*
* @category System
* @package System_Daemon
* @author Kevin van Zonneveld <kevin@vanzonneveld.net>
* @copyright 2008 Kevin van Zonneveld (http://kevin.vanzonneveld.net)
* @license http://www.opensource.org/licenses/bsd-license.php New BSD Licence
* @version SVN: Release: $Id$
* @link http://trac.plutonia.nl/projects/system_daemon
* *
*/
class System_Daemon_OS_Linux extends System_Daemon_OS
{
/**
* On Linux, a distro-specific version file is often telling us enough
*
* @var string
*/
protected $_osVersionFile = "";
/**
* Path to autoRun script
*
* @var string
*/
protected $_autoRunDir = "/etc/init.d";
/**
* Determines wether the system is compatible with this OS
*
* @return boolean
*/
public function isInstalled()
{
if (!stristr(PHP_OS, "Linux")) {
return false;
}
// Find out more specific
// This is used by extended classes that inherit
// this function
if ($this->_osVersionFile) {
if (!file_exists($this->_osVersionFile)) {
return false;
}
}
return true;
}//end isInstalled
}//end class