41 protected $errors = 0;
43 function __construct(&$dbManager,$verbose)
61 $folderDao =
new FolderDao($this->
dbManager, $GLOBALS[
'container']->
get(
'dao.user'), $GLOBALS[
'container']->
get(
'dao.upload'));
62 $folderDao->ensureTopLevelFolder();
73 $scopeMap = $decScopes->getMap();
74 $this->errors += $this->
checkDatabaseEnum($tablename =
'clearing_decision',
'scope', $scopeMap);
76 $typeMap = $decTypes->getExtendedMap();
77 $this->errors += $this->
checkDatabaseEnum($tablename =
'clearing_decision',
'decision_type', $typeMap);
86 $statusMap = $uploadStatus->getMap();
87 $this->errors += $this->
checkDatabaseEnum($tablename =
'upload_clearing',
'status_fk', $statusMap);
96 $map = $licenseEventTypes->getMap();
97 $this->errors += $this->
checkDatabaseEnum($tablename=
'clearing_event',
'type_fk', $map);
110 $stmt = __METHOD__.
".$tablename.$columnname";
111 $sql =
"SELECT $columnname,count(*) FROM $tablename GROUP BY $columnname";
114 while($row = $this->
dbManager->fetchArray($res))
116 if(!array_key_exists($row[$columnname], $map))
118 echo
"(-) found invalid $columnname '".$row[$columnname].
"' in table '$tablename'\n";
123 echo
"(+) found valid $columnname '".$row[$columnname].
"' in table '$tablename'\n";
137 $error = intval(!$this->
dbManager->existsTable($tableName));
139 echo
"(-) table $tableName does not exists";
143 echo
"(+) table $tableName exists";
145 $this->errors += $error;
checkExistsTable($tableName)
checkUploadStatus()
Check if upload_clearing have proper values in status_fk column.
int verbose
The verbose flag for the cli.
fo_dbManager * dbManager
fo_dbManager object
checkLicenseEventTypes()
Check if clearing_event have proper values in type_fk column.
checkDatabaseEnum($tablename, $columnname, $map)
Check if every values in given column are values from the given map.
check()
Check the sanity of decision, upload status, License Event types license_candidate table and ensures ...
checkDecisionScopes()
Check if clearing_decision have proper values in scope and decision_type columns. ...