Show
Ignore:
Timestamp:
06/19/08 13:31:51 (5 months ago)
Author:
llaumgui
Message:

Retrait de l'opérateur Tidy

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ez_publish/myutils/trunk/autoloads/myutils_operators.php

    r164 r183  
    4343                                                                        'is_debug_enabled', 
    4444                                                                        'path_to_path_array', 
    45                                                                         'php_tidy', 
    4645                                                                        'redirect', 
    4746                                                                        'str_ireplace', 
     
    7473                                                'path_to_path_array'                    => array( 
    7574                                                                'path'                  => array( 'type'        => 'array', 'required' => true, 'default' => ''  ), 
    76                                                                                                         ), 
    77  
    78                                                 'php_tidy'                                              => array( 
    79                                                                 'string'                => array( 'type'        => 'string', 'required' => true, 'default' => ''  ), 
    8075                                                                                                        ), 
    8176 
     
    118113                        $operatorValue = $this->path2PathArray(         $namedParameters['path'] ); 
    119114                        break; 
    120                                  
    121                         case 'php_tidy': 
    122                         $operatorValue = $this->phpTidy(        $namedParameters['string'] ); 
    123                         break; 
    124115 
    125116                        case 'redirect': 
     
    206197        } 
    207198 
    208          
    209          
    210         /** 
    211          * Métrosexualisation du code avec Tidy 
    212          *        
    213          * @author Guillaume Kulakowski <guillaume_AT_llaumgui_DOT_com> 
    214          * @since 1.0 
    215          * 
    216          * @param array $path 
    217          * @return array 
    218          */ 
    219         function phpTidy( $path ) 
    220         { 
    221                 if ( function_exists( 'tidy_get_output') ) 
    222                 { 
    223                         $tidy   = new tidy(); 
    224                         /* Mettre dans un tidy.conf  */ 
    225                         $config         = array(        'indent'                                => true, 
    226                                                                         'output-xhtml'                  => true, 
    227                                                                         'wrap'                                  => 400, 
    228                                                                         'hide-comments'                 => false,   
    229                                                                         'doctype'                               => 'auto',   
    230                                                                 ); 
    231                         $encoding       = 'UTF8'; 
    232                         $tidy->parseString( $originalMarkup, $config, $encoding ); 
    233                         $tidy->CleanRepair(); 
    234                         if ( $tidy->errorBuffer ) { 
    235                         //echo "Les erreurs suivantes ont été détectées :\n"; 
    236                         //echo $tidy->errorBuffer; 
    237                         } 
    238                         return (string) $tidy; 
    239                 } 
    240         } 
     199 
    241200 
    242201        /**