createConnector($config); $connector->connect($config); $this->info('Database ready.'); return Command::SUCCESS; } catch (SQLiteDatabaseDoesNotExistException $e) { touch($e->path); chown($e->path, 'www-data'); chgrp($e->path, 'www-data'); } catch (\Exception $e) { $this->warn('Waiting for database to be ready…'); sleep(1); } finally { $maxAttempts--; } } while ($maxAttempts > 0); $this->error('Unable to contact your database.'); return Command::FAILURE; } }