Skip to content

Commit ba9b01e

Browse files
committed
Optimise listing of admin-tools
Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com>
1 parent 0fbd9b1 commit ba9b01e

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

templates/index.mustache

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,14 @@ unset( $services['site_url'] );
7373

7474

7575
$scan = scandir( '{{ee_admin_path}}' );
76-
$tools = array_slice( $scan, 2 );
76+
$scan = array_diff( $scan, [ '.', '..', 'index.php' ] );
7777

78-
$tools = array_merge( $tools, [ 'nginx_status', 'ping', 'status' ] );
79-
if( $services['mailhog_enabled'] ) {
78+
$tools = array_merge( $scan, [ 'nginx_status', 'ping', 'status' ] );
79+
if ( $services['mailhog_enabled'] ) {
8080
$tools[] = 'mailhog';
8181
}
8282
sort( $tools );
8383

84-
$tools = array_diff( $tools, [ 'index.php' ] );
85-
8684
if ( ! $services['cache_nginx_fullpage'] ) {
8785
$tools = array_diff( $tools, [ 'pra' ] );
8886
}

0 commit comments

Comments
 (0)