◆ __construct()
ilArrayTableDataParser::__construct |
( |
|
$data_dir | ) |
|
◆ startParsing()
ilArrayTableDataParser::startParsing |
( |
| ) |
|
Definition at line 19 of file class.ilArrayTableDataParser.php.
References $DIC, $ilDB, and $rows.
22 $ilDB = $DIC->database();
23 $ilLogger = $DIC->logger()->root();
25 if (!$dp = opendir($this->dir)) {
26 $ilLogger->error(__METHOD__ .
': Cannot open data directory: ' . $this->dir);
30 $ilLogger->log(__METHOD__ .
': Reading table data from: ' . $this->dir);
31 while (
false !== ($file = readdir($dp))) {
32 $ilLogger->log(__METHOD__ .
': Handling file: ' . $file);
33 if (substr($file, -5) !=
'.data') {
34 $ilLogger->log(__METHOD__ .
': Ignoring file: ' . $file);
38 $content = file_get_contents($this->dir . DIRECTORY_SEPARATOR . $file);
40 $ilLogger->log(__METHOD__ .
': Reading inserts of ' . $this->dir .
'/' . $file);
41 $content = unserialize($content);
43 if (!is_array($content)) {
44 $ilLogger->log(__METHOD__ .
': No entries found in ' . $this->dir .
'/' . $file);
48 foreach ($content as $table =>
$rows) {
49 foreach (
$rows as $row) {
50 $ilDB->insert($table, $row);
53 if (function_exists(
'memory_get_usage')) {
54 $ilLogger->log(__METHOD__ .
': Memory usage ' . memory_get_usage(
true));
◆ $dir
ilArrayTableDataParser::$dir = null |
|
protected |
◆ $value
ilArrayTableDataParser::$value = '' |
|
protected |
The documentation for this class was generated from the following file: