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

Class: HTML_Progress2_Ajax_Common

Source Location: /HTML_Progress2-2.3.0a1/Progress2/Ajax/Common.php

Class Overview


Ajax driver base class.


Author(s):

Version:

  • Release: 2.3.0a1

Copyright:

  • 2007 The PHP Group

Variables

Methods


Child classes:

HTML_Progress2_Ajax_StdDOMxml
Ajax standard DOM XML driver class.

Inherited Variables

Inherited Methods


Class Details

[line 55]
Ajax driver base class.

Provide common methods of all AJAX driver class.

Here is a basic example:

  1.  <?php
  2.  require_once 'HTML/Progress2.php';
  3.  
  4.  $pb = new HTML_Progress2();
  5.  // try to register the standard DOM XML Ajax driver
  6.  $ae $pb->registerAjax();
  7.  if ($ae{
  8.    $ae->setRequestUri(basename(__FILE__));
  9.    $ae->setRequestMethod('post');
  10.    $ae->setRequestTimeout(2500);
  11.    $ae->setUrlArguments('startTask''targetId');
  12.  }
  13.  ?>



[ Top ]


Class Variables

$method =

[line 82]

Http request mode (GET or POST).
  • Since: 2.3.0a1
  • Access: public

Type:   string


[ Top ]

$timeout =

[line 91]

Delay in millisecond between each new polling loop starts.
  • Since: 2.3.0a1
  • Access: public

Type:   string


[ Top ]

$url =

[line 73]

Server script URL that handle Ajax client tasks.
  • Since: 2.3.0a1
  • Access: public

Type:   string


[ Top ]

$url_args =

[line 101]

Arguments to negotiate a new task identifier and passing though the server on polling loop.
  • Since: 2.3.0a1
  • Access: public

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 114]

HTML_Progress2_Ajax_Common __construct( &$obj, object $obj)

Constructor (ZE2) Summary

Creates an Ajax progress-meter basic driver


Overridden in child classes as:

HTML_Progress2_Ajax_StdDOMxml::__construct()
Constructor (ZE2) Summary

Parameters:

object   $obj   —  reference to a progress2 object
   &$obj   — 

[ Top ]

getRequestMethod   [line 226]

string getRequestMethod( )

get HTTP Ajax requests method.

Retrieve the request method to send Ajax client data to remote server.

  • Return: GET or POST
  • Since: 2.3.0a1
  • Access: public

[ Top ]

getRequestTimeout   [line 272]

int getRequestTimeout( )

get the timeout between each polling loop.

Retrieve the time to wait before requesting new fresh data from remote server

  • Since: 2.3.0a1
  • Access: public

[ Top ]

getRequestUri   [line 159]

string getRequestUri( [int $action = 0])

get URL that handle Ajax requests.

Retrieve server script URLs that will handle Ajax client requests.

  • Since: 2.3.0a1
  • Throws: HTML_PROGRESS2_ERROR_INVALID_INPUT
  • Access: public

Parameters:

int   $action   —  (optional) fullpath to server script 0: without query string 1: with query string to negociate task id action 2: with query string to proceed task id

[ Top ]

getScript   [line 340]

string getScript( boolean $raw)

Returns javascript progress meter handler.

Ajax code to handle the progress meter polling sequence.


Overridden in child classes as:

HTML_Progress2_Ajax_StdDOMxml::getScript()
Returns javascript progress meter handler.

Parameters:

boolean   $raw   —  html output with script tags or just raw data

[ Top ]

getUrlArguments   [line 321]

array getUrlArguments( )

get action arguments to handle task id.

Retrieve url mapped action to handle task id.

  • Return: 0: argument name to handle action of task id creation 1: argument name to handle identify of task id
  • Since: 2.3.0a1
  • Throws: HTML_PROGRESS2_ERROR_INVALID_INPUT
  • Access: public

[ Top ]

setRequestMethod   [line 198]

void setRequestMethod( [string $type = 'GET'])

set HTTP Ajax requests method.

Defines the request method to send Ajax client data to remote server.

  • Since: 2.3.0a1
  • Throws: HTML_PROGRESS2_ERROR_INVALID_INPUT
  • Access: public

Parameters:

string   $type   —  (optional) method to send data (GET or POST) Default value is GET.

[ Top ]

setRequestTimeout   [line 244]

void setRequestTimeout( [int $delay = 2000])

set timeout between each polling loop.

Defines the time to wait before requesting new fresh data from remote server

  • Since: 2.3.0a1
  • Throws: HTML_PROGRESS2_ERROR_INVALID_INPUT
  • Access: public

Parameters:

int   $delay   —  (optional) delay should be positive and greater than 1000 (to avoid server overload) Default value is 2000 (2 seconds).

[ Top ]

setRequestUri   [line 133]

void setRequestUri( string $url)

set URL to handle Ajax requests.

Defines the server script URL that will handle Ajax client requests.

  • Since: 2.3.0a1
  • Throws: HTML_PROGRESS2_ERROR_INVALID_INPUT
  • Access: public

Parameters:

string   $url   —  Server script URL

[ Top ]

setUrlArguments   [line 291]

void setUrlArguments( [string $action1 = 'registerTask'], [string $action2 = 'TaskId'])

set action arguments to handle task id.

Defines url mapped action to handle task id.

  • Since: 2.3.0a1
  • Throws: HTML_PROGRESS2_ERROR_INVALID_INPUT
  • Access: public

Parameters:

string   $action1   —  (optional) argument name to handle action of task id creation Default value is 'createTaskId'
string   $action2   —  (optional) argument name to handle identify of task id Default value is 'TaskId'

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:54:30 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright Š PHP Group 2004.