ILIAS
Release_3_10_x_branch Revision 61812
|
ILIAS Data Validator & Recovery Tool. More...
Public Member Functions | |
ilValidator ($a_log=false) | |
Constructor. | |
setMode ($a_mode, $a_value) | |
set mode of ilValidator Usage: setMode("restore",true) => enable object restorey setMode("all",true) => enable all features For all possible modes see variables declaration | |
isModeEnabled ($a_mode) | |
Is a particular mode enabled? | |
isLogEnabled () | |
setModeDependencies () | |
Sets modes by considering mode dependencies; some modes require other modes to be activated. | |
validate () | |
Performs the validation for each enabled mode. | |
findMissingObjects () | |
Search database for all object entries with missing reference and/or tree entry and stores result in $this->missing_objects. | |
findInvalidRolefolders () | |
Search database for all rolefolder object entries with missing reference entry. | |
findInvalidRBACEntries () | |
Search database for all role entries that are linked to invalid ref_ids. | |
getMissingObjects () | |
Gets all object entries with missing reference and/or tree entry. | |
findInvalidReferences () | |
Search database for all reference entries that are not linked with a valid object id and stores result in $this->invalid_references. | |
getInvalidReferences () | |
Gets all reference entries that are not linked with a valid object id. | |
findInvalidChilds () | |
Search database for all tree entries without any link to a valid object and stores result in $this->invalid_childs. | |
getInvalidChilds () | |
Gets all tree entries without any link to a valid object. | |
findUnboundObjects () | |
Search database for all tree entries having no valid parent (=> no valid path to root node) and stores result in $this->unbound_objects Result does not contain childs that are marked as deleted! Deleted childs have a negative number. | |
findDeletedObjects () | |
Search database for all tree entries having no valid parent (=> no valid path to root node) and stores result in $this->unbound_objects Result also contains childs that are marked as deleted! Deleted childs has a negative number in ["deleted"] otherwise NULL. | |
getUnboundObjects () | |
Gets all tree entries having no valid parent (=> no valid path to root node) Returns an array with child => actual entry with broken uplink to its parent parent => parent of child that does not exist grandparent => grandparent of child (where path to root node continues) deleted => containing a negative number (= parent in trash) or NULL (parent does not exist at all) | |
getDeletedObjects () | |
Gets all object in trash. | |
getInvalidRolefolders () | |
Gets invalid rolefolders (same as missing objects) | |
removeInvalidReferences ($a_invalid_refs=NULL) | |
Removes all reference entries that are linked with invalid object IDs. | |
removeInvalidChilds ($a_invalid_childs=NULL) | |
Removes all tree entries without any link to a valid object. | |
removeInvalidRolefolders ($a_invalid_rolefolders=NULL) | |
Removes invalid rolefolders. | |
restoreMissingObjects ($a_missing_objects=NULL) | |
Restores missing reference and/or tree entry for all objects found by this::getMissingObjects() Restored object are placed in RecoveryFolder. | |
restoreReference ($a_obj_id) | |
restore a reference for an object Creates a new reference entry in DB table object_reference for $a_obj_id | |
restoreUnboundObjects ($a_unbound_objects=NULL) | |
Restore objects (and their subobjects) to RecoveryFolder that are valid but not linked correctly in the hierarchy because they point to an invalid parent_id. | |
restoreTrash ($a_deleted_objects=NULL) | |
Restore all objects in trash to RecoveryFolder NOTE: All objects will be restored to top of RecoveryFolder regardless of existing hierarchical structure! | |
restoreDeletedObjects ($a_nodes) | |
Restore deleted objects (and their subobjects) to RecoveryFolder. | |
restoreSubTrees ($a_nodes) | |
Restore objects (and their subobjects) to RecoveryFolder. | |
purgeTrash ($a_nodes=NULL) | |
Removes all objects in trash from system. | |
purgeUnboundObjects ($a_nodes=NULL) | |
Removes all invalid objects from system. | |
purgeMissingObjects ($a_nodes=NULL) | |
Removes all missing objects from system. | |
purgeObjects ($a_nodes) | |
removes objects from system | |
initGapsInTree () | |
Initializes gaps in lft/rgt values of a tree. | |
handleErr ($error) | |
Callback function handles PEAR_error and outputs detailed infos about error TODO: implement that in global errorhandler of ILIAS (via templates) | |
writeScanLogArray ($a_arr) | |
writeScanLogLine ($a_msg) | |
hasScanLog () | |
Quickly determine if there is a scan log. | |
deleteScanLog () | |
Delete scan log. | |
readScanLog () | |
get_last_scan ($a_scan_log) | |
checkTreeStructure ($a_startnode=null) | |
dumpTree () | |
Dumps the Tree structure into the scan log. |
Data Fields | |
$rbac_object_types = NULL | |
$object_types_exclude | |
$mode | |
$invalid_references = array() | |
$invalid_childs = array() | |
$missing_objects = array() | |
$unbound_objects = array() | |
$deleted_objects = array() | |
$invalid_rolefolders = array() | |
$invalid_objects = array() | |
$logging = false | |
$scan_log | |
$scan_log_file = "scanlog.log" | |
$scan_log_separator = "<!-- scan log start -->" |
Protected Member Functions | |
isMediaFolder ($a_obj_id) | |
isExcludedFromRecovery ($a_type, $a_obj_id) | |
Check if type is excluded from recovery. |
Protected Attributes | |
$media_pool_ids = null |
ILIAS Data Validator & Recovery Tool.
Definition at line 31 of file class.ilValidator.php.
ilValidator::checkTreeStructure | ( | $a_startnode = null | ) |
Definition at line 2040 of file class.ilValidator.php.
References writeScanLogLine().
Referenced by validate().
ilValidator::deleteScanLog | ( | ) |
Delete scan log.
Definition at line 2004 of file class.ilValidator.php.
Referenced by ilValidator().
ilValidator::dumpTree | ( | ) |
Dumps the Tree structure into the scan log.
public
Definition at line 2055 of file class.ilValidator.php.
References DB_FETCHMODE_OBJECT, isMediaFolder(), and writeScanLogLine().
Referenced by validate().
ilValidator::findDeletedObjects | ( | ) |
Search database for all tree entries having no valid parent (=> no valid path to root node) and stores result in $this->unbound_objects Result also contains childs that are marked as deleted! Deleted childs has a negative number in ["deleted"] otherwise NULL.
public
Definition at line 992 of file class.ilValidator.php.
References DB_FETCHMODE_OBJECT, writeScanLogArray(), and writeScanLogLine().
Referenced by validate().
ilValidator::findInvalidChilds | ( | ) |
Search database for all tree entries without any link to a valid object and stores result in $this->invalid_childs.
public
Definition at line 873 of file class.ilValidator.php.
References DB_FETCHMODE_OBJECT, writeScanLogArray(), and writeScanLogLine().
Referenced by purgeObjects(), restoreSubTrees(), and validate().
ilValidator::findInvalidRBACEntries | ( | ) |
Search database for all role entries that are linked to invalid ref_ids.
public
Definition at line 714 of file class.ilValidator.php.
References DB_FETCHMODE_OBJECT, writeScanLogArray(), and writeScanLogLine().
ilValidator::findInvalidReferences | ( | ) |
Search database for all reference entries that are not linked with a valid object id and stores result in $this->invalid_references.
public
Definition at line 812 of file class.ilValidator.php.
References DB_FETCHMODE_OBJECT, writeScanLogArray(), and writeScanLogLine().
Referenced by validate().
ilValidator::findInvalidRolefolders | ( | ) |
Search database for all rolefolder object entries with missing reference entry.
Furthermore gets all rolefolders that are placed accidently in RECOVERY_FOLDER from earlier versions of System check. Result is stored in $this->invalid_rolefolders
public
Definition at line 633 of file class.ilValidator.php.
References DB_FETCHMODE_OBJECT, writeScanLogArray(), and writeScanLogLine().
Referenced by validate().
ilValidator::findMissingObjects | ( | ) |
Search database for all object entries with missing reference and/or tree entry and stores result in $this->missing_objects.
public
Definition at line 564 of file class.ilValidator.php.
References DB_FETCHMODE_OBJECT, isExcludedFromRecovery(), writeScanLogArray(), and writeScanLogLine().
Referenced by validate().
ilValidator::findUnboundObjects | ( | ) |
Search database for all tree entries having no valid parent (=> no valid path to root node) and stores result in $this->unbound_objects Result does not contain childs that are marked as deleted! Deleted childs have a negative number.
public
Definition at line 936 of file class.ilValidator.php.
References DB_FETCHMODE_OBJECT, writeScanLogArray(), and writeScanLogLine().
Referenced by validate().
ilValidator::get_last_scan | ( | $a_scan_log | ) |
Definition at line 2028 of file class.ilValidator.php.
Referenced by readScanLog().
ilValidator::getDeletedObjects | ( | ) |
Gets all object in trash.
public
Definition at line 1067 of file class.ilValidator.php.
References $deleted_objects.
Referenced by validate().
ilValidator::getInvalidChilds | ( | ) |
Gets all tree entries without any link to a valid object.
public
Definition at line 920 of file class.ilValidator.php.
References $invalid_childs.
Referenced by validate().
ilValidator::getInvalidReferences | ( | ) |
Gets all reference entries that are not linked with a valid object id.
public
Definition at line 859 of file class.ilValidator.php.
References $invalid_references.
Referenced by validate().
ilValidator::getInvalidRolefolders | ( | ) |
Gets invalid rolefolders (same as missing objects)
public
Definition at line 1080 of file class.ilValidator.php.
References $invalid_rolefolders.
Referenced by validate().
ilValidator::getMissingObjects | ( | ) |
Gets all object entries with missing reference and/or tree entry.
Returns array with obj_id => actual object entry with missing reference or tree type => symbolic name of object type ref_id => reference entry of object (or NULL if missing) child => always NULL (only for debugging and verification)
public
Definition at line 798 of file class.ilValidator.php.
References $missing_objects.
Referenced by validate().
ilValidator::getUnboundObjects | ( | ) |
Gets all tree entries having no valid parent (=> no valid path to root node) Returns an array with child => actual entry with broken uplink to its parent parent => parent of child that does not exist grandparent => grandparent of child (where path to root node continues) deleted => containing a negative number (= parent in trash) or NULL (parent does not exist at all)
public
Definition at line 1056 of file class.ilValidator.php.
References $unbound_objects.
Referenced by validate().
ilValidator::handleErr | ( | $error | ) |
Callback function handles PEAR_error and outputs detailed infos about error TODO: implement that in global errorhandler of ILIAS (via templates)
private
object | PEAR_error |
Definition at line 1904 of file class.ilValidator.php.
References exit.
ilValidator::hasScanLog | ( | ) |
Quickly determine if there is a scan log.
Definition at line 1995 of file class.ilValidator.php.
Referenced by readScanLog().
ilValidator::ilValidator | ( | $a_log = false | ) |
Constructor.
public
integer | mode |
Definition at line 136 of file class.ilValidator.php.
References deleteScanLog(), and writeScanLogLine().
ilValidator::initGapsInTree | ( | ) |
Initializes gaps in lft/rgt values of a tree.
Depending on the value of the gap property of the tree, this function either closes all gaps in the tree, or equally distributes gaps all over
the tree.
Wrapper for ilTree::renumber() @access public @return boolean false if clean mode disabled @see ilTree::renumber()
Definition at line 1873 of file class.ilValidator.php.
References $ilLog, and writeScanLogLine().
Referenced by validate().
|
protected |
Check if type is excluded from recovery.
string | $a_type | |
int | $a_obj_id |
Definition at line 2485 of file class.ilValidator.php.
References isMediaFolder().
Referenced by findMissingObjects(), and restoreMissingObjects().
ilValidator::isLogEnabled | ( | ) |
Definition at line 221 of file class.ilValidator.php.
References $logging.
Referenced by writeScanLogArray(), and writeScanLogLine().
|
protected |
Definition at line 2461 of file class.ilValidator.php.
References $res, and DB_FETCHMODE_OBJECT.
Referenced by dumpTree(), and isExcludedFromRecovery().
ilValidator::isModeEnabled | ( | $a_mode | ) |
Is a particular mode enabled?
public
string | mode to query |
Definition at line 210 of file class.ilValidator.php.
Referenced by validate().
ilValidator::purgeMissingObjects | ( | $a_nodes = NULL | ) |
Removes all missing objects from system.
public
array | list of nodes to delete |
Definition at line 1735 of file class.ilValidator.php.
References $ilLog, $missing_objects, purgeObjects(), and writeScanLogLine().
Referenced by validate().
ilValidator::purgeObjects | ( | $a_nodes | ) |
removes objects from system
private
array | list of objects |
Definition at line 1767 of file class.ilValidator.php.
References $ilLog, $ref_id, ilTree\_removeEntry(), findInvalidChilds(), removeInvalidChilds(), and writeScanLogLine().
Referenced by purgeMissingObjects(), purgeTrash(), and purgeUnboundObjects().
ilValidator::purgeTrash | ( | $a_nodes = NULL | ) |
Removes all objects in trash from system.
public
array | list of nodes to delete |
Definition at line 1667 of file class.ilValidator.php.
References $deleted_objects, $ilLog, purgeObjects(), and writeScanLogLine().
Referenced by validate().
ilValidator::purgeUnboundObjects | ( | $a_nodes = NULL | ) |
Removes all invalid objects from system.
public
array | list of nodes to delete |
Definition at line 1701 of file class.ilValidator.php.
References $ilLog, $unbound_objects, purgeObjects(), and writeScanLogLine().
Referenced by validate().
ilValidator::readScanLog | ( | ) |
Definition at line 2009 of file class.ilValidator.php.
References $scan_log, get_last_scan(), and hasScanLog().
ilValidator::removeInvalidChilds | ( | $a_invalid_childs = NULL | ) |
Removes all tree entries without any link to a valid object.
public
array | invalid IDs in tree (optional) |
Definition at line 1158 of file class.ilValidator.php.
References $ilLog, $invalid_childs, and writeScanLogLine().
Referenced by purgeObjects(), restoreSubTrees(), and validate().
ilValidator::removeInvalidReferences | ( | $a_invalid_refs = NULL | ) |
Removes all reference entries that are linked with invalid object IDs.
public
array | invalid IDs in object_reference (optional) |
Definition at line 1094 of file class.ilValidator.php.
References $ilLog, $invalid_references, and writeScanLogLine().
Referenced by validate().
ilValidator::removeInvalidRolefolders | ( | $a_invalid_rolefolders = NULL | ) |
Removes invalid rolefolders.
public
array | obj_ids of rolefolder objects (optional) |
Definition at line 1223 of file class.ilValidator.php.
References $ilLog, $invalid_rolefolders, restoreReference(), and writeScanLogLine().
Referenced by validate().
ilValidator::restoreDeletedObjects | ( | $a_nodes | ) |
Restore deleted objects (and their subobjects) to RecoveryFolder.
private
array | list of nodes |
Definition at line 1503 of file class.ilValidator.php.
References $ilLog, and writeScanLogLine().
Referenced by restoreTrash().
ilValidator::restoreMissingObjects | ( | $a_missing_objects = NULL | ) |
Restores missing reference and/or tree entry for all objects found by this::getMissingObjects() Restored object are placed in RecoveryFolder.
public
array | obj_ids of missing objects (optional) |
Definition at line 1295 of file class.ilValidator.php.
References $ilLog, $missing_objects, isExcludedFromRecovery(), restoreReference(), and writeScanLogLine().
Referenced by validate().
ilValidator::restoreReference | ( | $a_obj_id | ) |
restore a reference for an object Creates a new reference entry in DB table object_reference for $a_obj_id
integer | obj_id private |
Definition at line 1376 of file class.ilValidator.php.
References $ilLog.
Referenced by removeInvalidRolefolders(), and restoreMissingObjects().
ilValidator::restoreSubTrees | ( | $a_nodes | ) |
Restore objects (and their subobjects) to RecoveryFolder.
private
array | list of nodes |
Definition at line 1565 of file class.ilValidator.php.
References $ilLog, findInvalidChilds(), removeInvalidChilds(), and writeScanLogLine().
Referenced by restoreUnboundObjects().
ilValidator::restoreTrash | ( | $a_deleted_objects = NULL | ) |
Restore all objects in trash to RecoveryFolder NOTE: All objects will be restored to top of RecoveryFolder regardless of existing hierarchical structure!
public
array | list of deleted childs (optional) |
Definition at line 1449 of file class.ilValidator.php.
References $deleted_objects, $ilLog, restoreDeletedObjects(), and writeScanLogLine().
Referenced by validate().
ilValidator::restoreUnboundObjects | ( | $a_unbound_objects = NULL | ) |
Restore objects (and their subobjects) to RecoveryFolder that are valid but not linked correctly in the hierarchy because they point to an invalid parent_id.
public
array | list of childs with invalid parents (optional) |
Definition at line 1408 of file class.ilValidator.php.
References $ilLog, $unbound_objects, restoreSubTrees(), and writeScanLogLine().
Referenced by validate().
ilValidator::setMode | ( | $a_mode, | |
$a_value | |||
) |
set mode of ilValidator Usage: setMode("restore",true) => enable object restorey setMode("all",true) => enable all features For all possible modes see variables declaration
public
string | mode |
boolean | value (true=enable/false=disable) |
Definition at line 176 of file class.ilValidator.php.
References $mode, and setModeDependencies().
ilValidator::setModeDependencies | ( | ) |
Sets modes by considering mode dependencies; some modes require other modes to be activated.
This functions set all modes that are required according to the current setting.
private
Definition at line 234 of file class.ilValidator.php.
Referenced by setMode().
ilValidator::validate | ( | ) |
Performs the validation for each enabled mode.
Returns a validation summary for display to the user.
Definition at line 276 of file class.ilValidator.php.
References $lng, $mode, checkTreeStructure(), dumpTree(), findDeletedObjects(), findInvalidChilds(), findInvalidReferences(), findInvalidRolefolders(), findMissingObjects(), findUnboundObjects(), getDeletedObjects(), getInvalidChilds(), getInvalidReferences(), getInvalidRolefolders(), getMissingObjects(), getUnboundObjects(), initGapsInTree(), isModeEnabled(), purgeMissingObjects(), purgeTrash(), purgeUnboundObjects(), removeInvalidChilds(), removeInvalidReferences(), removeInvalidRolefolders(), restoreMissingObjects(), restoreTrash(), and restoreUnboundObjects().
ilValidator::writeScanLogArray | ( | $a_arr | ) |
Definition at line 1969 of file class.ilValidator.php.
References isLogEnabled().
Referenced by findDeletedObjects(), findInvalidChilds(), findInvalidRBACEntries(), findInvalidReferences(), findInvalidRolefolders(), findMissingObjects(), and findUnboundObjects().
ilValidator::writeScanLogLine | ( | $a_msg | ) |
Definition at line 1982 of file class.ilValidator.php.
References isLogEnabled().
Referenced by checkTreeStructure(), dumpTree(), findDeletedObjects(), findInvalidChilds(), findInvalidRBACEntries(), findInvalidReferences(), findInvalidRolefolders(), findMissingObjects(), findUnboundObjects(), ilValidator(), initGapsInTree(), purgeMissingObjects(), purgeObjects(), purgeTrash(), purgeUnboundObjects(), removeInvalidChilds(), removeInvalidReferences(), removeInvalidRolefolders(), restoreDeletedObjects(), restoreMissingObjects(), restoreSubTrees(), restoreTrash(), and restoreUnboundObjects().
ilValidator::$deleted_objects = array() |
Definition at line 98 of file class.ilValidator.php.
Referenced by getDeletedObjects(), purgeTrash(), and restoreTrash().
ilValidator::$invalid_childs = array() |
Definition at line 80 of file class.ilValidator.php.
Referenced by getInvalidChilds(), and removeInvalidChilds().
ilValidator::$invalid_objects = array() |
Definition at line 112 of file class.ilValidator.php.
ilValidator::$invalid_references = array() |
Definition at line 74 of file class.ilValidator.php.
Referenced by getInvalidReferences(), and removeInvalidReferences().
ilValidator::$invalid_rolefolders = array() |
Definition at line 106 of file class.ilValidator.php.
Referenced by getInvalidRolefolders(), and removeInvalidRolefolders().
ilValidator::$logging = false |
Definition at line 118 of file class.ilValidator.php.
Referenced by isLogEnabled().
|
protected |
Definition at line 33 of file class.ilValidator.php.
ilValidator::$missing_objects = array() |
Definition at line 86 of file class.ilValidator.php.
Referenced by getMissingObjects(), purgeMissingObjects(), and restoreMissingObjects().
ilValidator::$mode |
Definition at line 60 of file class.ilValidator.php.
Referenced by setMode(), and validate().
ilValidator::$object_types_exclude |
Definition at line 53 of file class.ilValidator.php.
ilValidator::$rbac_object_types = NULL |
Definition at line 39 of file class.ilValidator.php.
ilValidator::$scan_log |
Definition at line 124 of file class.ilValidator.php.
Referenced by readScanLog().
ilValidator::$scan_log_file = "scanlog.log" |
Definition at line 126 of file class.ilValidator.php.
ilValidator::$scan_log_separator = "<!-- scan log start -->" |
Definition at line 128 of file class.ilValidator.php.
ilValidator::$unbound_objects = array() |
Definition at line 92 of file class.ilValidator.php.
Referenced by getUnboundObjects(), purgeUnboundObjects(), and restoreUnboundObjects().