Improved structure
parent
4e1b1c0811
commit
4faef126ff
|
@ -1074,21 +1074,18 @@ class DBStructure
|
||||||
*/
|
*/
|
||||||
private static function isUpdating()
|
private static function isUpdating()
|
||||||
{
|
{
|
||||||
$processes = DBA::select(['information_schema' => 'processlist'],
|
|
||||||
['command', 'info'], ['db' => DBA::databaseName()]);
|
|
||||||
|
|
||||||
$isUpdate = false;
|
$isUpdate = false;
|
||||||
|
|
||||||
|
$processes = DBA::select(['information_schema' => 'processlist'], ['info'],
|
||||||
|
['db' => DBA::databaseName(), 'command' => ['Query', 'Execute']]);
|
||||||
|
|
||||||
while ($process = DBA::fetch($processes)) {
|
while ($process = DBA::fetch($processes)) {
|
||||||
if (empty($process['info'])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$parts = explode(' ', $process['info']);
|
$parts = explode(' ', $process['info']);
|
||||||
$command = strtolower(array_shift($parts));
|
if (strtolower(array_shift($parts)) == 'alter') {
|
||||||
if ($command == 'alter') {
|
|
||||||
$isUpdate = true;
|
$isUpdate = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DBA::close($processes);
|
DBA::close($processes);
|
||||||
|
|
||||||
return $isUpdate;
|
return $isUpdate;
|
||||||
|
|
Loading…
Reference in New Issue