2 require_once ("config.inc.php");
6 $check_result = array( true => 's_ok.png', false => 's_error.gif' );
9 $check_list = array( array( 'check_cmd' => 'php-gettext',
10 'check_label' => 'PHP - Gettext support',
11 'check_descr' => 'If you want Bacula-web in your language, please compile PHP with Gettext support' ),
12 array( 'check_cmd' => 'pear-db',
13 'check_label' => 'PEAR DB module',
14 'check_descr' => 'PEAR DB support not found, please read the Bacula-web installation document'),
15 array( 'check_cmd' => 'php-gd',
16 'check_label' => 'PHP - GD support',
17 'check_descr' => 'This is required by phplot, please compile php with GD support'),
18 array( 'check_cmd' => 'php-mysql',
19 'check_label' => 'PHP - MySQL support',
20 'check_descr' => 'PHP MySQL support must be installed in order to run bacula-web with MySQL bacula catalog'),
21 array( 'check_cmd' => 'php-postgres',
22 'check_label' => 'PHP - PostgreSQL support',
23 'check_descr' => 'PHP PostgreSQL support must be installed in order to run bacula-web with PostgreSQL bacula catalog'),
24 array( 'check_cmd' => 'smarty-cache',
25 'check_label' => 'Smarty cache folder write permission',
26 'check_descr' => 'Smarty template engine need write permissions to templates_c folder')
30 foreach( $check_list as &$check ) {
31 switch( $check['check_cmd'] )
34 $check['check_result'] = $check_result[ function_exists( 'gettext' ) ];
37 $check['check_result'] = $check_result[ function_exists( 'gd_info') ];
40 $check['check_result'] = $check_result[ class_exists('DB') ];
43 $check['check_result'] = $check_result[ function_exists('mysql_connect') ];
46 $check['check_result'] = $check_result[ function_exists('pg_connect') ];
49 $check['check_result'] = $check_result[ is_writable( "./templates_c" ) ];
55 // Generate test graph
56 $data = array( array('test', 100, 100, 200, 100), array('test1', 150, 100, 150, 100 ) );
57 $graph = new BGraph( "graph3.png" );
58 $graph->SetColors( array('green', 'red' ) );
60 $graph->SetData( $data, 'pie', 'text-data-single' );
61 $graph->SetGraphSize( 400, 230 );
66 $bw->tpl->assign( 'checks', $check_list );
67 $bw->tpl->assign('graph_test', $graph->Get_Image_file() );
68 $bw->tpl->display('test.tpl');