From ed24e4f9ececaa1b5cd4e68045f27956ebbb1938 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Sun, 10 Dec 2006 04:21:23 -0500 Subject: [PATCH 1/1] factored out read_whole_file into basics.php --- basics.php | 13 +++++++++++++ template.php | 11 +---------- 2 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 basics.php diff --git a/basics.php b/basics.php new file mode 100644 index 0000000..3a60248 --- /dev/null +++ b/basics.php @@ -0,0 +1,13 @@ + diff --git a/template.php b/template.php index c56e743..897afc7 100644 --- a/template.php +++ b/template.php @@ -34,6 +34,7 @@ # including the use of sub-templates can be found in tem_test.php require_once('code/wfpl/encode.php'); +require_once('code/wfpl/basics.php'); class tem { var $keyval; # an array containing key/value pairs @@ -184,16 +185,6 @@ function tem_output($filename = false) { -function read_whole_file($name) { - $fd = fopen($name, 'r'); - if($fd === false) { - die("Failed to read file: '$name'"); - } - $temp = fread($fd, filesize($name)); - fclose($fd); - return $temp; -} - # this is used in template_run() and should be of no other use function template_filler($matches) { list($tag, $enc) = explode('.', $matches[1], 2); -- 1.7.10.4