зеркало из https://github.com/mozilla/phonebook.git
Made LDAP server and memcache cluster configurable. Bug 691908.
git-svn-id: http://svn.mozilla.org/projects/phonebook/trunk@95859 4eb1ac78-321c-0410-a911-ec516a8615a5
This commit is contained in:
Родитель
407c632a1b
Коммит
38c4e01c2d
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
/*
|
||||
* This is where you would override certain config values, locally.
|
||||
* Copy this to config-local.php and change the values as appropriate.
|
||||
* If this file does not exist, they default to the values shown here.
|
||||
*/
|
||||
|
||||
// LDAP
|
||||
define('LDAP_HOST', 'pm-ns01.mozilla.org');
|
||||
|
||||
// Memcache (port number is mandatory)
|
||||
define("MEMCACHE_ENABLED", true);
|
||||
$memcache_servers = array(
|
||||
'localhost:11211',
|
||||
);
|
|
@ -1,8 +1,11 @@
|
|||
<?php
|
||||
|
||||
@include_once('config-local.php');
|
||||
require_once('constants.php');
|
||||
|
||||
define('LDAP_HOST', 'pm-ns01.mozilla.org');
|
||||
|
||||
if (!defined('LDAP_HOST'))
|
||||
define('LDAP_HOST', 'pm-ns01.mozilla.org');
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
|
|
17
init.php
17
init.php
|
@ -1,9 +1,13 @@
|
|||
<?php
|
||||
|
||||
@include_once('config-local.php');
|
||||
|
||||
error_reporting(E_ALL);
|
||||
ini_set("display_errors", 1);
|
||||
ini_set("memory_limit", "64M");
|
||||
define("MEMCACHE_ENABLED", true);
|
||||
|
||||
if (!defined('MEMCACHE_ENABLED'))
|
||||
define("MEMCACHE_ENABLED", true);
|
||||
|
||||
require_once("config.php");
|
||||
require_once("functions.php");
|
||||
|
@ -20,8 +24,15 @@ if (class_exists("Memcache") && MEMCACHE_ENABLED) {
|
|||
$ldapconn = get_ldap_connection();
|
||||
|
||||
if ($memcache_on) {
|
||||
$memcache = new Memcache;
|
||||
$memcache->connect("localhost", 11211);
|
||||
$memcache = new Memcache;
|
||||
|
||||
if (empty($memcache_servers))
|
||||
$memcache_servers = array('localhost:11211');
|
||||
|
||||
foreach ($memcache_servers as $mc_server) {
|
||||
list($host, $port) = explode(':', $mc_server, 2);
|
||||
$memcache->addServer($host, $port);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Загрузка…
Ссылка в новой задаче