[wordpress插件] Clinical Memcachier临床机械师

wordpress 插件 文章 2020-03-25 12:30 447 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

This is a WordPress object cache backend that supports the MemCachier caching service.

这是一个支持MemCachier缓存服务的WordPress对象缓存后端。

It requires Memcached ver.

它需要 Memcached版本。

2.2.0 PECL package or greater for SASL support.

2.2.0 PECL软件包或更高版本以支持SASL。

This is a fork of tollmanz object cache, adding SASL and

这是 tollmanz 对象缓存的分支,添加了SASL和

binary protocol support for cloud based caches.

二进制协议支持基于云的缓存。

Credits

积分

安装步骤

    1. Make sure you have libmemcached installed, built with SASL.

      确保已安装 libmemcached ,该文件是使用SASL构建的。

      See the Memcached Requirements.

      请参见 Memcached要求

    2. Install the Memcached ver.

      安装 Memcached版本。

      2.2.0 PECL package.

      2.2.0 PECL程序包。

    3. Define the Memcached servers and SASL credentials in your wp-config.php, as follows:

      在wp-config.php中定义Memcached服务器和SASL凭据,如下所示:

      global $memcached_servers;

        global $ memcached_servers;

      $memcached_servers = array( array( 'host', port ) );

      $ memcached_servers = array(array('host',port));

      global $memcached_username;

      全局$ memcached_username;

      $memcached_username = 'sasl_username';

      $ memcached_username ='sasl_username';

      global $memcached_password;

      全局$ memcached_pa​​ssword;

      $memcached_password = 'sasl_password';

      $ memcached_pa​​ssword ='sasl_password';

    4. Alternatively, set the environment variables, MEMCACHE_SERVERS, MEMCACHE_USERNAME and MEMCACHE_PASSWORD.

      或者,设置环境变量 MEMCACHE_SERVERS MEMCACHE_USERNAME MEMCACHE_PASSWORD

      The expected format for MEMCACHE_SERVERS is 'server1:port1,server2:port2,server3:port3'.

      MEMCACHE_SERVERS 的预期格式为'server1:port1,server2:port2,server3:port3'

    Note: If running on Heroku or AppFog, just install the MemCachier add-on and your conifguration environment variables will be set.

    注意:如果在Heroku或AppFog上运行,只需安装MemCachier附加组件,即可设置配置环境变量。

      1. Move object-cache.php to wp-content/object-cache.php

        将object-cache.php移至wp-content / object-cache.php

      2. To test the WordPress object cache setup, add the following code as an MU plugin:

        要测试WordPress对象缓存设置,请将以下代码添加为MU插件:

        `php

         `php

        <?php

        $key = ‘dummy’;

        $ key ='dummy';

        $value = ‘100’;

        $ value =‘100’;

        $dummy_value = wp_cache_get( $key );

        $ dummy_value = wp_cache_get($ key);

        if ( $value !== $dummy_value ) {
            

        if($ value!== $ dummy_value){
            

        echo “The dummy value is not in cache.

        echo“虚拟值不在缓存中。

        Adding the value now.”;
            

        立即添加值。”;
            

        wp_cache_set( $key, $value );

        wp_cache_set($ key,$ value);

        } else {
            

        } else {
            

        echo “Value is ” .

        回显“值是”。

        $dummy_value .

        $ dummy_value。

        “.

        ”。

        The WordPress Memcached Backend is working!”;

        WordPress Memcached后端正在运行!”;

        }
            

        }
            

        `

        `

        After adding the code, reload your WordPress site twice.

        添加代码后,重新加载WordPress网站两次。

        On the second load, you should see a success message printed at the top of the page.

        在第二次加载时,您应该会在页面顶部看到成功消息。

        Remove the MU plugin after you’ve verified the setup.

        验证设置后,请删除MU插件。

下载地址
https://downloads.wordpress.org/plugin/clinical-memcachier.zip
-EOF-

AI助手支持GPT4.0