13 public static function wnc()
16 "utf_mode" => array(
"value" => defined(
'BX_UTF'),
"readonly" =>
true),
17 "default_charset" => array(
"value" => defined(
'BX_DEFAULT_CHARSET') ? BX_DEFAULT_CHARSET :
null,
"readonly" =>
false),
18 "no_accelerator_reset" => array(
"value" => defined(
'BX_NO_ACCELERATOR_RESET'),
"readonly" =>
false),
19 "http_status" => array(
"value" => (defined(
'BX_HTTP_STATUS') && BX_HTTP_STATUS),
"readonly" =>
false),
23 if (defined(
'BX_CACHE_SID'))
24 $cache[
"sid"] = BX_CACHE_SID;
25 if (file_exists($_SERVER[
"DOCUMENT_ROOT"].
"/bitrix/modules/cluster/memcache.php"))
28 include($_SERVER[
"DOCUMENT_ROOT"].
"/bitrix/modules/cluster/memcache.php");
29 if (defined(
"BX_MEMCACHE_CLUSTER") && is_array($arList))
31 foreach ($arList as $listKey => $listVal)
33 $bOtherGroup = defined(
"BX_CLUSTER_GROUP") && ($listVal[
"GROUP_ID"] !== BX_CLUSTER_GROUP);
35 if (($listVal[
"STATUS"] !==
"ONLINE") || $bOtherGroup)
36 unset($arList[$listKey]);
41 $cache[
"type"] = array(
42 "extension" =>
"memcache",
43 "required_file" =>
"modules/cluster/classes/general/memcache_cache.php",
44 "class_name" =>
"CPHPCacheMemcacheCluster",
49 if (!isset($cache[
"type"]))
51 if (defined(
'BX_CACHE_TYPE'))
53 $cache[
"type"] = BX_CACHE_TYPE;
55 switch ($cache[
"type"])
58 case "CPHPCacheMemcache":
59 $cache[
"type"] =
"memcache";
62 case "CPHPCacheEAccelerator":
63 $cache[
"type"] =
"eaccelerator";
67 $cache[
"type"] =
"apc";
70 case "CPHPCacheXCache":
71 $cache[
"type"] = array(
72 "extension" =>
"xcache",
73 "required_file" =>
"modules/main/classes/general/cache_xcache.php",
74 "class_name" =>
"CPHPCacheXCache",
78 if (defined(
"BX_CACHE_CLASS_FILE") && file_exists(BX_CACHE_CLASS_FILE))
80 $cache[
"type"] = array(
81 "required_remote_file" => BX_CACHE_CLASS_FILE,
82 "class_name" => BX_CACHE_TYPE
87 $cache[
"type"] =
"files";
94 $cache[
"type"] =
"files";
97 if (defined(
"BX_MEMCACHE_PORT"))
98 $cache[
"memcache"][
"port"] = intval(BX_MEMCACHE_PORT);
99 if (defined(
"BX_MEMCACHE_HOST"))
100 $cache[
"memcache"][
"host"] = BX_MEMCACHE_HOST;
101 $ar[
"cache"] = array(
"value" => $cache,
"readonly" =>
false);
103 $cacheFlags = array();
104 $arCacheConsts = array(
"CACHED_b_option" =>
"config_options",
"CACHED_b_lang_domain" =>
"site_domain");
105 foreach ($arCacheConsts as $const => $name)
106 $cacheFlags[$name] = defined($const) ? constant($const) : 0;
107 $ar[
"cache_flags"] = array(
"value" => $cacheFlags,
"readonly" =>
false);
109 $ar[
"cookies"] = array(
"value" => array(
"secure" =>
false,
"http_only" =>
true),
"readonly" =>
false);
111 $ar[
"exception_handling"] = array(
114 "handled_errors_types" => E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE,
115 "exception_errors_types" => E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_WARNING & ~E_COMPILE_WARNING & ~E_DEPRECATED,
116 "ignore_silence" =>
false,
117 "assertion_throws_exception" =>
true,
118 "assertion_error_type" => E_USER_ERROR,
124 "file" =>
"bitrix/modules/error.log",
125 "log_size" => 1000000
132 global $DBHost, $DBName, $DBLogin, $DBPassword;
134 $dbClassName = defined(
'BX_USE_MYSQLI') && BX_USE_MYSQLI ===
true ?
"\\Bitrix\\Main\\DB\\MysqliConnection" :
"\\Bitrix\\Main\\DB\\MysqlConnection";
136 $ar[
'connections'][
'value'][
'default'] = array(
137 'className' => $dbClassName,
139 'database' => $DBName,
141 'password' => $DBPassword,
142 'options' => ((!defined(
"DBPersistent") || DBPersistent) ? 1 : 0) | ((defined(
"DELAY_DB_CONNECT") && DELAY_DB_CONNECT ===
true) ? 2 : 0)
144 $ar[
'connections'][
'readonly'] =
true;
148 foreach ($ar as $k => $v)
150 if ($configuration->get($k) ===
null)
153 $configuration->addReadonly($k, $v[
"value"]);
155 $configuration->add($k, $v[
"value"]);
159 $configuration->saveConfiguration();
161 $filename1 = $_SERVER[
"DOCUMENT_ROOT"].
"/bitrix/php_interface/after_connect.php";
162 $filename2 = $_SERVER[
"DOCUMENT_ROOT"].
"/bitrix/php_interface/after_connect_d7.php";
163 if (file_exists($filename1) && !file_exists($filename2))
165 $source = file_get_contents($filename1);
166 $source = trim($source);
167 $source = preg_replace(
"#\\\$DB->Query\(#i",
"\$this->queryExecute(", $source);
168 file_put_contents($filename2, $source);