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)  

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

Public Member Functions

 __construct ($callback=null)
 
 __destruct ()
 
 __get ($name)
 
 __set ($name, $value)
 
 add ($request)
 
 request ( $url, $method='GET', $postData=array(), $headers=array(), $options=array())
 
 get ( $url, $headers=null, $options=null)
 
 post ( $url, $post_data=null, $headers=null, $options=null)
 
 execute ($window_size=null)
 
 process ( $urls, $method='GET', $data=null, $sendAsJSON=false, $auth=false, $callback=false, $file=false, $timeout=false)
 
 isAvailable ($urls, $timeout=30, $port=-1)
 
- Public Member Functions inherited from FOGBase
 __construct ()
 
 __toString ()
 
 orderBy (&$orderBy)
 

Public Attributes

 $options
 

Private Member Functions

 _singleCurl ()
 
 _rollingCurl ($window_size=null)
 
 _getOptions ($request)
 
 _validUrl (&$url)
 

Private Attributes

 $_windowSize = 20
 
 $_aconntimeout = 2000
 
 $_conntimeout = 15
 
 $_timeout = 86400
 
 $_callback = ''
 
 $_response = array()
 
 $_headers = array()
 
 $_requests = array()
 
 $_requestMap = array()
 

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
 
- 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)
 
- Protected Attributes inherited from FOGBase
 $isLoaded = array()
 
- 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 fogurlrequests.class.php.

Constructor & Destructor Documentation

◆ __construct()

FOGURLRequests::__construct (   $callback = null)

Initializes our url requests object.

Parameters
string$callbackOptional callback

Definition at line 104 of file fogurlrequests.class.php.

References $_conntimeout, $_timeout, and FOGBase\getSubObjectIDs().

◆ __destruct()

FOGURLRequests::__destruct ( )

Cleans up when no longer needed.

Definition at line 153 of file fogurlrequests.class.php.

Referenced by isAvailable(), and process().

Member Function Documentation

◆ __get()

FOGURLRequests::__get (   $name)

Magic caller to get specialized methods in a common method.

Parameters
string$nameThe method to get
Returns
mixed

Definition at line 174 of file fogurlrequests.class.php.

Referenced by _getOptions().

◆ __set()

FOGURLRequests::__set (   $name,
  $value 
)

Magic caller to set specialized methods in a common method.

Parameters
string$nameThe method to set
mixed$valueThe value to set
Returns
object

Definition at line 193 of file fogurlrequests.class.php.

◆ _getOptions()

FOGURLRequests::_getOptions (   $request)
private

Get options of the request and whole.

Parameters
FOGRollingURL$requestthe request to get options from
Returns
array

Definition at line 430 of file fogurlrequests.class.php.

References $ip, $options, $password, $url, $username, __get(), _validUrl(), and FOGBase\getSubObjectIDs().

Referenced by _rollingCurl(), and _singleCurl().

◆ _rollingCurl()

FOGURLRequests::_rollingCurl (   $window_size = null)
private

Perform multiple url requests.

Parameters
mixed$window_sizeThe customized window size to use
Returns
mixed

Definition at line 354 of file fogurlrequests.class.php.

References $_requests, $_response, $_timeout, $_windowSize, FOGBase\$info, $options, $output, and _getOptions().

Referenced by execute().

◆ _singleCurl()

FOGURLRequests::_singleCurl ( )
private

Run a single url request.

Returns
mixed

Definition at line 332 of file fogurlrequests.class.php.

References FOGBase\$info, $options, $output, and _getOptions().

Referenced by execute().

◆ _validUrl()

FOGURLRequests::_validUrl ( $url)
private

Function simply ensures the url is valid.

Parameters
string$urlThe url test check
Returns
string

Definition at line 497 of file fogurlrequests.class.php.

References $url.

Referenced by _getOptions().

◆ add()

FOGURLRequests::add (   $request)

Add a request to the requests variable.

Parameters
FOGRollingURL$requestthe request to add
Returns
object

Definition at line 220 of file fogurlrequests.class.php.

◆ execute()

FOGURLRequests::execute (   $window_size = null)

