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

Use the advanced-cache.php (or object-cache.php) to get rid of wp-config.php modification #17

Closed
anttiviljami opened this issue Nov 23, 2016 · 7 comments

Comments

@anttiviljami
Copy link
Owner

There's also a possibility to get rid of db.php as well by plugging into the advanced-cache.php file, which has the ability to modify the global $table_prefix variable since it gets loaded before wp_set_wpdb_vars();

@anttiviljami
Copy link
Owner Author

Thanks @ideag for pointing this possibility out :)

@onnimonni
Copy link

onnimonni commented Nov 23, 2016

This seems like a very good idea since advanced-cache.php is not used so often.

If someone needs to use advanced-cache.php they could just modify that file to include wp-safe-updates as mercator does in sunrise.php:

// Default mu-plugins directory if you haven't set it
defined( 'WPMU_PLUGIN_DIR' ) or define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' );

// Also load mercator for domain mapping
require WPMU_PLUGIN_DIR . '/mercator/mercator.php';

@anttiviljami
Copy link
Owner Author

Upon more investigation advanced-cache.php won't work since we need to enable it via a constant and filter. object-cache.php is a better candidate.

@ideag
Copy link

ideag commented Nov 23, 2016

Actually, plugin could modify advanced-cache.php and append it's stuff automatically if it is not there. It's a simple string match.

@anttiviljami
Copy link
Owner Author

@ideag no, the problem is we still need to define WP_CACHE in wp-config.php for advanced-cache.php to be loaded.

@ideag
Copy link

ideag commented Nov 23, 2016

@anttiviljami yeah, i meant object-cache.php :) But the point about doing automatic check-and-append still stands.

@anttiviljami
Copy link
Owner Author

Ah, ok 👍 Yes, definitely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants