Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem z namespace i USE
busterek
post 17.08.2018, 15:02:30
Post #1





Grupa: Zarejestrowani
Postów: 108
Pomógł: 0
Dołączył: 30.07.2006
Skąd: Łódź

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


Witajcie,
Nie wiem, czy to nie przedszkole, ale już po prostu jestem głupi.
Mam taki kawałek kodu:

  1. namespace DreamCommerce;
  2.  
  3. use DreamCommerce\ShopAppstoreLib\Client;
  4.  
  5. try
  6. {
  7. $client = \DreamCommerce\ShopAppstoreLib\Client::factory(
  8. Client::ADAPTER_BASIC_AUTH,
  9. 'entrypoint'=>'https://adres',
  10. 'username' => '...',
  11. 'password' => '...'
  12. )
  13. );
  14.  
  15. $resource = new \DreamCommerce\ShopAppstoreLib\Resource\Producer($client);
  16. var_dump($resource->get());
  17. }
  18. catch(DreamCommerce\ShopAppstoreLib\Exception\Exception $ex)
  19. {
  20. die($ex->getMessage());
  21. }
  22.  


Po wywołaniu dostaję komunikat błędu: Fatal error: Class 'DreamCommerce\ShopAppstoreLib\Client' not found in /srv/worek/shoper/DreamCommerce/index.php on line 7.

O co chodzi, i jak to poprawićquestionmark.gif

Ten post edytował busterek 17.08.2018, 15:06:00
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
viking
post 17.08.2018, 18:55:28
Post #2





Grupa: Zarejestrowani
Postów: 6 365
Pomógł: 1114
Dołączył: 30.08.2006

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


Usuń namespace z tego pliku. Odświeżyles composera?


--------------------
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: 28.04.2024 - 12:00