|Subject:||I've found three potential problems...|
|Summary:||Package rating comment|
Artur Graniszewski rated this package as follows:
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.
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!
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.