15
15
16
16
global $ txt ;
17
17
18
- define ('BOARDDIR ' , dirname ( __FILE__ ) . '/.. ' );
18
+ define ('BOARDDIR ' , __DIR__ . '/.. ' );
19
19
define ('CACHEDIR ' , BOARDDIR . '/cache ' );
20
20
define ('ELK ' , '1 ' );
21
21
@@ -62,7 +62,7 @@ class ElkTestingSetup
62
62
*/
63
63
public function run_queries ()
64
64
{
65
- $ exists = array () ;
65
+ $ exists = [] ;
66
66
$ success = true ;
67
67
foreach ($ this ->_queries ['tables ' ] as $ table_method )
68
68
{
@@ -88,7 +88,7 @@ public function run_queries()
88
88
{
89
89
$ table_name = substr ($ insert_method , 6 );
90
90
91
- if (in_array ($ table_name , $ exists ))
91
+ if (in_array ($ table_name , $ exists, true ))
92
92
{
93
93
continue ;
94
94
}
@@ -135,14 +135,14 @@ public function load_queries($sql_file)
135
135
$ replaces ['{$ ' . $ key . '} ' ] = $ value ;
136
136
}
137
137
}
138
- $ replaces ['{$default_reserved_names} ' ] = strtr ($ replaces ['{$default_reserved_names} ' ], array ( '\\\\n ' => '\\n ' ) );
138
+ $ replaces ['{$default_reserved_names} ' ] = strtr ($ replaces ['{$default_reserved_names} ' ], [ '\\\\n ' => '\\n ' ] );
139
139
140
140
$ this ->_db ->skip_next_error ();
141
141
$ db_wrapper = new DbWrapper ($ this ->_db , $ replaces );
142
142
$ db_table_wrapper = new DbTableWrapper ($ this ->_db_table );
143
143
144
144
$ current_statement = '' ;
145
- $ exists = array () ;
145
+ $ exists = [] ;
146
146
147
147
require_once ($ sql_file );
148
148
@@ -162,7 +162,7 @@ public function load_queries($sql_file)
162
162
163
163
$ this ->_queries ['others ' ] = array_filter ($ methods , function ($ method )
164
164
{
165
- return substr ($ method , 0 , 2 ) !== ' __ ' && strpos ($ method , 'insert_ ' ) !== 0 && strpos ($ method , 'table_ ' ) !== 0 ;
165
+ return strpos ($ method , ' __ ' ) !== 0 && strpos ($ method , 'insert_ ' ) !== 0 && strpos ($ method , 'table_ ' ) !== 0 ;
166
166
});
167
167
}
168
168
@@ -270,25 +270,25 @@ public function update()
270
270
271
271
$ db ->insert ('' , '
272
272
{db_prefix}members ' ,
273
- array (
273
+ [
274
274
'member_name ' => 'string-25 ' , 'real_name ' => 'string-25 ' , 'passwd ' => 'string ' , 'email_address ' => 'string ' ,
275
275
'id_group ' => 'int ' , 'posts ' => 'int ' , 'date_registered ' => 'int ' , 'hide_email ' => 'int ' ,
276
276
'password_salt ' => 'string ' , 'lngfile ' => 'string ' , 'avatar ' => 'string ' ,
277
277
'member_ip ' => 'string ' , 'member_ip2 ' => 'string ' , 'buddy_list ' => 'string ' , 'pm_ignore_list ' => 'string ' ,
278
278
'message_labels ' => 'string ' , 'website_title ' => 'string ' , 'website_url ' => 'string ' ,
279
279
'signature ' => 'string ' , 'usertitle ' => 'string ' , 'secret_question ' => 'string ' ,
280
280
'additional_groups ' => 'string ' , 'ignore_boards ' => 'string ' ,
281
- ) ,
282
- array (
281
+ ] ,
282
+ [
283
283
'test_admin ' , 'test_admin ' , $ passwd , 'email@testadmin.tld ' ,
284
284
1 , 0 , time (), 0 ,
285
285
substr (md5 (mt_rand ()), 0 , 4 ), '' , '' ,
286
286
'123.123.123.123 ' , '123.123.123.123 ' , '' , '' ,
287
287
'' , '' , '' ,
288
288
'' , '' , '' ,
289
289
'' , '' ,
290
- ) ,
291
- array ( 'id_member ' )
290
+ ] ,
291
+ [ 'id_member ' ]
292
292
);
293
293
294
294
// The old Etc/GMT value is discouraged and does not work in some installs
@@ -298,13 +298,13 @@ public function update()
298
298
{
299
299
$ db ->insert ('' ,
300
300
$ db_prefix . 'settings ' ,
301
- array (
301
+ [
302
302
'variable ' => 'string-255 ' , 'value ' => 'string-65534 ' ,
303
- ) ,
304
- array (
303
+ ] ,
304
+ [
305
305
'default_timezone ' , $ timezone_id ,
306
- ) ,
307
- array ( 'variable ' )
306
+ ] ,
307
+ [ 'variable ' ]
308
308
);
309
309
}
310
310
}
@@ -314,7 +314,7 @@ class DbWrapper
314
314
{
315
315
protected $ db = null ;
316
316
protected $ count_mode = false ;
317
- protected $ replaces = array () ;
317
+ protected $ replaces = [] ;
318
318
319
319
public function __construct ($ db , $ replaces )
320
320
{
@@ -324,7 +324,7 @@ public function __construct($db, $replaces)
324
324
325
325
public function __call ($ name , $ args )
326
326
{
327
- return call_user_func_array (array ( $ this ->db , $ name) , $ args );
327
+ return call_user_func_array ([ $ this ->db , $ name] , $ args );
328
328
}
329
329
330
330
public function insert ()
@@ -344,9 +344,9 @@ public function insert()
344
344
}
345
345
}
346
346
347
- call_user_func_array (array ( $ this ->db , 'insert ' ) , $ args );
347
+ call_user_func_array ([ $ this ->db , 'insert ' ] , $ args );
348
348
349
- return $ this ->db ->affected_rows ();
349
+ // return $this->db->affected_rows();
350
350
}
351
351
352
352
public function countMode ($ on = true )
0 commit comments