* enforced v7.1 compliance, preparations for v7.2
 * removed deprecated usage of each()
 * prefer array deconstruction via [] instead of calling list()
 * try to catch failed session_start()
 * prefer ... - Token instead of calling func_get_args() func_num_args()
 * enforce return types in AjaxHandler
 * revision push
This commit is contained in:
Sarjuuk
2018-11-27 00:43:32 +01:00
parent f8a34aa98e
commit d9cd24026c
46 changed files with 299 additions and 342 deletions

View File

@@ -27,7 +27,7 @@ function build($syncMe = null)
CLI::write();
// files with template
foreach (FileGen::$tplFiles as $name => list($file, $destPath, $deps))
foreach (FileGen::$tplFiles as $name => [$file, $destPath, $deps])
{
$reqDBC = [];

View File

@@ -30,7 +30,7 @@ function dbconfig()
$port = 0;
if (strstr($dbInfo['host'], ':'))
list($dbInfo['host'], $port) = explode(':', $dbInfo['host']);
[$dbInfo['host'], $port] = explode(':', $dbInfo['host']);
if ($dbInfo['host'])
{

View File

@@ -127,7 +127,7 @@ function firstrun()
$port = 0;
if (strstr($AoWoWconf[$what]['host'], ':'))
list($AoWoWconf[$what]['host'], $port) = explode(':', $AoWoWconf[$what]['host']);
[$AoWoWconf[$what]['host'], $port] = explode(':', $AoWoWconf[$what]['host']);
if ($link = @mysqli_connect($AoWoWconf[$what]['host'], $AoWoWconf[$what]['user'], $AoWoWconf[$what]['pass'], $AoWoWconf[$what]['db'], $port ?: $defPort))
mysqli_close($link);
@@ -175,7 +175,7 @@ function firstrun()
'static_host' => [$prot, $res['static_host'], '/css/aowow.css']
);
foreach ($cases as $conf => list($protocol, $host, $testFile))
foreach ($cases as $conf => [$protocol, $host, $testFile])
{
if ($host)
{

View File

@@ -13,7 +13,7 @@ if (!CLI)
function update()
{
list($date, $part) = array_values(DB::Aowow()->selectRow('SELECT `date`, `part` FROM ?_dbversion'));
[$date, $part] = array_values(DB::Aowow()->selectRow('SELECT `date`, `part` FROM ?_dbversion'));
CLI::write('checking sql updates');
@@ -21,7 +21,7 @@ function update()
foreach (glob('setup/updates/*.sql') as $file)
{
$pi = pathinfo($file);
list($fDate, $fPart) = explode('_', $pi['filename']);
[$fDate, $fPart] = explode('_', $pi['filename']);
$fData = intVal($fDate);
@@ -59,7 +59,7 @@ function update()
CLI::write($nFiles ? 'applied '.$nFiles.' update(s)' : 'db is already up to date', CLI::LOG_OK);
// fetch sql/build after applying updates, as they may contain sync-prompts
list($sql, $build) = array_values(DB::Aowow()->selectRow('SELECT `sql`, `build` FROM ?_dbversion'));
[$sql, $build] = array_values(DB::Aowow()->selectRow('SELECT `sql`, `build` FROM ?_dbversion'));
sleep(1);