diff --git a/src/Admin_Tools_Command.php b/src/Admin_Tools_Command.php index 354155d..6919ea8 100644 --- a/src/Admin_Tools_Command.php +++ b/src/Admin_Tools_Command.php @@ -11,6 +11,7 @@ use function EE\Site\Utils\auto_site_name; use function EE\Utils\download; use function EE\Utils\extract_zip; +use function EE\Utils\random_password; class Admin_Tools_Command extends EE_Command { @@ -255,7 +256,12 @@ private function install_pma( $data, $tool_path ) { extract_zip( $download_path, $unzip_folder ); $zip_folder_name = scandir( $unzip_folder ); $this->fs->rename( $unzip_folder . '/' . array_pop( $zip_folder_name ), $tool_path ); - $this->move_config_file( 'pma.config.mustache', $tool_path . '/config.inc.php' ); + + $pma_config_data = [ + 'blowfish_secret' => random_password( 32 ), + ]; + $pma_config = EE\Utils\mustache_render( ADMIN_TEMPLATE_ROOT . '/pma.config.mustache', $pma_config_data ); + $this->fs->dumpFile( $tool_path . '/config.inc.php', $pma_config ); } /** diff --git a/templates/pma.config.mustache b/templates/pma.config.mustache index ef58f61..1d4de0b 100644 --- a/templates/pma.config.mustache +++ b/templates/pma.config.mustache @@ -14,7 +14,7 @@ * This is needed for cookie based authentication to encrypt password in * cookie. Needs to be 32 chars long. */ -$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ +$cfg['blowfish_secret'] = '{{blowfish_secret}}'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ /** * Servers configuration @@ -75,6 +75,7 @@ $cfg['Servers'][$i]['AllowNoPassword'] = false; */ $cfg['UploadDir'] = ''; $cfg['SaveDir'] = ''; +$cfg['TempDir'] = sys_get_temp_dir(); /** * Whether to display icons or text or both icons and text in table row