[PR #674] Replace hardcoded configuration path '/config.php' with CONFIG_FILE #1027

Open
opened 2026-03-02 16:02:49 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/prasathmani/tinyfilemanager/pull/674
Author: @maestrow
Created: 11/25/2021
Status: 🔄 Open

Base: masterHead: embed-with-variative-config


📝 Commits (2)

  • 306090b replace hardcoded configuration path '/config.php' with CONFIG_FILE named constant. Thus you can embed file manager with different configs.
  • 8b82508 fix typo

📊 Changes

1 file changed (+2 additions, -3 deletions)

View changed files

📝 tinyfilemanager.php (+2 -3)

📄 Description

Replace hardcoded configuration path '/config.php' with CONFIG_FILE named constant. Thus you can embed file manager with different configs.

  define('FM_EMBED', true);
  define('CONFIG_FILE', __DIR__.'/config1.php');  // this value can depends on some state
  print(CONFIG_FILE);
  define('FM_SELF_URL', $_SERVER['PHP_SELF']);
  require './tinyfilemanager.php';

This PR made possible #444 feature request: "allow user to access multiple directories". Use this scenario: For each target directory define a link which lead to it's own page with embedded file manager instance, having its own CONFIG_FILE. Common configuration options can be included from shared file.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/prasathmani/tinyfilemanager/pull/674 **Author:** [@maestrow](https://github.com/maestrow) **Created:** 11/25/2021 **Status:** 🔄 Open **Base:** `master` ← **Head:** `embed-with-variative-config` --- ### 📝 Commits (2) - [`306090b`](https://github.com/prasathmani/tinyfilemanager/commit/306090be65f0006ccc933b8459157a8a4c410b91) replace hardcoded configuration path '/config.php' with CONFIG_FILE named constant. Thus you can embed file manager with different configs. - [`8b82508`](https://github.com/prasathmani/tinyfilemanager/commit/8b82508ea2ad839a85dbc559df145f0efaeff4de) fix typo ### 📊 Changes **1 file changed** (+2 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `tinyfilemanager.php` (+2 -3) </details> ### 📄 Description Replace hardcoded configuration path '/config.php' with CONFIG_FILE named constant. Thus you can embed file manager with different configs. ``` define('FM_EMBED', true); define('CONFIG_FILE', __DIR__.'/config1.php'); // this value can depends on some state print(CONFIG_FILE); define('FM_SELF_URL', $_SERVER['PHP_SELF']); require './tinyfilemanager.php'; ``` This PR made possible #444 feature request: "allow user to access multiple directories". Use this scenario: For each target directory define a link which lead to it's own page with embedded file manager instance, having its own CONFIG_FILE. Common configuration options can be included from shared file. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tinyfilemanager#1027
No description provided.