[ Index ]
 

Code source de eGroupWare 1.2.106-2

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

title

Body

[fermer]

/phpgwapi/inc/horde/Horde/SyncML/ -> Command.php (source)

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


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