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)  

Initiator Class Reference

Public Member Functions

 __construct ()
 

Static Public Member Functions

static storeInSession ($key, $value)
 
static unsetSession ($key)
 
static getFromSession ($key)
 
static csrfGenToken ($formname)
 
static startInit ()
 
static sanitizeItems (&$value='')
 
static sanitizeOutput ($buffer)
 

Static Private Member Functions

static _determineBasePath ()
 
static _verCheck ()
 
static _extCheck ()
 

Static Private Attributes

static $_sanitizeItems
 

Detailed Description

Definition at line 34 of file init.php.

Constructor & Destructor Documentation

◆ __construct()

Initiator::__construct ( )

Constructs the initiator class

Returns
void

Lambda to sanitize our user input data.

Parameters
mixed$keythe key of the array.
mixed$valthe value of the array.
Returns
void

Find out if the link has service in the call.

Set useragent to false.

If user agent is passed, define the useragent

Define our base path (/var/www/, /var/www/html/, etc...)

Regex pattern to search for files of type.

Use our basepath and find all files that are not dots.

Create iterator item based on the directory iterator returns.

Filter our iterator using the regex applied earlier.

Set our iterator items into an array format.

Define all paths as an array.

Loop our paths from earlier storing the dirname of the element.

Set our include paths as all paths.

Pass our autoloaded items through our custom loader method.

If we are not a service file and we have a user agent string and the Session hasn't been started, Start the session.

Definition at line 47 of file init.php.

References $paths, and $val.

Member Function Documentation

◆ _determineBasePath()

static Initiator::_determineBasePath ( )
staticprivate

Gets the base path and sets WEB_ROOT constant

Returns
string the base path as determined.

Definition at line 235 of file init.php.

◆ _extCheck()

static Initiator::_extCheck ( )
staticprivate

Checks required extensions are installed

Exceptions
Exception
Returns
void

List of required extensions.

Get the loaded extensions.

Cross reference our required with what's loaded.

If the count doesn't match our required we know we're missing something.

Definition at line 370 of file init.php.

Referenced by startInit().

◆ _verCheck()

static Initiator::_verCheck ( )
staticprivate

Checks the php version is good with current system

Returns
void

If the version is less than 5.5.0 fail.

Definition at line 345 of file init.php.

References exit.

Referenced by startInit().

◆ csrfGenToken()

static Initiator::csrfGenToken (   $formname)
static

Generates token for csrf prevention.

Parameters
string$formnameThe form name to generate token for.
Returns
string

Definition at line 225 of file init.php.

References FOGBase\createSecToken(), and storeInSession().

◆ getFromSession()

static Initiator::getFromSession (   $key)
static

Get from session.

Parameters
string$keyThe key to get.
Returns
string|bool

Definition at line 211 of file init.php.

◆ sanitizeItems()

static Initiator::sanitizeItems ( $value = '')
static

Sanitizes output

Parameters
mixed$valuethe value to sanitize
Returns
string|array

If the value isn't specified, it will sanitize all REQUEST, COOKIE, POST, and GET data. Otherwise it will clean the passed value.

Definition at line 311 of file init.php.

References $process.

Referenced by FOGClient\__construct(), PDODB\_clean(), FOGBase\arrayChangeKey(), and ServiceModule\send().

◆ sanitizeOutput()

static Initiator::sanitizeOutput (   $buffer)
static

Cleans the buffer

Parameters
string$bufferbuffer to clean
Returns
string the cleaned up buffer

Line commented for clarity

Replaces what's found with same element here.

Perform our replace.

Returns the cleaned data.

Definition at line 404 of file init.php.

◆ startInit()

static Initiator::startInit ( )
static

Initiates the environment

Returns
void

Setup our error reporting information.

This enables the autoloader to work.

Check if the version of php is valid.

Check if the extensions fog needs are available.

Sets up variables for sub/node callers among other request/post/get variables for neater access.

Sets our variables to always be trimmed.

Initialize the system itself.

Initialize the configuration.

Definition at line 248 of file init.php.

References _extCheck(), and _verCheck().

◆ storeInSession()

static Initiator::storeInSession (   $key,
  $value 
)
static

Stores session csrf token.

Parameters
string$keyThe session key to store.
string$valueThe value to store.
Returns
void

If session isn't set return immediately.

Definition at line 179 of file init.php.

Referenced by csrfGenToken().

◆ unsetSession()

static Initiator::unsetSession (   $key)
static

Unset the session token.

Parameters
string$keyThe key to unset.
Returns
void

Definition at line 196 of file init.php.

Member Data Documentation

◆ $_sanitizeItems

Initiator::$_sanitizeItems
staticprivate

Definition at line 41 of file init.php.


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