Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -2616,6 +2616,29 @@ |
2617 | 2617 | } |
2618 | 2618 | |
2619 | 2619 | /** |
| 2620 | + * Remove a directory and all its content. |
| 2621 | + * Does not hide error. |
| 2622 | + */ |
| 2623 | +function wfRecursiveRemoveDir( $dir ) { |
| 2624 | + wfDebug( __FUNCTION__ . "( $dir )\n" ); |
| 2625 | + // taken from http://de3.php.net/manual/en/function.rmdir.php#98622 |
| 2626 | + if ( is_dir( $dir ) ) { |
| 2627 | + $objects = scandir( $dir ); |
| 2628 | + foreach ( $objects as $object ) { |
| 2629 | + if ( $object != "." && $object != ".." ) { |
| 2630 | + if ( filetype( $dir . '/' . $object ) == "dir" ) { |
| 2631 | + wfRecursiveRemoveDir( $dir . '/' . $object ); |
| 2632 | + } else { |
| 2633 | + unlink( $dir . '/' . $object ); |
| 2634 | + } |
| 2635 | + } |
| 2636 | + } |
| 2637 | + reset( $objects ); |
| 2638 | + rmdir( $dir ); |
| 2639 | + } |
| 2640 | +} |
| 2641 | + |
| 2642 | +/** |
2620 | 2643 | * @param $nr Mixed: the number to format |
2621 | 2644 | * @param $acc Integer: the number of digits after the decimal point, default 2 |
2622 | 2645 | * @param $round Boolean: whether or not to round the value, default true |
Index: trunk/phase3/includes/SeleniumWebSettings.php |
— | — | @@ -201,21 +201,3 @@ |
202 | 202 | $testUploadPath = getTestUploadPathFromResourceName( $testResourceName ); |
203 | 203 | $wgUploadPath = $testUploadPath; |
204 | 204 | } |
205 | | - |
206 | | -function wfRecursiveRemoveDir( $dir ) { |
207 | | - // taken from http://de3.php.net/manual/en/function.rmdir.php#98622 |
208 | | - if ( is_dir( $dir ) ) { |
209 | | - $objects = scandir( $dir ); |
210 | | - foreach ( $objects as $object ) { |
211 | | - if ( $object != "." && $object != ".." ) { |
212 | | - if ( filetype( $dir . '/' . $object ) == "dir" ) { |
213 | | - wfRecursiveRemoveDir( $dir . '/' . $object ); |
214 | | - } else { |
215 | | - unlink( $dir . '/' . $object ); |
216 | | - } |
217 | | - } |
218 | | - } |
219 | | - reset( $objects ); |
220 | | - rmdir( $dir ); |
221 | | - } |
222 | | -} |
\ No newline at end of file |