Stop using DS for DIRECTORY_SEPARATOR replacement
There is no need for a short entry, use the long one. The DS is still defined for backwards compatible use
This commit is contained in:
@@ -145,9 +145,7 @@ print "BASE: " . BASE . "<br>";
|
|||||||
print "ROOT: " . ROOT . "<br>";
|
print "ROOT: " . ROOT . "<br>";
|
||||||
print "HOST: " . HOST_NAME . " => DB HOST: " . DB_CONFIG_NAME . " => " . print_r(DB_CONFIG, true) . "<br>";
|
print "HOST: " . HOST_NAME . " => DB HOST: " . DB_CONFIG_NAME . " => " . print_r(DB_CONFIG, true) . "<br>";
|
||||||
|
|
||||||
$ds = defined('DS') ? DS : DIRECTORY_SEPARATOR;
|
print "DS is: " . DIRECTORY_SEPARATOR . "<br>";
|
||||||
$du = DS ?? DIRECTORY_SEPARATOR;
|
|
||||||
print "DS is: " . $ds . "<br>";
|
|
||||||
print "SERVER HOST: " . $_SERVER['HTTP_HOST'] . "<br>";
|
print "SERVER HOST: " . $_SERVER['HTTP_HOST'] . "<br>";
|
||||||
|
|
||||||
// print error messages
|
// print error messages
|
||||||
|
|||||||
@@ -11,72 +11,72 @@
|
|||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
/************* PATHS *********************/
|
/************* PATHS *********************/
|
||||||
// directory seperator
|
// [DEPRECATED] directory seperator
|
||||||
define('DS', DIRECTORY_SEPARATOR);
|
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__ . DS);
|
define('DIR', __DIR__ . DIRECTORY_SEPARATOR);
|
||||||
// base dir root folder level
|
// base dir root folder level
|
||||||
define('BASE', str_replace('/configs', '', __DIR__) . DS);
|
define('BASE', str_replace('/configs', '', __DIR__) . DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
// ** OLD DIR DECLARATIONS **
|
// ** OLD DIR DECLARATIONS **
|
||||||
// path to document root of file called
|
// path to document root of file called
|
||||||
define('ROOT', getcwd() . DS);
|
define('ROOT', getcwd() . DIRECTORY_SEPARATOR);
|
||||||
// libs path
|
// libs path
|
||||||
define('LIB', 'lib' . DS);
|
define('LIB', 'lib' . DIRECTORY_SEPARATOR);
|
||||||
define('LIBS', 'lib' . DS);
|
define('LIBS', 'lib' . DIRECTORY_SEPARATOR);
|
||||||
// configs folder
|
// configs folder
|
||||||
define('CONFIGS', 'configs' . DS);
|
define('CONFIGS', 'configs' . DIRECTORY_SEPARATOR);
|
||||||
// includes (strings, arrays for static, etc)
|
// includes (strings, arrays for static, etc)
|
||||||
define('INCLUDES', 'includes' . DS);
|
define('INCLUDES', 'includes' . DIRECTORY_SEPARATOR);
|
||||||
// data folder (mostly in includes, or root for internal data)
|
// data folder (mostly in includes, or root for internal data)
|
||||||
define('DATA', 'data' . DS);
|
define('DATA', 'data' . DIRECTORY_SEPARATOR);
|
||||||
// layout base path
|
// layout base path
|
||||||
define('LAYOUT', 'layout' . DS);
|
define('LAYOUT', 'layout' . DIRECTORY_SEPARATOR);
|
||||||
// pic-root (compatible to CMS)
|
// pic-root (compatible to CMS)
|
||||||
define('PICTURES', 'images' . DS);
|
define('PICTURES', 'images' . DIRECTORY_SEPARATOR);
|
||||||
// images
|
// images
|
||||||
define('IMAGES', 'images' . DS);
|
define('IMAGES', 'images' . DIRECTORY_SEPARATOR);
|
||||||
// icons (below the images/ folder)
|
// icons (below the images/ folder)
|
||||||
define('ICONS', 'icons' . DS);
|
define('ICONS', 'icons' . DIRECTORY_SEPARATOR);
|
||||||
// media (accessable from outside)
|
// media (accessable from outside)
|
||||||
define('MEDIA', 'media' . DS);
|
define('MEDIA', 'media' . DIRECTORY_SEPARATOR);
|
||||||
// uploads (anything to keep or data)
|
// uploads (anything to keep or data)
|
||||||
define('UPLOADS', 'uploads' . DS);
|
define('UPLOADS', 'uploads' . DIRECTORY_SEPARATOR);
|
||||||
// files (binaries) (below media or data)
|
// files (binaries) (below media or data)
|
||||||
define('BINARIES', 'binaries' . DS);
|
define('BINARIES', 'binaries' . DIRECTORY_SEPARATOR);
|
||||||
// files (videos) (below media or data)
|
// files (videos) (below media or data)
|
||||||
define('VIDEOS', 'videos' . DS);
|
define('VIDEOS', 'videos' . DIRECTORY_SEPARATOR);
|
||||||
// files (documents) (below media or data)
|
// files (documents) (below media or data)
|
||||||
define('DOCUMENTS', 'documents' . DS);
|
define('DOCUMENTS', 'documents' . DIRECTORY_SEPARATOR);
|
||||||
// files (pdfs) (below media or data)
|
// files (pdfs) (below media or data)
|
||||||
define('PDFS', 'documents' . DS);
|
define('PDFS', 'documents' . DIRECTORY_SEPARATOR);
|
||||||
// files (general) (below media or data)
|
// files (general) (below media or data)
|
||||||
define('FILES', 'files' . DS);
|
define('FILES', 'files' . DIRECTORY_SEPARATOR);
|
||||||
// CSV
|
// CSV
|
||||||
define('CSV', 'csv' . DS);
|
define('CSV', 'csv' . DIRECTORY_SEPARATOR);
|
||||||
// css
|
// css
|
||||||
define('CSS', 'css' . DS);
|
define('CSS', 'css' . DIRECTORY_SEPARATOR);
|
||||||
// font (web)
|
// font (web)
|
||||||
define('FONT', 'font' . DS);
|
define('FONT', 'font' . DIRECTORY_SEPARATOR);
|
||||||
// js
|
// js
|
||||||
define('JS', 'javascript' . DS);
|
define('JS', 'javascript' . DIRECTORY_SEPARATOR);
|
||||||
// table arrays
|
// table arrays
|
||||||
define('TABLE_ARRAYS', 'table_arrays' . DS);
|
define('TABLE_ARRAYS', 'table_arrays' . DIRECTORY_SEPARATOR);
|
||||||
// smarty libs path
|
// smarty libs path
|
||||||
define('SMARTY', 'Smarty' . DS);
|
define('SMARTY', 'Smarty' . DIRECTORY_SEPARATOR);
|
||||||
// po langs
|
// po langs
|
||||||
define('LANG', 'lang' . DS);
|
define('LANG', 'lang' . DIRECTORY_SEPARATOR);
|
||||||
// cache path
|
// cache path
|
||||||
define('CACHE', 'cache' . DS);
|
define('CACHE', 'cache' . DIRECTORY_SEPARATOR);
|
||||||
// temp path
|
// temp path
|
||||||
define('TMP', 'tmp' . DS);
|
define('TMP', 'tmp' . DIRECTORY_SEPARATOR);
|
||||||
// log files
|
// log files
|
||||||
define('LOG', 'log' . DS);
|
define('LOG', 'log' . DIRECTORY_SEPARATOR);
|
||||||
// compiled template folder
|
// compiled template folder
|
||||||
define('TEMPLATES_C', 'templates_c' . DS);
|
define('TEMPLATES_C', 'templates_c' . DIRECTORY_SEPARATOR);
|
||||||
// template base
|
// template base
|
||||||
define('TEMPLATES', 'templates' . DS);
|
define('TEMPLATES', 'templates' . DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
/************* HASH / ACL DEFAULT / ERROR SETTINGS / SMARTY *************/
|
/************* HASH / ACL DEFAULT / ERROR SETTINGS / SMARTY *************/
|
||||||
// default hash type
|
// default hash type
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ $paths = [
|
|||||||
];
|
];
|
||||||
// find convert
|
// find convert
|
||||||
foreach ($paths as $path) {
|
foreach ($paths as $path) {
|
||||||
if (file_exists($path . DS . 'convert') && is_file($path . DS . 'convert')) {
|
if (file_exists($path . DIRECTORY_SEPARATOR . 'convert') && is_file($path . DIRECTORY_SEPARATOR . 'convert')) {
|
||||||
// image magick convert location
|
// image magick convert location
|
||||||
define('CONVERT', $path . DS . 'convert');
|
define('CONVERT', $path . DIRECTORY_SEPARATOR . 'convert');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ for ($dir_pos = 0, $dir_max = count(explode(DIRECTORY_SEPARATOR, __DIR__)); $dir
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// fail if no base DS is not set
|
// fail if no base DIR is not set
|
||||||
if (!defined('DS')) {
|
if (!defined('DIR')) {
|
||||||
exit('Base config unloadable');
|
exit('Base config unloadable');
|
||||||
}
|
}
|
||||||
// find trigger name "admin/" or "frontend/" in the getcwd() folder
|
// find trigger name "admin/" or "frontend/" in the getcwd() folder
|
||||||
|
|||||||
@@ -330,13 +330,13 @@ class SmartyExtend extends SmartyBC
|
|||||||
// check if template names exist
|
// check if template names exist
|
||||||
if (!$this->MASTER_TEMPLATE_NAME) {
|
if (!$this->MASTER_TEMPLATE_NAME) {
|
||||||
exit('MASTER TEMPLATE is not set');
|
exit('MASTER TEMPLATE is not set');
|
||||||
} elseif (!file_exists($this->getTemplateDir()[0] . DS . $this->MASTER_TEMPLATE_NAME)) {
|
} elseif (!file_exists($this->getTemplateDir()[0] . DIRECTORY_SEPARATOR . $this->MASTER_TEMPLATE_NAME)) {
|
||||||
// abort if master template could not be found
|
// abort if master template could not be found
|
||||||
exit('MASTER TEMPLATE: ' . $this->MASTER_TEMPLATE_NAME . ' could not be found');
|
exit('MASTER TEMPLATE: ' . $this->MASTER_TEMPLATE_NAME . ' could not be found');
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
$this->TEMPLATE_NAME &&
|
$this->TEMPLATE_NAME &&
|
||||||
!file_exists($this->getTemplateDir()[0] . DS . $this->TEMPLATE_NAME)
|
!file_exists($this->getTemplateDir()[0] . DIRECTORY_SEPARATOR . $this->TEMPLATE_NAME)
|
||||||
) {
|
) {
|
||||||
exit('INCLUDE TEMPLATE: ' . $this->TEMPLATE_NAME . ' could not be found');
|
exit('INCLUDE TEMPLATE: ' . $this->TEMPLATE_NAME . ' could not be found');
|
||||||
}
|
}
|
||||||
@@ -355,7 +355,7 @@ class SmartyExtend extends SmartyBC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if we can't find it, dump it
|
// if we can't find it, dump it
|
||||||
if (!file_exists($this->getTemplateDir()[0] . DS . $this->TEMPLATE_TRANSLATE)) {
|
if (!file_exists($this->getTemplateDir()[0] . DIRECTORY_SEPARATOR . $this->TEMPLATE_TRANSLATE)) {
|
||||||
$this->TEMPLATE_TRANSLATE = null;
|
$this->TEMPLATE_TRANSLATE = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -327,13 +327,13 @@ class SmartyExtend4 extends Smarty
|
|||||||
// check if template names exist
|
// check if template names exist
|
||||||
if (!$this->MASTER_TEMPLATE_NAME) {
|
if (!$this->MASTER_TEMPLATE_NAME) {
|
||||||
exit('MASTER TEMPLATE is not set');
|
exit('MASTER TEMPLATE is not set');
|
||||||
} elseif (!file_exists($this->getTemplateDir()[0] . DS . $this->MASTER_TEMPLATE_NAME)) {
|
} elseif (!file_exists($this->getTemplateDir()[0] . DIRECTORY_SEPARATOR . $this->MASTER_TEMPLATE_NAME)) {
|
||||||
// abort if master template could not be found
|
// abort if master template could not be found
|
||||||
exit('MASTER TEMPLATE: ' . $this->MASTER_TEMPLATE_NAME . ' could not be found');
|
exit('MASTER TEMPLATE: ' . $this->MASTER_TEMPLATE_NAME . ' could not be found');
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
$this->TEMPLATE_NAME &&
|
$this->TEMPLATE_NAME &&
|
||||||
!file_exists($this->getTemplateDir()[0] . DS . $this->TEMPLATE_NAME)
|
!file_exists($this->getTemplateDir()[0] . DIRECTORY_SEPARATOR . $this->TEMPLATE_NAME)
|
||||||
) {
|
) {
|
||||||
exit('INCLUDE TEMPLATE: ' . $this->TEMPLATE_NAME . ' could not be found');
|
exit('INCLUDE TEMPLATE: ' . $this->TEMPLATE_NAME . ' could not be found');
|
||||||
}
|
}
|
||||||
@@ -352,7 +352,7 @@ class SmartyExtend4 extends Smarty
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if we can't find it, dump it
|
// if we can't find it, dump it
|
||||||
if (!file_exists($this->getTemplateDir()[0] . DS . $this->TEMPLATE_TRANSLATE)) {
|
if (!file_exists($this->getTemplateDir()[0] . DIRECTORY_SEPARATOR . $this->TEMPLATE_TRANSLATE)) {
|
||||||
$this->TEMPLATE_TRANSLATE = null;
|
$this->TEMPLATE_TRANSLATE = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user