fogproject  1.5.9
About: FOG is a Linux-based network computer cloning solution for Windows, Mac OSX and various Linux distributions that ties together a few open-source tools with a PHP-based web interface. FOG doesn’t use any boot disks, or CDs; everything is done via TFTP and PXE.
  Fossies Dox: fogproject-1.5.9.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

FOGController Class Reference
Inheritance diagram for FOGController:
[legend]
Collaboration diagram for FOGController:
[legend]

Public Member Functions

 __construct ($data='')
 
 __destruct ()
 
 __toString ()
 
 get ($key='')
 
 set ($key, $value)
 
 add ($key, $value)
 
 remove ($key, $value)
 
 save ()
 
 load ($key='id')
 
 getcolumns (&$fields)
 
 destroy ($key='id')
 
 key (&$key)
 
 isValid ()
 
 buildQuery (&$join, &$whereArrayAnd, &$c, $not=false, $compare='=')
 
 setQuery (&$queryData)
 
 getManager ()
 
 assocSetter ($assocItem, $alterItem='', $implicitCall=false)
 
- Public Member Functions inherited from FOGBase
 __construct ()
 
 orderBy (&$orderBy)
 

Protected Member Functions

 loadItem ($key)
 
 addRemItem ($key, $array, $array_type)
 
- Protected Member Functions inherited from FOGBase
 isLoaded ($key)
 
 setRequest ()
 
 sendData ( $datatosend, $service=true, $array=array())
 

Protected Attributes

 $data = array()
 
 $autoSave = false
 
 $databaseTable = ''
 
 $databaseFields = array()
 
 $databaseFieldsRequired = array()
 
 $additionalFields = array()
 
 $databaseFieldsFlipped = array()
 
 $databaseFieldsToIgnore
 
 $aliasedFields = array()
 
 $databaseFieldClassRelationships = array()
 
 $loadQueryTemplate = 'SELECT %s FROM `%s` %s WHERE `%s`=%s %s'
 
 $insertQueryTemplate = 'INSERT INTO `%s` (%s) VALUES (%s) %s %s'
 
 $destroyQueryTemplate = 'DELETE FROM `%s` WHERE %s=%s%s'
 
- Protected Attributes inherited from FOGBase
 $isLoaded = array()
 

Private Member Functions

 _testFields ($key)
 

Additional Inherited Members

- Static Public Member Functions inherited from FOGBase
static getClass ($class, $data='', $props=false)
 
static getHostItem ( $service=true, $encoded=false, $hostnotrequired=false, $returnmacs=false, $override=false, $mac=false)
 
static getAllBlamedNodes ($Host)
 
static niceDate ($date='now', $utc=false)
 
static formatTime ($time, $format=false, $utc=false)
 
static createSecToken ()
 
static aesencrypt ( $data, $key=false, $enctype='aes-256-cbc')
 
static aesdecrypt ( $encdata, $key=false, $enctype='aes-128-cbc')
 
static parseMacList ( $stringlist, $image=false, $client=false)
 
static getSubObjectIDs ( $object='Host', $findWhere=array(), $getField='id', $not=false, $operator='AND', $orderBy='name', $groupBy=false, $filter='array_unique')
 
static getSetting ($key)
 
static setSetting ($key, $value)
 
static getQueuedStates ()
 
static getQueuedState ()
 
static getCheckedInState ()
 
static getProgressState ()
 
static getCompleteState ()
 
static getCancelledState ()
 
static stringBetween ($string, $start, $end)
 
static stripAndDecode (&$item)
 
static getMasterInterface ($ip_find)
 
static lasterror ()
 
static getFilesize ($path)
 
static wakeUp ($macs)
 
static fastmerge ($array1)
 
static getHash ($file)
 
static attemptLogin ($username, $password)
 
static clearMACLookupTable ()
 
static getMACLookupCount ()
 
static resolveHostname ($host)
 
static getBroadcast ()
 
static randWait ()
 
- Static Public Attributes inherited from FOGBase
static $locale = ''
 
static $fogpingactive = false
 
static $fogdeleteactive = false
 
static $fogexportactive = false
 
static $pendingMACs = 0
 
static $pendingHosts = 0
 
static $defaultscreen = ''
 
static $pluginsinstalled = array()
 
static $useragent
 
static $foglang
 
static $ajax = false
 
static $post = false
 
static $service = false
 
static $json = false
 
static $newService = false
 
static $scriptname
 
static $querystring
 
static $httpreqwith
 
static $reqmethod
 
static $remoteaddr
 
static $httpreferer
 
static $mySchema = 0
 
static $showhtml = true
 
static $httpproto = false
 
static $httphost = ''
 
static $Host = null
 
- Static Protected Member Functions inherited from FOGBase
static getActivePlugins ()
 
static fatalError ($txt, $data=array())
 
static error ($txt, $data=array())
 
static debug ($txt, $data=array())
 
static info ($txt, $data=array())
 
static setMessage ($txt, $data=array())
 
static getMessages ()
 
static redirect ($url='')
 
static arrayInsertBefore ( $key, array &$array, $new_key, $new_value)
 
