@@ -149,6 +149,29 @@ protected static function removeDir($dir)
149149 }
150150 }
151151
152+ protected static function copyDir ($ source , $ dest )
153+ {
154+ $ dir = opendir ($ source );
155+ @mkdir ($ dest );
156+
157+ while (false !== ( $ file = readdir ($ dir )))
158+ {
159+ if (( $ file !== '. ' ) && ( $ file !== '.. ' ))
160+ {
161+ if (is_dir ($ source . '/ ' . $ file ))
162+ {
163+ static ::copyDir ($ source . '/ ' . $ file , $ dest . '/ ' . $ file );
164+ }
165+ else
166+ {
167+ copy ($ source . '/ ' . $ file , $ dest . '/ ' . $ file );
168+ }
169+ }
170+ }
171+
172+ closedir ($ dir );
173+ }
174+
152175 /**
153176 * Moves the Laminas Escaper files into our base repo so that it's
154177 * available for packaged releases where the users don't user Composer.
@@ -194,9 +217,9 @@ public static function moveEscaper()
194217 */
195218 public static function moveKint ()
196219 {
197- $ filename = 'vendor/kint-php/kint/build/kint-aante-light.php ' ;
220+ $ dir = 'vendor/kint-php/kint/src ' ;
198221
199- if (is_file ( $ filename ))
222+ if (is_dir ( $ dir ))
200223 {
201224 $ base = basename (__DIR__ ) . '/ ' . static ::$ basePath . 'Kint ' ;
202225
@@ -212,10 +235,10 @@ public static function moveKint()
212235 mkdir ($ base , 0755 );
213236 }
214237
215- if (! static ::moveFile ( $ filename , $ base . ' /kint.php ' ))
216- {
217- die ( ' Error moving: ' . $ filename );
218- }
238+ static ::copyDir ( $ dir , $ base);
239+ static :: copyDir ( $ dir . ' /../resources ' , $ base . ' /resources ' );
240+ copy ( $ dir . ' /../init.php ' , $ base . ' /init.php ' );
241+ copy ( $ dir . ' /../init_helpers.php ' , $ base . ' /init_helpers.php ' );
219242 }
220243 }
221244}
0 commit comments