June 2013 already?



Is it June already? Time flies when you are having fun! haha… Last time I wrote here was in January, so I guess the plan to start writing here more often failed. The truth is that I have been busy with soo many different things.

On the personal side of things – it’s all the same (partying, travelling, socialising, living life to the full and enjoying the small things). I must admit – the weather in Scotland has been lovely for the last few weeks. I think that Europe and Scotland exchanged – while EU gets all the rain – we got the sunshine in Scotland 🙂

On the technology side of things I have been digging deep into the mobile side of the web (building HTML5/CSS3/jQueryMobile web apps in Cordova) as well as trying to build the perfect MVC PHP framework to use for my own projects (I might release it under the GNU/GPL one day).

So far I have a very good database class which has enough functionality in its methods to almost replace writing SQL queries. The DB class uses the PHP PDO interface and it is meant to be the parent of the model class of the MVC framework I am building. That means that the model will be inheriting (extending) the DB class which will give standard $this->blah access to its methods. For example to get the result of this query

$query = 'SELECT `name`, `surname` FROM `people` WHERE `id`=\'' . $id . '\';';

as an array you would just do this in my class:

$peopleArray = $this->listFiltered($fields=array('name','surname'), $dbTable='people', filterData=array(array('field'=>'id','value'=$id, type='equals')));

So with one line you get the result you need without having to go through the standard PDO procedures (instance class, separate dynamic data, run query, etc). Similar methods are available for all the standard SQL statements (SELECT/UPDATE/DELETE). As you saw above it also supports complex operations such as specifying WHERE clauses(with all the operators), LIMIT parameters and JOIN instructions. I also have a few other classes like the user management/authentication class, methods for simple front-end database table records management (something like phpMyAdmin but simplified) + a few other classes.

There are hundreds of PHP frameworks that offer similar functionality but the truth is that they are all too limited for what I need. The technology and data I work with is spread from a lot of different programs on different platforms and different devices which have their own APIs and data formats with their own constrains and requirements (that’s the simplest way to put it without going into technical details). That’s why I am thinking that my framework is something unique.