Minor updates for set checks, example update for host config

Host config example for a pre-set config array to attach.

Update fixes for admin_set_paths, ACL\Login unset variable/index check
This commit is contained in:
Clemens Schwaighofer
2019-09-26 12:36:54 +09:00
parent ea3a8edae6
commit f6424bdd35
6 changed files with 21 additions and 11 deletions

View File

@@ -12,6 +12,7 @@ parameters:
- %currentWorkingDirectory%/phpstan-bootstrap.php
- www/configs/config.master.php
- www/lib/autoloader.php
- www/vendor/autoload.php
excludes_analyse:
# no check admin
- www/admin/qq_file_upload_front.php

View File

@@ -12,6 +12,15 @@
* HISTORY:
*********************************************************************/
// other master config to attach
// $LOCAL_CONFIG = array(
// 'db_host' => '',
// 'location' => '',
// 'debug_flag' => true,
// 'site_lang' => 'en_utf8',
// 'login_enabled' => true
// )
// each host has a different db_host
$SITE_CONFIG = array(
// development host
@@ -29,7 +38,8 @@ $SITE_CONFIG = array(
'site_lang' => 'en_utf8',
// enable/disable login override
'login_enabled' => true
)
),
// 'other.host.com' => $LOCAL_CONFIG
);
// __END__

View File

@@ -92,12 +92,12 @@ $cms->DATA['show_ea_extra'] = $login->acl['show_ea_extra'];
// automatic hide for DEBUG messages on live server
// can be overridden when setting DEBUG_ALL_OVERRIDE on top of the script (for emergency debugging of one page only)
if ((TARGET == 'live' || TARGET == 'remote') && !$DEBUG_ALL_OVERRIDE) {
$login->debug_output_all = 0;
$login->echo_output_all = 0;
$login->print_output_all = 0;
$cms->debug_output_all = 0;
$cms->echo_output_all = 0;
$cms->print_output_all = 0;
$login->debug_output_all = false;
$login->echo_output_all = false;
$login->print_output_all = false;
$cms->debug_output_all = false;
$cms->echo_output_all = false;
$cms->print_output_all = false;
}
$cms->DATA['JS_DEBUG'] = DEBUG;

View File

@@ -45,9 +45,9 @@ $cms->JS_TEMPLATE_NAME = str_replace(".tpl", ".js", $CONTENT_INCLUDE);
// css per page
$cms->CSS_TEMPLATE_NAME = str_replace(".tpl", ".css", $CONTENT_INCLUDE);
// special CSS file
$cms->CSS_SPECIAL_TEMPLATE_NAME = $CSS_NAME;
$cms->CSS_SPECIAL_TEMPLATE_NAME = isset($CSS_NAME) ? $CSS_NAME : '';
// special JS file
$cms->JS_SPECIAL_TEMPLATE_NAME = $JS_NAME;
$cms->JS_SPECIAL_TEMPLATE_NAME = isset($JS_NAME) ? $JS_NAME : '';
// compile & cache id
$cms->CACHE_ID = isset($CACHE_ID) ? $CACHE_ID : CACHE_ID;
$cms->COMPILE_ID = isset($COMPILE_ID) ? $COMPILE_ID : CACHE_ID;

View File

@@ -152,7 +152,7 @@ class Login extends \CoreLibs\DB\IO
if (defined('LOGIN_DB_SCHEMA')) {
/** @phan-suppress-next-line PhanUndeclaredConstant */
$SCHEMA = LOGIN_DB_SCHEMA;
} elseif ($db_config['db_schema']) {
} elseif (isset($db_config['db_schema']) && $db_config['db_schema']) {
$SCHEMA = $db_config['db_schema'];
} elseif (defined('PUBLIC_SCHEMA')) {
$SCHEMA = PUBLIC_SCHEMA;

View File

@@ -94,7 +94,6 @@
namespace CoreLibs;
/** Basic core class declaration */
class Basic
{