The Prado PHP Framework looks very interesting, but before I dive in, I am wondering if MongoDB can be used as the database for Prado without any issues?
Prado is based on Apache Tapestry, a Java Framework. Tapestry does not have a MongoDB library (unless recently added)
Being PHP, Prado can work with MongoDB, but one must do some PHP configuration since the Mongo PHP Driver is a third-party library and there is no specific Prado library for MongoDB.
First, configure MongoDB, install the MongoDB PHP Driver, then create a Prado class to interact it (the same with Apache Tapestry). The amount of issues encountered will be in regards to the class you create and how well it bridges Prado with MongoDB.
Standard PHP code looks like this:
<?php
try {
// open connection to MongoDB server
$conn = new Mongo('localhost');
// access database
$db = $conn->test;
// access collection
$collection = $db->items;
// execute query
// retrieve all documents
$cursor = $collection->find();
// iterate through the result set
// print each document
echo $cursor->count() . ' document(s) found. <br/>';
foreach ($cursor as $obj) {
echo 'Name: ' . $obj['name'] . '<br/>';
echo 'Quantity: ' . $obj['quantity'] . '<br/>';
echo 'Price: ' . $obj['price'] . '<br/>';
echo '<br/>';
}
// disconnect from server
$conn->close();
} catch (MongoConnectionException $e) {
die('Error connecting to MongoDB server');
} catch (MongoException $e) {
die('Error: ' . $e->getMessage());
}
?>
While Prado looks like a great concept, I would recomend using a more established framework such as Cake, Zend, or CodeIgniter. In addition there is Morph, a higher level of abstraction for PHP and MongoDB: http://code.google.com/p/mongodb-morph
Hope this helps.