From e09bc8749779e671ba38ecbda58eab50a98d05b0 Mon Sep 17 00:00:00 2001 From: Zero Jarvis Date: Tue, 1 Mar 2011 13:11:21 -0800 Subject: [PATCH 1/2] Add PHPCHECK view --- views/devtools/phpcheck.php | 95 +++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 views/devtools/phpcheck.php diff --git a/views/devtools/phpcheck.php b/views/devtools/phpcheck.php new file mode 100644 index 0000000..47108bf --- /dev/null +++ b/views/devtools/phpcheck.php @@ -0,0 +1,95 @@ + + + +

PHP Check

+ + + + $abs_filename) +{ +// echo "

$path

"; + try + { + $content = file_get_contents($abs_filename); + $rel_filename = str_replace(DOCROOT, "", $abs_filename); + + $prefix_pattern = '/^[\t\s]+<\?php/'; + $prefix_match_found = preg_match($prefix_pattern, $content, $prefix_matches); + + $suffix_pattern = '/\?>$/'; + $suffix_match_found = preg_match($suffix_pattern, $content, $suffix_matches); + + ?> + + + + + + + + + + + + 0) : ?> + + + + + + + 0) : ?> + + + + + +
URI
File Location
Prefix Problem $value) + echo "Found \"".html::chars($value)."\"
" + ?> +
Suffix Problem $value) + echo "Found \"".html::chars($value)."\"
" + ?> +
+ + From 9980b2708aa7e51a3347347b9569cceaf35c5420 Mon Sep 17 00:00:00 2001 From: Zero Jarvis Date: Tue, 1 Mar 2011 13:15:23 -0800 Subject: [PATCH 2/2] Add ACTION_PHPCHECK to display view --- classes/controller/devtools.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/classes/controller/devtools.php b/classes/controller/devtools.php index b6f15ba..23e0d16 100644 --- a/classes/controller/devtools.php +++ b/classes/controller/devtools.php @@ -108,4 +108,15 @@ public function action_i18n() $this->template->content = View::factory('devtools/i18n',array('i18n'=>$i18n)); } + + /** + * Check PHP files for open/close tags + */ + public function action_phpcheck() + { + $class_files = Kohana::list_files('classes'); + $this->template->content = View::factory('devtools/phpcheck',array('class_files'=>$class_files)); + } + + } \ No newline at end of file