// Adds a given template with content to install output stream
function addTemplateToInstallContent ($template, $content = array()) {
// Load the template
- $out = loadTemplate($template, true, $content);
+ $out = loadTemplate($template, TRUE, $content);
// Add it to output
addToInstallContent($out);
$content = $GLOBALS['install_content'];
} else {
// Nothing found, this needs fixing
- $content = displayMessage('{--INSTALLER_CONTENT_404--}', true);
+ $content = displayMessage('{--INSTALLER_CONTENT_404--}', TRUE);
}
// Return content
// Generates the installer menu by simply loading another template
function generateInstallerMenu () {
// Load installer menu template
- $OUT = loadTemplate('install_menu', true);
+ $OUT = loadTemplate('install_menu', TRUE);
// Return loaded content
return $OUT;
// Generate the install footer navigation by simply loading another template
function generateInstallerFooterNavigation () {
// Load installer menu template
- $OUT = loadTemplate('install_footer', true);
+ $OUT = loadTemplate('install_footer', TRUE);
// Return loaded content
return $OUT;
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Call-back function ' . $callbackName . ' not found. saveStatus[status]=' . $saveStatus['status'] . ', key=' . $key . ', value=' . $value);
// All fine (CAREFULL!)
- return true;
+ return TRUE;
} // END - if
// Then call it back
// Is it not valid?
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',value=' . $value . ',isValid=' . intval($isValid));
- if ($isValid === false) {
+ if ($isValid === FALSE) {
// Then add it to saveStatus
array_push($saveStatus['failed_fields'], $key);
} // END - if
$isValid = (bool) call_user_func($callbackName, $currentTab);
// Is it not valid?
- if (($isValid === false) || (count($GLOBALS['installer_failed_fields'][$currentTab]) > 0)) {
+ if (($isValid === FALSE) || (count($GLOBALS['installer_failed_fields'][$currentTab]) > 0)) {
// Then change status and message
$saveStatus['status'] = 'failed';
$saveStatus['message'] = '{%message,INSTALLER_POST_CHECK_' . strtoupper($currentTab) . '_FAILED=' . $GLOBALS['installer_post_error'][$currentTab] . '%}';
// Call-back function to check if database configuration in POST is valid
function isInstallerPostDatabaseConfigValid ($currentTab) {
// By default nothing is valid
- $isValid = false;
- $engineValid = false;
+ $isValid = FALSE;
+ $engineValid = FALSE;
$missingTables = 0;
// Do both passwords match?
// Password 1 not set
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_PASSWORD1_EMPTY--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_password1');
- return false;
+ return FALSE;
} elseif ((isPostRequestElementSet('mysql_password1')) && (!isPostRequestElementSet('mysql_password2'))) {
// Password 2 not set
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_PASSWORD2_EMPTY--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_password2');
- return false;
+ return FALSE;
} elseif (postRequestElement('mysql_password1') != postRequestElement('mysql_password2')) {
// Passwords mismatch
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_PASSWORDS_MISMATCH--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_password1', 'mysql_password2');
- return false;
+ return FALSE;
} // END - if
// Restore PHP's own error handler
// Cannot connect to database
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_CONNECT_ERROR--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_login', 'mysql_password1', 'mysql_password2');
- return false;
+ return FALSE;
} // END - if
// Then attempt to select the database
// Could not find database
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_SELECT_FAILED--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_dbase');
- return false;
+ return FALSE;
} // END - if
// Set database name and prefix
// Something bad happened
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_ENGINES_SQL_ERROR--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_type');
- return false;
+ return FALSE;
} elseif (count($engines) == 0) {
// Restore own error handler again
set_error_handler('__errorHandler');
// No engine is active
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_NO_ENGINES_ACTIVE--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_type');
- return false;
+ return FALSE;
}
// Then check all, if the requested is working
foreach ($engines as $engineArray) {
// By default the selected engine is not valid
- $engineValid = false;
+ $engineValid = FALSE;
// Is the engine there?
if (strtolower($engineArray['Engine']) == strtolower(postRequestElement('mysql_type'))) {
// Okay, engine is found
- $engineValid = true;
+ $engineValid = TRUE;
break;
} // END - if
} // END - foreach
// So, is the engine found?
- if ($engineValid === false) {
+ if ($engineValid === FALSE) {
// Restore own error handler again
set_error_handler('__errorHandler');
// Requested engine is not active
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_ENGINE_UNSUPPORTED--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_type');
- return false;
+ return FALSE;
} // END - if
// Init some known tables
$tables = array(
// Admins
- 'admins' => true,
+ 'admins' => TRUE,
// Admin menu
- 'admin_menu' => true,
+ 'admin_menu' => TRUE,
// Categories
- 'cats' => true,
+ 'cats' => TRUE,
// Configuration
- 'config' => true,
+ 'config' => TRUE,
// Extensions
- 'extensions' => true,
+ 'extensions' => TRUE,
// Guest menu
- 'guest_menu' => true,
+ 'guest_menu' => TRUE,
// Max receive
- 'max_receive' => true,
+ 'max_receive' => TRUE,
// Member menu
- 'member_menu' => true,
+ 'member_menu' => TRUE,
// Module registry
- 'mod_reg' => true,
+ 'mod_reg' => TRUE,
// Payments
- 'payments' => true,
+ 'payments' => TRUE,
// Sending pool
- 'pool' => true,
+ 'pool' => TRUE,
// Referral banner
- 'refbanner' => true,
+ 'refbanner' => TRUE,
// Referral levels
- 'refdepths' => true,
+ 'refdepths' => TRUE,
// Referral system
- 'refsystem' => true,
+ 'refsystem' => TRUE,
// Task system
- 'task_system' => true,
+ 'task_system' => TRUE,
);
// So check if all tables are not there
$tables[$tableName] = ifSqlTableExists($tableName);
// Is it (hopefully not) there?
- if ($tables[$tableName] === false) {
+ if ($tables[$tableName] === FALSE) {
// This does not exist
$missingTables++;
} // END - if
set_error_handler('__errorHandler');
// If the status is true, disconnect the database
- if ($isValid === false) {
+ if ($isValid === FALSE) {
// Still something bad happened (e.g. tables found)
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_IN_USE--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_dbase');