Platform
3.1
PHP API documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
FullFileIndex.php
Go to the documentation of this file.
1
<?php
2
/*
3
* @author Anakeen
4
* @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5
* @package FDL
6
*/
7
/**
8
* Detect file which are not indexed and index them
9
*
10
* @author Anakeen 2004
11
* @version $Id: FullFileIndex.php,v 1.2 2007/09/07 09:40:21 eric Exp $
12
* @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13
* @package FDL
14
* @subpackage
15
*/
16
/**
17
*/
18
ini_set(
"max_execution_time"
,
"36000"
);
19
20
include_once (
'FDL/Class.Doc.php'
);
21
include_once (
"FDL/Lib.Dir.php"
);
22
23
define(
"REDCOLOR"
,
'[1;31;40m'
);
24
define(
"UPDTCOLOR"
,
'[1;32;40m'
);
25
define(
"STOPCOLOR"
,
'[0m'
);
26
27
$force
= getHttpVars(
"force"
) ==
"yes"
;
28
29
$dbaccess
= GetParam(
"FREEDOM_DB"
);
30
if
(
$dbaccess
==
""
) {
31
print
"Database not found : param FREEDOM_DB"
;
32
exit
;
33
}
34
$o
=
new
DbObj
(
$dbaccess
);
35
$q
=
new
QueryDb
(
$dbaccess
,
"DocAttr"
);
36
$q
->AddQuery(
"type = 'file'"
);
37
$q
->AddQuery(
"usefor != 'Q'"
);
38
//$q->AddQuery("frameid not in (select id from docattr where type~'array')");
39
$la
=
$q
->Query(0, 0,
"TABLE"
);
40
41
foreach
(
$la
as $k => $v) {
42
$docid
= $v[
"docid"
];
43
$aid = $v[
"id"
];
44
45
$filter
= array();
46
$filter
[] =
"$aid is not null"
;
47
if
(!
$force
)
$filter
[] =
"{$aid}_txt is null"
;
48
$ldoc
=
getChildDoc
(
$dbaccess
, 0, 0,
"ALL"
,
$filter
,
$action
->user->id,
"ITEM"
,
$docid
);
49
$c
=
countDocs
(
$ldoc
);
50
51
print
"\n-- Family $docid, Attribute : $aid, count:$c\n"
;
52
while
(
$doc
=
getNextDoc
(
$dbaccess
,
$ldoc
)) {
53
print
"$c)"
.
$doc
->title .
"- $aid -"
.
$doc
->id .
'- '
.
$doc
->fromid .
"\n"
;
54
$c
--;
55
$err
=
$doc
->recomputeTextFiles($aid);
56
if
(
$err
) print
REDCOLOR
.
$err
.
STOPCOLOR
;
57
}
58
}
59
//print "$sqlicon\n";
60
61
?>
← centre documentaire
© anakeen
- published under
CC License
-
Dynacase