Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-20864

Add database value for connect function in install\index.php

    Details

    • Versioning Impact:
      Minor (add functionality in backwards-compatible manner)
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code
    • Verified?:
      Yes
    • Overview:
      Hide
      The connect function was introduced in order to find a port number present in the $host string and use it in the mysqli_connect function. However, the $database variable in this case is always an empty string.

      This improvement allows to pass the database name into that variable.
      Show
      The connect function was introduced in order to find a port number present in the $host string and use it in the mysqli_connect function. However, the $database variable in this case is always an empty string. This improvement allows to pass the database name into that variable.
    • How it works currently:
      The connect function is invoked without a database name, even though this parameter is passed to mysqli_connect function.
    • How it should work:
      Since the database name is present in all scopes of a connect invocation, this can be passed directly into the function.

      Description

      Related to the issue of the installation impossibility of version 4.7.21 described in Stackexchange, this improvement:

      • adds the database name to all invocations of the recently introduced connect function in civicrm/install/index.php as follows:
        $this->connect($server, $username, $password, $database);
        

        For allowing the database name to be passed through all the invocations, the respective $database parameter for requireMySQLAutoIncrementIncrementOne and requireMysqlConnection was added.

      • adds the $port parameter to the connect function with NULL as default value (avoiding the need to have an else block assigning this variable to NULL).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Armfoot Alexandre Gouveia
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: