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

Source for file AJAX_Locking.php

Documentation is available at AJAX_Locking.php

  1. <?php
  2. /* vim: set number autoindent tabstop=2 shiftwidth=2 softtabstop=2: */
  3.  
  4. /**
  5. * AJAX_Locking
  6. *
  7. * An AJAX framework to manage object locking
  8. * PHP versions 4 and 5
  9. *
  10. * LICENSE: This source file is subject to version 3.0 of the PHP license
  11. * that is available through the world-wide-web at the following URI:
  12. * http://www.php.net/license/3_0.txt. If you did not receive a copy of
  13. * the PHP License and are unable to obtain it through the web, please
  14. * send a note to license@php.net so we can mail you a copy immediately.
  15. *
  16. * @category HTML
  17. * @package AJAX_Locking
  18. * @author Fabio Ambrosanio <fabio@ambrosanio.com>
  19. * @license http://www.php.net/license/3_01.txt PHP
  20. * @version @package_version@
  21. */
  22. require_once 'HTML/AJAX/Server.php';
  23.  
  24. define("AJAX_LOCKING_DRIVER_DEFAULT", "File");
  25.  
  26. /**
  27. * This class implement a AJAX technique to locking of any object that
  28. * is identified by an id.
  29. *
  30. */
  31. class AJAX_Locking extends HTML_AJAX_Server
  32. {
  33. var $initMethods = true;
  34. var $driver;
  35. /**
  36. * Constructor
  37. *
  38. * @return AJAX_Locking
  39. */
  40. function AJAX_Locking($driver = false)
  41. {
  42. parent::HTML_AJAX_Server();
  43. $this->driver = $driver;
  44.  
  45. // registers aux library
  46. $path = '@data-dir@'.DIRECTORY_SEPARATOR.'AJAX_Locking'.DIRECTORY_SEPARATOR.'js'.DIRECTORY_SEPARATOR;
  47. if(strpos($path, '@'.'data-dir@') === 0) {
  48. $path = realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'js').DIRECTORY_SEPARATOR;
  49. }
  50. $this->registerJSLibrary('Locking','Locking.js', $path);
  51. }
  52. /**
  53. * Register the driver as AJAX remote object
  54. *
  55. * @param uriver $driver
  56. */
  57. function initAjaxLocking()
  58. {
  59. if (!$this->driver) {
  60. require_once ( dirname(__FILE__) . "/Driver/" . AJAX_LOCKING_DRIVER_DEFAULT . ".php");
  61. $this->driver = new AJAX_Locking_Driver_SharedMemory();
  62. }
  63. $this->registerClass($this->driver, 'AjaxLocking');
  64. }
  65. }
  66.  
  67. ?>

Documentation generated on Tue, 13 Feb 2007 21:42:43 +0100 by phpDocumentor 1.3.0RC3