Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [php+symfony] instalacja DoctrineFixturesBundle
dopelganger
post 22.08.2014, 12:13:57
Post #1





Grupa: Zarejestrowani
Postów: 236
Pomógł: 0
Dołączył: 27.10.2012

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


witam
mam problem z instalacją pakietu DoctrineFixturesBundle.

1) pobrałem źródło composer.phar z http://getcomposer.org/installer i wrzuciłem bezpośrednio na serwer jako plik: composer.phar (do katalogu gdzie mam Symfony2)

2) Dodałem kod do pliku composer.json
  1. {
  2. "require": {
  3. "doctrine/doctrine-fixtures-bundle": "2.2*"
  4. }
  5. }

ps. rozumiem, że dodaje to na sam koniec pliku po zawartości, która już tam jest?

3) Próbuje zrobić aktualizację:

  1. php composer.phar update


wyskakują błędy:

Downloading...
Download failed: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:func(144):reason(134)
file_get_contents(): Failed to enable crypto
file_get_contents(https://getcomposer.org/composer.phar): failed to open stream: operation failed
Downloading...
Download failed: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:func(144):reason(134)
file_get_contents(): Failed to enable crypto
file_get_contents(https://getcomposer.org/composer.phar): failed to open stream: operation failed
Downloading...
Download failed: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:func(144):reason(134)
file_get_contents(): Failed to enable crypto
file_get_contents(https://getcomposer.org/composer.phar): failed to open stream: operation failed
The download failed repeatedly, aborting.



Może da się to jakoś ręcznie zainstalować? Męczy mnie to już :/
Proszę o pomoc.

Ten post edytował dopelganger 22.08.2014, 12:35:42
Go to the top of the page
+Quote Post
skowron-line
post 22.08.2014, 13:00:40
Post #2





Grupa: Zarejestrowani
Postów: 4 340
Pomógł: 542
Dołączył: 15.01.2006
Skąd: Olsztyn/Warszawa

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


Pobierz, wrzuc do vendor wpisz appKernel i juz. Minus jest taki ze composer.lock nie bedzie mial tego w sobie.


--------------------
I'm so fast that last night I turned off the light switch in my hotel room and was in bed before the room was dark - Muhammad Ali.
Peg jeżeli chcesz uprawiać sex to dzieci muszą wyjść, a jeżeli chcesz żeby był dobry ty też musisz wyjść - Al Bundy.

QueryBuilder, Mootools.net, bbcradio1::MistaJam
http://www.phpbench.com/
Go to the top of the page
+Quote Post
dopelganger
post 22.08.2014, 14:03:09
Post #3





Grupa: Zarejestrowani
Postów: 236
Pomógł: 0
Dołączył: 27.10.2012

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


Cytat(skowron-line @ 22.08.2014, 14:00:40 ) *
Pobierz, wrzuc do vendor wpisz appKernel i juz. Minus jest taki ze composer.lock nie bedzie mial tego w sobie.


jestem początkujący z symfony, dlatego zapytam smile.gif co znaczy, że :"composer.lock nie bedzie mial tego w sobie."


no dobra dodałem ręcznie, ale mam byka:

ClassNotFoundException: Attempted to load class "DoctrineFixturesBundle" from namespace "Doctrine\Bundle\FixturesBundle" in /home/www


wrzuciłem do:

vendor/ katalog: DoctrineFixturesBundle/

w AppKernel dodałem:

  1. new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),


Ten post edytował dopelganger 22.08.2014, 14:12:57
Go to the top of the page
+Quote Post
by_ikar
post 22.08.2014, 14:22:45
Post #4





Grupa: Zarejestrowani
Postów: 1 798
Pomógł: 307
Dołączył: 13.05.2009
Skąd: Gubin/Wrocław

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


Jeszcze musisz napespace dodać do autoloadera.
Go to the top of the page
+Quote Post
dopelganger
post 22.08.2014, 14:25:50
Post #5





Grupa: Zarejestrowani
Postów: 236
Pomógł: 0
Dołączył: 27.10.2012

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


Cytat(by_ikar @ 22.08.2014, 15:22:45 ) *
Jeszcze musisz napespace dodać do autoloadera.


a gdzie ten plik i jak zapisać komende?

/app/autoload.php ?

czy

/vendor/autoload.php


.
.
.

Ten post edytował dopelganger 22.08.2014, 14:33:17
Go to the top of the page
+Quote Post
Pyton_000
post 22.08.2014, 14:48:50
Post #6





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

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


VPS/Dedyk? Jeżeli tak to zaktualizuj pakiet ssh
Go to the top of the page
+Quote Post
by_ikar
post 22.08.2014, 16:42:11
Post #7





Grupa: Zarejestrowani
Postów: 1 798
Pomógł: 307
Dołączył: 13.05.2009
Skąd: Gubin/Wrocław

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


Kod
/vendor/composer/autoload_namespaces.php


Dodaj sobie byleby nie na końcu linijkę:

  1. 'Doctrine\\Bundle\\FixturesBundle' => array($vendorDir . '/doctrine/doctrine-fixtures-bundle'),


Tak przykładowo wygląda cały plik autoload_namespaces.php po dodaniu doctrine-fixtures-bundle:

  1. <?php
  2.  
  3. // autoload_namespaces.php @generated by Composer
  4.  
  5. $vendorDir = dirname(dirname(__FILE__));
  6. $baseDir = dirname($vendorDir);
  7.  
  8. return array(
  9. 'Twig_Extensions_' => array($vendorDir . '/twig/extensions/lib'),
  10. 'Twig_' => array($vendorDir . '/twig/twig/lib'),
  11. 'Symfony\\Component\\Icu\\' => array($vendorDir . '/symfony/icu'),
  12. 'Symfony\\Bundle\\SwiftmailerBundle' => array($vendorDir . '/symfony/swiftmailer-bundle'),
  13. 'Symfony\\Bundle\\AsseticBundle' => array($vendorDir . '/symfony/assetic-bundle'),
  14. 'Symfony\\' => array($vendorDir . '/symfony/symfony/src'),
  15. 'SymfonyStandard' => array($baseDir . '/app'),
  16. 'Sensio\\Bundle\\GeneratorBundle' => array($vendorDir . '/sensio/generator-bundle'),
  17. 'Sensio\\Bundle\\FrameworkExtraBundle' => array($vendorDir . '/sensio/framework-extra-bundle'),
  18. 'Sensio\\Bundle\\DistributionBundle' => array($vendorDir . '/sensio/distribution-bundle'),
  19. 'SensioLabs\\Security' => array($vendorDir . '/sensiolabs/security-checker'),
  20. 'Psr\\Log\\' => array($vendorDir . '/psr/log'),
  21. 'Incenteev\\ParameterHandler' => array($vendorDir . '/incenteev/composer-parameter-handler'),
  22. 'Doctrine\\ORM\\' => array($vendorDir . '/doctrine/orm/lib'),
  23. 'Doctrine\\DBAL\\' => array($vendorDir . '/doctrine/dbal/lib'),
  24. 'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib'),
  25. 'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib'),
  26. 'Doctrine\\Common\\DataFixtures' => array($vendorDir . '/doctrine/data-fixtures/lib'),
  27. 'Doctrine\\Common\\Collections\\' => array($vendorDir . '/doctrine/collections/lib'),
  28. 'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib'),
  29. 'Doctrine\\Common\\Annotations\\' => array($vendorDir . '/doctrine/annotations/lib'),
  30. 'Doctrine\\Common\\' => array($vendorDir . '/doctrine/common/lib'),
  31. 'Doctrine\\Bundle\\FixturesBundle' => array($vendorDir . '/doctrine/doctrine-fixtures-bundle'),
  32. 'Doctrine\\Bundle\\DoctrineBundle' => array($vendorDir . '/doctrine/doctrine-bundle'),
  33. 'Assetic' => array($vendorDir . '/kriswallsmith/assetic/src'),
  34. '' => array($baseDir . '/src'),
  35. );


