页面“How to use redis in mediawiki”与“Git默认分支从master重命名为main”之间的差异

来自linux中国网wiki
(页面间的差异)
跳到导航 跳到搜索
docker>Evan
 
 
第1行: 第1行:
==pre  install==
+
2.1 克隆
安装我就不讲了
 
  
== configure==
+
首先克隆一份原仓库到本地进行操作:
<pre>//In your LocalSettings.php file, set:
 
  
/** @see RedisBagOStuff for a full explanation of these options. **/
+
git clone xxxxxxx.git
$wgObjectCaches['redis'] = array(
 
    'class'                => 'RedisBagOStuff',
 
    'servers'              => array( '127.0.0.1:6379' ),
 
    'connectTimeout'    => 1,
 
    //'persistent'        => false,
 
    //'persistent'        => true,
 
    //'password'          => 'secret',
 
    //'automaticFailOver' => true,
 
);
 
  
//#You'll now be able to acquire a Redis object cache object via wfGetCache( 'redis' ). If you'd like to use Redis as the default cache for various data, you may set any of the following configuration options:
+
2.2 创建并推送main
  
$wgMainCacheType = 'redis';
+
创建并切换到main:
$wgSessionCacheType = 'redis';  // same as WMF prod
 
  
// Not widely tested:
+
git checkout -b main
$wgMessageCacheType = 'redis';
 
$wgParserCacheType = 'redis';
 
$wgLanguageConverterCacheType = 'redis';
 
  
//Job queue[edit]
+
推送main:
$wgJobTypeConf['default'] = array(
 
'class'          => 'JobQueueRedis',
 
'redisServer'    => '127.0.0.1:6379',
 
'redisConfig'    => array(),
 
'claimTTL'      => 3600
 
);
 
//From that moment, jobs will be delivered to the Redis instance run the specified server.
 
  
 +
git push origin main
  
# vim includes/libs/redis/RedisConnectionPool.php
 
  
var_dump($result);
+
2.3 修改默认分支
if ( !$result ) {
 
echo  "redis server not run ";
 
$logger->error(
 
'Could not connect to server "{redis_server}"',
 
[ 'redis_server' => $server ]
 
);
 
  
注意  记得要把默认的apc 关闭
+
这一步需要到Github中进行操作,进入仓库的设置,点击分支选项:
## Shared memory settings
+
  evan886 /learn-english    中的settings
#$wgMainCacheType = CACHE_ACCEL;
 
谢谢松哥 download回来  就知道了是那个  然后关掉redis echo 个东西就知道有没有开 哈哈
 
</pre>
 
  
==参考==  
+
 
#官方安装文档 
+
2.4 删除master
  https://www.mediawiki.org/wiki/Redis
+
 
  https://www.mediawiki.org/wiki/Manual:Performance_tuning#Main_cache
+
删除本地master:
  https://doc.wikimedia.org/mediawiki-core/master/php/RedisConnRef_8php_source.html
+
 
  https://www.mediawiki.org/wiki/Memcached
+
git branch -d master
                                       
+
 
[[category:php]] [[category:redis]] [[category:wiki]]
+
删除远程master:
 +
 
 +
git push origin :master
 +
 
 +
=see also=
 +
[https://blog.csdn.net/github_38592071/article/details/108839813  几天后,GitHub 的 “master” 将更改为 “main”]
 +
 
 +
[https://zhuanlan.zhihu.com/p/339370999 Github仓库master分支到main分支迁移指南]
 +
 
 +
[https://blog.csdn.net/yanhanhui1/article/details/82819665  GitHub网页版删除分支]

2021年7月13日 (二) 03:29的版本

2.1 克隆

首先克隆一份原仓库到本地进行操作:

git clone xxxxxxx.git

2.2 创建并推送main

创建并切换到main:

git checkout -b main

推送main:

git push origin main


2.3 修改默认分支

这一步需要到Github中进行操作,进入仓库的设置,点击分支选项:

 evan886 /learn-english     中的settings 


2.4 删除master

删除本地master:

git branch -d master

删除远程master:

git push origin :master

see also

几天后,GitHub 的 “master” 将更改为 “main”

Github仓库master分支到main分支迁移指南

GitHub网页版删除分支