Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
vault_clean.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  * Increase size of vault file system
9  *
10  * @author Anakeen 2006
11  * @version $Id: vault_clean.php,v 1.1 2006/12/08 17:53:48 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 
19 include_once ("VAULT/Class.VaultDiskStorage.php");
20 include_once ("VAULT/Class.VaultDiskFsStorage.php");
21 include_once ("FDL/Class.DocVaultIndex.php");
22 // -----------------------------------
23 function vault_clean(&$action)
24 {
25  // GetAllParameters
26  $idfs = GetHttpVars("idfs");
27  $clean = GetHttpVars("clean", "orphan");
28  // Set the globals elements
29  $dbaccess = $action->GetParam("FREEDOM_DB");
30  $fs = new VaultDiskFsStorage($dbaccess, $idfs);
31 
32  if ($fs->isAffected()) {
33 
34  $q = new QueryDb($dbaccess, "VaultDiskFsStorage");
35 
36  $no = $q->Query(0, 0, "TABLE", "SELECT * from vaultdiskstorage where $sqlfs id_file not in (select vaultid from docvaultindex)"); //Orphean
37  //print_r2($no);
38  $wsh = getWshCmd(true);
39  $cmd = $wsh . " --api=VaultExamine --cmd=clean-unref";
40 
41  $cmd.= " >/dev/null";
42 
43  system($cmd, $status);
44  if ($status == 0) AddWarningMsg(sprintf(_("Orphan Cleaned in %s directory") , $fs->r_path));
45  else AddWarningMsg(sprintf(_("Error : Cleaning %s status %d") , $fs->r_path, $status));
46  }
47  redirect($action, "VAULT", "VAULT_VIEW", $action->GetParam("CORE_STANDURL"));
48 }
49 ?>
← centre documentaire © anakeen - published under CC License - Dynacase