@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | // Return path of sandbox directory for the given user. |
33 | 33 | // Create dir if not present. |
34 | 34 | // |
35 | -if (!function_exists("sandbox_dir")){ |
|
35 | +if (!function_exists("sandbox_dir")) { |
|
36 | 36 | function sandbox_dir($user) { |
37 | 37 | $dir = parse_config(get_config(), "<sandbox_dir>"); |
38 | 38 | if (!$dir) { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | foreach ($files as $file) { |
64 | 64 | $path = "$dir/$file"; |
65 | 65 | [$err, $file_size, $file_md5] = sandbox_parse_link_file($path); |
66 | - if (!$err){ |
|
66 | + if (!$err) { |
|
67 | 67 | if (strcmp($md5, $file_md5) == 0) { |
68 | 68 | $exist = true; |
69 | 69 | $elf = $file; |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | // TODO: this is a kludge. |
153 | 153 | // Should we use the job_file and batch_file_assoc tables instead? |
154 | 154 | // |
155 | -function sandbox_file_in_use($user, $file){ |
|
155 | +function sandbox_file_in_use($user, $file) { |
|
156 | 156 | $ufiles = array(); |
157 | 157 | |
158 | 158 | $pbatches = BoincBatch::enum( |
@@ -162,16 +162,16 @@ discard block |
||
162 | 162 | ); |
163 | 163 | if (!$pbatches) return false; |
164 | 164 | |
165 | - foreach ($pbatches as $batch){ |
|
165 | + foreach ($pbatches as $batch) { |
|
166 | 166 | $wus = BoincWorkUnit::enum("batch = $batch->id limit 1" ); |
167 | - if ($wus == null){ |
|
167 | + if ($wus == null) { |
|
168 | 168 | continue; |
169 | 169 | } |
170 | - foreach($wus as $wu){ |
|
170 | + foreach($wus as $wu) { |
|
171 | 171 | $x = "<in>".$wu->xml_doc."</in>"; |
172 | 172 | $x = simplexml_load_string($x); |
173 | 173 | global $fanout; |
174 | - foreach($x->workunit->file_ref as $fr){ |
|
174 | + foreach($x->workunit->file_ref as $fr) { |
|
175 | 175 | $pname = (string)$fr->file_name; |
176 | 176 | $ufiles[] = $pname; |
177 | 177 | } |
@@ -180,10 +180,10 @@ discard block |
||
180 | 180 | $dir = sandbox_dir($user); |
181 | 181 | $path = $dir."/".$file; |
182 | 182 | list($err, $size, $md5) = sandbox_parse_link_file($path); |
183 | - if (!$err){ |
|
183 | + if (!$err) { |
|
184 | 184 | $f = sandbox_file_name($user, $md5); |
185 | 185 | foreach($ufiles as $uf) { |
186 | - if (strcmp($f,$uf) == 0){ |
|
186 | + if (strcmp($f,$uf) == 0) { |
|
187 | 187 | return true; |
188 | 188 | } |
189 | 189 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | |
43 | 43 | // returns formatted data size |
44 | -function size_format($size){ |
|
44 | +function size_format($size) { |
|
45 | 45 | $retval = 0; |
46 | 46 | |
47 | 47 | $KB = 1024; |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | echo "<th>Avg. Size per Row</th>"; |
127 | 127 | echo "</tr>"; |
128 | 128 | |
129 | - for ($i = 0; $i < sizeof($db_rec)-1; $i++){ |
|
129 | + for ($i = 0; $i < sizeof($db_rec)-1; $i++) { |
|
130 | 130 | echo "<tr>"; |
131 | 131 | echo "<td align=left valign=top class=fieldname>" . $db_rec[$i]->name . "</td>"; |
132 | 132 | echo "<td align=left valign=top class=fieldname>" . size_format($db_rec[$i]->data_size) . "</td>"; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | } |
173 | 173 | if (empty($r)) $r=0; |
174 | 174 | |
175 | - for ($i=0; $i < sizeof($db_rec)-1; $i++){ |
|
175 | + for ($i=0; $i < sizeof($db_rec)-1; $i++) { |
|
176 | 176 | $file_details["name"] = $db_rec[$i]->name; |
177 | 177 | $file_details["data_size"] = $db_rec[$i]->data_size; |
178 | 178 | $file_details["index_size"] = $db_rec[$i]->index_size; |