chanmix51/PommBundle

Problems installing pommbundle

lucvht opened this issue · 8 comments

Having downloaded symfony 2.0.18 I wanted to play with Pomm but installing using composer seems to fail !

'''
Loading composer repositories with package information
Installing dependencies

  • Installing pomm/pomm (1.0.6)
    Downloading: 100%
  • Installing pomm/pomm-bundle (dev-master 39f3346)
    Cloning 39f3346

Writing lock file
Generating autoload files
"""

Everything looks ok but no autoloader changes and no registeredbundles....

After adding

new Pomm\PommBundle\PommBundle(), 

to appkernel.php and

    'Pomm/PommBundle'                => __DIR__.'/../vendor/bundles/Pomm',
    'Pomm'                           => __DIR__.'/../vendor/pomm',
# This is the default namespace for the model
# But it can be changed see the command line tools
    'Model'                          => __DIR__.'/..',    

to autoload.php I get the following when running php ./console

PHP Fatal error: Class 'Pomm\PommBundle\PommBundle' not found in /home/lucvh/public_html/Pomm/app/AppKernel.php on line 20
PHP Stack trace:
PHP 1. {main}() /home/lucvh/public_html/Pomm/app/console:0
PHP 2. Symfony\Component\Console\Application->run() /home/lucvh/public_html/Pomm/app/console:22
PHP 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /home/lucvh/public_html/Pomm/vendor/symfony/src/Symfony/Component/Console/Application.php:118
PHP 4. Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands() /home/lucvh/public_html/Pomm/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:67
PHP 5. Symfony\Component\HttpKernel\Kernel->boot() /home/lucvh/public_html/Pomm/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:81
PHP 6. Symfony\Component\HttpKernel\Kernel->initializeBundles() /home/lucvh/public_html/Pomm/app/bootstrap.php.cache:518
PHP 7. AppKernel->registerBundles() /home/lucvh/public_html/Pomm/app/bootstrap.php.cache:724

Fatal error: Class 'Pomm\PommBundle\PommBundle' not found in /home/lucvh/public_html/Pomm/app/AppKernel.php on line 20

Any clues ?

It looks like you are setting your autoloading on wrong paths. It should be

'Pomm\PommBundle' => vendor/pomm/pomm-bundle/src',
'Pomm' => 'vendor/pomm/pomm'

Still no luck, will keep on trying. I assume the examples on this page: https://github.com/chanmix51/PommBundle are out of date ?

That's weird ... I tried on my side and got it to work. Yes, this README is out of date, thanks for pointing that to me. I am going to update it.

I have Pomm and its bundle installed in vendor/pomm. I changed the app/autoload.php file adding the following lines :

    'Pomm'             => __DIR__.'/../vendor/pomm/pomm',
    'Pomm\\PommBundle'     => __DIR__.'/../vendor/pomm/pomm-bundle',

Launching php app/console dumped me the help page with Pomm's commands:

pomm
  pomm:mapfile:create                   Generates the Map file from a given table.
  pomm:mapfile:scan                     Scans and generates the map files from a database schema.

If you can see them, it works.

Thanks, we have lift off ! Meanwhile have upgraded to the latest Ubuntu LTS version, and followed instructions. So am not sure what the problem was. Am hoping this will be a better option then doctrine for use with a legacy postgres database :)

Happy to see you managed to sort out this problem. About replacing Doctrine by Pomm, do keep in mind

  • Pomm is fortunately not an ORM and will not provide you with automatic object relations in PHP
  • Pomm is unfortunately not fully integrated with Symfony and the bundle lacks some functionnalities
    • web debug toolbar integration
    • forms cannot be used with Pomm's entities a need dedicated popo
    • no user provider for the SecurityBundle

Do not hesitate to post bugs or feature request.

As your using Composer you can considering changing the loader to that of Composer.
https://github.com/symfony/symfony-standard/blob/master/app/autoload.php

You can still register autoloading namespaces your self, but will benefit from the Composer autoloader.

Exactly, this is the case with Symfony 2.1