-
Notifications
You must be signed in to change notification settings - Fork 790
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
[discussion] installation and php db connection support for postgres #584
Comments
I wrote a Perl script to make it multi-database capable. A php-login 2.0.1 ready made version exists on https://github.com/normai/php-login-xdb. The further not-ready work, you can inspect on http://downtown.trilo.de/svn/phplogin/trunk/PhpDbSwitch/index.html. I have not tried the Perl script against 'huge', but I expect it works there as well. The thing is not ready in so far, as the database creation has to be done manually without instructions. And it is not scrutinized at all! I am planning to write programmatic database creation for MySQL, PostgreSQL and SQLite and possibly Oracle and MS-SQL. But I am lazy. Try the Perl script, possibly I can help when you get stuck. Bye, N. |
Hi guys, @abeck87 Sorry, not from my side: I think expanding this to different database types is out of the scope of this script, and it would also make everything more complicated (as it's not possible to do the same things on all 3 for sure, plus the fact that the SQLlite PDO is "broken" (or at least it does work differently than the mysql PDO)). Plus, most people use mysql, so keep it as simple as possible. @normai Excellent! Looks very good! I'll write a big documentation about the entire project in the next months, and put in a link to this discussion here and to your code for sure, so others might find this easilsy. But let's keep the db part as simple as possible, with pure mysql for now. Other opinions ? Feel free to comment! |
Thank you. This will put me under a bit pressure to continue for a solid solution. Haha, just I am pretty resistant about pressure. Anyway, if I notice interest, it will give me motivation.
This was the idea behind the PhpDbSwitch project: Let you work without the multi-db complications, then independently provide multi-db capability on top of your work. It was a quick experiment. Not sure whether it can ever be a solid solution, but the first results looked encouraging. |
Thanks for the reply. I stood up the latest huge version and attempted to migrate the existing mysql sql scripts to postgres equivalents, but no luck. When i try to login i get a "Login failed." response. I switch the db connection to use PDO pgsql "$this->database = new PDO('pgsql:". , but my schema structure must not be correct. I wrote a Perl script to make it multi-database capable. A php-login 2.0.1 ready made version exists on https://github.com/normai/php-login-xdb. The further not-ready work, you can inspect on http://downtown.trilo.de/svn/phplogin/trunk/PhpDbSwitch/index.html. I have not tried the Perl script against 'huge', but I expect it works there as well. The thing is not ready in so far, as the database creation has to be done manually without instructions. And it is not scrutinized at all! I am planning to write programmatic database creation for MySQL, PostgreSQL and SQLite and possibly Oracle and MS-SQL. But I am lazy. Try the Perl script, possibly I can help when you get stuck. Bye, N. —
|
The line seems to be from DatabaseFactory.php, which did not exist when I worked last time on it (in july). I saw it first time right now. I will try to catch up in the course of the week. Give me some days, then maybe I can answer more educated. @panique DatabaseFactory - cool! In the class header, you refer to http://stackoverflow.com/questions/130878/global-or-singleton-for-database-connection. I find this thread largely in accordance with what I indicated in #585 (comment) about singleton. What I find most interesting in this thread is the comment by user1093284 at http://stackoverflow.com/posts/8482925/revisions. He/she calls a singleton 'not really OOP', and recommends Dependency Injection instead (http://symfony.com/components/DependencyInjection). Yes, for a deep understanding of the db connecting options, also DI has to be taken into account. But for my humble understanding, this is out of reach for you current state of the project, and would be overkill anyway. Just I like to philosophize about. |
Huge forces me to update PHP .. forces update Apache, XDebug ... then possibly Perl, Python, WSGI, etc., each very carefully. BTW my environment is http://downtown.trilo.de/apps.html :) Give me even more days. |
@abeck87 Hey, I think that this is out of scope of the script, and you can easily add postgres support witha few lines of code. If we start with that, then others will requests noSQL / mongoDB etc too and things get overcomplicated. As mysql fits for 99% of the users it might be better to keep it supersimple. |
Can a installation solution for postgres be provided? Would need to provide a flag to choose between postgres and mysql db connections.
The text was updated successfully, but these errors were encountered: