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 WordPress constant to load Predis library #15

Merged
merged 1 commit into from
Oct 29, 2015
Merged

Use WordPress constant to load Predis library #15

merged 1 commit into from
Oct 29, 2015

Conversation

carlalexander
Copy link
Contributor

Modified object cache to use WP_CONTENT_DIR instead dirname( __FILE__). This fixes an issue where the object cache couldn't find the Predis library. The cause was the fact that object-cache.php was symlinked into wp-content. dirname( __FILE__) would resolve to the wrong location.

Modified object cache to use WP_CONTENT_DIR instead 'dirname( __FILE__)'. This fixes an issue where the object cache couldn't find the Predis library. The cause was the fact that 'object-cache.php' was symlinked into 'wp-content'. 'dirname( __FILE__)' would resolve to the wrong location.
@carlalexander
Copy link
Contributor Author

Just as note, I also tested WP_PLUGIN_DIR. The issue was that the constant isn't defined yet when WordPress loads object-cache.php. Because of that, we have to use WP_CONTENT_DIR.

@jerclarke
Copy link
Contributor

+1 This is vital for our usage.

@tillkruss
Copy link
Member

Would it make sense to check dirname( __FILE__ ) as fallback as well, just in case someone has an even more complicated setup?

@carlalexander
Copy link
Contributor Author

I can't think of another edge case right now that isn't covered by the WP_CONTENT_DIR constant.

tillkruss added a commit that referenced this pull request Oct 29, 2015
Include Predis with `WP_CONTENT_DIR` instead of `dirname(__FILE__)`
@tillkruss tillkruss merged commit c480fee into rhubarbgroup:master Oct 29, 2015
@carlalexander carlalexander deleted the patch-1 branch October 30, 2015 12:12
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.

3 participants