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

Disable the object cache dropin for local testing #609

Closed
renatonascalves opened this issue Dec 18, 2024 · 1 comment · Fixed by #617
Closed

Disable the object cache dropin for local testing #609

renatonascalves opened this issue Dec 18, 2024 · 1 comment · Fixed by #617
Assignees
Labels
enhancement New feature or request php Requires understanding PHP

Comments

@renatonascalves
Copy link
Contributor

renatonascalves commented Dec 18, 2024

Description

Locally, Mantle can load the object-cache.php dropin file which can impact the running of the unit tests.

Use Case

I'd propose a helper method, ->without_object_cache(), that can be chained. It's similar to how I was able to stop it in a client project.

->on( 'enable_loading_object_cache_dropin', function ( $retval ): bool {
    if ( defined( 'VIP_GO_APP_ENVIRONMENT' ) && 'local' === \VIP_GO_APP_ENVIRONMENT ) {
        return false;
    }

    return $retval;
} )

This example assumes VIP_GO_APP_ENVIRONMENT is used, but we could create a custom env or the helper method could accept a callback/validator.

@renatonascalves renatonascalves added enhancement New feature or request php Requires understanding PHP labels Dec 18, 2024
@renatonascalves renatonascalves self-assigned this Dec 18, 2024
@renatonascalves
Copy link
Contributor Author

@srtfisher Do you have a preference for the implementation? A custom env or a callback/validator?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request php Requires understanding PHP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants