Skip to content

Commit

Permalink
Optionally disable database initialization/update using environment v…
Browse files Browse the repository at this point in the history
…ariables (#40)
  • Loading branch information
alecpl committed Jan 22, 2025
1 parent d76570f commit c4db5c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ExtensionInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa
}

// initialize database schema
if (!empty($extra['roundcube']['sql-dir'])) {
if (!empty($extra['roundcube']['sql-dir']) && !getenv('SKIP_DB_INIT')) {
if ($sqldir = realpath($package_dir . \DIRECTORY_SEPARATOR . $extra['roundcube']['sql-dir'])) {
$this->io->write("<info>Running database initialization script for {$package_name}</info>");

Expand Down Expand Up @@ -197,7 +197,7 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini
$fs->remove($temp_dir);

// update database schema
if (!empty($extra['roundcube']['sql-dir'])) {
if (!empty($extra['roundcube']['sql-dir']) && !getenv('SKIP_DB_UPDATE')) {
if ($sqldir = realpath($package_dir . \DIRECTORY_SEPARATOR . $extra['roundcube']['sql-dir'])) {
$this->io->write("<info>Updating database schema for {$package_name}</info>");

Expand Down

0 comments on commit c4db5c9

Please sign in to comment.