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/global.inc.php");
22 $icon_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' => 'php-gd',
29 'check_label' => 'PHP - GD support',
30 'check_descr' => 'This is required by phplot, please compile PHP with GD support'),
31 array( 'check_cmd' => 'php-mysql',
32 'check_label' => 'PHP - MySQL support',
33 'check_descr' => 'PHP MySQL support must be installed in order to run bacula-web with MySQL bacula catalog'),
34 array( 'check_cmd' => 'php-postgres',
35 'check_label' => 'PHP - PostgreSQL support',
36 'check_descr' => 'PHP PostgreSQL support must be installed in order to run bacula-web with PostgreSQL bacula catalog'),
37 array( 'check_cmd' => 'php-pdo',
38 'check_label' => 'PHP - PDO support',
39 'check_descr' => 'PHP PDO support is required, please compile PHP with this option'),
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'),
43 array( 'check_cmd' => 'php-version',
44 'check_label' => 'PHP version',
45 'check_descr' => 'PHP version must be at least 5.0.0 (current = ' . PHP_VERSION . ')' )
49 foreach( $check_list as &$check ) {
50 switch( $check['check_cmd'] )
53 $check['check_result'] = $icon_result[ function_exists( 'gettext' ) ];
56 $check['check_result'] = $icon_result[ function_exists( 'gd_info') ];
59 $check['check_result'] = $icon_result[ class_exists('DB') ];
62 $check['check_result'] = $icon_result[ function_exists('mysql_connect') ];
65 $check['check_result'] = $icon_result[ function_exists('pg_connect') ];
68 $check['check_result'] = $icon_result[ class_exists('PDO') ];
71 $check['check_result'] = $icon_result[ is_writable( "./templates_c" ) ];
74 $check['check_result'] = $icon_result[ version_compare( PHP_VERSION, '5.0.0', '>=' ) ];
79 // Generate test graph
80 $data = array( array('test', 100, 100, 200, 100), array('test1', 150, 100, 150, 100 ) );
81 $graph = new CGraph( "graph3.png" );
82 $graph->SetColors( array('green', 'red' ) );
84 $graph->SetData( $data, 'pie', 'text-data-single' );
85 $graph->SetGraphSize( 400, 230 );
90 $bw->tpl->assign( 'checks', $check_list );
91 $bw->tpl->assign('graph_test', $graph->Get_Image_file() );
92 $bw->tpl->display('test.tpl');