base config.inc update

This commit is contained in:
Clemens Schwaighofer
2018-06-08 16:41:35 +09:00
parent 382cc0524a
commit 80715e5ef1

View File

@@ -21,67 +21,70 @@ DEFINE('DEFAULT_LANG', "en_utf8");
DEFINE('DEFAULT_ENCODING', "UTF-8"); DEFINE('DEFAULT_ENCODING', "UTF-8");
/************* PATHS *********************/ /************* PATHS *********************/
// directory seperator
DEFINE('DS', DIRECTORY_SEPARATOR);
// ** NEW/BETTER DIR DECLARATIONS ** // ** NEW/BETTER DIR DECLARATIONS **
// path to original file (if symlink) // path to original file (if symlink)
DEFINE('DIR', __DIR__."/"); DEFINE('DIR', __DIR__.DS);
// libs base path based on DIR // base dir root folder level
DEFINE('LIBDIR', DIR.'libs/'); DEFINE('BASE', str_replace('configs', '', __DIR__));
// SMARTY path based on DIR
DEFINE('SMARTYDIR', DIR.'Smarty/');
// table arrays for Class Form
DEFINE('TABLEARRAYDIR', DIR.'table_arrays/');
// ** OLD DIR DECLARATIONS ** // ** OLD DIR DECLARATIONS **
// path to document root of file called // path to document root of file called
DEFINE('ROOT', getcwd()."/"); DEFINE('ROOT', getcwd().DS);
// libs path // libs path
DEFINE('LIBS', "libs/"); DEFINE('LIB', 'lib'.DS);
DEFINE('LIBS', 'lib'.DS);
// includes (strings, arrays for static, etc) // includes (strings, arrays for static, etc)
DEFINE('INCLUDES', "includes/"); DEFINE('INCLUDES', 'includes'.DS);
// layout base path // layout base path
DEFINE('LAYOUT', 'layout/'); DEFINE('LAYOUT', 'layout'.DS);
// pic-root (compatible to CMS) // pic-root (compatible to CMS)
DEFINE('PICTURES', "images/"); DEFINE('PICTURES', "images".DS);
// images // images
DEFINE('IMAGES', "images/"); DEFINE('IMAGES', "images".DS);
// icons (below the images/ folder) // icons (below the images/ folder)
DEFINE('ICONS', 'icons/'); DEFINE('ICONS', 'icons'.DS);
// media // media
DEFINE('MEDIA', "media/"); DEFINE('MEDIA', "media".DS);
// flash-root (below media) // flash-root (below media)
DEFINE('FLASH', "flash/"); DEFINE('FLASH', "flash".DS);
// uploads (anything to keep) // uploads (anything to keep)
DEFINE('UPLOADS', "uploads/"); DEFINE('UPLOADS', "uploads".DS);
// files (binaries) (below media) // files (binaries) (below media)
DEFINE('BINARIES', "binaries/"); DEFINE('BINARIES', "binaries".DS);
// files (videos) (below media) // files (videos) (below media)
DEFINE('VIDEOS', "videos/"); DEFINE('VIDEOS', "videos".DS);
// files (documents) (below media) // files (documents) (below media)
DEFINE('DOCUMENTS', "documents/"); DEFINE('DOCUMENTS', "documents".DS);
// files (pdfs) (below media) // files (pdfs) (below media)
DEFINE('PDFS', "documents/"); DEFINE('PDFS', "documents".DS);
// CSV
DEFINE('CSV', 'csv'.DS);
// css // css
DEFINE('CSS', "css/"); DEFINE('CSS', "css".DS);
// js // js
DEFINE('JS', "javascript/"); DEFINE('JS', "javascript".DS);
// table arrays // table arrays
DEFINE('TABLE_ARRAYS', "table_arrays/"); DEFINE('TABLE_ARRAYS', "table_arrays".DS);
// smarty libs path // smarty libs path
DEFINE('SMARTY', "Smarty/"); DEFINE('SMARTY', "Smarty".DS);
// po langs // po langs
DEFINE('LANG', "lang/"); DEFINE('LANG', "lang".DS);
// cache path // cache path
DEFINE('CACHE', "cache/"); DEFINE('CACHE', "cache".DS);
// temp path // temp path
DEFINE('TMP', "tmp/"); DEFINE('TMP', "tmp".DS);
// log files // log files
DEFINE('LOG', 'log/'); DEFINE('LOG', 'log'.DS);
// compiled template folder
DEFINE('TEMPLATES_C', 'templates_c'.DS);
// template base // template base
DEFINE('TEMPLATES', "templates/"); DEFINE('TEMPLATES', "templates".DS);
// frontend template dir', only for admin // frontend template dir', only for admin
DEFINE('TEMPLATES_FRONTEND', "templates_frontend/"); DEFINE('TEMPLATES_FRONTEND', "templates_frontend".DS);
// default template // default template
DEFINE('DEFAULT_TEMPLATE', "default/"); DEFINE('DEFAULT_TEMPLATE', "default".DS);
// default template file // default template file
DEFINE('DEFAULT_TEMPLATE_FILE', 'default.tpl'); DEFINE('DEFAULT_TEMPLATE_FILE', 'default.tpl');
@@ -142,6 +145,7 @@ DEFINE('MASTER_TEMPLATE_NAME', 'main_body.tpl');
DEFINE('PUBLIC_SCHEMA', 'public'); DEFINE('PUBLIC_SCHEMA', 'public');
DEFINE('DEV_SCHEMA', 'public'); DEFINE('DEV_SCHEMA', 'public');
DEFINE('TEST_SCHEMA', 'public'); DEFINE('TEST_SCHEMA', 'public');
DEFINE('LIVE_SCHEMA', 'public');
// non constant part // non constant part
/************* DB ACCESS *****************/ /************* DB ACCESS *****************/
@@ -249,27 +253,5 @@ if (DEBUG == false) {
// any other global definitons here // any other global definitons here
// DEFINE('SOME_ID', <SOME VALUE>); // DEFINE('SOME_ID', <SOME VALUE>);
// function that will be called on top of each class include to load the class // read auto loader
function _spl_autoload($include_file) require BASE.LIB.'autoloader.php';
{
// where to search for the files to include
$dirs = array (
LIBDIR,
SMARTYDIR,
TABLEARRAYDIR,
'',
LIBS,
SMARTY,
TABLE_ARRAYS,
__DIR__.'/'.LIBS,
__DIR__.'/'.SMARTY
);
// try to find and load the class ifle
foreach ($dirs as $folder) {
if (file_exists($folder.$include_file)) {
require_once($folder.$include_file);
return true;
}
}
return false;
}