Login   Register  
PHP Classes
elePHPant
Icontem

I've found three potential problems in your class: 1) code l...

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      YouTube Video Fetcher  >  All threads  >  I've found three potential problems in your class: 1) code l...  >  (Un) Subscribe thread alerts  
Subject:I've found three potential problems in your class: 1) code l...
Summary:Package rating comment
Messages:3
Author:Artur Graniszewski
Date:2011-03-11 08:43:52
Update:2011-03-17 10:12:42
 

Artur Graniszewski rated this package as follows:

Utility: Sufficient
Consistency: Sufficient
Documentation: Good
Examples: Good

  1. I've found three potential problems in your class: 1) code l...   Reply  
Picture of Artur Graniszewski
Artur Graniszewski
2011-03-11 08:43:53
I've found three potential problems in your class:

1) code library should not halt entire application on error (using die() method), you should use exceptions or throw error at least. Let the applications' own error handler handle this situation.

2) you really shouldn't load entire youtube video into the PHP memory. On most of the shared hostings there is a low memory limit set (for example 8, 16, 32MB of RAM). In those situations bigger youtube files can cause fatal out-of-memory errors. Try to use fopen instead and download file in small chunks.

3) you really should change scope of your methods from private to protected, this will allow easy class extension by other web developers.

  2. Re: I've found three potential problems in your class: 1) code   Reply  
Picture of Biagio Vincenzo Mamone Neto
Biagio Vincenzo Mamone Neto
2011-03-11 13:54:23 - In reply to message 1 from Artur Graniszewski
Thank you for your comment!

I`ve made this class a few weeks ago and I`ve already made a newer (and much better) version, I should upload it soon. I`ll also make a better way to handle the errors!

Thanks again!

  3. Re: I've found three potential problems in your class: 1) code   Reply  
Picture of mojbuk
mojbuk
2011-03-17 10:12:42 - In reply to message 1 from Artur Graniszewski
Best regards. I am a beginner but I wonder how they can use to download youtube videos to your PC. If you would be so kind to write the code from the input form youtube link.

Thank you.