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

Class: System_Daemon_OS

Source Location: /System_Daemon-1.0.0/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

$errors = array()

[line 36]

Holds errors
  • Access: public

Type:   array


[ Top ]

$_autoRunDir =

[line 59]

Path of init.d scripts
  • Access: protected

Type:   string


[ Top ]

$_autoRunTemplatePath =  ""

[line 44]

Template path
  • Access: protected

Type:   string


[ Top ]

$_autoRunTemplateReplace = array()

[line 52]

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

Type:   array


[ Top ]

$_osDetails = array()

[line 66]

Hold OS information
  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 74]

System_Daemon_OS __construct( )

Constructor

Only ran by instantiated OS Drivers

  • Access: public

[ Top ]

factory   [line 100]

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 277]

string getAutoRunPath( string $appName)

Returns OS specific path to autoRun file
  • Access: public

Parameters:

string   $appName   —  Unix-proof name of daemon

[ Top ]

getAutoRunScript   [line 371]

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 349]

unknown getAutoRunTemplate( array $properties)

Returns a template to base the autuRun script on.

Uses $autoRunTemplatePath if possible.

  • See: autoRunTemplatePath
  • Access: public

Parameters:

array   $properties   —  Contains the daemon properties

[ Top ]

getAutoRunTemplatePath   [line 196]

unknown getAutoRunTemplatePath( [array $properties = array()])

Returns a template path to base the autuRun script on.

Uses $autoRunTemplatePath if possible.

  • See: autoRunTemplatePath
  • Access: public

Parameters:

array   $properties   —  Additional properties

[ Top ]

getDataDir   [line 229]

string getDataDir( )

Returns the directory where data is stored (like init.d templates) Could be PEAR's data directory but could also be a local one.
  • Access: public

[ Top ]

getDetails   [line 182]

array getDetails( )

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

[ Top ]

isInstalled   [line 171]

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_Arch::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 ]

isWritable   [line 315]

boolean isWritable( string $path)

A 'better' is_writable. Taken from PHP.NET comments:

http://nl.php.net/manual/en/function.is-writable.php#73596 Will work in despite of Windows ACLs bug NOTE: use a trailing slash for folders!!! see http://bugs.php.net/bug.php?id=27609 see http://bugs.php.net/bug.php?id=30931

  • Access: public

Parameters:

string   $path   —  Path to test

[ Top ]

writeAutoRun   [line 423]

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 578]

integer _getAncestorCount( string $class)

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

Parameters:

string   $class   —  Full classname or instance

[ Top ]

_getAncestors   [line 590]

array _getAncestors( string $class)

Get an array of parent classes
  • Access: protected

Parameters:

string   $class   —  Full classname or instance

[ Top ]

_getShortHand   [line 562]

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 544]

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 480]

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:47:43 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.