I would like to implement the PDO methods to the current DBAL. Most likely, I'll create it from scratch as it'll help in the later stages of overall development. I am aware that this is a huge project and breaking it into parts which can be completed/shown in the GSoC duration of 3 months is difficult.
My idea is an extension of existing RFC discussion here ( http://area51.phpbb.com/phpBB/viewtopic.php?f=108&t=32883 ). As PDO is bundled with PHP itself, a lot of duplication in current DBAL used for phpBB can be reduced. Prepared statements provide a lot of flexibility too.
- PDO can be used to maintain FreeTDS/Microsoft SQL Server/Sybase, Firebird/Interbase 6, MySQL 3.x/4.x/5.x, PostgreSQL, SQLite 3 and SQLite 2, Microsoft SQL Server/SQL Azure and a lot of others(with active support for all of them).
- Exceptions and error handling is easier(with the PDOException class).
- Large objects(using
PDO::PARAM_LOB
) can also be stored and streamed to/from databases(such as avtars). I have not tried it myself though. - Cleaner code, with a lot of predefined methods. A simple extension of class is all that will be needed.
- A database-specific PDO driver is needed to access a database server.
I will be starting from scratch. A note can be taken into account of a repository from igorw on the aforementioned RFC thread. A lot of progress and bugfixes have been done/released for PDO since the linked discussion on Area51 developments board. To name a few(which were also discussed/raised-as-flags in RFC thread) SSL support and buffered query support.
Creating a new database abstraction layer extending PDO for MySQL. This will require/act-as a replacement of the current(too old, imo; but still working great) DBAL being used in releases of phpBB. Also, since it can be extended to support other drivers I'd be glad to stay with the phpBB community and keep developing it. My proposed timeline for this project shall be:
- Get acquainted with current DBAL, read the
mysql.php
,mysql_base.php
andmysqli.php
present in the/includes/db/driver
directory along with the codes in igorw's repository - 1 week. - Start writing
pdo_mysql
and the inherited classpdo_dbal
. Completing thepdo_dbal
for database connectivity - 7 to 10 days. Most basic task completed. - Discussing query builder and building a rough draft for the same under mentor's guidance - 1 week.
- Complete working on the
pdo_mysql
class so that it supports phpBB builds - 2 weeks. - Apply tweaks wherever necessary to
pdo_mysql
andpdo_dbal
- 8 to 10 days. This patch is ready to be submitted for mid-term evaluation. - This part will deal with generating dialects so that other drivers can also rely on same class.
- Discuss the most commonly required dialects with mentor(s) - 4 to 7 days.
- Create the base query builder for supporting MySQL commands - 2 weeks.
- Deduplication between
pdo_mysql
and query builder classes - 1 week.
- Finalize query builder,
pdo_mysql
andpdo_dbal
classes - 1 week. - Testing and modifying accordingly the finalized model with constant discussions on IRC and with mentor - 12 to 15 days.
- Finalizing project. Minor cleaning up. Get the files ready for final submission - 3 to 5 days.
- Further implement it for sqlite3 driver (after the GSoC period).
My name is Amritanshu Varshney. I'm a resident of India(UTC +05:30) and a student of Mathematics and Computing at Indian Institute of Technology, Kharagpur in Kharagpur, West Bengal. I can work on this project with dedication since I currently have no other project/work requiring my immediate attention(for at least two months). I can provide a net of 5 to 8 hours on a daily basis averaging to 35 hours for the weekdays(Monday through Friday). Also, on weekends my work time can increase up to 10 hours(per day) giving a total of atleast 50 hours a week.
I have been working primarily with PHP for the past 2 years. I'm also an active user on Stack Overflow and keep regularly answering questions on PHP, MySQL, jQuery, HTML and other web-development languages. I have also been using phpBB and modifying it (mostly templates) in my leisure time. So far, I've only sent three pull requests one of which has been merged and two are still awaiting.
I'm quite familiar with PDO_MYSQL
driver and hence, my primary aim during the project is just for developing MySQL. My work progress can be tracked easily on my GitHub account. I use the nickname hjpotter92 everywhere and can easily be seen around on several places like IRC, phpBB community, GitHub etc. I can be contacted at [email protected]
This will be my first project and I'm really excited towards it.
Here are some points/quotes from the previously linked RFC thread.
-
From imkingdavid
I think converting to PDO would be a great idea. It would be ton of work, but I think it would be a lot more efficient and cleaner.
-
From naderman
I would very much like to see these as an alternative to the existing drivers. They could especially be used as a basis for future drivers. If they work just as well they could theoretically replace the existing ones.
-
From igorw
If other things come up it could always be pushed back to 3.2. I'd personally like to use this chance and improve the code base.