wpsyntex/object-cache-annihilator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wpsyntex/object-cache-annihilator

Composer 安装命令:

composer require wpsyntex/object-cache-annihilator

包简介

A simple file-based object cache implementation for testing purposes.

README 文档

README

A simple file-based object cache implementation for WordPress, designed for testing purposes. This plugin provides a convenient way to test and debug WordPress object cache functionality.

Features

  • File-based object cache implementation
  • Easy enable/disable through admin bar
  • Cache flushing capabilities
  • Support for cache groups and expiration
  • Admin interface for cache management

Requirements

  • WordPress 6.2 or higher
  • PHP 7.2 or higher
  • Write permissions to the wp-content directory

Installation

  1. Follow the instructions in the Distribution section to build the plugin
  2. Upload the plugin files to the /wp-content/plugins/object-cache-annihilator directory
  3. Activate the plugin through the 'Plugins' menu in WordPress

Usage

Once activated, you'll see a new menu item in the admin bar:

  • Object Cache ☠️: Main menu item
    • Die ????: Disable the object cache
    • Resurrect ????: Enable the object cache
    • Flush ????: Clear all cached data (only available when cache is enabled)

Development

Setup

  1. Clone the repository
  2. Run composer install to install dependencies
  3. Run npm install to install development dependencies

Development Environment

The plugin includes a WordPress development environment using @wordpress/env. To start it:

npm run env:start

Other available commands:

  • npm run env:stop: Stop the environment
  • npm run env:clean: Clean the environment
  • npm run env:start:fresh: Start a fresh environment
  • npm run env:composer: Run composer commands in the environment

Code Quality

The plugin uses several tools to maintain code quality:

  • PHPCS for coding standards
  • PHPStan for static analysis
  • Composer for dependency management

Available commands:

  • composer cs: Run coding standards check
  • composer cs-fix: Fix coding standards issues
  • composer stan: Run static analysis

Distribution

To create a distribution package:

npm run dist

This will:

  1. Clean up development files
  2. Install production dependencies
  3. Create a distribution package in the dist directory

Advanced Usage

Process-specific Cache Management

For managing the cache within a single PHP process (without affecting the drop-in file):

global $wp_object_cache;

// Enable cache for current process
$wp_object_cache->resurrect();

// Disable cache for current process
$wp_object_cache->die();

// Flush cache for current process
$wp_object_cache->flush();

This approach is useful when you need to temporarily enable/disable the cache for specific operations without affecting the global cache state.

License

This plugin is licensed under the GPL v3 or later.

wpsyntex/object-cache-annihilator 适用场景与选型建议

wpsyntex/object-cache-annihilator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17.82k 次下载、GitHub Stars 达 0, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 wpsyntex/object-cache-annihilator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 wpsyntex/object-cache-annihilator 我们能提供哪些服务?
定制开发 / 二次开发

基于 wpsyntex/object-cache-annihilator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 17.82k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 15
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 未知