@@ -103,6 +103,8 @@ public function handle(): int
103
103
intro ('Pruning vendor directory ' );
104
104
$ this ->pruneVendorDirectory ();
105
105
106
+ $ this ->cleanEnvFile ();
107
+
106
108
// Check composer.json for symlinked or private packages
107
109
if (! $ this ->checkComposerJson ()) {
108
110
return static ::FAILURE ;
@@ -145,8 +147,6 @@ private function zipApplication(): bool
145
147
return false ;
146
148
}
147
149
148
- $ this ->cleanEnvFile ();
149
-
150
150
$ this ->addFilesToZip ($ zip );
151
151
152
152
$ zip ->close ();
@@ -184,11 +184,13 @@ private function checkComposerJson(): bool
184
184
$ this ->newLine ();
185
185
intro ('Patching composer.json in development mode… ' );
186
186
187
- $ filteredRepo = array_filter ($ composerJson ['repositories ' ], fn ($ repository ) => $ repository ['type ' ] !== 'path ' );
187
+ $ filteredRepo = array_filter ($ composerJson ['repositories ' ],
188
+ fn ($ repository ) => $ repository ['type ' ] !== 'path ' );
188
189
189
190
if (count ($ filteredRepo ) !== count ($ composerJson ['repositories ' ])) {
190
191
$ composerJson ['repositories ' ] = $ filteredRepo ;
191
- file_put_contents ($ this ->buildPath ('composer.json ' ), json_encode ($ composerJson , JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ));
192
+ file_put_contents ($ this ->buildPath ('composer.json ' ),
193
+ json_encode ($ composerJson , JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ));
192
194
193
195
Process::path ($ this ->buildPath ())
194
196
->run ('composer update --no-dev ' , function (string $ type , string $ output ) {
@@ -218,7 +220,7 @@ private function addFilesToZip(ZipArchive $zip): void
218
220
$ this ->newLine ();
219
221
intro ('Creating zip archive… ' );
220
222
221
- $ app = (new Finder )->files ()
223
+ $ finder = (new Finder )->files ()
222
224
->followLinks ()
223
225
->ignoreVCSIgnored (true )
224
226
->in ($ this ->buildPath ())
@@ -232,16 +234,15 @@ private function addFilesToZip(ZipArchive $zip): void
232
234
'build ' , // Compiled box assets
233
235
'temp ' , // Temp files
234
236
'tests ' , // Tests
237
+ ])
238
+ ->exclude (config ('nativephp.cleanup_exclude_files ' , []));
235
239
236
- // TODO: include everything in the .gitignore file
237
-
238
- ...config ('nativephp.cleanup_exclude_files ' , []), // User defined
239
- ]);
240
-
241
- $ this ->finderToZip ($ app , $ zip );
240
+ $ this ->finderToZip ($ finder , $ zip );
242
241
243
- // Add .env file manually because Finder ignores hidden files
242
+ // Add .env file manually because Finder ignores VSC ignored files
244
243
$ zip ->addFile ($ this ->buildPath ('.env ' ), '.env ' );
244
+ $ zip ->addFile ($ this ->buildPath ('bootstrap/cache/services.php ' ), 'bootstrap/cache/services.php ' );
245
+ $ zip ->addFile ($ this ->buildPath ('bootstrap/cache/packages.php ' ), 'bootstrap/cache/packages.php ' );
245
246
246
247
// Add auth.json file to support private packages
247
248
// WARNING: Only for testing purposes, don't uncomment this
0 commit comments