Login   Register  
PHP Classes
elePHPant
Icontem

File: docs/PHP_API.txt

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Guilherme Blanco  >  pAjax  >  docs/PHP_API.txt  >  Download  
File: docs/PHP_API.txt
Role: Documentation
Content type: text/plain
Description: PHP API Documentation
Class: pAjax
Do RPC calls from the browser without page reloads
Author: By
Last change: Added content
Date: 2005-09-28 05:59
Size: 6,111 bytes
 

Contents

Class file image Download
###############################################################################
# pAjax                                                               PHP API #
###############################################################################
# Created:            # CopyrightŪ 2005, PontUKom Corp # Updated:             #
#   2005-09-21 17:19  #        Guilherme Blanco        #   2005-09-22 11:40   #
###############################################################################


NOTE: Protected and private methods were not detailed. This means that you 
should never try to use these functions directly in your pAjax Application. I
am not the responsable for script hackings, using private methods to execute 
some special behaviour.


+-----------------------------------------------------------------------------+
| Class: pAjax                                                                |
+-----------------------------------------------------------------------------+
PHP Handler of all pAjax Requests. No inheritance is needed here. Provides few
methods and static methods to handle the whole structure. Via enable/disable
methods, you can set up more or less protection on server against cracking, but
more protection, more limitations.
JS support is available via "showJavaScript" static method. This means that if
the programmer want to split the page in client and server, it's not necessary
to instanciate a pAjax object on client page.
"handleRequest" method supports any type of encoding via the optional available
parameter (default is UTF-8). It controls the request and call the right 
function requested from JS code, and fires Exceptions if any errors were found.
"export" method is available if export protection is enabled, meaning that only
exported methods/functions can be fired. An Exception is fired if method called
was not exported.


| Private methods
+------------------------------------------------------------------------------
| execCall
| isValidDomain
| isValidFunction
+------------------------------------------------------------------------------


| pAjax(void)
+------------------------------------------------------------------------------
| Build a pAjax instance
+------------------------------------------------------------------------------
| Type: Constructor
| Access: public
| Return: pAjax object
+------------------------------------------------------------------------------


| handleRequest([string charset = "UTF-8"])
+------------------------------------------------------------------------------
| Handle the request call, fires the right method and report errors occurred
+------------------------------------------------------------------------------
| Type: Instance method
| Access: public
| Return: void
| Arguments:
|    - XML Document charset (optional. default: UTF-8)
+------------------------------------------------------------------------------


| showJavaScript([string directory = "."])
+------------------------------------------------------------------------------
| Print JS file calls for pAjax Application
+------------------------------------------------------------------------------
| Type: Static method
| Access: public
| Return: void
| Arguments:
|    - Dir reference of JS files (optional. default: Dir of the current file)
+------------------------------------------------------------------------------


| export([mixed method [, ...])
+------------------------------------------------------------------------------
| Export a function or method to be accessed from pAjax if exportProtection is
| enabled.
+------------------------------------------------------------------------------
| Type: Instance method
| Access: public
| Return: void
| Arguments:
|    - String or Array of methods to be exported
|    - ...
+------------------------------------------------------------------------------


| enableDomainProtection(void)
+------------------------------------------------------------------------------
| Enable Domain protection (allows pAjax calls fired only on the same server)
+------------------------------------------------------------------------------
| Type: Instance method
| Access: public
| Return: void
+------------------------------------------------------------------------------


| enableExportProtection(void)
+------------------------------------------------------------------------------
| Enable Export Method protection (only defined functions can be called)
+------------------------------------------------------------------------------
| Type: Instance method
| Access: public
| Return: void
+------------------------------------------------------------------------------


| disableDomainProtection(void)
+------------------------------------------------------------------------------
| Disable Domain protection (allows pAjax calls fired only on the same server)
+------------------------------------------------------------------------------
| Type: Instance method
| Access: public
| Return: void
+------------------------------------------------------------------------------


| disableExportProtection(void)
+------------------------------------------------------------------------------
| Disable Export Method protection (only defined functions can be called)
+------------------------------------------------------------------------------
| Type: Instance method
| Access: public
| Return: void
+------------------------------------------------------------------------------






+-----------------------------------------------------------------------------+
| Class: pAjaxParser                                                          |
+-----------------------------------------------------------------------------+
Internal class to handle XML generation and XML Processment. Never use this
class in your pAjax Application. I'm not responsable for strange behaviours if
you try to use it. Details about this class will not be given.