[Phpslash-commit] CVS: phpslash-ft/class slashTemplate.class,1.2,1.3
Brought to you by:
joestewart,
nhruby
From: Peter C. <kr...@us...> - 2003-02-08 11:19:37
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory sc8-pr-cvs1:/tmp/cvs-serv1524/class Modified Files: slashTemplate.class Log Message: [B] Override filename() function to deal with Windows absolute filepaths (ie test 2nd char is a ':') Index: slashTemplate.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/slashTemplate.class,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** slashTemplate.class 7 Jan 2003 19:31:13 -0000 1.2 --- slashTemplate.class 8 Feb 2003 11:19:33 -0000 1.3 *************** *** 115,118 **** --- 115,134 ---- } // end of function set_root + + // As per template.inc, with added test for windows absolute path + function filename($filename) { + if ($this->debug & 4) { + echo "<p><b>filename:</b> filename = $filename</p>\n"; + } + if (substr($filename, 0, 1) != "/" && substr($filename, 1, 1) != ":") { // Test for Windows absolute path - could use preg_match(/[A-Z]:/i,...) test? + $filename = $this->root."/".$filename; + } + + if (!file_exists($filename)) { + $this->halt("filename: file $filename does not exist."); + } + return $filename; + } + } // end of slashTemplate class |