-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Found a possible gap in the docs while figuring out how to connect to WordPress (MySQL) database from Phel which requires accessing the wpdb object via PHP superglobals.
I was looking for something equivalent to the PHP global statement first (generally recommended with wpdb), but the alternative method by accessing $GLOBALS superglobals array seemed more feasible.
Figured to access the $GLOBALS array then with (get php/$GLOBALS "wpdb") after reading Phel http library sources that I knew to be messing with the superglobals.
Docs didn't really give any good pointers about this so maybe it could be worth to mention something about it in eg. "Global and local bindings" or "PHP interop" or both as they'd seem the most logical places, if this would be considered a general enough issue? I'm not very familiar with the PHP ecosystem at large but find this somewhat frequent related to WP at least.