Advertisement
krot

new proj symfony win

Aug 17th, 2017
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. php composer.phar create-project symfony/framework-standard-edition test.test
  2. php composer.phar create-project symfony/framework-standard-edition testproj @stable
  3. or
  4. >php -r "file_put_contents('symfony', file_get_contents('https://symfony.com/installer'));"
  5. >php symfony new test.test
  6.  
  7. >php console generate:bundle --namespace=A1/TestBundle
  8. Fatal error: \app\AppKernel.php on line 19
  9. edit composer.json
  10. "autoload": {
  11.         "psr-4": {
  12.             "": "src/"
  13.         },
  14.         "classmap": [
  15.             "app/AppKernel.php",
  16.             "app/AppCache.php"
  17.         ]
  18.     }
  19.  
  20. >php composer.phar dump-autoload
  21.  
  22. Edit the composer.json file and register the bundle
  23.   namespace in the "autoload" section:
  24.  
  25. Add your new bundle to the composer.json file
  26.  
  27. "autoload": {
  28.     "psr-0": {
  29.         "currentbundle\\": "src/",
  30.         "YOURNEWBUNDLE\\": "src/",            
  31.     }
  32. }
  33. You then need to run install on composer again
  34.  
  35. composer -n install --dev
  36. You should then have both of the bundles autoloaded
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement