Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Pomoc z ładowaniem klasy
tabbi
post
Post #1





Grupa: Zarejestrowani
Postów: 150
Pomógł: 3
Dołączył: 30.10.2010

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


Witam,

nie potrafie sobie załadować klasy w klasie.

Wywołuje kod:
  1. require ("include/services/Download.class.php");
  2. $download = new Download;
  3. $download->setProvider('Megaupload');
  4. $file_info = $download->_provider->fileCheck($data);


wyskakuje mi błąd:


Fatal error: Class 'Megaupload' not found in C:\xampp\htdocs\smarty\include\services\Download.class.php on line 98

Download.class.php:
  1.  
  2. Class Download {
  3. var $_provider;
  4.  
  5. function setProvider($value) {
  6. if($value == 'Rapidshare') {
  7. $this->_provider = new Rapidshare($this);
  8. } elseif($value == 'Uploaded') {
  9. $this->_provider = new Uploaded($this);
  10. } elseif($value == 'Netload') {
  11. $this->_provider = new Netload($this);
  12. } elseif($value == 'Redtube') {
  13. $this->_provider = new Redtube($this);
  14. } elseif($value == 'Freakshare') {
  15. $this->_provider = new Freakshare($this);
  16. } elseif($value == 'Hotfile') {
  17. $this->_provider = new Hotfile($this);
  18. } elseif($value == 'Megaupload') {
  19. $this->_provider = new Megaupload($this);
  20. } elseif($value == 'Wrzuta') {
  21. $this->_provider = new Wrzuta($this);
  22. } elseif($value == 'Pornhub') {
  23. $this->_provider = new Pornhub($this);
  24. } elseif($value == 'Youporn') {
  25. $this->_provider = new Youporn($this);
  26. } elseif($value == 'Megavideo') {
  27. $this->_provider = new Megavideo($this);
  28. } elseif($value == 'Fileserve') {
  29. $this->_provider = new Fileserve($this);
  30. }
  31. }
  32.  
  33. function __autoload($className) {
  34. require('include/services/'.$className.'.class.php');
  35. }


i nie moge odwolac sie do klasy Megaupload.class.php i jej metod

Ten post edytował tabbi 10.04.2011, 20:35:13
Go to the top of the page
+Quote Post
wookieb
post
Post #2





Grupa: Moderatorzy
Postów: 8 989
Pomógł: 1550
Dołączył: 8.08.2008
Skąd: Słupsk/Gdańsk




Zainteresuje się __autoload
albo pamiętaj o dołączeniu klasy MegaUpload za pomocą require_once
Go to the top of the page
+Quote Post
ADeM
post
Post #3





Grupa: Zarejestrowani
Postów: 455
Pomógł: 69
Dołączył: 23.10.2004
Skąd: Oświęcim

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


Poczytaj dokładniej to, co podał Ci ~wookieb.
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 23.08.2025 - 08:51