teppo Posted April 6, 2012 Share Posted April 6, 2012 Background story: I'm installing PW for a friend to evaluate in a web hosting platform that only allows one database. That single database already contains quite a few tables for various other systems (and to be honest names of PW tables are not THAT unique, already had a table called "pages" there for an example.) So my question is: is it already possible to prefix PW tables with something like "pw_", "mysecondpwsite_" etc? -- As a sidenote, WordPress installer for an example allows user to easily choose which prefix (if any) he/she want's to use. Makes running multiple WP installations in one DB very easy. This may not be the best solution considering security issues etc. but it's still a very real scenario for quite a few users. Link to comment Share on other sites More sharing options...
Ben Posted April 6, 2012 Share Posted April 6, 2012 I'm not terribly informed about the ins and outs, but judging from the source it doesn't appear to be currently supported. The easiest solution would be to buy a month of cheap hosting for evaluation or up the plan at the current host. Of course, that isn't anything you didn't already know.. It might be hackable through the __call method of the DatabaseQuery class (regex replace of all known database tables), but that would break the installer, generally be unpredictable, and likely end in catastrophic failure. Edit: the installer definitely uses fixed table names (install.sql). Changing DatabaseQuery would not prevent the installer from overwriting your existing "pages" table. So what was a bad idea in the first place (hacking __call), is much worse than initially suspected. Link to comment Share on other sites More sharing options...
ryan Posted April 9, 2012 Share Posted April 9, 2012 I don't think sharing one database for multiple pieces of software is a good idea. Lots of concerns there whether PW is part of it or not. A vulnerability in one piece of software suddenly becomes a vulnerability in all. Table prefixes have been intentionally left out of PW, and I'm of the opinion that this is something other software should phase out as well (especially WordPress). I'm guessing this is from a legacy hosting platform or a free web hosting account, and so would say it doesn't meet PW's minimum requirements in that regard. I understand the hosting part is out of your hands, but would probably suggest kindly encouraging your friend to get a $3/month web hosting account from HostGator or something, so they can have more than one database. Though it surprises me even a free host would still be enforcing that limitation as it's a magnet for security problems and tech support. 1 Link to comment Share on other sites More sharing options...
teppo Posted April 12, 2012 Author Share Posted April 12, 2012 Very good points there, Ryan - kinda guessed that there might be that kind of reasoning behind this, just wanted to make sure. I consider security very important and I'm well aware of various risks of sharing a database between multiple apps so I can absolutely respect this Developers of WP on the other hand clearly wan't to appear as user friendly as possible - even to the point where that actually works against especially their less-informed users - and this way increase the user base of WP. Personally I don't see that as such a great way to go in the long run, but I guess both ways do have their strong points. This too depends on the audience you're trying to reach and image you're trying to achieve. ... and by the way, that friend of mine already switched his web host. So the original problem has been solved Link to comment Share on other sites More sharing options...
ryan Posted April 12, 2012 Share Posted April 12, 2012 Glad that your friend was able to solve it with the hosting change. Just thinking about WP again, it would probably be very hard for them to take away the table prefixes now, since they've already been there for years. Sounds like a potential support nightmare. Still, I have to believe that if they were starting from scratch today, they might avoid them. Link to comment Share on other sites More sharing options...
DaveP Posted April 12, 2012 Share Posted April 12, 2012 An added complication in a WP network (running multiple blogs from one codebase), you end up with 2 levels of prefixes! So you might have a wp-posts table and a wp-1-posts and wp-2-posts tables. (I have changed the prefix to something other than the default on mine, though 8) ) Link to comment Share on other sites More sharing options...
Nico Knoll Posted September 26, 2012 Share Posted September 26, 2012 I would love to have prefixes... Or at least the opportunity to chose if I want them or not in the "config.php"... 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now