Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
refreshDocuments.php File Reference

Go to the source code of this file.

Namespaces

 FDL
 

Functions

 color_failure ($msg)
 
 color_success ($msg)
 
 color_warning ($msg)
 

Variables

global $action
 
 $usage = new ApiUsage()
 
 $famId = $usage->addRequiredParameter("famid", "the family identifier used to filter")
 
 $method
 
 $arg = $usage->addOptionalParameter("arg", "optional method argument to set when calling method")
 
 $revision
 
 $docid = $usage->addOptionalParameter("docid", "use only for this document id")
 
 $start = $usage->addOptionalParameter("start", "start from offset", array() , 0)
 
 $slice = $usage->addOptionalParameter("slice", "limit from offset", array() , "all")
 
 $fldid = $usage->addOptionalParameter("fldid", "use collection id to limit search")
 
 $filter = $usage->addOptionalParameter("filter", "sql filter to limit search")
 
 $save
 
 $statusFile
 
 $stopOnError = ($usage->addEmptyParameter("stop-on-error", "Stop processing when a document returns an error or throws an exception") !== false)
 
 $allrev = ($revision == "yes")
 
 $dbaccess = $action->dbaccess
 
if($dbaccess=="") if($statusFile=== '') $famtitle = ""
 
if($famId) $s = new SearchDoc($dbaccess, $famId)
 
$s orderby = 'id desc'
 
$s slice = $slice
 
$s start = $start
 
if($s->searchError()) $targ = array()
 
 $card = $s->count()
 
 $ret = ""
 
 $countAll = $card
 
 $countProcessed = 0
 
 $countSuccess = 0
 
 $countFailure = 0
 
 $exitcode = 0
 
while($doc=$s->getNextDoc()) $writeStatus
 

Function Documentation

color_failure (   $msg)

Definition at line 22 of file refreshDocuments.php.

color_success (   $msg)

Definition at line 28 of file refreshDocuments.php.

color_warning (   $msg)

Definition at line 34 of file refreshDocuments.php.

Variable Documentation

global $action

Definition at line 17 of file refreshDocuments.php.

$allrev = ($revision == "yes")

Definition at line 88 of file refreshDocuments.php.

$arg = $usage->addOptionalParameter("arg", "optional method argument to set when calling method")

Definition at line 57 of file refreshDocuments.php.

$card = $s->count()

Definition at line 146 of file refreshDocuments.php.

$countAll = $card

Definition at line 150 of file refreshDocuments.php.

$countFailure = 0

Definition at line 153 of file refreshDocuments.php.

$countProcessed = 0

Definition at line 151 of file refreshDocuments.php.

$countSuccess = 0

Definition at line 152 of file refreshDocuments.php.

$dbaccess = $action->dbaccess

Definition at line 89 of file refreshDocuments.php.

$docid = $usage->addOptionalParameter("docid", "use only for this document id")

Definition at line 62 of file refreshDocuments.php.

$exitcode = 0

Definition at line 154 of file refreshDocuments.php.

$famId = $usage->addRequiredParameter("famid", "the family identifier used to filter")

Definition at line 42 of file refreshDocuments.php.

if ($dbaccess=="") if ($statusFile=== '') $famtitle = ""

Definition at line 99 of file refreshDocuments.php.

$filter = $usage->addOptionalParameter("filter", "sql filter to limit search")

Definition at line 66 of file refreshDocuments.php.

$fldid = $usage->addOptionalParameter("fldid", "use collection id to limit search")

Definition at line 65 of file refreshDocuments.php.

$method
Initial value:
= $usage->addOptionalParameter("method", "method to use", function ($value)
{
return '';
}
if (!is_string($value)) {
return sprintf("Invalid %s value for option --method=<methodName>", gettype($value));
}
if (strlen($value) <= 0) {
return sprintf("Invalid empty value for option --method=<methodName>");
}
return '';
}
, "refresh")
const GET_USAGE
$value

Definition at line 43 of file refreshDocuments.php.

$ret = ""

Definition at line 149 of file refreshDocuments.php.

Initial value:
= $usage->addOptionalParameter("revision", "use all revision", array(
"yes",
"no"
) , "no")

Definition at line 58 of file refreshDocuments.php.

if ($famId) $s = new SearchDoc($dbaccess, $famId)

Definition at line 112 of file refreshDocuments.php.

$save
Initial value:
= $usage->addOptionalParameter("save", "store mode", array(
"complete",
"light",
"none"
) , "light")

Definition at line 67 of file refreshDocuments.php.

$slice = $usage->addOptionalParameter("slice", "limit from offset", array() , "all")

Definition at line 64 of file refreshDocuments.php.

$start = $usage->addOptionalParameter("start", "start from offset", array() , 0)

Definition at line 63 of file refreshDocuments.php.

$statusFile
Initial value:
= $usage->addOptionalParameter("status-file", "refresh's status file or '-' for STDOUT", function ($value)
{
return '';
}
if (!is_string($value)) {
return sprintf("Invalid %s value for option --status-file=<statusFile>|'-'", gettype($value));
}
if (strlen($value) <= 0) {
return sprintf("Invalid empty value for option --status-file=<statusFile>|'-'");
}
return '';
})
const GET_USAGE
$value

Definition at line 72 of file refreshDocuments.php.

$stopOnError = ($usage->addEmptyParameter("stop-on-error", "Stop processing when a document returns an error or throws an exception") !== false)

Definition at line 85 of file refreshDocuments.php.

if ($s->searchError()) $targ = array()

Definition at line 144 of file refreshDocuments.php.

$usage = new ApiUsage()

Definition at line 40 of file refreshDocuments.php.

while ($doc=$s->getNextDoc()) $writeStatus
Initial value:
= function ($statusFile, $status)
{
$err = '';
$fh = STDOUT;
if ($statusFile !== '-') {
if (file_exists($statusFile)) {
unlink($statusFile);
}
if (($fh = fopen($statusFile, 'x')) === false) {
$err = sprintf("Error creating refresh's status file '%s'.", $statusFile);
return $err;
}
}
if (fwrite($fh, $status) === false) {
$err = sprintf("Error writing refresh's status to file '%s'.", $statusFile);
fclose($fh);
return $err;
}
if ($fh !== STDOUT) {
fclose($fh);
}
return $err;
}
$status
Definition: index.php:30
$statusFile
if($file) if($subject==""&&$file) if($subject=="") $err

Definition at line 211 of file refreshDocuments.php.

$s orderby = 'id desc'

Definition at line 114 of file refreshDocuments.php.

$s slice = $slice

Definition at line 115 of file refreshDocuments.php.

$s start = $start

Definition at line 116 of file refreshDocuments.php.

← centre documentaire © anakeen