mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
fehlerupdate: added check for app (existing in database?), code layout
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user