Permalink
Browse files

Fix #15920: Missing config file causes cli scripts to fail silently

We now display an error message and die with exit code 1.
  • Loading branch information...
1 parent fe2b85a commit 05091f54f66a2aec636e3b1c640df3cb4bdc9758 @dregad dregad committed May 25, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 core.php
View
@@ -169,6 +169,11 @@ function __autoload( $className ) {
compress_start_handler();
if ( false === $t_config_inc_found ) {
+ if( php_sapi_name() == 'cli' ) {
+ echo "Error: config_inc.php file not found; ensure MantisBT is properly setup.\n";
+ exit(1);
+ }
+
# if not found, redirect to the admin page to install the system
# this needs to be long form and not replaced by is_page_name as that function isn't loaded yet
if ( !( isset( $_SERVER['SCRIPT_NAME'] ) && ( 0 < strpos( $_SERVER['SCRIPT_NAME'], 'admin' ) ) ) ) {

0 comments on commit 05091f5

Please sign in to comment.