@@ -79,7 +79,7 @@ |
||
79 | 79 | if ($first) { |
80 | 80 | $first = false; |
81 | 81 | echo "<p>"; |
82 | - echo forum_title($category, NULL, NULL); |
|
82 | + echo forum_title($category, null, null); |
|
83 | 83 | echo "<p>"; |
84 | 84 | show_mark_as_read_button($user); |
85 | 85 | start_table('table-striped'); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | project_forum_index_intro(); |
70 | 70 | } |
71 | 71 | |
72 | - if (defined('FORUM_QA_MERGED_MODE') && FORUM_QA_MERGED_MODE){ |
|
72 | + if (defined('FORUM_QA_MERGED_MODE') && FORUM_QA_MERGED_MODE) { |
|
73 | 73 | $categories = BoincCategory::enum("true order by orderID"); |
74 | 74 | } else { |
75 | 75 | echo "<p>" |
@@ -210,5 +210,5 @@ discard block |
||
210 | 210 | } else { |
211 | 211 | main($user); |
212 | 212 | } |
213 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
213 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
214 | 214 | ?> |
@@ -69,7 +69,7 @@ |
||
69 | 69 | project_forum_index_intro(); |
70 | 70 | } |
71 | 71 | |
72 | - if (defined('FORUM_QA_MERGED_MODE') && FORUM_QA_MERGED_MODE){ |
|
72 | + if (defined('FORUM_QA_MERGED_MODE') && FORUM_QA_MERGED_MODE) { |
|
73 | 73 | $categories = BoincCategory::enum("true order by orderID"); |
74 | 74 | } else { |
75 | 75 | echo "<p>" |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | start_table('table-striped'); |
28 | 28 | |
29 | 29 | $x = ['User']; |
30 | - for ($i=0; $i<S_NFLAGS; $i++) { |
|
30 | + for ($i = 0; $i < S_NFLAGS; $i++) { |
|
31 | 31 | $x[] = $special_user_bitfield[$i]; |
32 | 32 | } |
33 | 33 | $x[] = ''; |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | $pref->userid |
43 | 43 | ); |
44 | 44 | $x = ["$user->name ($user->id)"]; |
45 | - for ($j=0; $j<S_NFLAGS; $j++) { |
|
45 | + for ($j = 0; $j < S_NFLAGS; $j++) { |
|
46 | 46 | $bit = substr($pref->special_user, $j, 1); |
47 | - $c = ($bit == 1)?"checked":""; |
|
47 | + $c = ($bit == 1) ? "checked" : ""; |
|
48 | 48 | $x[] = sprintf( |
49 | 49 | '<input type="checkbox" name="role%d" value="1" %s>', |
50 | 50 | $j, $c |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | echo '<form action="user_permissions.php" method="POST">'; |
59 | 59 | $x = ['Add User ID: <input type="text" name="userid" size="6">']; |
60 | - for ($j=0; $j<S_NFLAGS; $j++) { |
|
60 | + for ($j = 0; $j < S_NFLAGS; $j++) { |
|
61 | 61 | $x[] = sprintf( |
62 | 62 | '<input type="checkbox" name="role%d" value="1">', |
63 | 63 | $j |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | if (!$user) error_page('no user'); |
78 | 78 | BoincForumPrefs::lookup($user); |
79 | 79 | |
80 | - for ($i=0; $i<S_NFLAGS; $i++) { |
|
80 | + for ($i = 0; $i < S_NFLAGS; $i++) { |
|
81 | 81 | if (post_int("role$i", true) == 1) { |
82 | 82 | $bitset .= '1'; |
83 | 83 | echo "<br> setting $i"; |
@@ -103,5 +103,5 @@ discard block |
||
103 | 103 | user_permissions_form(); |
104 | 104 | } |
105 | 105 | |
106 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
106 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
107 | 107 | ?> |
@@ -7,7 +7,7 @@ |
||
7 | 7 | // add other criteria like # of countries (based on IP addr) |
8 | 8 | // consider only hosts with recent last RPC time |
9 | 9 | |
10 | -define ('MAX_HOSTS', 100); |
|
10 | +define('MAX_HOSTS', 100); |
|
11 | 11 | |
12 | 12 | require_once('../inc/boinc_db.inc'); |
13 | 13 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $parent_post_id = 0; |
57 | 57 | } |
58 | 58 | |
59 | -if ($filter != "false"){ |
|
59 | +if ($filter != "false") { |
|
60 | 60 | $filter = true; |
61 | 61 | } else { |
62 | 62 | $filter = false; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | $warning = null; |
74 | -if ($content && (!$preview)){ |
|
74 | +if ($content && (!$preview)) { |
|
75 | 75 | check_tokens($logged_in_user->authenticator); |
76 | 76 | if (!akismet_check($logged_in_user, $content)) { |
77 | 77 | $warning = tra("Your post has been flagged as spam by the Akismet anti-spam system. Please modify your text and try again."); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
96 | -page_head(tra("Post to thread")." '$thread->title'",'','','', $bbcode_js); |
|
96 | +page_head(tra("Post to thread")." '$thread->title'", '', '', '', $bbcode_js); |
|
97 | 97 | |
98 | 98 | if ($parent_post) { |
99 | 99 | echo sprintf( |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $x2 .= " method=\"post\" name=\"post\" onsubmit=\"return checkForm(this)\">\n"; |
162 | 162 | $x2 .= form_tokens($logged_in_user->authenticator); |
163 | 163 | $x2 .= $bbcode_html."<textarea class=\"form-control\" name=\"content\" rows=\"18\">"; |
164 | - $no_quote = get_int("no_quote", true)==1; |
|
164 | + $no_quote = get_int("no_quote", true) == 1; |
|
165 | 165 | if ($preview) { |
166 | 166 | $x2 .= htmlspecialchars($content); |
167 | 167 | } else if (!$no_quote) { |
@@ -170,9 +170,9 @@ discard block |
||
170 | 170 | } |
171 | 171 | } |
172 | 172 | if (!$logged_in_user->prefs->no_signature_by_default) { |
173 | - $enable_signature='checked="true"'; |
|
173 | + $enable_signature = 'checked="true"'; |
|
174 | 174 | } else { |
175 | - $enable_signature=""; |
|
175 | + $enable_signature = ""; |
|
176 | 176 | } |
177 | 177 | $x2 .= sprintf('</textarea><p> </p> |
178 | 178 | <input class="btn btn-sm" %s type="submit" name="preview" value="%s"> |
@@ -200,11 +200,11 @@ discard block |
||
200 | 200 | return sprintf( |
201 | 201 | 'In reply to %s\'s message of %s: |
202 | 202 | [quote]%s[/quote]', |
203 | - $user?$user->name:'unknown user', |
|
203 | + $user ? $user->name : 'unknown user', |
|
204 | 204 | date_str($post->timestamp), |
205 | 205 | htmlspecialchars($post->content) |
206 | 206 | ); |
207 | 207 | } |
208 | 208 | |
209 | -$cvs_version_tracker[]="\$Id$"; |
|
209 | +$cvs_version_tracker[] = "\$Id$"; |
|
210 | 210 | ?> |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $parent_post_id = 0; |
57 | 57 | } |
58 | 58 | |
59 | -if ($filter != "false"){ |
|
59 | +if ($filter != "false") { |
|
60 | 60 | $filter = true; |
61 | 61 | } else { |
62 | 62 | $filter = false; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | $warning = null; |
74 | -if ($content && (!$preview)){ |
|
74 | +if ($content && (!$preview)) { |
|
75 | 75 | check_tokens($logged_in_user->authenticator); |
76 | 76 | if (!akismet_check($logged_in_user, $content)) { |
77 | 77 | $warning = tra("Your post has been flagged as spam by the Akismet anti-spam system. Please modify your text and try again."); |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | $preview = post_str("preview", true); |
57 | 57 | $warning = null; |
58 | 58 | |
59 | -if ($content && $title && (!$preview)){ |
|
59 | +if ($content && $title && (!$preview)) { |
|
60 | 60 | if (post_str('add_signature', true)) { |
61 | - $add_signature = true; // set a flag and concatenate later |
|
62 | - } else { |
|
61 | + $add_signature = true; // set a flag and concatenate later |
|
62 | + } else { |
|
63 | 63 | $add_signature = false; |
64 | 64 | } |
65 | 65 | check_tokens($logged_in_user->authenticator); |
@@ -74,14 +74,14 @@ discard block |
||
74 | 74 | if (post_str('subscribe', true)) { |
75 | 75 | BoincSubscription::replace($logged_in_user->id, $thread->id); |
76 | 76 | } |
77 | - header('Location: forum_thread.php?id=' . $thread->id); |
|
77 | + header('Location: forum_thread.php?id='.$thread->id); |
|
78 | 78 | } else { |
79 | 79 | error_page("Can't create thread. $forum_error"); |
80 | 80 | } |
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
84 | -page_head(tra("Create new thread"),'','','', $bbcode_js); |
|
84 | +page_head(tra("Create new thread"), '', '', '', $bbcode_js); |
|
85 | 85 | show_forum_header($logged_in_user); |
86 | 86 | |
87 | 87 | if ($warning) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $submit_help = "<br /><font color=\"red\">".tra("Remember to add a title")."</font>"; |
123 | 123 | } |
124 | 124 | |
125 | -if ($force_title && $title){ |
|
125 | +if ($force_title && $title) { |
|
126 | 126 | row2( |
127 | 127 | tra("Title"), |
128 | 128 | sprintf( |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | row2( |
137 | 137 | tra("Title").$submit_help, |
138 | 138 | sprintf('<input type="text" class="form-control" name="title" value="%s">', |
139 | - $title?htmlspecialchars($title):'' |
|
139 | + $title ?htmlspecialchars($title) : '' |
|
140 | 140 | ), |
141 | 141 | null, FORUM_LH_PCT |
142 | 142 | ); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | sprintf( |
148 | 148 | '%s <textarea class="form-control" name="content" rows="12" cols="80">%s</textarea>', |
149 | 149 | $bbcode_html, |
150 | - $content?htmlspecialchars($content):'' |
|
150 | + $content ?htmlspecialchars($content) : '' |
|
151 | 151 | ), |
152 | 152 | null, FORUM_LH_PCT |
153 | 153 | ); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | if (!$logged_in_user->prefs->no_signature_by_default) { |
156 | 156 | $enable_signature = 'checked="true"'; |
157 | 157 | } else { |
158 | - $enable_signature=''; |
|
158 | + $enable_signature = ''; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | if (is_news_forum($forum)) { |
@@ -195,5 +195,5 @@ discard block |
||
195 | 195 | |
196 | 196 | page_tail(); |
197 | 197 | |
198 | -$cvs_version_tracker[]="\$Id$"; |
|
198 | +$cvs_version_tracker[] = "\$Id$"; |
|
199 | 199 | ?> |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | $preview = post_str("preview", true); |
57 | 57 | $warning = null; |
58 | 58 | |
59 | -if ($content && $title && (!$preview)){ |
|
59 | +if ($content && $title && (!$preview)) { |
|
60 | 60 | if (post_str('add_signature', true)) { |
61 | 61 | $add_signature = true; // set a flag and concatenate later |
62 | - } else { |
|
62 | + } else { |
|
63 | 63 | $add_signature = false; |
64 | 64 | } |
65 | 65 | check_tokens($logged_in_user->authenticator); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $submit_help = "<br /><font color=\"red\">".tra("Remember to add a title")."</font>"; |
123 | 123 | } |
124 | 124 | |
125 | -if ($force_title && $title){ |
|
125 | +if ($force_title && $title) { |
|
126 | 126 | row2( |
127 | 127 | tra("Title"), |
128 | 128 | sprintf( |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | return $x; |
52 | 52 | } |
53 | 53 | |
54 | -function pm_team_form($user, $teamid, $error=null) { |
|
54 | +function pm_team_form($user, $teamid, $error = null) { |
|
55 | 55 | global $bbcode_html, $bbcode_js; |
56 | 56 | $team = BoincTeam::lookup_id($teamid); |
57 | 57 | if (!$team) { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | error_page("not admin"); |
62 | 62 | } |
63 | 63 | |
64 | - page_head(tra("Send message to team"),'','','', $bbcode_js); |
|
64 | + page_head(tra("Send message to team"), '', '', '', $bbcode_js); |
|
65 | 65 | |
66 | 66 | $subject = post_str("subject", true); |
67 | 67 | $content = post_str("content", true); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | function pm_form_page($replyto, $userid, $error = null) { |
114 | 114 | global $bbcode_html, $bbcode_js; |
115 | 115 | global $g_logged_in_user; |
116 | - page_head(tra("Send private message"),'','','', $bbcode_js); |
|
116 | + page_head(tra("Send private message"), '', '', '', $bbcode_js); |
|
117 | 117 | |
118 | 118 | if (post_str("preview", true) == tra("Preview")) { |
119 | 119 | $content = post_str("content", true); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | if (!$user) { |
138 | 138 | error_page("Sender no longer exists"); |
139 | 139 | } |
140 | - $writeto = UNIQUE_USER_NAME?$user->name:$userid." (".$user->name.")"; |
|
140 | + $writeto = UNIQUE_USER_NAME ? $user->name : $userid." (".$user->name.")"; |
|
141 | 141 | $subject = $message->subject; |
142 | 142 | if (substr($subject, 0, 3) != "re:") { |
143 | 143 | $subject = "re: ".$subject; |
@@ -147,15 +147,15 @@ discard block |
||
147 | 147 | if (!$user) { |
148 | 148 | error_page("Sender no longer exists"); |
149 | 149 | } |
150 | - $writeto = UNIQUE_USER_NAME?$user->name:$userid." (".$user->name.")"; |
|
150 | + $writeto = UNIQUE_USER_NAME ? $user->name : $userid." (".$user->name.")"; |
|
151 | 151 | } else { |
152 | 152 | $writeto = sanitize_tags(post_str("to", true)); |
153 | 153 | $subject = post_str("subject", true); |
154 | 154 | $content = post_str("content", true); |
155 | 155 | } |
156 | 156 | |
157 | - $content = $content?htmlspecialchars($content):''; |
|
158 | - $subject = $subject?htmlspecialchars($subject):''; |
|
157 | + $content = $content ?htmlspecialchars($content) : ''; |
|
158 | + $subject = $subject ?htmlspecialchars($subject) : ''; |
|
159 | 159 | |
160 | 160 | if ($error != null) { |
161 | 161 | echo "<p class=\"text-danger\">".$error."</p>\n"; |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | function send_pm_notification_email( |
212 | 212 | $logged_in_user, $to_user, $subject, $content |
213 | 213 | ) { |
214 | - $message = " |
|
214 | + $message = " |
|
215 | 215 | You have received a new private message at ".PROJECT.". |
216 | 216 | |
217 | 217 | From: $logged_in_user->name (ID $logged_in_user->id) |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | $pm = BoincPrivateMessage::lookup_id($notify->opaque); |
242 | 242 | $from_user = BoincUser::lookup_id($pm->senderid); |
243 | 243 | if (!$pm || !$from_user) return null; |
244 | - return "<a href=pm.php>".tra("Private message%1 from %2, subject:" , "</a>", $from_user->name )." $pm->subject"; |
|
244 | + return "<a href=pm.php>".tra("Private message%1 from %2, subject:", "</a>", $from_user->name)." $pm->subject"; |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | function pm_send_msg($from_user, $to_user, $subject, $content, $send_email) { |
@@ -305,11 +305,11 @@ discard block |
||
305 | 305 | |
306 | 306 | function pm_email_remind($user) { |
307 | 307 | if (!$user->prefs->pm_notification) { |
308 | - return "<br><small>" . |
|
308 | + return "<br><small>". |
|
309 | 309 | tra( |
310 | 310 | "For email notification, %1 edit community prefs %2", |
311 | 311 | '<a href="edit_forum_preferences_form.php">', '</a>' |
312 | - ) . |
|
312 | + ). |
|
313 | 313 | "</small>" |
314 | 314 | ; |
315 | 315 | } |
@@ -335,5 +335,5 @@ discard block |
||
335 | 335 | } |
336 | 336 | } |
337 | 337 | |
338 | -$cvs_version_tracker[]="\$Id: pm.inc 14019 2007-11-01 23:04:39Z davea $"; |
|
338 | +$cvs_version_tracker[] = "\$Id: pm.inc 14019 2007-11-01 23:04:39Z davea $"; |
|
339 | 339 | ?> |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | if ($n === false) return ''; |
34 | 34 | $m = strpos($p, ']', $n); |
35 | 35 | if ($m === false) return ''; |
36 | - $x = substr($p, $n+5, $m-$n-5); |
|
36 | + $x = substr($p, $n + 5, $m - $n - 5); |
|
37 | 37 | |
38 | 38 | $n = strpos($x, ' '); |
39 | 39 | if ($n !== false) return substr($x, 0, $n); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | if ($n === false) return ''; |
48 | 48 | $m = strpos($p, ']', $n); |
49 | 49 | if ($m === false) return ''; |
50 | - $x = substr($p, $n+5, $m-$n-5); |
|
50 | + $x = substr($p, $n + 5, $m - $n - 5); |
|
51 | 51 | $n = strpos($x, '_'); |
52 | 52 | if ($n !== false) return substr($x, 0, $n); |
53 | 53 | $n = strpos($x, 'r'); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | function main() { |
59 | 59 | global $max_days; |
60 | - $t = time()-$max_days*86400; |
|
60 | + $t = time() - $max_days*86400; |
|
61 | 61 | $hosts = BoincHost::enum("rpc_time>$t"); |
62 | 62 | $descs = []; |
63 | 63 | foreach ($hosts as $host) { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | // show list of BUDA apps and variants, |
33 | 33 | // w/ buttons for adding and deleting |
34 | 34 | // |
35 | -function app_list($notice=null) { |
|
35 | +function app_list($notice = null) { |
|
36 | 36 | global $buda_root; |
37 | 37 | if (!is_dir($buda_root)) { |
38 | 38 | mkdir($buda_root); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $dir = "$buda_root/$app/$variant"; |
103 | 103 | start_table(); |
104 | 104 | table_header('name', 'size', 'md5'); |
105 | - foreach(scandir($dir) as $f) { |
|
105 | + foreach (scandir($dir) as $f) { |
|
106 | 106 | if ($f[0] == '.') continue; |
107 | 107 | [$md5, $size] = parse_info_file("$dir/.md5/$f"); |
108 | 108 | table_row( |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | if (!is_valid_filename($app)) die('bad arg'); |
93 | 93 | $variant = get_str('variant'); |
94 | 94 | if (!is_valid_filename($variant)) die('bad arg'); |
95 | - page_head("App $app variant $variant"); |
|
95 | + page_head("app $app variant $variant"); |
|
96 | 96 | $dir = "$buda_root/$app/$variant"; |
97 | 97 | start_table(); |
98 | 98 | table_header('name', 'size', 'md5'); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | form_input_hidden('app', $app); |
137 | 137 | form_input_hidden('action', 'variant_action'); |
138 | 138 | form_input_text('Plan class', 'variant'); |
139 | - form_select("Dockerfile$sb", 'dockerfile', $sbitems); |
|
139 | + form_select("dockerfile$sb", 'dockerfile', $sbitems); |
|
140 | 140 | form_select_multiple("Application files$sb", 'app_files', $sbitems); |
141 | 141 | form_input_text( |
142 | 142 | 'Input file names<br><small>Space-separated</small>', |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | // Note: we don't currently allow indirect file access. |
223 | 223 | // If we did, we'd need to create job.toml to mount project dir |
224 | 224 | |
225 | - app_list("Variant $variant added for app $app."); |
|
225 | + app_list("variant $variant added for app $app."); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | function variant_delete() { |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | if ($ret) { |
250 | 250 | error_page("delete failed"); |
251 | 251 | } |
252 | - $notice = "Variant $variant of app $app removed."; |
|
252 | + $notice = "variant $variant of app $app removed."; |
|
253 | 253 | app_list($notice); |
254 | 254 | } else { |
255 | 255 | page_head("Confirm"); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | if ($ret) { |
279 | 279 | error_page('delete failed'); |
280 | 280 | } |
281 | - $notice = "App $app removed."; |
|
281 | + $notice = "app $app removed."; |
|
282 | 282 | app_list($notice); |
283 | 283 | } else { |
284 | 284 | page_head('Confirm'); |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | if (!is_valid_filename($name)) die("bad arg: $name"); |
308 | 308 | $dir = "$buda_root/$name"; |
309 | 309 | if (file_exists($dir)) { |
310 | - error_page("App $name already exists."); |
|
310 | + error_page("app $name already exists."); |
|
311 | 311 | } |
312 | 312 | mkdir($dir); |
313 | 313 | header("Location: buda.php"); |
@@ -22,12 +22,12 @@ discard block |
||
22 | 22 | // Intended to be subclassed (e.g., BoincDb, BossaDb) |
23 | 23 | // |
24 | 24 | class DbConn { |
25 | - var $db_conn; // a mysqli object |
|
26 | - var $db_name; // the DB name |
|
25 | + var $db_conn; // a mysqli object |
|
26 | + var $db_name; // the DB name |
|
27 | 27 | |
28 | 28 | function init_conn($user, $passwd, $host, $name) { |
29 | 29 | $x = explode(":", $host); |
30 | - if (sizeof($x)>1) { |
|
30 | + if (sizeof($x) > 1) { |
|
31 | 31 | $host = $x[0]; |
32 | 32 | $port = $x[1]; |
33 | 33 | } else { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | try { |
37 | 37 | $this->db_conn = @new mysqli($host, $user, $passwd, $name, $port); |
38 | - } catch(Exception $e) { |
|
38 | + } catch (Exception $e) { |
|
39 | 39 | return false; |
40 | 40 | } |
41 | 41 | if (mysqli_connect_error()) { |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | return $this->enum_general($classname, $query); |
137 | 137 | } |
138 | 138 | |
139 | - function enum($table, $classname, $where_clause=null, $order_clause=null) { |
|
139 | + function enum($table, $classname, $where_clause = null, $order_clause = null) { |
|
140 | 140 | return self::enum_fields( |
141 | 141 | $table, $classname, '*', $where_clause, $order_clause |
142 | 142 | ); |
@@ -181,15 +181,15 @@ discard block |
||
181 | 181 | if ($x) return (double)$x->$field; |
182 | 182 | return false; |
183 | 183 | } |
184 | - function count($table, $clause="TRUE") { |
|
184 | + function count($table, $clause = "TRUE") { |
|
185 | 185 | $query = "select count(*) as total from DBNAME.$table where $clause"; |
186 | 186 | return $this->get_int($query, 'total'); |
187 | 187 | } |
188 | - function sum($table, $field, $clause="") { |
|
188 | + function sum($table, $field, $clause = "") { |
|
189 | 189 | $query = "select sum($field) as total from DBNAME.$table $clause"; |
190 | 190 | return $this->get_double($query, 'total'); |
191 | 191 | } |
192 | - function max($table, $field, $clause="") { |
|
192 | + function max($table, $field, $clause = "") { |
|
193 | 193 | $query = "select max($field) as total from DBNAME.$table $clause"; |
194 | 194 | return $this->get_double($query, 'total'); |
195 | 195 | } |