Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI Commands for Cachify #165

Merged
merged 6 commits into from
Feb 1, 2019
Merged

CLI Commands for Cachify #165

merged 6 commits into from
Feb 1, 2019

Conversation

derweili
Copy link

This PR adds basic CLI Commands for Cachify:

Flush Command

wp cachify flush

This command flushes the total cache.
This is equal to the Cachify::flush_total_cache();

Available Options

The flush command accepts the --all-methods option to flush the cache of all methods.
This is euqal to Cachify::flush_total_cache( true );

Cache Size Command

wp cachify cache-size

This command returns the current cache size.
Example Output: The cache size is 120188 bytes

Available Options

The Cache Size command accepts the --raw option to return only the cache size in bytes.
Example Output: 120188

cache-size command added
flush cache by id function added
flush cache by page function added
flush cache by id/url commands removed
unused optimize function removed
@derweili
Copy link
Author

Related Issue: #164

Copy link
Contributor

@chesio chesio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I've identified one issue to resolve, but it's a small one.

cachify.php Outdated Show resolved Hide resolved
now using `cli_init` instead of `init`
obsolete check cli support removed
Copy link
Contributor

@chesio chesio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested your changes locally and noticed that all-methods argument is not working. Then I have one more suggestion, but otherwise everything seems to work fine!

inc/cachify_cli.class.php Outdated Show resolved Hide resolved
inc/cachify_cli.class.php Outdated Show resolved Hide resolved
fix: --all-methods flush not flushing all caches
improvement: more specific output for flush command
@chesio
Copy link
Contributor

chesio commented Feb 1, 2019

Whitespace formatting needs to be fixed as well for consistency (tabs should be used instead of spaces), but I'll merge your PR as it is and fix that later.

Thanks for your effort!

@chesio chesio merged commit 37816be into pluginkollektiv:master Feb 1, 2019
chesio added a commit that referenced this pull request Feb 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants