Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pma config setup for new changes in pma #43

Merged
merged 1 commit into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/Admin_Tools_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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 );
}

/**
Expand Down
3 changes: 2 additions & 1 deletion templates/pma.config.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down