本文整理汇总了PHP中ilTree::_removeEntry方法的典型用法代码示例。如果您正苦于以下问题:PHP ilTree::_removeEntry方法的具体用法?PHP ilTree::_removeEntry怎么用?PHP ilTree::_removeEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilTree
的用法示例。
在下文中一共展示了ilTree::_removeEntry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: purgeObjects
/**
* removes objects from system
*
* @access private
* @param array list of objects
* @return boolean
*/
function purgeObjects($a_nodes)
{
global $ilias, $ilLog;
// Get purge limits
$count_limit = $ilias->account->getPref("systemcheck_count_limit");
if (!is_numeric($count_limit) || $count_limit < 0) {
$count_limit = count($a_nodes);
}
$timestamp_limit = time();
$age_limit = $ilias->account->getPref("systemcheck_age_limit");
if (is_numeric($age_limit) && $age_limit > 0) {
$timestamp_limit -= $age_limit * 60 * 60 * 24;
}
$type_limit = $ilias->account->getPref("systemcheck_type_limit");
if ($type_limit) {
$type_limit = trim($type_limit);
if (strlen($type_limit) == 0) {
$type_limit = null;
}
}
// handle wrong input
if (!is_array($a_nodes)) {
$this->throwError(INVALID_PARAM, WARNING, DEBUG);
return false;
}
// start delete process
$this->writeScanLogLine("action\tref_id\tobj_id\ttype\telapsed\ttitle");
$count = 0;
foreach ($a_nodes as $node) {
if ($type_limit && $node['type'] != $type_limit) {
$this->writeScanLogLine("skip\t" . $node['child'] . "\t\t" . $node['type'] . "\t\t" . $node['title']);
continue;
}
$count++;
if ($count > $count_limit) {
$this->writeScanLogLine("Stopped purging after " . ($count - 1) . " objects, because count limit was reached: " . $count_limit);
break;
}
if ($node["deleted_timestamp"] > $timestamp_limit) {
$this->writeScanLogLine("Stopped purging after " . ($count - 1) . " objects, because timestamp limit was reached: " . date("c", $timestamp_limit));
continue;
}
$ref_id = $node["child"] ? $node["child"] : $node["ref_id"];
$node_obj =& $ilias->obj_factory->getInstanceByRefId($ref_id, false);
if ($node_obj === false) {
$this->invalid_objects[] = $node;
continue;
}
$message = sprintf('%s::purgeObjects(): Removing object (id:%s ref:%s)', get_class($this), $ref_id, $node_obj->getId());
$ilLog->write($message, $ilLog->WARNING);
$startTime = microtime(true);
$node_obj->delete();
ilTree::_removeEntry($node["tree"], $ref_id);
$endTime = microtime(true);
$this->writeScanLogLine("purged\t" . $ref_id . "\t" . $node_obj->getId() . "\t" . $node['type'] . "\t" . round($endTime - $startTime, 1) . "\t" . $node['title']);
}
$this->findInvalidChilds();
$this->removeInvalidChilds();
return true;
}