Plugins  LAST
 All Data Structures Files Functions Variables Pages
raw.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of NOALYSS.
5  *
6  * NOALYSS is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * NOALYSS is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with NOALYSS; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 /* $Revision$ */
21 
22 // Copyright (c) 2002 Author Dany De Bontridder dany@alchimerys.be
23 
24 /***
25  * \file
26  * \brief raw file for backup
27  */
28 $cmd=escapeshellcmd(PG_DUMP);
29 if (defined("noalyss_user"))
30 {
31  putenv("PGPASSWORD=".noalyss_password);
32  putenv("PGUSER=".noalyss_user);
33  putenv("PGHOST=".noalyss_psql_host);
34  putenv("PGPORT=".noalyss_psql_port);
35  $port=noalyss_psql_port;
36 }
37 else if (defined("phpcompta_user"))
38 {
39  putenv("PGPASSWORD=".phpcompta_password);
40  putenv("PGUSER=".phpcompta_user);
41  putenv("PGHOST=".phpcompta_psql_host);
42  putenv("PGPORT=".phpcompta_psql_port);
43  $port=phpcompta_psql_port;
44 }
45 
46 $database=domaine."dossier".Dossier::id();
47 $args=" -Fc -Z9 --no-owner -p ".$port." ".$database;
48 header('Content-type: application/octet');
49 header('Content-Disposition:attachment;filename="'.$database.'.bin"', FALSE);
50 
51 passthru($cmd.$args, $a);
$select_type id
$cmd
Definition: raw.php:28
$args
Definition: raw.php:47
if(defined("noalyss_user")) else if(defined("phpcompta_user")) $database
Definition: raw.php:46