MongoDB and Photon [was: [PATCH] POT file generation]
- Loic d'Anterroches
- 2011-05-09 @ 09:03
> Maybe a stupid question, but I just discovered Photon-project. I ike the
> concept and like to start hacking around with it.
> Can someone give me some hints on where / how to tie in the mongodb driver.
> Is there a short tutorial somewhere out there?
Not really. This comes from my experience with Django, many frameworks,
writting an ORM and complex web applications. I basically found that the
current MongoDB driver is good enough to be used "directly". That is,
you just put your connection data in your config file:
return array( ...
'mongo_dsn' => 'connection-string',);
and in yyour code, you get the value directly:
$conn = new \Mongo(Conf::f('mongo_dsn', 'mongodb://localhost:27017'));
Some people are fans of the doctrine ORM, other like MySQL raw, etc. To
avoid issues, you can see that for everything in the core framework
which requires a storage, I am providing a clear interface and 2 ways to
store the data (usually file + memory). The goal is to be really
Of course usage patterns will emerge, after 5 projects using MongoDB, I
will start to have a collections of tools to do the usual things, I will
then bundle them in an app to easily reuse them.
My goal is really to keep Photon itslef database independant (but it is
of course fine to create a mongodb or mysql only solution using Photon).
I hope it helps, do not hesitate to ask more questions if you have some.
Indefero - Project management and code hosting - http://www.indefero.net
Photon - High Performance PHP Framework - http://photon-project.com
Céondo Ltd - Web + Science = Fun - http://www.ceondo.com
> Best Regards,
> Alex Knol
> Movil: +34 693 206 868
> Company: Pumiwex S.L.U.
> PostBox: Apartado Correos 842, Camarles
> Delivery / Fiscal: Plaza Don Diego de Leon 3, Camarles (Tarragona)
> Postal Code: 43894
> Country: Espana Pumiwex S.L.
> CIF B43969187
> On Mon, May 2, 2011 at 10:37 AM, William MARTIN <firstname.lastname@example.org
> <mailto:email@example.com>> wrote:
> Hi again,
> This patch add "hnu pot" command to generate POT file for all
> installed application.
> I think the code must be review and improve, but it's a good working
> start point.
> William MARTIN