symfony / symfony-docs

The Symfony documentation
https://symfony.com/doc
Other
2.17k stars 5.12k forks source link

Best practices – Creating Projects: Impossible to follow for 2.5 #4470

Closed magnusnordlander closed 9 years ago

magnusnordlander commented 9 years ago

Following the installation instructions in the best practices document, it is impossible to create the AppBundle as suggested in the side note. To wit:

Tesla:Sftest magnus$ composer create-project symfony/framework-standard-edition blog/
Installing symfony/framework-standard-edition (v2.5.6)
  - Installing symfony/framework-standard-edition (v2.5.6)
    Loading from cache

Created project in blog/
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing jdorn/sql-formatter (v1.2.17)
    Loading from cache

  - Installing psr/log (1.0.0)
    Loading from cache

  - Installing twig/twig (v1.16.2)
    Loading from cache

  - Installing doctrine/lexer (v1.0)
    Loading from cache

  - Installing doctrine/annotations (v1.2.1)
    Loading from cache

  - Installing doctrine/collections (v1.2)
    Loading from cache

  - Installing doctrine/cache (v1.3.1)
    Loading from cache

  - Installing doctrine/inflector (v1.0)
    Loading from cache

  - Installing doctrine/common (v2.4.2)
    Loading from cache

  - Installing symfony/symfony (v2.5.6)
    Loading from cache

  - Installing doctrine/dbal (v2.4.3)
    Loading from cache

  - Installing doctrine/doctrine-bundle (v1.2.0)
    Loading from cache

  - Installing doctrine/orm (v2.4.6)
    Loading from cache

  - Installing twig/extensions (v1.2.0)
    Loading from cache

  - Installing kriswallsmith/assetic (v1.2.0)
    Loading from cache

  - Installing symfony/assetic-bundle (v2.5.0)
    Loading from cache

  - Installing swiftmailer/swiftmailer (v5.3.0)
    Loading from cache

  - Installing symfony/swiftmailer-bundle (v2.3.7)
    Loading from cache

  - Installing monolog/monolog (1.11.0)
    Loading from cache

  - Installing symfony/monolog-bundle (v2.6.1)
    Loading from cache

  - Installing sensiolabs/security-checker (v2.0.0)
    Loading from cache

  - Installing sensio/distribution-bundle (v3.0.8)
    Loading from cache

  - Installing sensio/framework-extra-bundle (v3.0.3)
    Loading from cache

  - Installing incenteev/composer-parameter-handler (v2.1.0)
    Loading from cache

  - Installing sensio/generator-bundle (v2.4.0)
    Loading from cache

kriswallsmith/assetic suggests installing leafo/lessphp (Assetic provides the integration with the lessphp LESS compiler)
kriswallsmith/assetic suggests installing leafo/scssphp (Assetic provides the integration with the scssphp SCSS compiler)
kriswallsmith/assetic suggests installing ptachoire/cssembed (Assetic provides the integration with phpcssembed to embed data uris)
kriswallsmith/assetic suggests installing leafo/scssphp-compass (Assetic provides the integration with the SCSS compass plugin)
kriswallsmith/assetic suggests installing patchwork/jsqueeze (Assetic provides the integration with the JSqueeze JavaScript compressor)
symfony/assetic-bundle suggests installing kriswallsmith/spork (to be able to dump assets in parallel)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing raven/raven (Allow sending log messages to a Sentry server)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing videlalvaro/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
Writing lock file
Generating autoload files
Would you like to install Acme demo bundle? [y/N]  
Creating the "app/config/parameters.yml" file
Some parameters are missing. Please provide them.
database_driver (pdo_mysql): 
database_host (127.0.0.1): 
database_port (null): 
database_name (symfony): 
database_user (root): 
database_password (null): 
mailer_transport (smtp): 
mailer_host (127.0.0.1): 
mailer_user (null): 
mailer_password (null): 
locale (en): 
secret (ThisTokenIsNotSoSecretChangeIt): 
debug_toolbar (true): 
debug_redirects (false): 
use_assetic_controller (true): 
Clearing the cache for the dev environment with debug true
Installing assets as hard copies
Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
Installing assets for Sensio\Bundle\DistributionBundle into web/bundles/sensiodistribution
Tesla:Sftest magnus$ cd blog
Tesla:blog magnus$ php app/console generate:bundle --namespace=AppBundle --dir=src --format=annotation --no-interaction

  [InvalidArgumentException]                                                   
  The namespace must contain a vendor namespace (e.g. "VendorName\AppBundle"   
  instead of simply "AppBundle").                                              
  If you've specified a vendor namespace, did you forget to surround it with   
  quotes (init:bundle "Acme\BlogBundle")?                                      

generate:bundle [--namespace="..."] [--dir="..."] [--bundle-name="..."] [--format="..."] [--structure]

Tesla:blog magnus$ 
javiereguiluz commented 9 years ago

@magnusnordlander thanks for reporting this error. You are absolutely right, it doesn't work right now.

Fortunately, there is a PR about to be merged that fixes this: https://github.com/sensiolabs/SensioGeneratorBundle/pull/299

Moreover, when 2.6 is launched, the process that you've showed in your PR will be as follows:

$ symfony new blog

That's all! The latest version of Symfony will be downloaded and the AppBundle will be already generated and loaded.

wouterj commented 9 years ago

Closing this. The guide is still in beta and it'll start working when 2.6 is released. Thanks for reporting. I'm sorry that it is a bit unclear and it gives you wrong information at the moment.

magnusnordlander commented 9 years ago

Well, the instructions were specific to Symfony <=2.5, but yes, that GeneratorBundle PR will certainly fix it :)