static arrayInsertAfter ( $key, array &$array, $new_key, $new_value)
 
static arrayRemove ($key, array &$array)
 
static arrayFind ( $needle, array $haystack, $ignorecase=false)
 
static resetRequest ()
 
static formatByteSize ($size)
 
static getGlobalModuleStatus ($names=false, $keys=false)
 
static validDate ($date, $format='')
 
static pluralize ($count, $text, $space=false)
 
static diff ($start, $end, $ago=false)
 
static humanify ($diff, $unit)
 
static arrayChangeKey (array &$array, $old_key, $new_key)
 
static byteconvert ($kilobytes)
 
static hex2bin ($hex)
 
static certEncrypt ($data)
 
static certDecrypt ($dataArr, $padding=true)
 
static arrayStrpos ($haystack, $needles, $case=true)
 
static log ( $txt, $curlog, $logfile, $logbrow, $obj, $level=1)
 
static logHistory ($string)
 
static getIPAddress ($force=false)
 
- Static Protected Attributes inherited from FOGBase
static $strlen
 
static $debug = false
 
static $info = false
 
static $buildSelectBox
 
static $selected
 
static $DB
 
static $FOGFTP
 
static $FOGCore
 
static $EventManager
 
static $HookManager
 
static $TimeZone
 
static $FOGUser
 
static $FOGPageManager
 
static $FOGURLRequests
 
static $FOGSubMenu
 
static $ips = array()
 
static $interface = array()
 
static $searchPages
 

Detailed Description

Definition at line 28 of file fogcontroller.class.php.

Constructor & Destructor Documentation

◆ __construct()

FOGController::__construct (   $data = '')

Constructor to set variables.

Parameters
mixed$datathe data to construct from if different
Exceptions
Exception
Returns
self

Reimplemented in TaskLog, SlackHandler, and PushbulletHandler.

Definition at line 121 of file fogcontroller.class.php.

References $data, $str, FOGBase\error(), load(), and setQuery().

◆ __destruct()

FOGController::__destruct ( )

Closes out the object.

Returns
bool

Definition at line 159 of file fogcontroller.class.php.

References save().

Member Function Documentation

◆ __toString()

FOGController::__toString ( )

Default way to present object as a string.

Returns
string

Reimplemented from FOGBase.

Definition at line 172 of file fogcontroller.class.php.

References $str.

Referenced by Host\save().

◆ _testFields()

FOGController::_testFields (   $key)
private

Test our needed fields.

Parameters
string$keythe key to test
Returns
bool

Definition at line 188 of file fogcontroller.class.php.

References key().

Referenced by add(), addRemItem(), destroy(), get(), load(), loadItem(), remove(), and set().

◆ add()

FOGController::add (   $key,
  $value 
)

Add value to key (array).

Parameters
string$keythe key to add to
mixed$valuethe value to add
Exceptions
Exception
Returns
object

Reimplemented in Host.

Definition at line 288 of file fogcontroller.class.php.

References $msg, $str, $test, _testFields(), FOGBase\debug(), FOGBase\info(), FOGBase\isLoaded(), key(), and loadItem().

Referenced by addRemItem().

◆ addRemItem()

FOGController::addRemItem (   $key,
  $array,
  $array_type 
)
protected

◆ assocSetter()

FOGController::assocSetter (   $assocItem,
  $alterItem = '',
  $implicitCall = false 
)

Set's values for associative fields.

Parameters
string$assocItemthe assoc item to work from/with
string$alterItemthe alternate item to work with
bool$implicitCallcall class implicitely instead of appending with association
Returns
object

Reimplemented in Site.

Definition at line 1055 of file fogcontroller.class.php.

References $items, Route\deletemass(), FOGBase\getClass(), Route\getData(), Route\ids(), and FOGBase\isLoaded().

Referenced by Image\save().

◆ buildQuery()

FOGController::buildQuery ( $join,
$whereArrayAnd,
$c,
  $not = false,
  $compare = '=' 
)

Builds query strings as needed.

Parameters
array$joinThe join array.
array$whereArrayAndThe where array.
array$cThe join object.
bool$notWhether to compare using not operator.
string$compareThe comparator to use.
Returns
array

Lambda function to build the where array additionals.

Parameters
string$fieldthe field to work from
mixed$valuethe value of the field

Lambda function to build the join of a query.

Parameters
string$classthe class to work from
mixed$fieldsthe fields to work off

Definition at line 907 of file fogcontroller.class.php.

References FOGBase\getClass().

Referenced by load().

◆ destroy()

FOGController::destroy (   $key = 'id')

Removes the item from the database.

Parameters
string$keythe key to remove
Exceptions
Exception
Returns
object

Reimplemented in WindowsKey, Location, HostStatus, Snapin, Printer, Module, Image, Host, and Group.

Definition at line 656 of file fogcontroller.class.php.

References $column, $msg, $test, $val, _testFields(), FOGBase\debug(), key(), and FOGBase\logHistory().

Referenced by ScheduledTask\cancel().

◆ get()

◆ getcolumns()

FOGController::getcolumns ( $fields)

Gets the columns.

