summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a47eef2)
raw | patch | inline | side by side (parent: a47eef2)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 25 Oct 2007 12:44:27 +0000 (12:44 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 25 Oct 2007 12:44:27 +0000 (12:44 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7658 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_hostActionQueue.inc | patch | blob | history |
index cbebb11ea2207fb96391581e689b35a3fb6a9b01..59ca97dde940f913ad2185782c91d9591ff50a13 100644 (file)
$this->s_error = "";
$this->i_pointer = 0;
- $this->get_new_id();
-
/* Check file accessibility */
if(!file_exists($this->s_queue_file)){
$this->set_error(sprintf(_("Can't locate gotomasses queue file '%s'."),$this->s_queue_file));
$desc =preg_replace("/^.*desc:(.*)$/","\\1",$comment);
}
if($task_id == 0 || empty($task_id)){
- $task_id = preg_replace("/[^0-9]*/","",microtime());
+ $task_id = $this->get_new_id();
}
if($entry_id == 0 || empty($entry_id)){
- $entry_id = preg_replace("/[^0-9]*/","",microtime());
+ $entry_id = $this->get_new_id();
}
/* Get unige id */
while(in_array($entry_id,$used_ids)){
- $entry_id = preg_replace("/[^0-9]*/","",microtime());
+ $entry_id = $this->get_new_id();
}
$used_ids[] = $entry_id;
}
$entry['Comment'] = $desc;
$this->a_queue[] = $entry;
-
}
+ $comment = "";
}
/* Udpate ENTRY_ID -> id mapping */
private function _add_entry($entry,$task_id = 0)
{
if($task_id == 0 || empty($task_id)){
- $task_id=preg_replace("/[^0-9]*/","",microtime());
+ $task_id = $this->get_new_id();
}
$entry['TASK_ID'] = $task_id;
if(!isset($entry['ID']) || empty($entry['ID']) || !isset($entry['ID']) || empty($entry['ID'])){
- $entry['ID'] = preg_replace("/[^0-9]*/","",microtime());
+ $entry['ID'] = $this->get_new_id();
}
$this->a_queue[] = $entry;
public function add_multiple($array)
{
- $task_id = preg_replace("/[^0-9]*/","",microtime());
+ $task_id = $this->get_new_id();
foreach($array as $entry){
if(!$this->_add_entry($entry,$task_id)){
return(FALSE);
private function get_new_id()
{
+ $mt = microtime();
+ $sec = preg_replace("/^0.([0-9]*) ([0-9]*)$/","\\2",$mt);
+ $msec = preg_replace("/^0.([0-9]*) ([0-9]*)$/","\\1",$mt);
+ return(strtoupper(base_convert($sec,10,36).base_convert($msec,10,36)));
}
public function min_entry_priority($id)