Source for file strip.php

Documentation is available at strip.php

  1. <?php
  2.  
  3. /**
  4.  * Strips the spaces at the beginning and end of each line and also the line breaks
  5.  * <pre>
  6.  *  * mode : sets the content being stripped, available mode are 'default' or 'js'
  7.  *    for javascript, which strips the comments to prevent syntax errors
  8.  * </pre>
  9.  *
  10.  * This software is provided 'as-is', without any express or implied warranty.
  11.  * In no event will the authors be held liable for any damages arising from the use of this software.
  12.  *
  13.  * @author     Jordi Boggiano <j.boggiano@seld.be>
  14.  * @copyright  Copyright (c) 2008, Jordi Boggiano
  15.  * @license    http://dwoo.org/LICENSE   Modified BSD License
  16.  * @link       http://dwoo.org/
  17.  * @version    1.1.0
  18.  * @date       2009-07-18
  19.  * @package    Dwoo
  20.  */
  21. {
  22.     public function init($mode "default")
  23.     {
  24.     }
  25.  
  26.     public static function preProcessing(Dwoo_Compiler $compilerarray $params$prepend$append$type)
  27.     {
  28.         return '';
  29.     }
  30.  
  31.     public static function postProcessing(Dwoo_Compiler $compilerarray $params$prepend$append$content)
  32.     {
  33.         $params $compiler->getCompiledParams($params);
  34.  
  35.         $mode trim($params['mode']'"\'');
  36.         switch ($mode{
  37.             case 'js':
  38.             case 'javascript':
  39.                 $content preg_replace('#(?<!:)//\s[^\r\n]*|/\*.*?\*/#s',''$content);
  40.  
  41.             case 'default':
  42.             default:
  43.         }
  44.  
  45.         $content preg_replace(array("/\n/","/\r/",'/(<\?(?:php)?|<%)\s*/')array('','','$1 ')preg_replace('#^\s*(.+?)\s*$#m''$1'$content));
  46.  
  47.         return $content;
  48.     }
  49. }

Documentation generated on Sat, 18 Jul 2009 21:05:22 +0200 by phpDocumentor 1.4.0