PHP Classes

File: tests/server.php

Recommend this page to a friend!
  Classes of Fabio Ambrosanio   AJAX Locking   tests/server.php   Download  
File: tests/server.php
Role: Auxiliary script
Content type: text/plain
Description: Example AJAX server
Class: AJAX Locking
Lock server side resources from AJAX requests
Author: By
Last change: Added example of use of AJAX_Locking_Driver_File driver
Date: 18 years ago
Size: 656 bytes
 

Contents

Class file image Download
<?php
require_once ('../AJAX_Locking.php');

//require_once('../Driver/SharedMemory.php');
//$driver = new AJAX_Locking_Driver_SharedMemory('file', false, 3600);

//require_once('../Driver/MDB2.php');
//$names = array(
// 'table' => 'ajaxlocks',
// 'columns' => array(
// 'user' => 'username',
// 'time' => 'expire'
// )
//);
//$driver = new AJAX_Locking_Driver_MDB2("mssql://test:test!@localhost/pubs", $names, 3600);

require_once('../Driver/File.php');
$driver = new AJAX_Locking_Driver_File('/tmp', 30);

$server = new AJAX_Locking($driver);
$server->registerJSLibrary('Locking','Locking.js', "../js/");

$server->handleRequest();
?>