Skip to content

Commit a5df0bb

Browse files
authored
Merge branch 'develop' into add/pma-migration
2 parents cc685eb + 2a6190d commit a5df0bb

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/Admin_Tools_Command.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use function EE\Site\Utils\auto_site_name;
1212
use function EE\Utils\download;
1313
use function EE\Utils\extract_zip;
14+
use function EE\Utils\random_password;
1415

1516
class Admin_Tools_Command extends EE_Command {
1617

@@ -255,7 +256,12 @@ private function install_pma( $data, $tool_path ) {
255256
extract_zip( $download_path, $unzip_folder );
256257
$zip_folder_name = scandir( $unzip_folder );
257258
$this->fs->rename( $unzip_folder . '/' . array_pop( $zip_folder_name ), $tool_path );
258-
$this->move_config_file( 'pma.config.mustache', $tool_path . '/config.inc.php' );
259+
260+
$pma_config_data = [
261+
'blowfish_secret' => random_password( 32 ),
262+
];
263+
$pma_config = EE\Utils\mustache_render( ADMIN_TEMPLATE_ROOT . '/pma.config.mustache', $pma_config_data );
264+
$this->fs->dumpFile( $tool_path . '/config.inc.php', $pma_config );
259265
}
260266

261267
/**

templates/pma.config.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* This is needed for cookie based authentication to encrypt password in
1515
* cookie. Needs to be 32 chars long.
1616
*/
17-
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
17+
$cfg['blowfish_secret'] = '{{blowfish_secret}}'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
1818

1919
/**
2020
* Servers configuration
@@ -75,6 +75,7 @@ $cfg['Servers'][$i]['AllowNoPassword'] = false;
7575
*/
7676
$cfg['UploadDir'] = '';
7777
$cfg['SaveDir'] = '';
78+
$cfg['TempDir'] = sys_get_temp_dir();
7879

7980
/**
8081
* Whether to display icons or text or both icons and text in table row

0 commit comments

Comments
 (0)