[Assorted-commits] SF.net SVN: assorted:[1036] wp-easy-filter/trunk/src/easyfilt.php
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-10-23 15:43:14
|
Revision: 1036 http://assorted.svn.sourceforge.net/assorted/?rev=1036&view=rev Author: yangzhang Date: 2008-10-23 15:43:05 +0000 (Thu, 23 Oct 2008) Log Message: ----------- fixed debugging, metadata Modified Paths: -------------- wp-easy-filter/trunk/src/easyfilt.php Modified: wp-easy-filter/trunk/src/easyfilt.php =================================================================== --- wp-easy-filter/trunk/src/easyfilt.php 2008-10-23 15:32:38 UTC (rev 1035) +++ wp-easy-filter/trunk/src/easyfilt.php 2008-10-23 15:43:05 UTC (rev 1036) @@ -3,7 +3,7 @@ Plugin Name: Easy Filter Plugin URI: http://assorted.sf.net/wp-easy-filter/ Description: Easy filtering of blog posts. -Version: 1.0 +Version: 0.2 Author: Yang Zhang Author URI: http://www.mit.edu/~y_z/ */ @@ -57,7 +57,7 @@ # function filter_custom($content) { - global $debug, $tag2cmd, $wp_filter, $descriptorspec; + global $debug, $debugfile, $tag2cmd, $wp_filter, $descriptorspec; $lines = explode("\n", $content); $tag = trim(substr($lines[0], 2)); if (substr($lines[0], 0, 2) === '#!' && $tag2cmd[$tag]) { @@ -72,6 +72,9 @@ $filtered = stream_get_contents($pipes[1]); fclose($pipes[1]); + $stderr = stream_get_contents($pipes[2]); + fclose($pipes[2]); + $retval = proc_close($process); } } else { @@ -80,10 +83,16 @@ } if ($debug) { $f = fopen($debugfile, 'w'); - fwrite($f, print_r($wp_filter, true)); - fwrite($f, print_r($lines, true)); - fwrite($f, substr($lines[0], 0, 2) . " " . (substr($lines[0], 0, 2) === '#!') . " " . $cmd . " " . $tag2cmd[$cmd]); - fwrite($f, "\n===\n$content\n===\n$filtered"); + fwrite($f, "\nwp_filter = " . print_r($wp_filter, true)); + fwrite($f, "\nlines = " . print_r($lines, true)); + fwrite($f, "\nlines[0][0:2] = " . substr($lines[0], 0, 2)); + fwrite($f, "\nlines[0][0:2] === '#!' = " . (substr($lines[0], 0, 2) === '#!')); + fwrite($f, "\ntag = " . $tag); + fwrite($f, "\ncmd = " . $cmd); + fwrite($f, "\nretval = " . $retval); + fwrite($f, "\n\n\ncontent =\n$content"); + fwrite($f, "\n\n\nfiltered =\n$filtered"); + fwrite($f, "\n\n\nstderr =\n$stderr"); fclose($f); } return $filtered; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |