home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / PHP / Beautifier / Batch / Output / FilesTar.php < prev   
Encoding:
PHP Script  |  2008-07-02  |  2.4 KB  |  65 lines

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  3. /**
  4. * Handle the batch process for one/multiple php files to one tar compressed file
  5. *
  6. * PHP version 5
  7. *
  8. * LICENSE: This source file is subject to version 3.0 of the PHP license
  9. * that is available through the world-wide-web at the following URI:
  10. * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  11. * the PHP License and are unable to obtain it through the web, please
  12. * send a note to license@php.net so we can mail you a copy immediately.
  13. * @category   PHP
  14. * @package PHP_Beautifier
  15. * @subpackage Batch
  16. * @author Claudio Bustos <cdx@users.sourceforge.com>
  17. * @copyright  2004-2006 Claudio Bustos
  18. * @link     http://pear.php.net/package/PHP_Beautifier
  19. * @link     http://beautifyphp.sourceforge.net
  20. * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  21. * @version    CVS: $Id:$
  22. */
  23. /**
  24. * Require Archive_Tar
  25. */
  26. include_once 'Archive/Tar.php';
  27. /**
  28. * Handle the batch process for one/multiple php files to one tar compressed file
  29. * @category   PHP
  30. * @package PHP_Beautifier
  31. * @author Claudio Bustos <cdx@users.sourceforge.com>
  32. * @copyright  2004-2006 Claudio Bustos
  33. * @link     http://pear.php.net/package/PHP_Beautifier
  34. * @link     http://beautifyphp.sourceforge.net
  35. * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  36. * @version    Release: 0.1.14
  37. */
  38. class PHP_Beautifier_Batch_Output_FilesTar extends PHP_Beautifier_Batch_Output {
  39.     protected $oTar;
  40.     protected $sCompress=false;
  41.     protected $sExt="tar";
  42.     public function __construct(PHP_Beautifier_Batch $oBatch) 
  43.     {
  44.         parent::__construct($oBatch);
  45.         $sOutput = $this->oBatch->getOutputPath();
  46.         $sOutput = preg_replace("/(\.tar|\.tar\.gz|\.tgz|\.gz|\.tar\.bz2)$/", '', $sOutput) .".".$this->sExt;
  47.         PHP_Beautifier_Common::createDir($sOutput);
  48.         $this->oTar = new Archive_Tar($sOutput, $this->sCompress);
  49.     }
  50.     public function get() 
  51.     {
  52.         throw (new Exception("TODO"));
  53.     }
  54.     public function save() 
  55.     {
  56.         $aInputFiles = $this->oBatch->getInputFiles();
  57.         $aOutputFiles = PHP_Beautifier_Common::getSavePath($aInputFiles);
  58.         for ($x = 0;$x<count($aInputFiles);$x++) {
  59.             $this->beautifierSetInputFile($aInputFiles[$x]);
  60.             $this->beautifierProcess();
  61.             $this->oTar->addString($aOutputFiles[$x], $this->beautifierGet());
  62.         }
  63.     }
  64. }
  65. ?>