$this->adapter->
initializeShopwareDb($connection);
$coreMigrations->
sync();
} // use 7 s as max execution time, so the UI stays responsive
$maxExecutionTime =
min(\
ini_get('max_execution_time'
), 7
);
$startTime =
microtime(true
);
$executedMigrations =
$offset;
$stopped = false;
while (iterator_count($coreMigrations->
migrateInSteps(null, 1
)) === 1
) { $runningSince =
microtime(true
) -
$startTime;
++
$executedMigrations;
// if there are more than 5 seconds execution time left, we execute more migrations in this request, otherwise we return the result
// on first request only execute one migration, otherwise the UI will feel unresponsive
if ($runningSince + 5 >
$maxExecutionTime ||
$executedMigrations === 1
) { $stopped = true;
break;
} }