Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [SF][Symfony2][Symfony]fosuserbundle błąd podczas tworzenia użytkownika
symer
post 24.08.2017, 11:18:17
Post #1





Grupa: Zarejestrowani
Postów: 66
Pomógł: 0
Dołączył: 24.08.2017

Ostrzeżenie: (0%)
-----


Witam. Otóż mam problem z utworzeniem użytkownika za pomocą fosuserbundle:
  1. C:\xampp\htdocs\symfony2\szypi>php app/console fos:user:create adnim szypula89@o
  2. net.pl haker777
  3. PHP Fatal error: Uncaught exception 'Symfony\Component\DependencyInjection\Exce
  4. ption\InvalidArgumentException' with message 'There is no extension able to load
  5. the configuration for "encoders" (in C:\xampp\htdocs\symfony2\szypi\app/config\
  6. security.yml). Looked for namespace "encoders", found "framework", "security", "
  7. twig", "monolog", "swiftmailer", "doctrine", "sensio_framework_extra", "fos_user
  8. ", "debug", "web_profiler", "sensio_distribution"' in C:\xampp\htdocs\symfony2\s
  9. zypi\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Loader\Yam
  10. lFileLoader.php:399
  11. Stack trace:
  12. #0 C:\xampp\htdocs\symfony2\szypi\vendor\symfony\symfony\src\Symfony\Component\D
  13. ependencyInjection\Loader\YamlFileLoader.php(369): Symfony\Component\DependencyI
  14. njection\Loader\YamlFileLoader->validate(Array, 'C:\\xampp\\htdocs...')
  15. #1 C:\xampp\htdocs\symfony2\szypi\vendor\symfony\symfony\src\Symfony\Component\D
  16. ependencyInjection\Loader\YamlFileLoader.php(44): Symfony\Component\DependencyIn
  17. jection\Loader\YamlFileLoader->loadFile('C:\\xampp\\htdoc in C:\xampp\htdocs\sym
  18. fony2\szypi\vendor\symfony\symfony\src\Symfony\Component\Config\Loader\FileLoade
  19. r.php on line 133
  20.  
  21. Fatal error: Uncaught exception 'Symfony\Component\DependencyInjection\Exception
  22. \InvalidArgumentException' with message 'There is no extension able to load the
  23. configuration for "encoders" (in C:\xampp\htdocs\symfony2\szypi\app/config\secur
  24. ity.yml). Looked for namespace "encoders", found "framework", "security", "twig"
  25. , "monolog", "swiftmailer", "doctrine", "sensio_framework_extra", "fos_user", "d
  26. ebug", "web_profiler", "sensio_distribution"' in C:\xampp\htdocs\symfony2\szypi\
  27. vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Loader\YamlFile
  28. Loader.php:399
  29. Stack trace:
  30. #0 C:\xampp\htdocs\symfony2\szypi\vendor\symfony\symfony\src\Symfony\Component\D
  31. ependencyInjection\Loader\YamlFileLoader.php(369): Symfony\Component\DependencyI
  32. njection\Loader\YamlFileLoader->validate(Array, 'C:\\xampp\\htdocs...')
  33. #1 C:\xampp\htdocs\symfony2\szypi\vendor\symfony\symfony\src\Symfony\Component\D
  34. ependencyInjection\Loader\YamlFileLoader.php(44): Symfony\Component\DependencyIn
  35. jection\Loader\YamlFileLoader->loadFile('C:\\xampp\\htdoc in C:\xampp\htdocs\sym
  36. fony2\szypi\vendor\symfony\symfony\src\Symfony\Component\Config\Loader\FileLoade
  37. r.php on line 133


oto plik security.yml:
  1. imports:
  2. - { resource: parameters.yml }
  3. - { resource: security.yml }
  4. - { resource: services.yml }
  5. - { resource: "@SzypiBundle/Resources/config/services.yml" }
  6.  
  7. # Put parameters here that don't need to change on each machine where the app is deployed
  8. # <a href="http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration" target="_blank">http://symfony.com/doc/current/best_practi...d-configuration</a>
  9. parameters:
  10. locale: en
  11.  
  12. framework:
  13. #esi: ~
  14. #translator: { fallbacks: ["%locale%"] }
  15. secret: "%secret%"
  16. router:
  17. resource: "%kernel.root_dir%/config/routing.yml"
  18. strict_requirements: ~
  19. form: ~
  20. csrf_protection: ~
  21. validation: { enable_annotations: true }
  22. #serializer: { enable_annotations: true }
  23. templating:
  24. engines: ['twig']
  25. default_locale: "%locale%"
  26. trusted_hosts: ~
  27. trusted_proxies: ~
  28. session:
  29. # handler_id set to null will use default session handler from php.ini
  30. handler_id: ~
  31. fragments: ~
  32. http_method_override: true
  33. translator: ~
  34. session:
  35. default_locale: pl
  36.  
  37. # Twig Configuration
  38. twig:
  39. debug: "%kernel.debug%"
  40. strict_variables: "%kernel.debug%"
  41.  
  42. # Doctrine Configuration
  43. doctrine:
  44. dbal:
  45. driver: pdo_mysql
  46. host: "%database_host%"
  47. port: "%database_port%"
  48. dbname: "%database_name%"
  49. user: "%database_user%"
  50. password: "%database_password%"
  51. charset: UTF8
  52. # if using pdo_sqlite as your database driver:
  53. # 1. add the path in parameters.yml
  54. # e.g. database_path: "%kernel.root_dir%/data/data.db3"
  55. # 2. Uncomment database_path in parameters.yml.dist
  56. # 3. Uncomment next line:
  57. # path: "%database_path%"
  58.  
  59. orm:
  60. auto_generate_proxy_classes: "%kernel.debug%"
  61. naming_strategy: doctrine.orm.naming_strategy.underscore
  62. auto_mapping: true
  63.  
  64. # Swiftmailer Configuration
  65. swiftmailer:
  66. transport: "%mailer_transport%"
  67. host: "%mailer_host%"
  68. username: "%mailer_user%"
  69. password: "%mailer_password%"
  70. spool: { type: memory }
  71. fos_user:
  72. db_driver: orm
  73. firewall_name: main
  74. user_class: SzypiBundle\Entity\User


plik user w ENTITY:
  1. <?php
  2. namespace SzypiBundle\Entity;
  3. &#8203;
  4. use FOS\UserBundle\Model\User as BaseUser;
  5. use Doctrine\ORM\Mapping as ORM;
  6. &#8203;
  7. /**
  8. * @ORM\Entity
  9. * @ORM\Table(name="fos_user")
  10. */
  11. class User extends BaseUser
  12. {
  13. /**
  14.   * @ORM\Id
  15.   * @ORM\Column(type="integer")
  16.   * @ORM\GeneratedValue(strategy="AUTO")
  17.   */
  18. protected $id;
  19. &#8203;
  20. public function __construct()
  21. {
  22. parent::__construct();
  23. // your own logic
  24. }
  25. &#8203;
  26. }


gdzie może być błąd? proszę o pomoc
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 25.06.2025 - 08:16