From: Jason Woofenden Date: Sun, 26 Jan 2014 06:34:06 +0000 (-0500) Subject: fix require_once paths X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=commitdiff_plain;h=571c58fff7b139f590b5c4862761092bc1045436 fix require_once paths --- diff --git a/calendar.php b/calendar.php index c7f51ab..0cdeab8 100644 --- a/calendar.php +++ b/calendar.php @@ -35,7 +35,7 @@ -require_once('code/wfpl/template.php'); +require_once(__DIR__ . '/template.php'); function calendar_week(&$template) { $template->sub('week'); diff --git a/db.php b/db.php index 1bf78fd..b1faf2c 100644 --- a/db.php +++ b/db.php @@ -16,8 +16,8 @@ # along with this program. If not, see . -require_once('code/wfpl/encode.php'); -require_once('code/wfpl/format.php'); +require_once(__DIR__ . '/encode.php'); +require_once(__DIR__ . '/format.php'); # db_connect() -- connect to a mysql database # diff --git a/dwt.php b/dwt.php index 0837b35..9bdc5c6 100644 --- a/dwt.php +++ b/dwt.php @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -require_once('code/wfpl/file.php'); +require_once(__DIR__ . '/file.php'); function dwt_reset() { $GLOBALS['_dwt_keys'] = array(''); diff --git a/fdb.php b/fdb.php index bfc54d6..d008cec 100644 --- a/fdb.php +++ b/fdb.php @@ -29,8 +29,8 @@ # fdb_set_dir() passing the path to that directory. -require_once('code/wfpl/file.php'); -require_once('code/wfpl/binary.php'); +require_once(__DIR__ . '/file.php'); +require_once(__DIR__ . '/binary.php'); # call this to set what directory is used to store the files function fdb_set_dir($dir) { diff --git a/format.php b/format.php index e34f4b3..17d0461 100644 --- a/format.php +++ b/format.php @@ -293,13 +293,13 @@ function format_dollars($str) { # date is edited as mm/dd/yyyy but stored as yyyy-mm-dd function format_mdy_to_ymd($str) { if($str == '') return ''; - require_once('code/wfpl/time.php'); + require_once(__DIR__ . '/time.php'); return mdy_to_ymd(format_oneline($str)); } # date is yyyy-mm-dd function format_ymd($str) { - require_once('code/wfpl/time.php'); + require_once(__DIR__ . '/time.php'); list($year, $month, $day) = ymd_clean($str); return sprintf('%04u-%02u-%02u', $year, $month, $day); } diff --git a/messages.php b/messages.php index 8c66ee2..98ada56 100644 --- a/messages.php +++ b/messages.php @@ -51,7 +51,7 @@ # # -require_once('code/wfpl/template.php'); +require_once(__DIR__ . '/template.php'); # call this to display a message function message($msg) { diff --git a/metaform.php b/metaform.php index a16e92f..deba1de 100644 --- a/metaform.php +++ b/metaform.php @@ -18,10 +18,10 @@ # This file writes the code for you (sql, php, html, email) to handle a form. -require_once('code/wfpl/template.php'); -require_once('code/wfpl/http.php'); -require_once('code/wfpl/tar.php'); -require_once('code/wfpl/format.php'); +require_once(__DIR__ . '/template.php'); +require_once(__DIR__ . '/http.php'); +require_once(__DIR__ . '/tar.php'); +require_once(__DIR__ . '/format.php'); # see code/wfpl/metaform/template.html for the html templates for these elements $GLOBALS['types'] = array( diff --git a/session_messages.php b/session_messages.php index 6f0148c..d2e57b6 100644 --- a/session_messages.php +++ b/session_messages.php @@ -23,9 +23,9 @@ # see messages.php for documentation on how to use it. -require_once('code/wfpl/session.php'); -require_once('code/wfpl/string_array.php'); -require_once('code/wfpl/messages.php'); +require_once(__DIR__ . '/session.php'); +require_once(__DIR__ . '/string_array.php'); +require_once(__DIR__ . '/messages.php'); function session_save_messages() { if(!isset($GLOBALS['wfpl_messages'])) { diff --git a/string_array.php b/string_array.php index d11376f..2e4a8e3 100644 --- a/string_array.php +++ b/string_array.php @@ -18,7 +18,7 @@ # This file contains code to convert an array into a string, and back again. -require_once('code/wfpl/binary.php'); +require_once(__DIR__ . '/binary.php'); function string_to_array($data) { $header_count = pop_int($data); diff --git a/template.php b/template.php index 8e0028b..5d35ff7 100644 --- a/template.php +++ b/template.php @@ -37,9 +37,9 @@ # tem_auto_* function to munge the data, automating certain common use # cases. See the comments on the tem_auto functions for more details. -require_once('code/wfpl/encode.php'); -require_once('code/wfpl/file.php'); -require_once('code/wfpl/misc.php'); +require_once(__DIR__ . '/encode.php'); +require_once(__DIR__ . '/file.php'); +require_once(__DIR__ . '/misc.php'); # Top-Level Functions diff --git a/uploader.php b/uploader.php index b1fe9b0..5672936 100644 --- a/uploader.php +++ b/uploader.php @@ -16,10 +16,10 @@ # along with this program. If not, see . -require_once('code/wfpl/template.php'); -require_once('code/wfpl/encode.php'); -require_once('code/wfpl/session.php'); -require_once('code/wfpl/upload.php'); # FIXME for path_to() which should be somewhere else +require_once(__DIR__ . '/template.php'); +require_once(__DIR__ . '/encode.php'); +require_once(__DIR__ . '/session.php'); +require_once(__DIR__ . '/upload.php'); # FIXME for path_to() which should be somewhere else # This function is for making an uploader with a progress bar. #