Permalink
Browse files

Get extras before accessing them

  • Loading branch information...
thomascube committed Sep 15, 2014
1 parent f655d77 commit 08720b0c4a0e5fc443bf453ca7743d5efff5f6c4
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/Roundcube/Composer/PluginInstaller.php
@@ -45,6 +45,7 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa
// post-install: activate plugin in Roundcube config
$config_file = $this->rcubeConfigFile();
$extra = $package->getExtra();
if (is_writeable($config_file) && php_sapi_name() == 'cli') {
$plugin_name = $this->getPluginName($package);
@@ -62,7 +63,6 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa
}
// run post-install script
$extra = $package->getExtra();
if (!empty($extra['roundcube']['post-install-script'])) {
$this->rcubeRunScript($extra['roundcube']['post-install-script'], $package);
}
@@ -76,6 +76,8 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini
$this->rcubeVersionCheck($target);
parent::update($repo, $initial, $target);
$extra = $target->getExtra();
// trigger updatedb.sh
if (!empty($extra['roundcube']['sql-dir'])) {
$plugin_name = $this->getPluginName($target);
@@ -85,7 +87,6 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini
}
// run post-update script
$extra = $target->getExtra();
if (!empty($extra['roundcube']['post-update-script'])) {
$this->rcubeRunScript($extra['roundcube']['post-update-script'], $target);
}

0 comments on commit 08720b0

Please sign in to comment.