30 protected $errors = 0;
32 function __construct(&$dbManager,$verbose)
50 $folderDao =
new FolderDao($this->
dbManager, $GLOBALS[
'container']->
get(
'dao.user'), $GLOBALS[
'container']->
get(
'dao.upload'));
51 $folderDao->ensureTopLevelFolder();
62 $scopeMap = $decScopes->getMap();
63 $this->errors += $this->
checkDatabaseEnum($tablename =
'clearing_decision',
'scope', $scopeMap);
65 $typeMap = $decTypes->getExtendedMap();
66 $this->errors += $this->
checkDatabaseEnum($tablename =
'clearing_decision',
'decision_type', $typeMap);
75 $statusMap = $uploadStatus->getMap();
76 $this->errors += $this->
checkDatabaseEnum($tablename =
'upload_clearing',
'status_fk', $statusMap);
85 $map = $licenseEventTypes->getMap();
86 $this->errors += $this->
checkDatabaseEnum($tablename=
'clearing_event',
'type_fk', $map);
99 $stmt = __METHOD__.
".$tablename.$columnname";
100 $sql =
"SELECT $columnname,count(*) FROM $tablename GROUP BY $columnname";
103 while($row = $this->
dbManager->fetchArray($res))
105 if(!array_key_exists($row[$columnname], $map))
107 echo
"(-) found invalid $columnname '".$row[$columnname].
"' in table '$tablename'\n";
112 echo
"(+) found valid $columnname '".$row[$columnname].
"' in table '$tablename'\n";
126 $error = intval(!$this->
dbManager->existsTable($tableName));
128 echo
"(-) table $tableName does not exists";
132 echo
"(+) table $tableName exists";
134 $this->errors += $error;
checkExistsTable($tableName)
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.
checkLicenseEventTypes()
Check if clearing_event have proper values in type_fk column.
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