diff --git a/index.php b/index.php new file mode 100644 index 0000000..d441ca5 --- /dev/null +++ b/index.php @@ -0,0 +1,93 @@ +destination ) ) { + if ( function_exists( 'symlink' ) ){ + symlink( $this->source, $this->destination); + } + else { + // Lets don't do it automatically, instead make a notice to user + // copy( $this->source, $this->destination ); + } + } + + } + } + + public function deactivate() { + // Only delete file if it belongs to this plugin + if ( defined($this->constName) && file_exists( $this->destination ) ) { + unlink( $this->destination ); + } + } + + // Check if current plugin is active, but it's cache not being used. If so, show warning to user to deactivate this plugin to avoid any confusion + public function check_if_activated() { + $plugin_basename= plugin_basename(__FILE__); + $plugin_name = dirname($plugin_basename); + + if ( is_plugin_active ($plugin_basename) && ! defined($this->constName) ) + { ?> +
+

+

()

+ ' . __('Memcache class is not detected in your hosting, and there is no way you can use that. You have to install it at first, or try to conctact your server administrators. Untill you do that, it\'s better to deactivate this plugin', 'memcached-enabler') .'.'; + } + else if ( ! function_exists( 'symlink' ) ) + { + ?> +
  • symlink function is not enabled in your hosting. So, you have to manually copy %s to %s. In that case, if you ever manually (beyond WP) delete this plugin, you will also need to remove that file manually, otherwise it will remain in use.', 'memcached-enabler'), $this->source, $this->destination ); ?>.
  • + destination ) ) + { + ?> +
  • %s ), probably some other plugin has replaced that file. So, this plugin ( '. basename($plugin_name).') is now non-functional. Please deactivate it to avoid any confusion. In case you really want to retain only this plugin, that remove the existing %s and re-activate this plugin', 'memcached-enabler'), basename($plugin_name), 'wp-content/'. basename($this->destination), 'wp-content/'. basename($this->destination) ) ;?>.
  • + +
  • %s) doesn\'t exist, so this plugin doesn\'t function. Not sure what has happened, but you may try to re-activate this plugin )', 'memcached-enabler'), 'wp-content/'. basename($this->destination), 'wp-content/'. basename($this->destination) ) ;?>.
  • + +

    +
    + diff --git a/object-cache.php b/object-cache.php index 5f6507a..648c942 100644 --- a/object-cache.php +++ b/object-cache.php @@ -1,14 +1,9 @@