hicklemr / rtgui

Automatically exported from code.google.com/p/rtgui
0 stars 1 forks source link

Suppress certain warnings #50

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Not sure if this is actually a good idea or not in the long run, but here
are a few changes I'm using.

Firstly, suppress the file_get_contents warning in functions.php, line 11:

   if ($file = file_get_contents($rpc_connect, false, $context)) {

..becomes..

   if ($file = @file_get_contents($rpc_connect, false, $context)) {

Secondly, suppress the warning when $downloaddir is not set in
function.php, line 239.  It may be better to do a proper if(isset(...))
like used below, but I'm not sure it makes all that much difference in the
long run.

   $retarr[0]['diskspace']=disk_free_space($downloaddir);

..becomes..

   $retarr[0]['diskspace']=@disk_free_space($downloaddir);

Finally, don't display unless $downloadir is set; index.php, lines 68-71:

echo "<p>\n";

echo "&nbsp;&nbsp;&nbsp;Disk Free: <span class='inline'
id='glob_diskfree'>".format_bytes($rates[0]['diskspace'])."</span> /
".format_bytes(disk_total_space($downloaddir))."
(".(round($rates[0]['diskspace']/disk_total_space($downloaddir)*100))."%)\n";
echo "</p>\n";

..become..

if (isset($downloaddir)) {
   echo "<p>\n";
   echo "&nbsp;&nbsp;&nbsp;Disk Free: <span class='inline'
id='glob_diskfree'>".format_bytes($rates[0]['diskspace'])."</span> /
".format_bytes(disk_total_space($downloaddir))."
(".(round($rates[0]['diskspace']/disk_total_space($downloaddir)*100))."%)\n";
   echo "</p>\n";
}

Original issue reported on code.google.com by llamaXxX@gmail.com on 22 Sep 2008 at 4:46

GoogleCodeExporter commented 8 years ago
Yup - all cool, I'll go with all these changes.

I like things to be cleaner output and less-mandatory.

Cheers Llama
-Simon

Original comment by lemonbe...@gmail.com on 23 Sep 2008 at 8:07

GoogleCodeExporter commented 8 years ago
Fixed in 0.2.6

Original comment by lemonbe...@gmail.com on 5 Dec 2008 at 10:25