<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
global $crmPath, $sqlPath, $pkgPath, $tplPath;
global $compileDir;
+ $pkgPath = $crmPath . DIRECTORY_SEPARATOR . 'packages';
+ set_include_path($crmPath . PATH_SEPARATOR .
+ $pkgPath . PATH_SEPARATOR .
+ get_include_path()
+ );
+
$sqlPath = $crmPath . DIRECTORY_SEPARATOR . 'sql';
$tplPath = $crmPath . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'CRM' . DIRECTORY_SEPARATOR . 'common' . DIRECTORY_SEPARATOR;
$compileDir = addslashes($compileDir);
}
+/**
+ * @param $name
+ * @param $buffer
+ */
function civicrm_write_file($name, &$buffer) {
$fd = fopen($name, "w");
if (!$fd) {
fclose($fd);
}
+/**
+ * @param $config
+ */
function civicrm_main(&$config) {
global $sqlPath, $crmPath, $cmsPath, $installType;
}
+/**
+ * @param $dsn
+ * @param $fileName
+ * @param bool $lineMode
+ */
function civicrm_source($dsn, $fileName, $lineMode = FALSE) {
global $crmPath;
+
require_once "$crmPath/packages/DB.php";
$db = DB::connect($dsn);
}
$db->query("SET NAMES utf8");
+ $db->query("SET NAMES utf8");
+
if (!$lineMode) {
$string = file_get_contents($fileName);
}
}
+/**
+ * @param $config
+ *
+ * @return string
+ */
function civicrm_config(&$config) {
global $crmPath, $comPath;
global $compileDir;
return trim($str);
}
+/**
+ * @return string
+ */
function civicrm_cms_base() {
global $installType;
return $url . $baseURL;
}
+/**
+ * @return string
+ */
function civicrm_home_url() {
$drupalURL = civicrm_cms_base();
return $drupalURL . 'index.php?q=civicrm';