Actually executes the requests. If only one request, perform a _singleCurl. If multiple perform _rollingCurl.

Parameters
mixed$window_sizeThe window size to allow at run time
Returns
object

Definition at line 309 of file fogurlrequests.class.php.

References _rollingCurl(), and _singleCurl().

Referenced by process().

◆ get()

FOGURLRequests::get (   $url,
  $headers = null,
  $options = null 
)

Get method url request definition.

Parameters
string$urlThe url to request to
mixed$headersThe custom headers to send with this
mixed$optionsThe custom options to send with this
Returns
object

Definition at line 263 of file fogurlrequests.class.php.

References $options, $url, and request().

◆ isAvailable()

FOGURLRequests::isAvailable (   $urls,
  $timeout = 30,
  $port = -1 
)

Quick test if url is available.

Parameters
string$urlsthe url to check.
int$timeoutthe timeout value.
int$portthe port to test on.
Returns
void

Definition at line 575 of file fogurlrequests.class.php.

References $output, $url, $urls, and __destruct().

◆ post()

FOGURLRequests::post (   $url,
  $post_data = null,
  $headers = null,
  $options = null 
)

Post method url request definition.

Parameters
string$urlThe url to request to
mixed$post_dataThe post data to send
mixed$headersThe custom headers to send with this
mixed$optionsThe custom options to send with this
Returns
object

Definition at line 286 of file fogurlrequests.class.php.

References $options, $url, and request().

Referenced by process().

◆ process()

FOGURLRequests::process (   $urls,
  $method = 'GET',
  $data = null,
  $sendAsJSON = false,
  $auth = false,
  $callback = false,
  $file = false,
  $timeout = false 
)

Processes the requests as needed.

Parameters
mixed$urlsthe urls to process
string$methodthe method to use for all urls
mixed$datapost/get data possibly
bool$sendAsJSONSend data as json if needed
mixed$authAny authorization data needed
string$callbackA callback to use if needed
string$fileA filename to use to download a file
mixed$timeoutallow updating timeout values
Returns
array

Definition at line 520 of file fogurlrequests.class.php.

References $data, $file, $url, $urls, __destruct(), execute(), and post().

◆ request()

FOGURLRequests::request (   $url,
  $method = 'GET',
  $postData = array(),
  $headers = array(),
  $options = array() 
)

Generates the request and stores to our requests variable.

Parameters
string$urlThe url to request
string$methodThe method to call
mixed$postDataThe data to pass
mixed$headersAny additional request headers to send
mixed$optionsAny additional request options to use
Returns
object

Definition at line 237 of file fogurlrequests.class.php.

References $options, and $url.

Referenced by get(), and post().

Member Data Documentation

◆ $_aconntimeout

FOGURLRequests::$_aconntimeout = 2000
private

Definition at line 37 of file fogurlrequests.class.php.

◆ $_callback

FOGURLRequests::$_callback = ''
private

Definition at line 63 of file fogurlrequests.class.php.

◆ $_conntimeout

FOGURLRequests::$_conntimeout = 15
private

Definition at line 45 of file fogurlrequests.class.php.

Referenced by __construct().

◆ $_headers

FOGURLRequests::$_headers = array()
private

Definition at line 85 of file fogurlrequests.class.php.

◆ $_requestMap

FOGURLRequests::$_requestMap = array()
private

Definition at line 98 of file fogurlrequests.class.php.

◆ $_requests

FOGURLRequests::$_requests = array()
private

Definition at line 91 of file fogurlrequests.class.php.

Referenced by _rollingCurl().

◆ $_response

FOGURLRequests::$_response = array()
private

Definition at line 69 of file fogurlrequests.class.php.

Referenced by _rollingCurl().

◆ $_timeout

FOGURLRequests::$_timeout = 86400
private

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

Referenced by __construct(), and _rollingCurl().

◆ $_windowSize

FOGURLRequests::$_windowSize = 20
private

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

Referenced by _rollingCurl().

◆ $options

FOGURLRequests::$options
Initial value:
= array(
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_RETURNTRANSFER => true,
)

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

Referenced by _getOptions(), _rollingCurl(), _singleCurl(), get(), post(), and request().


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