Does the Prado PHP Framework support MongoDB? -


the prado php framework looks interesting, before dive in, wondering if mongodb can used database prado without issues?

prado based on apache tapestry, java framework. tapestry not have mongodb library (unless added)

being php, prado can work mongodb, 1 must php configuration since mongo php driver third-party library , there no specific prado library mongodb.

first, configure mongodb, install mongodb php driver, create prado class interact (the same apache tapestry). amount of issues encountered in regards class create , how bridges prado mongodb.

standard php code looks this:

<?php try {   // open connection mongodb server   $conn = new mongo('localhost');    // access database   $db = $conn->test;    // access collection   $collection = $db->items;    // execute query   // retrieve documents   $cursor = $collection->find();    // iterate through result set   // print each document   echo $cursor->count() . ' document(s) found. <br/>';     foreach ($cursor $obj) {     echo 'name: ' . $obj['name'] . '<br/>';     echo 'quantity: ' . $obj['quantity'] . '<br/>';     echo 'price: ' . $obj['price'] . '<br/>';     echo '<br/>';   }    // disconnect server   $conn->close(); } catch (mongoconnectionexception $e) {   die('error connecting mongodb server'); } catch (mongoexception $e) {   die('error: ' . $e->getmessage()); } ?> 

while prado looks great concept, recomend using more established framework such cake, zend, or codeigniter. in addition there morph, higher level of abstraction php , mongodb: http://code.google.com/p/mongodb-morph

hope helps.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -