Make WordPress Core

Ticket #28575: wptexturize.php

File wptexturize.php, 450 bytes (added by dllh, 11 years ago)

Simple script for profiling.

Line 
1<?php
2
3require_once( 'wp-load.php' );
4
5// This is a fairly markup-heavy file of roughly 1MB.
6$text = file_get_contents( '/tmp/text' );
7
8// Generated by calling and unmodified wptexturize() on $text before running the tests.
9$text_texturized_md5 = md5( file_get_contents( '/tmp/texturized' ) );
10
11for( $i = 1; $i < 10; $i++ ) {
12        echo "Iteration $i\n";
13        $x = md5( wptexturize( $text ) );
14        if ( $x != $text_texturized_md5 ) {
15                echo "\tNO MATCH\n";
16        }
17}