[ Index ]
 

Code source de Horde 3.1.3

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

title

Body

[fermer]

/lib/VFS/ISOWriter/ -> RealInputStrategy.php (source)

   1  <?php
   2  
   3  /**
   4   * Encapsulate strategies for getting a real, local filesystem structure from
   5   * a VFS.
   6   *
   7   * $Horde: framework/VFS_ISOWriter/ISOWriter/RealInputStrategy.php,v 1.1.8.7 2006/01/01 21:28:43 jan Exp $
   8   *
   9   * Copyright 2004-2006 Cronosys, LLC <http://www.cronosys.com/>
  10   *
  11   * See the enclosed file COPYING for license information (LGPL). If you
  12   * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
  13   *
  14   * @author  Jason M. Felice <jfelice@cronosys.com>
  15   * @package VFS_ISO
  16   * @since   Horde 3.0
  17   */
  18  class VFS_ISOWriter_RealInputStrategy {
  19  
  20      /**
  21       * A reference to the source VFS we want to read.
  22       *
  23       * @var VFS
  24       */
  25      var $_sourceVfs = null;
  26  
  27      /**
  28       * The root directory within the source VFS
  29       *
  30       * @var string
  31       */
  32      var $_sourceRoot;
  33  
  34      function VFS_ISOWriter_RealInputStrategy(&$sourceVfs, $sourceRoot)
  35      {
  36          $this->_sourceVfs = &$sourceVfs;
  37          $this->_sourceRoot = &$sourceRoot;
  38      }
  39  
  40      /**
  41       * Get a real path to the input tree.
  42       *
  43       * @abstract
  44       * @return mixed    A string with the real path, or PEAR_Error on failure.
  45       */
  46      function getRealPath()
  47      {
  48          return PEAR::raiseError(_("Not implemented."));
  49      }
  50  
  51      /**
  52       * Indicate we are finished with this input strategy.
  53       *
  54       * @abstract
  55       * @return mixed        Null or PEAR_Error on failure.
  56       */
  57      function finished()
  58      {
  59          return PEAR::raiseError(_("Not implemented."));
  60      }
  61  
  62      /**
  63       * Decide which strategy to use to get a real FS and create it.
  64       *
  65       * @static
  66       *
  67       * @param object &$sourceVfs        The VFS we want to read from.
  68       * @param string $sourceRoot        The root directory in that VFS.
  69       * @return object   A concrete strategy or PEAR_Error if no strategy is
  70       *                  available.
  71       */
  72      function factory(&$sourceVfs, $sourceRoot)
  73      {
  74          if (strtolower(get_class($sourceVfs)) == 'vfs_file') {
  75              $method = 'direct';
  76          } else {
  77              $method = 'copy';
  78          }
  79  
  80          @include_once dirname(__FILE__) . '/RealInputStrategy/' . $method .
  81                        '.php';
  82          $class = 'VFS_ISOWriter_RealInputStrategy_' . $method;
  83          if (!class_exists($class)) {
  84              return PEAR::raiseError(sprintf(_("Could not load strategy \"%s\"."),
  85                                              $method));
  86          }
  87  
  88          $strategy = &new $class($sourceVfs, $sourceRoot);
  89          return $strategy;
  90      }
  91  
  92  }
  93  


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