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

Return the conf array when calling civicrm-sql-conf so it can be used elsewhere

    Details

    • Documentation Required?:
      Developer Doc
    • Funding Source:
      Contributed Code

      Description

      When calling civicrm-sql-conf, the configuration is outputted as string, which isn't useful when you want to use the result in another script.
      See below what the difference is.

      command:

      drush php-eval '$result = drush_invoke_process("@self", "civicrm-sql-conf", array(), array(), array('integrate' => FALSE)); var_dump($result["output"]); var_dump($result["object"]);'
      

      before patch:

      string(167) "Array
      (
          [driver] => mysql
          [username] => username
          [password] => password
          [host] => 127.0.0.1
          [port] => 
          [database] => database
      )
      "
      
      array(0) {
      }
      

      after patch

      string(167) "Array
      (
          [driver] => mysql
          [username] => username
          [password] => password
          [host] => 127.0.0.1
          [port] => 
          [database] => database
      )
      "
      
      array(6) {
        'driver' =>
        string(5) "mysql"
        'username' =>
        string(4) "username"
        'password' =>
        string(12) "password"
        'host' =>
        string(9) "127.0.0.1"
        'port' =>
        string(0) ""
        'database' =>
        string(22) "database"
      }
      

      The PR will fix this.

        Attachments

          Activity

            People

            • Assignee:
              mollux Mattias Michaux
              Reporter:
              mollux Mattias Michaux
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: