From d1518f9b2ad0981505c82eebcb77f61c97d93592 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Thu, 9 Oct 2008 19:25:28 +0000 Subject: [PATCH] Renamed Pickles.php and moved the smarty/functions directory to be functions/smarty. Renamed the tmp directory to be var (more Linux-centric for it's purpose) git-svn-id: http://svn.cleancode.org/svn/pickles@64 4d10bc64-7434-11dc-a737-d2d0f8310089 --- Pickles2.php | 83 ------------------- classes/Viewer/Smarty.php | 2 +- .../smarty}/function.contact_form.php | 0 .../smarty}/function.draw_pagination.php | 0 .../smarty}/function.pagination.php | 0 .../smarty}/function.var_dump.php | 0 Pickles.php => pickles.php | 4 +- 7 files changed, 3 insertions(+), 86 deletions(-) delete mode 100755 Pickles2.php rename {smarty/functions => functions/smarty}/function.contact_form.php (100%) rename {smarty/functions => functions/smarty}/function.draw_pagination.php (100%) rename {smarty/functions => functions/smarty}/function.pagination.php (100%) rename {smarty/functions => functions/smarty}/function.var_dump.php (100%) rename Pickles.php => pickles.php (95%) diff --git a/Pickles2.php b/Pickles2.php deleted file mode 100755 index 0749c3b..0000000 --- a/Pickles2.php +++ /dev/null @@ -1,83 +0,0 @@ -. - * - * @author Joshua John Sherman - * @copyright Copyright 2007, 2008 Joshua John Sherman - * @link http://phpwithpickles.org - * @license http://www.gnu.org/copyleft/lesser.html - * @package PICKLES - * @usage require_once 'Pickles.php'; - */ - -/** - * @todo Allow users to override the timezone from their configuration file. - */ -// Sets the timezone to avoid Smarty warnings -if (ini_get('date.timezone') == '') { - ini_set('date.timezone', 'America/New_York'); -} - -// Establishes our paths -define('SITE_PATH', getcwd() . '/'); -define('PICKLES_PATH', dirname(__FILE__) . '/'); -define('TEMP_PATH', PICKLES_PATH . 'tmp/'); -define('SMARTY_PATH', TEMP_PATH . 'smarty/' . $_SERVER['SERVER_NAME'] . '/'); - -// Loads the appropriately named configuration file -Config::load(SITE_PATH . '../config.xml'); - -/** - * Magic function to automatically load classes - * - * Determines if the system needs to load a PICKLES core class or - * a PICKLES shared model (not to be confused with site level models). - * - * @param string $class Name of the class to be loaded - * @return boolean Return value of require_once() or false (default) - */ -function __autoload($class) { - $filename = str_replace('_', '/', $class) . '.php'; - - $class_file = PICKLES_PATH . 'classes/' . $filename; - $model_file = PICKLES_PATH . 'models/' . $filename; - - // Loads the class file - if (file_exists($class_file)) { - return require_once $class_file; - } - // Loads the shared model - else if (file_exists($model_file)) { - return require_once $model_file; - } - // Loads Smarty - else if ($class == 'Smarty') { - return require_once 'contrib/smarty/libs/Smarty.class.php'; - } - // Loads nothing - else { - return false; - } -} - -?> diff --git a/classes/Viewer/Smarty.php b/classes/Viewer/Smarty.php index 528f05f..3ac4653 100644 --- a/classes/Viewer/Smarty.php +++ b/classes/Viewer/Smarty.php @@ -56,7 +56,7 @@ class Viewer_Smarty extends Viewer_Common { $smarty->load_filter('output','trimwhitespace'); // Includes the PICKLES custom Smarty functions - $directory = PICKLES_PATH . 'smarty/functions/'; + $directory = PICKLES_PATH . 'functions/smarty/'; if (is_dir($directory)) { if ($handle = opendir($directory)) { diff --git a/smarty/functions/function.contact_form.php b/functions/smarty/function.contact_form.php similarity index 100% rename from smarty/functions/function.contact_form.php rename to functions/smarty/function.contact_form.php diff --git a/smarty/functions/function.draw_pagination.php b/functions/smarty/function.draw_pagination.php similarity index 100% rename from smarty/functions/function.draw_pagination.php rename to functions/smarty/function.draw_pagination.php diff --git a/smarty/functions/function.pagination.php b/functions/smarty/function.pagination.php similarity index 100% rename from smarty/functions/function.pagination.php rename to functions/smarty/function.pagination.php diff --git a/smarty/functions/function.var_dump.php b/functions/smarty/function.var_dump.php similarity index 100% rename from smarty/functions/function.var_dump.php rename to functions/smarty/function.var_dump.php diff --git a/Pickles.php b/pickles.php similarity index 95% rename from Pickles.php rename to pickles.php index 0749c3b..d34900b 100755 --- a/Pickles.php +++ b/pickles.php @@ -41,8 +41,8 @@ if (ini_get('date.timezone') == '') { // Establishes our paths define('SITE_PATH', getcwd() . '/'); define('PICKLES_PATH', dirname(__FILE__) . '/'); -define('TEMP_PATH', PICKLES_PATH . 'tmp/'); -define('SMARTY_PATH', TEMP_PATH . 'smarty/' . $_SERVER['SERVER_NAME'] . '/'); +define('VAR_PATH', PICKLES_PATH . 'var/' . $_SERVER['SERVER_NAME'] . '/'); +define('SMARTY_PATH', VAR_PATH . 'smarty/'); // Loads the appropriately named configuration file Config::load(SITE_PATH . '../config.xml');