Hi all,
To fix an issue with the manualpages feature, I had planned to use this key/value file format:
logs.cgi/config.dat=configuration/logs/logsettings
But unfortunately this is not possible with the existing General::readhash() function, because it removes non-alphanumeric keys.
Before I write yet another readsomething() function: Is there a file format available somewhere in the IPFire CGIs that supports this?
Best regards, Leo
Hey Leo,
Did you try &General::readhasharray()?
Then this file would just be a CSV file.
I believe that readhasharray might want a numeric key, but maybe it accepts the first value as key whatever it is.
-Michael
On 21 Mar 2022, at 19:27, Leo Hofmann hofmann@leo-andres.de wrote:
Hi all,
To fix an issue with the manualpages feature, I had planned to use this key/value file format:
logs.cgi/config.dat=configuration/logs/logsettings
But unfortunately this is not possible with the existing General::readhash() function, because it removes non-alphanumeric keys.
Before I write yet another readsomething() function: Is there a file format available somewhere in the IPFire CGIs that supports this?
Best regards, Leo
Hi Michael,
Thank you, I just tried it. As you suspected, General::readhasharray() accepts only numeric keys.
This format would work: 1,logs.cgi/config.dat,configuration/logs/logsettings
But I need the path as a key, because I don't want to write a clumsy search routine. I'll wait for other suggestions and then build my own readmanualpages() if needed!
Best regards, Leo
Am 21.03.2022 um 20:29 schrieb Michael Tremer:
Hey Leo,
Did you try &General::readhasharray()?
Then this file would just be a CSV file.
I believe that readhasharray might want a numeric key, but maybe it accepts the first value as key whatever it is.
-Michael
On 21 Mar 2022, at 19:27, Leo Hofmann hofmann@leo-andres.de wrote:
Hi all,
To fix an issue with the manualpages feature, I had planned to use this key/value file format:
logs.cgi/config.dat=configuration/logs/logsettings
But unfortunately this is not possible with the existing General::readhash() function, because it removes non-alphanumeric keys.
Before I write yet another readsomething() function: Is there a file format available somewhere in the IPFire CGIs that supports this?
Best regards, Leo
Hello,
You could just remove the check for whether the key is numeric:
https://git.ipfire.org/?p=ipfire-2.x.git;a=blob;f=config/cfgroot/general-fun...
I do not see it serving any purpose being strictly numeric. We could just treat the first value as the key no matter what it is.
The only place where this could because a problem is when calling &findhasharraykey() since that is enumerating all keys.
-Michael
On 21 Mar 2022, at 20:12, Leo Hofmann hofmann@leo-andres.de wrote:
Hi Michael,
Thank you, I just tried it. As you suspected, General::readhasharray() accepts only numeric keys.
This format would work: 1,logs.cgi/config.dat,configuration/logs/logsettings
But I need the path as a key, because I don't want to write a clumsy search routine. I'll wait for other suggestions and then build my own readmanualpages() if needed!
Best regards, Leo
Am 21.03.2022 um 20:29 schrieb Michael Tremer:
Hey Leo,
Did you try &General::readhasharray()?
Then this file would just be a CSV file.
I believe that readhasharray might want a numeric key, but maybe it accepts the first value as key whatever it is.
-Michael
On 21 Mar 2022, at 19:27, Leo Hofmann hofmann@leo-andres.de wrote:
Hi all,
To fix an issue with the manualpages feature, I had planned to use this key/value file format:
logs.cgi/config.dat=configuration/logs/logsettings
But unfortunately this is not possible with the existing General::readhash() function, because it removes non-alphanumeric keys.
Before I write yet another readsomething() function: Is there a file format available somewhere in the IPFire CGIs that supports this?
Best regards, Leo