Admin Menu, Multiple Developers and a Shared Database
Navigation : Back to Blog
Tags :
I'm a big fan of the Admin Menu module. I'm also a big fan our multiple developer development process.
If you're using these two things together (admin menu & shared database) you've probably the problem this will fix. Admin menu caches it's links. That means that if we are sharing a database and separate URL space, admin menu will link to the wrong sandbox. (pointing to /~otheruser/ instead of /~myuser/)
The trick is to prefix your cache tables. In your settings.php after $db_url, define $db_prefix as (with your username instead of
<span style="color: #000000"><span style="color: #0000BB"><?php<br />$db_prefix </span><span style="color: #007700">= array(<br /> </span><span style="color: #DD0000">'cache' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'jskulski_'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'cache_admin_menu' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'jskulski_'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'cache_menu' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'jskulski_'</span><span style="color: #007700">,<br />);<br /></span><span style="color: #0000BB">?></span></span>Then create cache tables in MySQL with commands like:
CREATE TABLE jskulski_cache LIKE cache;<br />CREATE TABLE jskulski_cache_admin_menu LIKE cache_admin_menu;<br />CREATE TABLE jskulski_cache_menu LIKE cache_menu;This will copy the structure of cache and create the jskulski_cache table. Clear caches and you will enjoy admin_menu immunity!
You can read the Admin Menu issue dealing with this problem.
Comments
Post a comment
Presentations
What we've coded
Videos
Upcoming workshops
-
San Francisco, CAFebruary 28, 2012
-
Denver, COMarch 19, 2012
-
Denver, COMarch 19, 2012






0