@@ -73,10 +73,11 @@ private function initializeRoundcubemailEnvironment(): void
73
73
public function install (InstalledRepositoryInterface $ repo , PackageInterface $ package )
74
74
{
75
75
$ this ->setRoundcubemailInstallPath ($ repo );
76
- $ this ->initializeRoundcubemailEnvironment ();
77
- $ this ->rcubeVersionCheck ($ package );
78
76
79
77
$ postInstall = function () use ($ package ) {
78
+ $ this ->initializeRoundcubemailEnvironment ();
79
+ $ this ->rcubeVersionCheck ($ package );
80
+
80
81
$ config_file = $ this ->rcubeConfigFile ();
81
82
$ package_name = $ this ->getPackageName ($ package );
82
83
$ package_dir = $ this ->getInstallPath ($ package );
@@ -139,20 +140,21 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa
139
140
public function update (InstalledRepositoryInterface $ repo , PackageInterface $ initial , PackageInterface $ target )
140
141
{
141
142
$ this ->setRoundcubemailInstallPath ($ repo );
142
- $ this ->initializeRoundcubemailEnvironment ();
143
- $ this ->rcubeVersionCheck ($ target );
144
143
145
- $ extra = $ target ->getExtra ();
146
- $ fs = new Filesystem ();
144
+ $ postUpdate = function () use ($ initial , $ target ) {
145
+ $ this ->initializeRoundcubemailEnvironment ();
146
+ $ this ->rcubeVersionCheck ($ target );
147
+
148
+ $ extra = $ target ->getExtra ();
149
+ $ fs = new Filesystem ();
147
150
148
- // backup persistent files e.g. config.inc.php
149
- $ package_dir = $ this ->getInstallPath ($ initial );
150
- $ temp_dir = $ package_dir . '- ' . sprintf ('%010d%010d ' , mt_rand (), mt_rand ());
151
+ // backup persistent files e.g. config.inc.php
152
+ $ package_dir = $ this ->getInstallPath ($ initial );
153
+ $ temp_dir = $ package_dir . '- ' . sprintf ('%010d%010d ' , mt_rand (), mt_rand ());
151
154
152
- // make a backup of existing files (for restoring persistent files)
153
- $ fs ->copy ($ package_dir , $ temp_dir );
155
+ // make a backup of existing files (for restoring persistent files)
156
+ $ fs ->copy ($ package_dir , $ temp_dir );
154
157
155
- $ postUpdate = function () use ($ target , $ extra , $ fs , $ temp_dir ) {
156
158
$ package_name = $ this ->getPackageName ($ target );
157
159
$ package_dir = $ this ->getInstallPath ($ target );
158
160
@@ -209,11 +211,12 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini
209
211
public function uninstall (InstalledRepositoryInterface $ repo , PackageInterface $ package )
210
212
{
211
213
$ this ->setRoundcubemailInstallPath ($ repo );
212
- $ this ->initializeRoundcubemailEnvironment ();
213
214
214
- $ config = $ this ->composer ->getConfig ()->get ('roundcube ' );
215
+ $ postUninstall = function () use ($ package ) {
216
+ $ this ->initializeRoundcubemailEnvironment ();
217
+
218
+ $ config = $ this ->composer ->getConfig ()->get ('roundcube ' );
215
219
216
- $ postUninstall = function () use ($ package , $ config ) {
217
220
// post-uninstall: deactivate package
218
221
$ package_name = $ this ->getPackageName ($ package );
219
222
$ package_dir = $ this ->getInstallPath ($ package );
0 commit comments