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)  

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

Public Member Functions

 dropDuplicateData ( $dbname, $table=array(), $indexNeeded=false)
 
 exportdb ( $backup_name='', $remove_file=true)
 
 importdb ($file)
 
- Public Member Functions inherited from FOGController
 __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)
 

Static Public Member Functions

static getDBName ()
 
static createDatabaseQuery ()
 
static useDatabaseQuery ()
 
static createDatabase ( $name, $exists)
 
static createTable ( $name, $exists, $fields, $types, $nulls, $default, $unique, $engine='MyISAM', $charset='utf8', $prime='', $autoin='')
 
static dropTable ($name)
 
- 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 ()
 

Protected Attributes

 $operators
 
 $databaseTable = 'schemaVersion'
 
 $databaseFields
 
- Protected Attributes inherited from FOGController
 $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()
 

Additional Inherited Members

- 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
 
- Protected Member Functions inherited from FOGController
 loadItem ($key)
 
 addRemItem ($key, $array, $array_type)
 
- Protected Member Functions inherited from FOGBase
 isLoaded ($key)
 
 setRequest ()
 
 sendData ( $datatosend, $service=true, $array=array())
 
- 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 22 of file schema.class.php.

Member Function Documentation

◆ createDatabase()

static Schema::createDatabase (   $name,
  $exists 
)
static

SQL create database syntax.

Parameters
string$nameWhat are we calling it?
bool$existsIf not exists?
Returns
string

Definition at line 270 of file schema.class.php.

References $exists.

Referenced by createDatabaseQuery().

◆ createDatabaseQuery()

static Schema::createDatabaseQuery ( )
static

Creates the database creation query

Returns
string

Definition at line 66 of file schema.class.php.

References createDatabase().

◆ createTable()

static Schema::createTable (   $name,
  $exists,
  $fields,
  $types,
  $nulls,
  $default,
  $unique,
  $engine = 'MyISAM',
  $charset = 'utf8',
  $prime = '',
  $autoin = '' 
)
static

SQL create table syntax

Parameters
string$nameWhat are we calling the table?
bool$existsIf not exists?
array$fieldsThe fields and names.
array$typesThe types for the fields.
array$nullsWhich fields to have null or not.
array$defaultDefault values for field(s).
array$uniqueThe unique fields.
string$engineThe db engine for the table.
string$charsetThe charset to use for the table.
string$primeThe primary field, if one.
string$autoinThe auto increment field.
Exceptions
Exception
Returns
string

Definition at line 306 of file schema.class.php.

References $exists.

Referenced by ClientUpdaterManager\install(), DirCleanerManager\install(), GreenFogManager\install(), GroupAssociationManager\install(), GroupManager\install(), HistoryManager\install(), HostAutoLogoutManager\install(), HostManager\install(), HostScreenSettingManager\install(), ImageAssociationManager\install(), ImageManager\install(), ImagePartitionTypeManager\install(), ImageTypeManager\install(), ImagingLogManager\install(), InventoryManager\install(), IpxeManager\install(), KeySequenceManager\install(), MACAddressAssociationManager\install(), ModuleAssociationManager\install(), ModuleManager\install(), MulticastSessionAssociationManager\install(), MulticastSessionManager\install(), NodeFailureManager\install(), OSManager\install(), OUIManager\install(), PluginManager\install(), PowerManagementManager\install(), PrinterAssociationManager\install(), PrinterManager\install(), PXEMenuOptionsManager\install(), ScheduledTaskManager\install(), SchemaManager\install(), ServiceManager\install(), SnapinAssociationManager\install(), SnapinGroupAssociationManager\install(), SnapinJobManager\install(), SnapinManager\install(), SnapinTaskManager\install(), StorageGroupManager\install(), StorageNodeManager\install(), TaskLogManager\install(), TaskManager\install(), TaskStateManager\install(), TaskTypeManager\install(), UserCleanupManager\install(), UserManager\install(), UserTrackingManager\install(), VirusManager\install(), AccessControlAssociationManager\install(), AccessControlManager\install(), AccessControlRuleAssociationManager\install(), AccessControlRuleManager\install(), CaponeManager\install(), FileIntegrityManager\install(), HostStatusManager\install(), LDAPManager\install(), LocationAssociationManager\install(), LocationManager\install(), PushbulletManager\install(), SiteHostAssociationManager\install(), SiteManager\install(), SiteUserAssociationManager\install(), SiteUserRestrictionManager\install(), SlackManager\install(), SubnetgroupManager\install(), WindowsKeyAssociationManager\install(), WindowsKeyManager\install(), and WolbroadcastManager\install().

◆ dropDuplicateData()

Schema::dropDuplicateData (   $dbname,
  $table = array(),
  $indexNeeded = false 
)

Recreates the database passed and removes duplicate data

Parameters
string$dbnamethe database name
string$tablethe table name
bool$indexNeededindex is needed
Returns
void

Definition at line 92 of file schema.class.php.

◆ dropTable()

static Schema::dropTable (   $name)
static

The sql to drop the table passed.

Parameters
string$nameThe table name to drop.
Returns
string

Definition at line 411 of file schema.class.php.

Referenced by FOGManagerController\uninstall().

◆ exportdb()

Schema::exportdb (   $backup_name = '',
  $remove_file = true 
)

Export the db and present it as a file.

Parameters
string$backup_nameThe backup name to use.
bool$remove_fileRemove the backup when done.
Returns
string The filename to export from.

Definition at line 186 of file schema.class.php.

References $file, and FOGBase\getClass().

◆ getDBName()

static Schema::getDBName ( )
static

Simply returns the database name

Returns
string

Definition at line 57 of file schema.class.php.

◆ importdb()

Schema::importdb (   $file)

Imports the database and updates the db.

Parameters
string$fileThe filename to import from.
Returns
string|bool

Definition at line 231 of file schema.class.php.

References $file.

◆ useDatabaseQuery()

static Schema::useDatabaseQuery ( )
static

Ensures we're using the database

Returns
string

Definition at line 75 of file schema.class.php.

Member Data Documentation

◆ $databaseFields

Schema::$databaseFields
protected
Initial value:
= array(
'id' => 'vID',
'version' => 'vValue',
)

Definition at line 48 of file schema.class.php.

◆ $databaseTable

Schema::$databaseTable = 'schemaVersion'
protected

Definition at line 42 of file schema.class.php.

◆ $operators

Schema::$operators
protected
Initial value:
= [
'=', '<', '>', '<=', '>=', '<>', '!=',
'like', 'like binary', 'not like', 'between', 'ilike',
'&', '|', '^', '<<', '>>',
'rlike', 'regexp', 'not regexp',
'~', '~*', '!~', '!~*', 'similar to',
'not similar to', 'not ilike', '~~*', '!~~*'
]

Definition at line 29 of file schema.class.php.


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