Lucee Extensions

Hi Everyone,

Is there anywhere that I can found out about extensions?
What are the for, what functions do they include?

Ultimately I am trying to work out which extensions, of the ones that are installed on our Prod servers, we are actually using.
So that I can remove or the superfluous extensions and
Keep an eye on updates / do testing etc for the ones that we use.

https://download.lucee.org/ isn’t “that” helpful in this regard.
Some have a description “of sorts” - other don’t.

I note that the documentation for ESAPIDecode, denotes,
Requires Extension: ESAPI extension

I suppose what I am asking for;

  • Is a “reverse” of this.
  • “What are the functions attributed to a given extension”
    could this be dynamically created?
  • We (I) could add a “More Information” or similar to the current page, per extension
  • And then populate with the functions from the extension.

I don’t understand this question. As for the other questions, are you asking about ESAPI specifically or in general about all extensions?

Hi @bdw429s

I am speaking generically of all extensions.

As an example there is;
This for esapi in the documentation.

But - it isn’t mentioned anywhere on that page - which functions are Lucee BIFs and which are provided by an extension - or whether they are all provided by the extension.

Within encodeForSQL() - just like esapiDecode()
there is : Requires Extension: ESAPI extension

So if one was to assume that ALL functions that require the ESAPI extension have this “marker” then I could use the existing documentation - to pull-out all the functions that have “requires ESAPI Extension” and list them “specifically with” the ESAPI extension documentation.

For my current use-case;
I can then use THIS list to search my code-base and determine:

  • Do I use the ESAPI extension at all?
  • Can I remove the extension from my installation?

Rinse and repeat for the PDF / Image / CFSpreadsheet / Caching extensions.
The datasource ones are pretty self-evident… do you use a Postgres DB at all? No? : Remove the Postgres extension.

Otherwise - if the Requires Extension: marker is “hand” added - then it is not going to be a reliable method for producing a list of functions that are provided by an extension.

And if this is the case,
How can I go about getting a list of functions that are provided from an extension, so that I can edit the current docs at https://download.lucee.org/ to include them?

So that the documentation;

Can be more like this;

Ahh yes, interesting. I’m not actually sure how to programmatically find all the BIFs (or tags) an extension contributes to Lucee. Obviously you can read the source code of the extension, but even that is tricky since functions and tags can be provided via Java or CFML. I was thinking the getFunctionData() or getTagData() BIFs would include this information but it seems they don’t.

I did notice some BIFs in the docs have a “requires extension” entry, but you’d have to check the source code to see how it determines that. I vaguely recall Zac working on that logic.

On a broader note, Adobe’s cfpm tool has an option to scan your codebase and tell you what modules you need to install. Lucee could stand to have a tool like this. Someone could build it in CommandBox, but short of a proper CFML parser, you’d basically be doing regex on the .cfm or .cfc files which can be a bit shoddy.

what on earth makes you think it’s hand added?

https://luceeserver.atlassian.net/browse/LD-143

1 Like

:smiley: - That is great news!

As for why would I think otherwise?
Well…

Sometimes we do crazy shit, to get it working, right?
And you do A LOT of EVERYTING for Lucee…

So I could understand That it might have started with;
Hand-written notes “This function belongs to this Extension”

and then after a few times of adding this by hand - you think;
“This is shitty - can I automate it?”
but… never actually getting around to completing the automation task.

Anyway - I will look into how you’re creating the Requires Extension tag and use that logic to create a function list, per extension.

Thanks for the pointer!