Changeset 2155703
- Timestamp:
- 09/12/2019 06:15:34 PM (6 years ago)
- Location:
- runcache-purger/trunk
- Files:
-
- 3 edited
-
runcache-purger.php (modified) (3 diffs)
-
vendor/redis_is_connect.php (modified) (1 diff)
-
views/settings.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
runcache-purger/trunk/runcache-purger.php
r2155656 r2155703 3 3 * @wordpress-plugin 4 4 * Plugin Name: RunCache Purger 5 * Plugin URI: https:// runcloud.io5 * Plugin URI: https://wordpress.org/plugins/runcache-purger/ 6 6 * Description: This plugin will purge RunCloud.io NGINX fastcgi, Proxy Cache and Redis Object Cache. 7 * Version: 1. 1.07 * Version: 1.2.0 8 8 * Author: RunCloud 9 9 * Author URI: https://profiles.wordpress.org/runcloud/ … … 64 64 65 65 // version 66 private static $version = '1. 1.0';67 private static $version_prev = '1. 0.9';66 private static $version = '1.2.0'; 67 private static $version_prev = '1.1.0'; 68 68 69 69 // later … … 1140 1140 if ( !empty($req_status['is_redis']) && 404 === $req_status['code'] ) { 1141 1141 if ( !empty($req_status['is_avail']) ) { 1142 if ( !empty($req_status['is_connect']) ) {1142 if ( empty($req_status['is_connect']) ) { 1143 1143 $msg = __('Redis server not connected.', self::$textdomain); 1144 1144 } else { -
runcache-purger/trunk/vendor/redis_is_connect.php
r2155656 r2155703 5 5 $port = ( !empty($port) ? (int)$port : 6379 ); 6 6 7 /*$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);8 $ret = @socket_connect($socket, $host, $port);9 if ( !$ret ) {10 $ error = socket_strerror(socket_last_error());11 }12 @socket_close($socket);*/7 $ret = false; 8 if ( function_exists('fsockopen') ) { 9 @ini_set('display_errors',0); 10 $fp = fsockopen('tcp://'.$host, $port, $errno, $errstr); 11 $ret = ( $fp ? true : false ); 12 @fclose($fp); 13 13 14 $ret = false; 15 $fp = fsockopen('tcp://'.$host, $port, $errno, $errstr); 16 $ret = ( $fp ? true : false ); 17 @fclose($fp); 18 19 if ( !$ret ) { 20 $error = $errno.' '.$errstr; 14 if ( !$ret ) { 15 $error = $errno.' '.$errstr; 16 } 17 } else { 18 $error = 'fsockopen disabled'; 21 19 } 22 20 -
runcache-purger/trunk/views/settings.php
r2155285 r2155703 142 142 <h4>Redis Server</h4> 143 143 <label for="redis_prefix"><?php _e( 'Status', self::$textdomain ); ?></label> 144 <?php $redis_stat = self::is_redis_connect(self::$value['redis_host'], self::$value['redis_port']); ?> 145 <div class='redis-status<?php echo ( $redis_stat ? ' redis-status-ok' : ' redis-status-ko');?>'><?php echo ( $redis_stat ? 'Connected' : 'Not connected' );?></div> 144 <?php 145 $redis_stat = self::is_redis_connect(self::$value['redis_host'], self::$value['redis_port']); 146 $redis_stat_text = ( $redis_stat ? 'Connected' : ( function_exists('fsockopen') ? 'Not connected' : 'fsockopen disabled' ) ); 147 ?> 148 <div class='redis-status<?php echo ( $redis_stat ? ' redis-status-ok' : ' redis-status-ko');?>'><?php echo $redis_stat_text;?></div> 146 149 <br> 147 150 <label for="redis_host"><?php _e( 'Hostname', self::$textdomain ); ?></label>
Note: See TracChangeset
for help on using the changeset viewer.