Parameters
array$fieldsThe fields to get.
Returns
void

Lambda to get the fields to use.

Parameters
string$kThe key (for class relations).
string$columnThe column name.

Definition at line 624 of file fogcontroller.class.php.

References $column, $databaseTable, and FOGBase\getClass().

Referenced by load().

◆ getManager()

FOGController::getManager ( )

Get an objects manager class.

Returns
object

Reimplemented in Plugin.

Definition at line 1039 of file fogcontroller.class.php.

Referenced by SnapinJob\cancel(), SnapinTask\cancel(), PowerManagement\getActionSelect(), and Task\getInFrontOfHostCount().

◆ isValid()

◆ key()

FOGController::key ( $key)

Get's the relevant common key if available.

Parameters
string | array$keythe key to get commonized
Returns
mixed

Definition at line 770 of file fogcontroller.class.php.

Referenced by _testFields(), add(), Host\add(), addRemItem(), destroy(), get(), isValid(), load(), loadItem(), remove(), save(), User\set(), set(), Host\set(), and Task\set().

◆ load()

FOGController::load (   $key = 'id')

Loads the item from the database.

Parameters
string$keythe key to load
Exceptions
Exception
Returns
object

Definition at line 538 of file fogcontroller.class.php.

References $msg, $str, $test, $val, _testFields(), buildQuery(), FOGBase\debug(), getcolumns(), FOGBase\info(), key(), and setQuery().

Referenced by __construct(), Image\save(), and Snapin\save().

◆ loadItem()

FOGController::loadItem (   $key)
protected

Load the item field.

Parameters
string$keythe key to load
Exceptions
Exception
Returns
object

Definition at line 788 of file fogcontroller.class.php.

References $test, _testFields(), and key().

Referenced by add(), get(), remove(), and set().

◆ remove()

FOGController::remove (   $key,
  $value 
)

Remove value from key (array).

Parameters
string$keythe key to remove from
mixed$valuethe value to remove
Exceptions
Exception
Returns
object

Definition at line 338 of file fogcontroller.class.php.

References $msg, $str, $test, _testFields(), FOGBase\debug(), FOGBase\info(), FOGBase\isLoaded(), key(), and loadItem().

◆ save()

◆ set()

FOGController::set (   $key,
  $value 
)

Set value to key.

Parameters
string$keythe key to set to
mixed$valuethe value to set
Exceptions
Exception
Returns
object

Reimplemented in Task, and Host.

Definition at line 241 of file fogcontroller.class.php.

References $msg, $str, $test, _testFields(), FOGBase\debug(), FOGBase\info(), FOGBase\isLoaded(), key(), and loadItem().

Referenced by TaskQueue\_moveUpload().

◆ setQuery()

FOGController::setQuery ( $queryData)

Set's the queries data into the object as/where needed.

Parameters
array$queryDataThe data to work from.
Returns
object

Definition at line 1001 of file fogcontroller.class.php.

References FOGBase\arrayChangeKey(), FOGBase\fastmerge(), and FOGBase\getClass().

Referenced by __construct(), and load().

Member Data Documentation

◆ $additionalFields

FOGController::$additionalFields = array()
protected

Definition at line 65 of file fogcontroller.class.php.

◆ $aliasedFields

FOGController::$aliasedFields = array()
protected

Definition at line 87 of file fogcontroller.class.php.

◆ $autoSave

FOGController::$autoSave = false
protected

Definition at line 41 of file fogcontroller.class.php.

◆ $data

◆ $databaseFieldClassRelationships

FOGController::$databaseFieldClassRelationships = array()
protected

Definition at line 93 of file fogcontroller.class.php.

◆ $databaseFields

FOGController::$databaseFields = array()
protected

Definition at line 53 of file fogcontroller.class.php.

◆ $databaseFieldsFlipped

FOGController::$databaseFieldsFlipped = array()
protected

Definition at line 72 of file fogcontroller.class.php.

◆ $databaseFieldsRequired

FOGController::$databaseFieldsRequired = array()
protected

Definition at line 59 of file fogcontroller.class.php.

◆ $databaseFieldsToIgnore

FOGController::$databaseFieldsToIgnore
protected
Initial value:
= array(
'createdBy',
'createdTime',
)

Definition at line 78 of file fogcontroller.class.php.

◆ $databaseTable

FOGController::$databaseTable = ''
protected

Definition at line 47 of file fogcontroller.class.php.

Referenced by getcolumns().

◆ $destroyQueryTemplate

FOGController::$destroyQueryTemplate = 'DELETE FROM `%s` WHERE %s=%s%s'
protected

Definition at line 111 of file fogcontroller.class.php.

◆ $insertQueryTemplate

FOGController::$insertQueryTemplate = 'INSERT INTO `%s` (%s) VALUES (%s) %s %s'
protected

Definition at line 105 of file fogcontroller.class.php.

◆ $loadQueryTemplate

FOGController::$loadQueryTemplate = 'SELECT %s FROM `%s` %s WHERE `%s`=%s %s'
protected

Definition at line 99 of file fogcontroller.class.php.


The documentation for this class was generated from the following file: