Move household relationship types to the processor
[civicrm-core.git] / api / class.api.php
index d91daa2b9c2aa211aa4f9aa0e7b0c6ec527740f9..88d9b2116596c52bb40f898c97552faea70bdf26 100644 (file)
@@ -112,7 +112,9 @@ class civicrm_api3 {
       return;
     }
     if (isset($config) && isset($config['conf_path'])) {
-      define('CIVICRM_SETTINGS_PATH', $config['conf_path'] . '/civicrm.settings.php');
+      if (!defined('CIVICRM_SETTINGS_PATH')) {
+        define('CIVICRM_SETTINGS_PATH', $config['conf_path'] . '/civicrm.settings.php');
+      }
       require_once CIVICRM_SETTINGS_PATH;
       require_once 'CRM/Core/ClassLoader.php';
       require_once 'api/api.php';
@@ -162,9 +164,13 @@ class civicrm_api3 {
    *
    * @return \stdClass
    */
-  public function remoteCall($entity, $action, $params = array()) {
-    $fields = "key={$this->key}&api_key={$this->api_key}&json=" . urlencode(json_encode($params));
+  private function remoteCall($entity, $action, $params = array()) {
     $query = $this->uri . "?entity=$entity&action=$action";
+    $fields = http_build_query(array(
+      'key' => $this->key,
+      'api_key' => $this->api_key,
+      'json' => json_encode($params),
+    ));
 
     if (function_exists('curl_init')) {
       // To facilitate debugging without leaking info, entity & action
@@ -211,7 +217,7 @@ class civicrm_api3 {
    *
    * @return bool
    */
-  public function call($entity, $action = 'Get', $params = array()) {
+  private function call($entity, $action = 'Get', $params = array()) {
     if (is_int($params)) {
       $params = array('id' => $params);
     }