Skip to content

Commit d86ee4d

Browse files
committed
Merge branch 'mrrobot47-fix/pra' into develop
2 parents 955efe3 + 9023ab0 commit d86ee4d

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

src/Admin_Tools_Command.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ private function install_pma( $data, $tool_path ) {
283283
$temp_dir = EE\Utils\get_temp_dir();
284284
$download_path = $temp_dir . 'pma.zip';
285285
$unzip_folder = $temp_dir . '/pma';
286+
$this->fs->remove( [ $download_path, $unzip_folder ] );
286287
$this->download( $download_path, $data['url'] );
287288
$this->extract_zip( $download_path, $unzip_folder );
288289
$zip_folder_name = scandir( $unzip_folder );
@@ -301,18 +302,20 @@ private function install_pra( $data, $tool_path ) {
301302
$temp_dir = EE\Utils\get_temp_dir();
302303
$download_path = $temp_dir . 'pra.zip';
303304
$unzip_folder = $temp_dir . '/pra';
304-
$vendor_zip = $temp_dir . 'vendor.zip';
305-
$vendor_path = $unzip_folder . '/vendor';
306-
$download_url = str_replace( '{version}', $data['version'], $data['url'] );
305+
$this->fs->remove( [ $download_path, $unzip_folder ] );
306+
$vendor_zip = $temp_dir . 'vendor.zip';
307+
$download_url = str_replace( '{version}', $data['version'], $data['url'] );
307308
$this->download( $download_path, $download_url );
308309
$this->extract_zip( $download_path, $unzip_folder );
309310
$zip_folder_name = scandir( $unzip_folder );
311+
$pra_root_folder = $unzip_folder . '/' . array_pop( $zip_folder_name );
312+
$vendor_path = $pra_root_folder . '/vendor';
310313
$vendor_requirement_url = 'https://github.com/nrk/predis/archive/v1.1.1.zip';
311314
$this->download( $vendor_zip, $vendor_requirement_url );
312-
$this->extract_zip( $vendor_zip, $vendor_path );
313-
$this->fs->rename( $unzip_folder . '/' . array_pop( $zip_folder_name ), $tool_path );
315+
$this->extract_zip( $vendor_zip, $pra_root_folder );
316+
$this->fs->rename( $pra_root_folder . '/predis-1.1.1', $vendor_path );
317+
$this->fs->rename( $pra_root_folder, $tool_path );
314318
$this->move_config_file( 'pra.config.mustache', $tool_path . '/includes/config.inc.php' );
315-
316319
}
317320

318321
/**
@@ -325,6 +328,7 @@ private function install_opcache( $data, $tool_path ) {
325328

326329
$temp_dir = EE\Utils\get_temp_dir();
327330
$download_path = $temp_dir . 'opcache-gui.php';
331+
$this->fs->remove( $download_path );
328332
$this->download( $download_path, $data['url'] );
329333
$this->fs->rename( $temp_dir . 'opcache-gui.php', $tool_path . '-gui.php' );
330334
}

templates/pra.config.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $config = array(
44
'servers' => array(
55
array(
66
'name' => getenv('VIRTUAL_HOST'), // Optional name.
7-
'host' => 'redis',
7+
'host' => 'global-redis',
88
'port' => 6379,
99
'filter' => '*',
1010
'scheme' => 'tcp', // Optional. Connection scheme. 'tcp' - for TCP connection, 'unix' - for connection by unix domain socket

0 commit comments

Comments
 (0)