Changeset 183
- Timestamp:
- 06/19/08 13:31:51 (4 months ago)
- Location:
- ez_publish/myutils/trunk/autoloads
- Files:
-
- 2 modified
-
eztemplateautoload.php (modified) (1 diff)
-
myutils_operators.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ez_publish/myutils/trunk/autoloads/eztemplateautoload.php
r164 r183 35 35 'is_debug_enabled', 36 36 'path_to_path_array', 37 'php_tidy',38 37 'redirect', 39 38 'str_ireplace', -
ez_publish/myutils/trunk/autoloads/myutils_operators.php
r164 r183 43 43 'is_debug_enabled', 44 44 'path_to_path_array', 45 'php_tidy',46 45 'redirect', 47 46 'str_ireplace', … … 74 73 'path_to_path_array' => array( 75 74 'path' => array( 'type' => 'array', 'required' => true, 'default' => '' ), 76 ),77 78 'php_tidy' => array(79 'string' => array( 'type' => 'string', 'required' => true, 'default' => '' ),80 75 ), 81 76 … … 118 113 $operatorValue = $this->path2PathArray( $namedParameters['path'] ); 119 114 break; 120 121 case 'php_tidy':122 $operatorValue = $this->phpTidy( $namedParameters['string'] );123 break;124 115 125 116 case 'redirect': … … 206 197 } 207 198 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 241 200 242 201 /**
