16 $this->dir = $data_dir;
23 if(!$dp = opendir($this->dir))
25 $ilLog->write(__METHOD__.
': Cannot open data directory: '.$this->dir);
29 $ilLog->write(__METHOD__.
': Reading table data from: '.$this->dir);
30 while (
false !== (
$file = readdir($dp)))
32 $ilLog->write(__METHOD__.
': Handling file: '.
$file);
33 if(substr(
$file, -5) !=
'.data')
35 $ilLog->write(__METHOD__.
': Ignoring file: '.
$file);
39 $content = file_get_contents($this->dir.DIRECTORY_SEPARATOR.$file);
41 $ilLog->write(__METHOD__.
': Reading inserts of '.$this->dir.
'/'.
$file);
42 $content = unserialize($content);
44 if(!is_array($content))
46 $ilLog->write(__METHOD__.
': No entries found in '.$this->dir.
'/'.
$file);
50 foreach($content as $table => $rows)
52 foreach($rows as
$row)
57 if(function_exists(
'memory_get_usage'))
memory_get_usage(true)/1024/1024)
An exception for terminatinating execution or to throw for unit testing.
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file