ILIAS
release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
◀ ilDoc Overview
class.ilArrayTableDataParser.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
8
class
ilArrayTableDataParser
9
{
10
protected
$dir
=
null
;
11
12
protected
$value
=
''
;
13
14
public
function
__construct
($data_dir)
15
{
16
$this->dir = $data_dir;
17
}
18
19
public
function
startParsing
()
20
{
21
global
$ilDB
,
$ilLog
;
22
23
if
(!$dp = opendir($this->dir))
24
{
25
$ilLog
->write(__METHOD__.
': Cannot open data directory: '
.$this->dir);
26
return
false
;
27
}
28
29
$ilLog
->write(__METHOD__.
': Reading table data from: '
.$this->dir);
30
while
(
false
!== (
$file
= readdir($dp)))
31
{
32
$ilLog
->write(__METHOD__.
': Handling file: '
.
$file
);
33
if
(substr(
$file
, -5) !=
'.data'
)
34
{
35
$ilLog
->write(__METHOD__.
': Ignoring file: '
.
$file
);
36
continue
;
37
}
38
39
$content = file_get_contents($this->dir.DIRECTORY_SEPARATOR.$file);
40
41
$ilLog
->write(__METHOD__.
': Reading inserts of '
.$this->dir.
'/'
.
$file
);
42
$content = unserialize($content);
43
44
if
(!is_array($content))
45
{
46
$ilLog
->write(__METHOD__.
': No entries found in '
.$this->dir.
'/'
.
$file
);
47
continue
;
48
}
49
50
foreach
($content as $table => $rows)
51
{
52
foreach
($rows as
$row
)
53
{
54
$ilDB
->insert($table,
$row
);
55
}
56
}
57
if
(function_exists(
'memory_get_usage'
))
58
{
59
$ilLog
->write(__METHOD__.
': Memory usage '
.memory_get_usage(
true
));
60
}
61
}
62
fclose($dp);
63
}
64
65
}
66
?>
$file
print $file
Definition:
HFile_ueconv.php:128
ilArrayTableDataParser
Definition:
class.ilArrayTableDataParser.php:9
ilArrayTableDataParser\$value
$value
Definition:
class.ilArrayTableDataParser.php:12
ilArrayTableDataParser\__construct
__construct($data_dir)
Definition:
class.ilArrayTableDataParser.php:14
ilArrayTableDataParser\$dir
$dir
Definition:
class.ilArrayTableDataParser.php:10
ilArrayTableDataParser\startParsing
startParsing()
Definition:
class.ilArrayTableDataParser.php:19
$row
$row
Definition:
examplelayouts.sql.php:26
$ilLog
$ilLog
Definition:
inc.setup_header.php:136
$ilDB
global $ilDB
Definition:
storeScorm2004.php:19
Services
Database
classes
class.ilArrayTableDataParser.php
Generated on Wed Sep 24 2025 19:00:55 for ILIAS by
1.9.4 (using
Doxyfile
)