4 ms·
The code on your GitHub, for the most part, seems fine. One thing I can say is don't use exec[1] if you can avoid it: $string = 'rm /var/www/Giftest/*.gif
by ancarda 14y ago
The code on your GitHub, for the most part, seems fine.
One thing I can say is don't use exec[1] if you can avoid it:
$string = 'rm /var/www/Giftest/*.gif';
exec($string);
While there's nothing * technically* wrong, it's platform specific and I think it would be better to use PHP's unlink[2] function. Also, sorry if this is wrong, I haven't looked at the regex but it seems your parsing YouTube URLs? Have you looked at oEmbed[3] - it may be an easier way to accomplish what your doing? You can use it with json_decode[4] to get an object.
[1] https://github.com/Machtap/GiffyTube/blob/master/download.php https://github.com/Machtap/GiffyTube/blob/master/download.ph...
[2] http://php.net/manual/en/function.unlink.php http://php.net/manual/en/function.unlink.php
[3] http://apiblog.youtube.com/2009/10/oembed-support.html http://apiblog.youtube.com/2009/10/oembed-support.html
[4] http://php.net/manual/en/function.json-decode.php http://php.net/manual/en/function.json-decode.php