Wydaje mi się że openssl w twoim php.ini jest zakomentowany dlatego też masz takie błędy. Wpisz w konsoli
Kod
php -m

i sprawdź w liście załadowanych modułów czy znajduje się openssl, jeżeli nie, to w php.ini usuń średnik sprzed:
Kod
;extension=php_openssl.dll

Jeżeli to jest na windowsie, lub:
Kod
;extension=php_openssl.so

jeżeli to jest na unixie.
Go to the top of the page
+Quote Post
dopelganger
post 23.08.2014, 06:05:17
Post #8





Grupa: Zarejestrowani
Postów: 236
Pomógł: 0
Dołączył: 27.10.2012

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


no dobra poradziłem sobie poprzez ssh. Poniżej wklejam rozwiązanie gdyby ktoś w przyszłości potrzebował. Troche błędów po drodze i niespodzianek jeszcze było smile.gif

1. Pobieramy plik composer.phar: https://getcomposer.org/download/ i wrzucamy do katalogu z Symfony.
Tylko pobrać z tego adresu co wkleiłem. Jak kopiowałem kod z : https://getcomposer.org/installer to ciągle pojawiały się błedy, wina edytora? (testy: Pajączek, Geany). Pluło się o jakieś znaki niewidoczne gołym okiem smile.gif

2. W pliku composer.json znajdź linie z : "require" i doklej: "doctrine/doctrine-fixtures-bundle": "2.2.*"

3. $: php composer.phar update doctrine/doctrine-fixtures-bundle
[JAK WYSKOCZY BŁĄD typu:
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 72 bytes) in
phar:///home/..../public_html/symfony/composer.phar/src/Composer/DependencyResolver/Rule.php on line 50

]
tzn że na wykonanie skryptu php jest za mało pamięci. Dotyczy kont hostingowych, trzeba walić drzwiami i oknami do administratora, ażeby zwiększył limit, chociaż na ta jedną operacje.

4. Do pliku: app/AppKernel.php dodać linie: new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),


Zamykamy temat, dzięki za pomoc.
Pozdrawiam

Ten post edytował dopelganger 23.08.2014, 06:25:04
Go to the top of the page
+Quote Post

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: 11.06.2024 - 22:31