13 public static function wnc()
16 "default_charset" =>
array(
"value" => defined(
'BX_DEFAULT_CHARSET') ? BX_DEFAULT_CHARSET :
null,
"readonly" =>
false),
17 "no_accelerator_reset" =>
array(
"value" => defined(
'BX_NO_ACCELERATOR_RESET'),
"readonly" =>
false),
18 "http_status" =>
array(
"value" => (defined(
'BX_HTTP_STATUS') && BX_HTTP_STATUS),
"readonly" =>
false),
22 if (defined(
'BX_CACHE_SID'))
23 $cache[
"sid"] = BX_CACHE_SID;
24 if (file_exists(
$_SERVER[
"DOCUMENT_ROOT"].
"/bitrix/modules/cluster/memcache.php"))
27 include(
$_SERVER[
"DOCUMENT_ROOT"].
"/bitrix/modules/cluster/memcache.php");
28 if (defined(
"BX_MEMCACHE_CLUSTER") && is_array($arList))
30 foreach ($arList as $listKey => $listVal)
32 $bOtherGroup = defined(
"BX_CLUSTER_GROUP") && ($listVal[
"GROUP_ID"] !== BX_CLUSTER_GROUP);
34 if (($listVal[
"STATUS"] !==
"ONLINE") || $bOtherGroup)
35 unset($arList[$listKey]);
40 $cache[
"type"] =
array(
41 "extension" =>
"memcache",
42 "required_file" =>
"modules/cluster/classes/general/memcache_cache.php",
43 "class_name" =>
"CPHPCacheMemcacheCluster",
48 if (!isset($cache[
"type"]))
50 if (defined(
'BX_CACHE_TYPE'))
52 $cache[
"type"] = BX_CACHE_TYPE;
54 switch ($cache[
"type"])
57 case "CPHPCacheMemcache":
58 $cache[
"type"] =
"memcache";
61 case "CPHPCacheEAccelerator":
62 $cache[
"type"] =
"eaccelerator";
66 $cache[
"type"] =
"apc";
69 case "CPHPCacheXCache":
70 $cache[
"type"] =
array(
71 "extension" =>
"xcache",
72 "required_file" =>
"modules/main/classes/general/cache_xcache.php",
73 "class_name" =>
"CPHPCacheXCache",
77 if (defined(
"BX_CACHE_CLASS_FILE") && file_exists(BX_CACHE_CLASS_FILE))
79 $cache[
"type"] =
array(
80 "required_remote_file" => BX_CACHE_CLASS_FILE,
81 "class_name" => BX_CACHE_TYPE
86 $cache[
"type"] =
"files";
93 $cache[
"type"] =
"files";
96 if (defined(
"BX_MEMCACHE_PORT"))
97 $cache[
"memcache"][
"port"] = intval(BX_MEMCACHE_PORT);
98 if (defined(
"BX_MEMCACHE_HOST"))
99 $cache[
"memcache"][
"host"] = BX_MEMCACHE_HOST;
100 $ar[
"cache"] =
array(
"value" => $cache,
"readonly" =>
false);
102 $cacheFlags =
array();
103 $arCacheConsts =
array(
"CACHED_b_option" =>
"config_options");
104 foreach ($arCacheConsts as $const =>
$name)
105 $cacheFlags[
$name] = defined($const) ? constant($const) : 0;
106 $ar[
"cache_flags"] =
array(
"value" => $cacheFlags,
"readonly" =>
false);
108 $ar[
"cookies"] =
array(
"value" =>
array(
"secure" =>
false,
"http_only" =>
true),
"readonly" =>
false);
113 "handled_errors_types" => E_ALL & ~E_NOTICE & ~E_USER_NOTICE,
114 "exception_errors_types" => E_ALL & ~E_NOTICE & ~E_WARNING & ~E_USER_NOTICE & ~E_USER_WARNING & ~E_COMPILE_WARNING & ~E_DEPRECATED,
115 "ignore_silence" =>
false,
116 "assertion_throws_exception" =>
true,
117 "assertion_error_type" => E_USER_ERROR,
123 "file" =>
"bitrix/modules/error.log",
124 "log_size" => 1000000
133 $dbClassName = defined(
'BX_USE_MYSQLI') && BX_USE_MYSQLI ===
true ?
"\\Bitrix\\Main\\DB\\MysqliConnection" :
"\\Bitrix\\Main\\DB\\MysqlConnection";
135 $ar[
'connections'][
'value'][
'default'] =
array(
136 'className' => $dbClassName,
141 'options' => ((defined(
'DBPersistent') && DBPersistent) ? 1 : 0) | ((defined(
"DELAY_DB_CONNECT") && DELAY_DB_CONNECT ===
true) ? 2 : 0)
143 $ar[
'connections'][
'readonly'] =
true;
147 foreach (
$ar as
$k => $v)
149 if ($configuration->get(
$k) ===
null)
152 $configuration->addReadonly(
$k, $v[
"value"]);
154 $configuration->add(
$k, $v[
"value"]);
158 $configuration->saveConfiguration();
160 $filename1 =
$_SERVER[
"DOCUMENT_ROOT"].
"/bitrix/php_interface/after_connect.php";
161 $filename2 =
$_SERVER[
"DOCUMENT_ROOT"].
"/bitrix/php_interface/after_connect_d7.php";
162 if (file_exists($filename1) && !file_exists($filename2))
164 $source = file_get_contents($filename1);
165 $source = trim($source);
166 $source = preg_replace(
"#\\\$DB->Query\(#i",
"\$this->queryExecute(", $source);
167 file_put_contents($filename2, $source);