3 +-------------------------------------------------------------------------+
4 | Copyright (C) 2004 Juan Luis Francés Jiménez |
5 | Copyright 2010-2011, Davide Franco |
7 | This program is free software; you can redistribute it and/or |
8 | modify it under the terms of the GNU General Public License |
9 | as published by the Free Software Foundation; either version 2 |
10 | of the License, or (at your option) any later version. |
12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | GNU General Public License for more details. |
16 +-------------------------------------------------------------------------+
18 require_once ("config.inc.php");
22 $check_result = array( true => 'ok.png', false => 'error.png' );
25 $check_list = array( array( 'check_cmd' => 'php-gettext',
26 'check_label' => 'PHP - Gettext support',
27 'check_descr' => 'If you want Bacula-web in your language, please compile PHP with Gettext support' ),
28 array( 'check_cmd' => 'pear-db',
29 'check_label' => 'PEAR DB module',
30 'check_descr' => 'PEAR DB support not found, please read the Bacula-web installation document'),
31 array( 'check_cmd' => 'php-gd',
32 'check_label' => 'PHP - GD support',
33 'check_descr' => 'This is required by phplot, please compile php with GD support'),
34 array( 'check_cmd' => 'php-mysql',
35 'check_label' => 'PHP - MySQL support',
36 'check_descr' => 'PHP MySQL support must be installed in order to run bacula-web with MySQL bacula catalog'),
37 array( 'check_cmd' => 'php-postgres',
38 'check_label' => 'PHP - PostgreSQL support',
39 'check_descr' => 'PHP PostgreSQL support must be installed in order to run bacula-web with PostgreSQL bacula catalog'),
40 array( 'check_cmd' => 'smarty-cache',
41 'check_label' => 'Smarty cache folder write permission',
42 'check_descr' => 'Smarty template engine need write permissions to templates_c folder')
46 foreach( $check_list as &$check ) {
47 switch( $check['check_cmd'] )
50 $check['check_result'] = $check_result[ function_exists( 'gettext' ) ];
53 $check['check_result'] = $check_result[ function_exists( 'gd_info') ];
56 $check['check_result'] = $check_result[ class_exists('DB') ];
59 $check['check_result'] = $check_result[ function_exists('mysql_connect') ];
62 $check['check_result'] = $check_result[ function_exists('pg_connect') ];
65 $check['check_result'] = $check_result[ is_writable( "./templates_c" ) ];
70 // Generate test graph
71 $data = array( array('test', 100, 100, 200, 100), array('test1', 150, 100, 150, 100 ) );
72 $graph = new BGraph( "graph3.png" );
73 $graph->SetColors( array('green', 'red' ) );
75 $graph->SetData( $data, 'pie', 'text-data-single' );
76 $graph->SetGraphSize( 400, 230 );
81 $bw->tpl->assign( 'checks', $check_list );
82 $bw->tpl->assign('graph_test', $graph->Get_Image_file() );
83 $bw->tpl->display('test.tpl');