First PHP 5.3 feature in use and some other progress
Hey,
I just made the MySQLi use of MageDB a little more effective. Previously it was duplicating some code to make arrays out of database requests. Now one function is making all the array decisions and the rest makes use of that one function resulting in cleaner and more easy to understand code.
That was the most minor thing. Another thing i added in is array profiling! quite handy when you’re developing but for the avarage user of MageDB not of much use thus it’s off by default.
The last thing i added in is quite complex. In PHP 5.3 you have a new MySQL backend called MySQLND (nd == native driver) which is, when enabled, used for mysqli, mysql and pdo_mysql. If it’s not enabled the ‘old’ default of libmysql is used. That’s one of the changes in PHP 5.3 one which i can use in MageDB. When MySQLND is enabled i have the function: fetch_all() in mysqli which is putting a query response in a array. Now this is probably not turned on on every php 5.3 server so if that’s the case i’m going to use SplFixedArray which is just a bit faster then a normal array but twice as memory efficient! So, that’s a big win win situation for you as a user and your host as a sever owner. So there you have it. 2 php 5.3 features are already in MageDB and will be used as soon as your server has it. Buth features that i user are (still) backwards compatible with at least php 5.2.
And an idea for some future version. Right now MageDB is MySQLi only and just MySQL will never be supported anymore since that is just ugly stuff. But i do think of supporting PostgreSQL but that will be quite hard since queries are not exactly the same on both database vendors.. most are the same though.
And last but not least. MageDB updates will from now on be here a lot more or faster since the next week is going to be a MageDB scripting week.
Till next post,
Mark

Did I understand right that MageDB will support older php versions such as 5.2.x? Aspecially on shared hosting environments not every hoster will upgrade to 5.3 soon I think.
Steffen,
Yes, MageDB is going to be php 5.2.x compatible. That’s is mainly because i’ve developed everything with php 5.2.x versions and am now starting to develop it further in php 5.3. And besides that php 5.2.x will be on the most servers for probably the comming year so keeping compatibility with 5.2.x seems like something wise to do.
That must have cleared up your anwser ^_^
Mark.