Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Api/freedom_import.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * importation of documents
8  *
9  * @author Anakeen
10  * @version $Id: freedom_import.php,v 1.9 2008/11/13 16:49:16 eric Exp $
11  * @package FDL
12  * @subpackage WSH
13  */
14 
15 error_log("*** API script 'freedom_import' is deprecated! You should use 'importDocuments' instead. ***");
16 
17 $wsh = array_shift($argv);
18 if (substr($wsh, 0, 1) != '/') {
19  $realwsh = realpath($wsh);
20  if ($realwsh === false) {
21  error_log("Error: could not get real path of '%s'.", $wsh);
22  exit(1);
23  }
24  $wsh = $realwsh;
25 }
26 $args = array(
27  escapeshellarg($wsh)
28 );
29 foreach ($argv as $arg) {
30  if (preg_match('/^--api=/', $arg)) {
31  $arg = '--api=importDocuments';
32  }
33  $args[] = escapeshellarg($arg);
34 }
35 $cmd = join(' ', $args);
36 $ret = 0;
37 $out = system($cmd, $ret);
38 if ($out === false) {
39  error_log("Error: could not execute command '%s'.", $cmd);
40  exit(1);
41 }
42 exit($ret);
if(substr($wsh, 0, 1)!= '/') $args
foreach($argv as $arg) $cmd
switch($command) exit
Definition: checkVault.php:46
← centre documentaire © anakeen