fehlerupdate: added check for app (existing in database?), code layout

This commit is contained in:
Alexei Karpenko
2026-01-19 15:27:54 +01:00
parent cd03264ab4
commit 131ec86dee
4 changed files with 30 additions and 15 deletions
+14 -14
View File
@@ -59,8 +59,9 @@ class FehlerUpdateLib
// Loads EPrintfLib
$this->_ci->load->library('EPrintfLib');
// Loads the PhraseModel
// Loads the Models
$this->_ci->load->model('system/Fehler_model', 'FehlerModel');
$this->_ci->load->model('system/App_model', 'AppModel');
}
// -----------------------------------------------------------------------------------------------------------------
@@ -93,7 +94,6 @@ class FehlerUpdateLib
$this->installFrom($configFilePath);
}
}
}
/**
@@ -207,23 +207,23 @@ class FehlerUpdateLib
// no fehler has been found
// hanlde apps
// handle apps
if (isset($fehler[self::APP]))
{
$apps = $fehler[self::APP];
if (is_string($apps)) $apps = [$apps];
//unset($fehler[self::APP]);
foreach ($apps as $app)
{
// check if app exists in db
$this->_ci->AppModel->addSelect('1');
$appRes = $this->_ci->AppModel->loadWhere(['app' => $app]);
if (!hasData($appRes)) return error("App ".$app." does not exist");
// TODO add entry for each app
}
$fehler[self::APP] = $apps[0];
//~ foreach ($apps as $app)
//~ {
//~ // TODO add entry for each app
//~ foreach ($_ as $_)
//~ {
//~ }
//~ }
}
// Then add the fehler to the database
@@ -144,6 +144,7 @@ class PlausicheckProducerLib
$result = new StdClass();
$result->errors = [];
$result->infos = [];
$mappingFehlerKurbz = array_keys($this->_fehlerLibMappings);
// check if all issues to produce could be found in database
@@ -161,7 +161,7 @@ class PlausicheckResolverLib
if (isset($this->_codeLibMappings[$issue->fehlercode]))
{
$codeLibMapping = $this->_codeLibMappings[$issue->fehlercode];
$libName = $codeLibMapping[self::RESOLVER_LIB_NAME];
$libName = $codeLibMapping[self::RESOLVER_LIB_NAME] ?? null;
$extensionName = $codeLibMapping[self::EXTENSION_NAME] ?? null;
$producerIsResolver = $codeLibMapping[self::PRODUCER_IS_RESOLVER_NAME] ?? false;
+14
View File
@@ -0,0 +1,14 @@
<?php
class App_model extends DB_Model
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->dbTable = 'system.tbl_app';
$this->pk = 'app';
}
}