Remove \Basic class from all other Class extensions
If not created Logger class will be auto created in \DB\IO Recommended to run a CoreLibs\Debug\Logging([...]); and use this class for all ACL\Login, Admin\Backend, DB\IO, Output\Form\Generate calls. Last parameter after DB CONFIG is the log parameter Session create has been moved to a new Create\Session class from the \Basic class and MUST be started before using ACL\Login. Currently ACL\Login will fallback and start it if no session is yet started. See the Readme.md file for which classes use _SESSION data In future the _SESSION settings should be moved to some wrapper class for this so we can unit test sessions Only Output\Form\Generate class call has the new changed with the second parameter no longer beeing the table width setting but the class setting. But as this is a semi retired class and only used for edit_base this is not 100% breaking. All other classes can be used as is and have internal fallback to run as before. Deprecation messages will be added later.
This commit is contained in:
@@ -73,6 +73,8 @@ class Backend extends \CoreLibs\DB\IO
|
||||
// the current active edit access id
|
||||
/** @var int */
|
||||
public $edit_access_id;
|
||||
/** @var string */
|
||||
public $page_name;
|
||||
// error/warning/info messages
|
||||
/** @var array<mixed> */
|
||||
public $messages = [];
|
||||
@@ -108,15 +110,25 @@ class Backend extends \CoreLibs\DB\IO
|
||||
/**
|
||||
* main class constructor
|
||||
* @param array<mixed> $db_config db config array
|
||||
* @param \CoreLibs\Debug\Logging|null $log Logging class, default set if not set
|
||||
*/
|
||||
public function __construct(array $db_config)
|
||||
{
|
||||
public function __construct(
|
||||
array $db_config,
|
||||
?\CoreLibs\Debug\Logging $log = null
|
||||
) {
|
||||
// set to log not per class
|
||||
if ($log !== null) {
|
||||
$log->setLogPer('class', false);
|
||||
}
|
||||
$this->setLangEncoding();
|
||||
// get the language sub class & init it
|
||||
$this->l = new \CoreLibs\Language\L10n($this->lang);
|
||||
|
||||
// init the database class
|
||||
parent::__construct($db_config);
|
||||
parent::__construct($db_config, $log ?? new \CoreLibs\Debug\Logging());
|
||||
|
||||
// set the page name
|
||||
$this->page_name = \CoreLibs\Get\System::getPageName();
|
||||
|
||||
// set the action ids
|
||||
foreach ($this->action_list as $_action) {
|
||||
|
||||
Reference in New Issue
Block a user