Tony "What makes you think your license key is stored in index.php?" ... because I'm sitting right here directly in front of my laptop using the app you created that's how I know come on now.
It does not get stored in index.php
unless you add it there manually. All your own config options should go in _files/config/config.php
, because this is the entire point of the external config.php
file. So the index.php
file does not get edited and is easy to update when new versions are released.
Tony If I don't put the license key in the index file and into the config file only, it pops up the payment box. When I put it back on the index, it works, the question is totally clear and very well explained.
If it only works when you put the license key in index.php
but not in _files/config/config.php
, there there is a problem with your installation, in which case I need a link or more information to diagnose this.
The license key is supposed to go into config.php
NOT index.php
, like all other config options.
Tony But all of that is already part of the config file. It creates redundancy.
I'm not sure where you are getting this from. As noted, there are good reasons to use an external config.php
file. 1. It is easy to view and edit without having to edit the main code, 2. The config remains in tact after you upgrade Files Gallery index.php
to new releases, 3. You only need to un-comment and add config options when they differ from defaults, 4. It's simply good practice to abstract your own custom config options in an isolated separate file. What happens when you update to new Files Gallery version coming soon, and you only have your own custom config options and new options are missing in default? It will break. This is normal application structure.
Tony All this intersecting can be saved under one roof and that's the config file so why is "defaults" even needed?
From the users perspective, there is only one roof, config.php
. The defaults in index.php
are for the application to to function properly and for the developers to assign sensible defaults to configurable options. Besides, only the un-commented options in config.php
will apply.
Tony Anyways the point is, I'm sitting right here using the application you developed and all I asked is there a way to simply look for it once in the config and not both, no need to question me or others who's invested money on how I know something is when they literally looking directly at.
I will question any request that can't be answered logically. As noted, your license key or any other of your custom config options will never get stored in index.php
, unless you opened the file and saved them there yourself. How would we even be able to programmatically write config options into index.php
? It's not possible, and that's a good thing.
Tony License Key in the index file
Not that it matters where your screenshot comes from, but that screenshot is config.php
not index.php
. Config options in index.php
are sorted into sections, and are certainly not commented out like in your screenshot.
https://github.com/mjau-mjau/files.photo.gallery/blob/master/index.php
https://github.com/mjau-mjau/files.photo.gallery/blob/master/_files/config/config.php
Tony When I comment it out or remove the license key(Thus it's in the config file)
If you comment it out from the same file as in your screenshot, then the license key option no longer exists, and it will naturally display the license popup.
If you want me to look into it, you can send link and further details to karl @ photo.gallery if you like.