System_Daemon
[ class tree: System_Daemon ] [ index: System_Daemon ] [ all elements ]

Class: System_Daemon_OS

Source Location: /System_Daemon-0.6.9/System/Daemon/OS.php

Class Overview


Operating System focussed functionality.


Author(s):

Version:

  • SVN: Release: $Id: OS.php 150 2008-09-05 22:06:05Z kevin $

Copyright:

  • 2008 Kevin van Zonneveld (http://kevin.vanzonneveld.net)

Variables

Methods


Child classes:

System_Daemon_OS_BSD
A System_Daemon_OS driver for BSD
System_Daemon_OS_Linux
A System_Daemon_OS driver for Linux based Operating Systems
System_Daemon_OS_Windows
A System_Daemon_OS driver for Windows

Inherited Variables

Inherited Methods


Class Details

[line 29]
Operating System focussed functionality.


[ Top ]


Class Variables

$autoRunTemplatePath =  ""

[line 45]

Template path
  • Access: protected

Type:   string


[ Top ]

$autoRunTemplateReplace = array()

[line 53]

Replace the following keys with values to convert a template into a read autorun script
  • Access: protected

Type:   array


[ Top ]

$errors = array()

[line 36]

Holds errors
  • Access: public

Type:   array


[ Top ]

$_osDetails = array()

[line 62]

Hold OS information
  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 70]

System_Daemon_OS __construct( )

Constructor

Only ran by instantiated OS Drivers

  • Access: public

[ Top ]

factory   [line 96]

object &factory( [mixed $force_os = false], [boolean $retried = false])

Loads all the drivers and returns the one for the most specifc OS
  • Access: public

Parameters:

mixed   $force_os   —  boolean or string when you want to enforce an OS for testing purposes. CAN BE VERY DANGEROUS IF WRONG OS IS SPECIFIED! Will otherwise autodetect OS.
boolean   $retried   —  used internally to find out wether we are retrying

[ Top ]

getAutoRunPath   [line 256]

string getAutoRunPath( string $appName)

Returns OS specific path to autoRun file
  • Access: public

Parameters:

string   $appName   —  Unix-proof name of daemon

[ Top ]

getAutoRunScript   [line 311]

mixed getAutoRunScript( array $properties)

Uses properties to enrich the autuRun Template
  • Return: string or boolean on failure
  • Access: public

Parameters:

array   $properties   —  Contains the daemon properties

[ Top ]

getAutoRunTemplate   [line 289]

unknown getAutoRunTemplate( )

Returns a template to base the autuRun script on.

Uses $autoRunTemplatePath if possible.


[ Top ]

getAutoRunTemplatePath   [line 190]

unknown getAutoRunTemplatePath( )

Returns a template path to base the autuRun script on.

Uses $autoRunTemplatePath if possible.


[ Top ]

getDataDir   [line 212]

void getDataDir( )

  • Access: public

[ Top ]

getDetails   [line 178]

array getDetails( )

Returns array with all the specific details of the loaded OS
  • Access: public

[ Top ]

isInstalled   [line 167]

boolean isInstalled( )

Determines wether the system is compatible with this OS
  • Access: public

Overridden in child classes as:

System_Daemon_OS_BSD::isInstalled()
Determines wether the system is compatible with this OS
System_Daemon_OS_Linux::isInstalled()
Determines wether the system is compatible with this OS
System_Daemon_OS_Windows::isInstalled()
Determines wether this system is compatible with this OS

[ Top ]

writeAutoRun   [line 359]

mixed writeAutoRun( array $properties, [boolean $overwrite = false])

Writes an: 'init.d' script on the filesystem combining

Parameters:

array   $properties   —  Contains the daemon properties
boolean   $overwrite   —  Wether to overwrite when the file exists

[ Top ]

_getAncestorCount   [line 505]

integer _getAncestorCount( string $class)

Get the total parent count of a class
  • Access: protected

Parameters:

string   $class   —  Full classname or instance

[ Top ]

_getAncestors   [line 517]

array _getAncestors( string $class)

Get an array of parent classes
  • Access: protected

Parameters:

string   $class   —  Full classname or instance

[ Top ]

_getShortHand   [line 489]

string _getShortHand( string $class)

Extracts last part of a classname. e.g. System_Daemon_OS_Ubuntu -> Ubuntu
  • Access: protected

Parameters:

string   $class   —  Full classname

[ Top ]

_mostSpecific   [line 473]

string _mostSpecific( array $classes)

Determines how specific an operating system is.

e.g. Ubuntu is more specific than Debian is more specific than Linux is more specfic than Common. Determined based on class hierarchy.

  • Access: protected

Parameters:

array   $classes   —  Array with keys with classnames

[ Top ]

_testAutoRunProperties   [line 416]

array _testAutoRunProperties( [array $properties = false])

Sets daemon specific properties
  • Access: protected

Parameters:

array   $properties   —  Contains the daemon properties

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:29:09 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.