|
Jonathan Moss - 2010-03-01 16:10:58
Hi Cesar,
Have you seen Morph for MongoDB. It is PHP package for MongoDB with an ActiveRecord type interface making it super easy to use MongoDB with PHP.
You can find it at http://code.google.com/p/mongodb-morph/
Personally I think it is pretty good but then I did write it so I'm probably a little biased :)
However, the GridFS stream wrapper would be awesome and something I have thought about writing myself but have yet to find time to implement it.
Regards,
Jon
Cesar D. Rodas - 2010-03-01 20:03:58 - In reply to message 1 from Jonathan Moss
Hello Jonathan,
I wasn't aware about MongoDB-Morph, that's why I started with my ActiveMongo project :-). I just bookmarked it to review it later today.
About the Stream Wrapper, it is always a good idea to make things simple, that's why I created a brief prototype to abstract GridFS as much as possible, and Stream Wrapper were the best option. My prototype is still alpha, just support reads right now, but I'm adding write operations, which are a bit more complex.
If this prototype works and it is well accepted by the community, I'll try to port it to C, in order to merge with PECL/Mongo drive.
Best regards,
Rene Ausserehl - 2010-03-03 18:05:32 - In reply to message 1 from Jonathan Moss
Ok, maybe Iam stupid, Iam new to "NoSQL/ MongoDB" But I thought it is without "int, varchar, text..." field types.
So why it uses:
class Book extends Morph_Object
{
public function __construct($id = null)
{
parent::__construct($id);
$this->addProperty(new Morph_Property_String('title'))
->addProperty(new Morph_Property_String('author'))
->addProperty(new Morph_Property_Integer('pageNumber'))
->addProperty(new Morph_Property_Date('publishedDate'));
}
}
Any (logical ) reasons for this?
Cesar D. Rodas - 2010-03-03 19:20:57 - In reply to message 3 from Rene Ausserehl
Hello,
Morph is just an abstraction over MongoDB, and I don't know why it uses this sort of things.
You can use MongoDB without any abstraction, it is very amicable, or perhaps you can try my beta ActiveMongo
github.com/crodas/ActiveMongo/
Example of use:
github.com/crodas/ActiveMongo/blob/ ...
When this package became stable (few things are missing, in one or two days), I'll submit it here.
Best regards,
|