Respect DISALLOW_FILE_MODS
, but why?
#38
-
Hello there, In your recent 2.5.0 update, we noticed that you added this change: /**
* Determines whether object cache file modifications are allowed.
*
* @return bool
*/
function is_file_mod_allowed() {
return apply_filters(
'file_mod_allowed',
! defined( 'DISALLOW_FILE_MODS' ) || ! DISALLOW_FILE_MODS,
'object_cache_dropin'
);
} And this: if ( ! $this->is_file_mod_allowed() ) {
return new WP_Error( 'disallowed', __( 'File modifications are not allowed.', 'redis-cache' ) );
} But I don't fully get it, what is the reason behind this change? We have What is the best practice here in our case in your opinion? how will that affect the environment? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Those are essentially checks for If the filesystem is not writeable ( In your environment, I'd suggest putting the |
Beta Was this translation helpful? Give feedback.
Those are essentially checks for
wp_is_file_mod_allowed()
.If the filesystem is not writeable (
DISALLOW_FILE_MODS = true
) then we shouldn't try to write the drop-in on the filesystem.In your environment, I'd suggest putting the
object-cache.php
in place by hand, or using WP CLI.