validateEnvironment($baseDir); } private function validateEnvironment($baseDir) { $requirements = array(); if(!is_writable(self::ASSETS_DIR)) { $requirements[] = 'Please make writable by the web server next directory: ' . $baseDir . '/' . self::ASSETS_DIR . ''; } if(!is_writable(self::DATA_DIR)) { $requirements[] = 'Please make writable by the web server next directory: ' . $baseDir . '/' . self::DATA_DIR . ''; } if(!is_writable(self::RUNTIME_DIR)) { $requirements[] = 'Please make writable by the web server next directory: ' . $baseDir . '/' . self::RUNTIME_DIR . ''; } if(!function_exists('curl_init') || !function_exists('curl_setopt') || !function_exists('curl_exec') || !function_exists('curl_close')) { $requirements[] = 'Please install cURL PHP module.'; } if(!function_exists('bcmul') || !function_exists('bcpow')) { $requirements[] = 'Please install BCMath PHP module.'; } if(!extension_loaded('pdo_pgsql') && !extension_loaded('pdo_mysql')) { $requirements[] = 'Please install PDO (PHP Data Objects) PHP module for PostgreSQL or MySQL depending on what database type you are using with Bacula.'; } if(!function_exists('mb_strlen')) { $requirements[] = 'Please install MB String PHP module for support for multi-byte string handling to PHP.'; } if(!function_exists('json_decode')) { $requirements[] = 'Please install Module for JSON functions in PHP scripts.'; } if(count($requirements) > 0) { echo '

Baculum - Missing dependencies

'; echo 'For run Baculum please correct above requirements and refresh this page in web browser.'; echo ''; exit(); } } } ?>