Remove all include/require parts from classes and use autoload function

Any include or require call is removed and now we use only _spl_autoload
in any class external file include call.
There are three new _DIR vars: LIBDIR, SMARTYDIR, TABLEARRAYDIR that are
based on the __DIR__ and not current working directory.
This commit is contained in:
Clemens Schwaighofer
2015-11-11 14:19:25 +09:00
parent b2fdbc0571
commit 647dd52c92
3 changed files with 10 additions and 4 deletions

View File

@@ -19,14 +19,19 @@
DEFINE('DEFAULT_ENCODING', "UTF-8");
/************* PATHS *********************/
// path to document root of file called
DEFINE('ROOT', getcwd()."/");
// ** NEW/BETTER DIR DECLARATIONS **
// path to original file (if symlink)
DEFINE('DIR', __DIR__."/");
// libs base path based on DIR
DEFINE('LIBDIR', DIR.'libs/');
// SMARTY path based on DIR
DEFINE('SMARTYDIR', DIR.'Smarty/');
// table arrays for Class Form
DEFINE('TABLEARRAYDIR', DIR.'table_arrays/');
// ** OLD DIR DECLARATIONS **
// path to document root of file called
DEFINE('ROOT', getcwd()."/");
// libs path
DEFINE('LIBS', "libs/");
// includes (strings, arrays for stati, etc)
@@ -255,6 +260,7 @@
$dirs = array (
LIBDIR,
SMARTYDIR,
TABLEARRAYDIR,
'',
LIBS,
SMARTY,