r/PHP•
almightymole

Augmentative from the start.

I have started a project for a CMS system for a specific context. I won't bore you with the details of what the context is, since I may be all day. I thought it would be fun to do a project like this from scratch. Either way, I have one other person willing to help with the project. Unfortunately, we can't seem to agree on a number of things already. I know it is my project, but I don't want to turn off anyone who is willing to assist.

The first thing we do not agree on is dealing with database transactions. I want to just set up a PDO object, and have it passed to any objects or functions that may require it, then use PDO's methods to perform our queries on a database. He however wants to set up wrapping functions around it, as in he wants something of the lines of: (In accordance to my understanding of what he said was. )

$rows = dbQuery($sql);  // to fetch all results for a give sql query
$row = dbFetch(dbQuery($sql)); //for a single result 

Since I was thinking on using some form of Model view controller style architecture, I think this is not required. That the Models will be the parts mostly dealing with the database, and everything else will not give a dam.

What do the knowledgeable people of Reddit think about this? Am I right in thinking this isn't the best way of dealing with this, or am I a complete and utter plonker and I should forever give up doing web development as a hobby? Well perhaps nothing that dramatic, but at least reconsider his idea.

One last thing. He also gave me a file which is part of a template system he apparently has been working on.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-type" content="text/html;charset=UTF-8" /> <title> <?php if (isset($GLOBALS['TEMPLATE']['title'])) { echo $GLOBALS['TEMPLATE']['title']; } ?> </title> <?php if (isset($GLOBALS['TEMPLATE']['header'])) { echo $GLOBALS['TEMPLATE']['header']; } ?> </head> <body> <div id="banner"> <?php if (isset($GLOBALS['TEMPLATE']['banner'])) { echo $GLOBALS['TEMPLATE']['banner']; } ?> </div> <div id="topContent"> <?php if (isset($GLOBALS['TEMPLATE']['topContent'])) { echo $GLOBALS['TEMPLATE']['topContent']; } ?> </div> <div id="container"> <div id="center" class="column"> <?php if (isset($GLOBALS['TEMPLATE']['centerContent'])) { echo $GLOBALS['TEMPLATE']['centerContent']; } ?> </div> <div id="left" class="column"> <?php if (isset($GLOBALS['TEMPLATE']['leftContent'])) { echo $GLOBALS['TEMPLATE']['leftContent']; } ?> </div> <div id="right" class="column"> <?php if (isset($GLOBALS['TEMPLATE']['rightContent'])) { echo $GLOBALS['TEMPLATE']['rightContent']; } ?> </div> </div> <div id="footer"> <?php if (isset($GLOBALS['TEMPLATE']['bottomContent'])) { echo $GLOBALS['TEMPLATE']['bottomContent']; } ?> </div> </body> </html>

I am not sure what to think of this.

Any thoughts provided are much appreciated, thanks in advance.

Posted Nov 3, 2010, 11:48 PM UTC

017
Loading comments…