]> git.mxchange.org Git - mailer.git/blobdiff - inc/install-functions.php
Code style changed, ext-user continued:
[mailer.git] / inc / install-functions.php
index 8b9bb808ba5d6c35090fd048ef49850672ae8e5b..3dddbb89a4b9b38769d8554f93cff7b46fdd7c58 100644 (file)
@@ -109,7 +109,7 @@ function doInstallWriteLocalConfigurationFile ($path) {
 // 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);
@@ -135,7 +135,7 @@ function getInstallerContent () {
                $content = $GLOBALS['install_content'];
        } else {
                // Nothing found, this needs fixing
-               $content = displayMessage('{--INSTALLER_CONTENT_404--}', true);
+               $content = displayMessage('{--INSTALLER_CONTENT_404--}', TRUE);
        }
 
        // Return content
@@ -158,7 +158,7 @@ function readSqlDump ($FQFN) {
 // 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;
@@ -167,7 +167,7 @@ function generateInstallerMenu () {
 // 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;
@@ -223,7 +223,7 @@ function isInstallerDataValid (&$saveStatus, $key, $value) {
                //* 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
@@ -231,7 +231,7 @@ function isInstallerDataValid (&$saveStatus, $key, $value) {
 
        // 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
@@ -269,7 +269,7 @@ function doInstallerPostCheck ($currentTab, &$saveStatus) {
        $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] . '%}';
@@ -421,8 +421,8 @@ function isInstallerMysqlTypeValid ($value) {
 // 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?
@@ -430,17 +430,17 @@ function isInstallerPostDatabaseConfigValid ($currentTab) {
                // 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
@@ -460,7 +460,7 @@ function isInstallerPostDatabaseConfigValid ($currentTab) {
                // 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
@@ -471,7 +471,7 @@ function isInstallerPostDatabaseConfigValid ($currentTab) {
                // 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
@@ -492,7 +492,7 @@ function isInstallerPostDatabaseConfigValid ($currentTab) {
                // 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');
@@ -500,65 +500,65 @@ function isInstallerPostDatabaseConfigValid ($currentTab) {
                // 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
@@ -567,7 +567,7 @@ function isInstallerPostDatabaseConfigValid ($currentTab) {
                $tables[$tableName] = ifSqlTableExists($tableName);
 
                // Is it (hopefully not) there?
-               if ($tables[$tableName] === false) {
+               if ($tables[$tableName] === FALSE) {
                        // This does not exist
                        $missingTables++;
                } // END - if
@@ -583,7 +583,7 @@ function isInstallerPostDatabaseConfigValid ($currentTab) {
        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');