Skip to content
This repository has been archived by the owner on Feb 23, 2019. It is now read-only.

Commit

Permalink
fix redis test (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
nigrosimone committed Mar 2, 2017
1 parent aea9354 commit 0c04122
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Generic_AdminActions_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ function w3tc_test_memcached() {
* @return void
*/
function w3tc_test_redis() {
$servers = Util_Request::get_array( 'servers' );
$servers = Util_Request::get_array( 'servers' );
$persistent = Util_Request::get_boolean( 'persistent', false );
$password = Util_Request::get_string('password', '');
$dbid = Util_Request::get_integer( 'dbid', 0 );

if ( count( $servers ) <= 0 )
$success = false;
Expand All @@ -47,8 +50,10 @@ function w3tc_test_redis() {

foreach ( $servers as $server ) {
@$cache = Cache::instance( 'redis', array(
'servers' => $server,
'persistent' => false
'servers' => $server,
'persistent' => $persistent,
'password' => $password,
'dbid' => $dbid
) );
if ( is_null( $cache ) )
$success = false;
Expand Down
3 changes: 3 additions & 0 deletions pub/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,9 @@ jQuery(function() {
jQuery.post('admin.php?page=w3tc_dashboard', {
w3tc_test_redis: 1,
servers: jQuery('#redis_servers').val(),
persistent : jQuery('#objectcache__redis__persistent').is(':checked'),
dbid : jQuery('#redis_dbid').val(),
password : jQuery('#redis_password').val(),
_wpnonce: jQuery(this).metadata().nonce
}, function(data) {
status.addClass(data.result ? 'w3tc-success' : 'w3tc-error');
Expand Down

0 comments on commit 0c04122

Please sign in to comment.