blob: 85c78e3c6b8efbe6b982420b4c23388f8e166ae7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
<?php
require "include/main.php";
require "class/CommonTable.php";
$db = new PDO ("mysql:dbname=" . MYBASE . ";host=" . MYHOST, MYUSER, MYPASS);
$pear = new TableRRepo($db);
print_r($pear->getAllRepo());
echo "PEAR\n";
$pear = new TablePearRepo($db);
print_r($pear->getAllRepo());
$pear = new TablePearRepo($db);
print_r($pear->getAllRepo(false));
$a=$pear->add(array('alias'=>'test', 'url'=>'testurl'));
echo "Ajout : $a\n";
$b=$pear->delete(array('id'=>$a));
echo "Del : $b\n";
echo "RPM:";
$rpm = new TableRpmRepo($db);
if ($rpm->update(999, array('stamp'=>1)))
{
echo "Update 1 ok\n";
}
print_r($rpm->getAllRepo());
if ($rpm->update(999, array('stamp'=>2)))
{
echo "Update 2 ok\n";
}
$all = $rpm->getAllRepo();
print_r(array_pop($all));
echo "find(devel):";
if ($row = $rpm->find(array('main'=>'devel'))) {
print_r($row);
} else {
echo "not found\n";
}
echo "find(rawhide):";
if ($row = $rpm->find(array('main'=>'rawhide'))) {
print_r($row);
} else {
echo "not found\n";
}
echo "find():";
if ($row = $rpm->find(array())) {
print_r($row);
} else {
echo "not found\n";
}
echo "get(999):";
if ($row = $rpm->get(999)) {
print_r($row);
} else {
echo "not found\n";
}
echo "get(888):";
if ($row = $rpm->get(888)) {
print_r($row);
} else {
echo "not found\n";
}
?>
|