version = Version; $instance->basename = Basename; $instance->filename = Filename; $instance->directory = (string) realpath(__DIR__ . '/..'); if ($wp_object_cache instanceof ObjectCacheInterface) { $instance->config = $wp_object_cache->config(); } else { $instance->config = Configuration::safelyFrom( defined('\WP_REDIS_CONFIG') ? \WP_REDIS_CONFIG : [] ); } foreach ((array) class_uses($instance) as $class) { $name = substr((string) $class, strrpos((string) $class, '\\') + 1); $instance->{"boot{$name}"}(); } return $instance; } /** * Returns the raw basename. * * @return string */ public function basename() { return $this->basename; } /** * Returns the cleaned up basename. * * @return string */ public function slug() { return strpos($this->basename, '/') === false ? $this->basename : dirname($this->basename); } /** * Returns the configuration instance. * * @return \RedisCachePro\Configuration\Configuration */ public function config() { return $this->config; } /** * Returns a singleton diagnostics instance. * * @return \RedisCachePro\Diagnostics\Diagnostics */ public function diagnostics() { global $wp_object_cache; static $diagnostics = null; if (! $diagnostics) { $diagnostics = new Diagnostics($wp_object_cache); } return $diagnostics; } }