[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/SyncML/ -> Command.php (source)

   1  <?php
   2  
   3  include_once 'SyncML/State.php';
   4  
   5  /**
   6   * The SyncML_Command class provides a super class fo SyncBody
   7   * commands.
   8   *
   9   * $Horde: framework/SyncML/SyncML/Command.php,v 1.4.10.7 2006/01/01 21:28:36 jan Exp $
  10   *
  11   * Copyright 2003-2006 Anthony Mills <amills@pyramid6.com>
  12   *
  13   * See the enclosed file COPYING for license information (LGPL). If you
  14   * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
  15   *
  16   * @author  Anthony Mills <amills@pyramid6.com>
  17   * @since   Horde 3.0
  18   * @package SyncML
  19   */
  20  class SyncML_Command {
  21  
  22      /**
  23       * @var integer
  24       */
  25      var $_cmdID;
  26  
  27      /**
  28       * Internal structure used during XML parsing.
  29       *
  30       * @var array
  31       */
  32      var $_Stack = array();
  33  
  34      /**
  35       * @var string
  36       */
  37      var $_chars;
  38  
  39      function &factory($command, $params = null)
  40      {
  41          include_once 'SyncML/Command/' . $command . '.php';
  42          $class = 'SyncML_Command_' . $command;
  43          if (class_exists($class)) {
  44              $cmd = &new $class($params);
  45          } else {
  46              $GLOBALS['backend']->logMessage('Class definition of ' . $class . ' not found.',
  47                                              __FILE__, __LINE__, PEAR_LOG_ERR);
  48              include_once 'PEAR.php';
  49              $cmd = PEAR::raiseError('Class definition of ' . $class . ' not found.');
  50          }
  51  
  52          return $cmd;
  53      }
  54  
  55      function output($currentCmdID, $output)
  56      {
  57      }
  58  
  59      function startElement($uri, $localName, $attrs)
  60      {
  61          $this->_Stack[] = $localName;
  62      }
  63  
  64      function endElement($uri, $element)
  65      {
  66          switch (count($this->_Stack)) {
  67          case 2:
  68              if ($element == 'CmdID') {
  69                  $this->_cmdID = intval(trim($this->_chars));
  70              }
  71              break;
  72          }
  73  
  74          $this->_chars = '';
  75          array_pop($this->_Stack);
  76      }
  77  
  78      function characters($str)
  79      {
  80          $this->_chars .= $str;
  81      }
  82  
  83  }


Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7