Skip to content

Commit

Permalink
Save $CONFIG to config.php if it exists (#1144)
Browse files Browse the repository at this point in the history
Writes $CONFIG variable to the main plugin file, unless there is a config.php
  • Loading branch information
RavanH authored Oct 14, 2024
1 parent 3716af2 commit 1042994
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tinyfilemanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3598,7 +3598,8 @@ function __construct()

function save()
{
$fm_file = __FILE__;
global $config_file;
$fm_file = is_readable($config_file) ? $config_file : __FILE__;
$var_name = '$CONFIG';
$var_value = var_export(json_encode($this->data), true);
$config_string = "<?php" . chr(13) . chr(10) . "//Default Configuration".chr(13) . chr(10)."$var_name = $var_value;" . chr(13) . chr(10);
Expand Down

0 comments on commit 1042994

Please sign in to comment.