Skip to content

Commit

Permalink
Fix "Constant INSTALL_PATH already defined" error
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Jun 24, 2022
1 parent 9c66c27 commit c4335e2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Roundcube/Composer/ExtensionInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ public function getInstallPath(PackageInterface $package)
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
{
// initialize Roundcube environment
define('INSTALL_PATH', getcwd() . '/');
if (!defined('INSTALL_PATH')) {
define('INSTALL_PATH', getcwd() . '/');
}
include_once(INSTALL_PATH . 'program/include/clisetup.php');

$this->rcubeVersionCheck($package);
Expand Down Expand Up @@ -115,7 +117,9 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
{
// initialize Roundcube environment
define('INSTALL_PATH', getcwd() . '/');
if (!defined('INSTALL_PATH')) {
define('INSTALL_PATH', getcwd() . '/');
}
include_once(INSTALL_PATH . 'program/include/clisetup.php');

$this->rcubeVersionCheck($target);
Expand Down Expand Up @@ -190,7 +194,9 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
{
// initialize Roundcube environment
define('INSTALL_PATH', getcwd() . '/');
if (!defined('INSTALL_PATH')) {
define('INSTALL_PATH', getcwd() . '/');
}
include_once(INSTALL_PATH . 'program/include/clisetup.php');

$self = $this;
Expand Down

0 comments on commit c4335e2

Please sign in to comment.