PHPCR & Symfony2

77 views
Skip to first unread message

Craig

unread,
Mar 15, 2012, 8:30:42 PM3/15/12
to phpcr...@googlegroups.com
Hey guys,

I'm quite excited by the potential of this project, and wanted to play around with Jackalope in a Symfony2 app. I know you're also working on the Symfony2 CMF, but I wanted to start small and get to know the PHPCR/Jackrabbit APIs a little better before delving into the CMF.

I tried setting everything up with the latest version of Symfony (2.0.11) but it seems that since this commit at least, the DoctrinePHPCRBundle isn't compatible with that version. So I checked out the master of Symfony, and tried to set everything up with Composer - but there seems to be a conflict that prevents the PHPCR-ODM being installed. I'm totally new to Composer so was hoping you could help me shed some light on the problem (or alternatively tell me that Composer isn't the best way to do this right now, in which case I'm all ears!).

My composer.json file is here: https://gist.github.com/2047834

but I get the following error when running it:

Composer\DependencyResolver\SolverProblemsException]                                                                                                                                                                                                                            
  [Job(cmd=install, target=symfony/symfony, packages=[symfony/symfony-2.1.9999999.9999999-dev (alias of 9999999-dev), symfony/symfony-2.1.9999999.9999999-dev (alias of 9999999-dev)]), Job(cmd=install, target=doctrine/phpcr-odm, packages=[doctrine/phpcr-odm-9999999-dev]), ]

I know it's the phpcr-odm library that's causing the issue, but I can't see why because I don't think its requirements conflict with the other libraries. As an aside, I'm not sure why I have to include it explicitly when it should be installed as a suggested library of the PHPCR bundle (see http://packagist.org/packages/doctrine/phpcr-bundle) - but even with --install-suggested enabled it doesn't get installed, leading to a ReflectionException: Class Doctrine\ODM\PHPCR\Document\Generic does not exist.

I'd appreciate some help in getting past this!

Cheers,
Craig

Lukas Kahwe Smith

unread,
Mar 15, 2012, 9:32:46 PM3/15/12
to phpcr...@googlegroups.com

Great to hear you are interested.
We are currently in the process of migrating to composer and as you found out we are not quite there yet, but I expect things to be ready fairly soon. If you are motivated to dive into the issue and try to get it fixed I recommend joining #composer-dev on freenode IRC to get assistance in getting the issue resolved, but like I said if you dont do it, likely someone else will soon do it.

That being said this list is more about general discussion about PHPCR and not so much about issues in specific applications and frameworks using PHPCR. So in this spirit it would be best to direct Symfony2 related issues at http://groups.google.com/group/symfony-cmf-devs

The installer issue about PHPCR ODM is however a topic for this list, though the above list would also get you help, just as the doctrine dev and users lists.

regards,
Lukas Kahwe Smith
m...@pooteeweet.org

David Buchmann

unread,
Mar 16, 2012, 3:51:35 AM3/16/12
to phpcr...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi,

> We are currently in the process of migrating to composer and as you found out we are not quite there yet, but I expect things to be ready fairly soon. If you are motivated to dive into the issue and try to get it fixed I recommend joining #composer-dev on freenode IRC to get assistance in getting the issue resolved, but like I said if you dont do it, likely someone else will soon do it.

if you don't want to solve composer things and start right now, you can
also install the cmf-sandbox according to the readme. it should get you
working with the non-composer way until composer support is finished.
that way you get a working symfony2 with jackalope-jackrabbit running in it.

or you can also setup jackalope-jackrabbit stand alone (again see readme
in that repository) and run scripts on the command line. to learn phpcr,
thats probably the best way.

the reason the phpcr tutorial recommends going with the cmf sandbox is
that with just jackalope-jackrabbit, you have no data in the repository
to start with. i hope to clean this up some day and have a tutorial
without any symfony complicating things.

cheers,david
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9i8QcACgkQqBnXnqWBgIvzQwCgtZQSp7xftpgz1xHw/W8ao0WF
+wAAn3Z2nSba32ZNehJzOhcQXtoJtnD5
=Us/Y
-----END PGP SIGNATURE-----

Craig

unread,
Mar 16, 2012, 9:56:47 AM3/16/12
to phpcr...@googlegroups.com
Thanks for the advice both. I was initially avoiding the sandbox because I wanted to manually handle dependencies to learn how they all fit together, but after reading David's message it occurred to me to simply diff the sandbox with the standard edition so I could see what was added - I then saw the modifications to remove bootstrap caching, and various other tweaks to the app skeleton which help explain why I wasn't having much luck getting things working out of the box. I'm happily messing round with vanilla Symfony and the PHPCR now, so mission achieved, thanks.

I'll be sure to direct any future questions to the appropriate list, thanks Lukas.

Lukas Kahwe Smith

unread,
Mar 19, 2012, 2:41:25 PM3/19/12
to phpcr...@googlegroups.com

On Mar 15, 2012, at 20:30 , Craig wrote:

> My composer.json file is here: https://gist.github.com/2047834
>
> but I get the following error when running it:
>
> Composer\DependencyResolver\SolverProblemsException]
> [Job(cmd=install, target=symfony/symfony, packages=[symfony/symfony-2.1.9999999.9999999-dev (alias of 9999999-dev), symfony/symfony-2.1.9999999.9999999-dev (alias of 9999999-dev)]), Job(cmd=install, target=doctrine/phpcr-odm, packages=[doctrine/phpcr-odm-9999999-dev]), ]
>
> I know it's the phpcr-odm library that's causing the issue, but I can't see why because I don't think its requirements conflict with the other libraries. As an aside, I'm not sure why I have to include it explicitly when it should be installed as a suggested library of the PHPCR bundle (see http://packagist.org/packages/doctrine/phpcr-bundle) - but even with --install-suggested enabled it doesn't get installed, leading to a ReflectionException: Class Doctrine\ODM\PHPCR\Document\Generic does not exist.
>
> I'd appreciate some help in getting past this!

just for the record.
i have done a fair bit of work on the composer.json files for all the PHPCR related projects.
there are still a few Bundles to migrate to composer before we will switch the cmf and the sandbox over the composer but you might get better results now.

most importantly composer has seen several improvements over the past days, most importantly much better exception messages.

Reply all
Reply to author
Forward
0 new messages