NAJAX Server Class.
This class is used to handle client callbacks.
Example:
- <?php
- require_once('najax.php');
- class Calculator
- {
- var $result;
- function Calculator()
- {
- $this->result = 0;
- }
- function Add($arg)
- {
- $this->result += $arg;
- }
- }
- NAJAX_Server::runServer();
- ?>
Located in /classes/Server.class.php (line 77)
NAJAX_Observable | --NAJAX_Server
Adds a NAJAX_Server events observer.
Adds specified classes to the allowed classes map.
Example:
- <?php
- class AllowedClass
- {
- function call() { return 'AllowedClass->call()'; }
- }
- class DeniedClass
- {
- function call() { return 'DeniedClass->call()'; }
- }
- require_once('najax.php');
- NAJAX_Server::allowClasses('AllowedClass');
- if (NAJAX_Server::runServer()) {
- exit;
- }
- ?>
- <?= NAJAX_Utilities::header() ?>
- <script type="text/javascript">
- var allowedClass = <?= NAJAX_Client::register(new AllowedClass()) ?>;
- var deniedClass = <?= NAJAX_Client::register(new DeniedClass()) ?>;
- alert(allowedClass.call());
- // This line will throw an exception.
- // DeniedClass is not in the allowed classes list.
- alert(deniedClass.call());
- </script>
Adds specified classes to the denied classes map.
Example:
- <?php
- class AllowedClass
- {
- function call() { return 'AllowedClass->call()'; }
- }
- class DeniedClass
- {
- function call() { return 'DeniedClass->call()'; }
- }
- require_once('najax.php');
- NAJAX_Server::denyClasses('DeniedClass');
- if (NAJAX_Server::runServer()) {
- exit;
- }
- ?>
- <?= NAJAX_Utilities::header() ?>
- <script type="text/javascript">
- var allowedClass = <?= NAJAX_Client::register(new AllowedClass()) ?>;
- var deniedClass = <?= NAJAX_Client::register(new DeniedClass()) ?>;
- alert(allowedClass.call());
- // This line will throw an exception.
- // DeniedClass is in the denied classes list.
- alert(deniedClass.call());
- </script>
Handles all errors that occur during the callback.
Only E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR and E_USER_ERROR will halt the callback and throw an exception.
Checks if the request is a client callback to the server and initializes callback parameters.
Checks if a class can be accessed within a callback request.
Loads a specified class from the classes map.
Adds a specified class to the classes map.
Example:
- <?php
- require_once('najax.php');
- NAJAX_Server::mapClass('Calculator', 'Calculator.class.php');
- NAJAX_Server::mapClass('EnglishDictionary', array('BaseDictionary.class.php', 'EnglishDictionary.class.php'));
- NAJAX_Server::runServer();
- ?>
Checks if the request is a client callback to the server and handles it.
Throws a NAJAX callback exception.
Inherited From NAJAX_Observable
NAJAX_Observable::addObserver()
NAJAX_Observable::notifyObservers()
Documentation generated on Tue, 20 Sep 2005 21:40:29 +0300 by phpDocumentor 1.3.0RC3