foundeo / cfdocs

Repository for the cfdocs.org site.

Home Page:https://cfdocs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lucee 5 extensionList() method #hacktoberfest

michaelborn opened this issue · comments

We're missing documentation for this little-known but extremely handy Lucee-specific method: extensionList().

  • This method takes no arguments
  • This method returns a query object

Here's a quick example of using this method to check the version of an installed extension:

var extension = extensionList().filter( ( extension ) => extension.name == "Hibernate ORM Engine" );
if ( !extension.recordCount ){
  throw( "Hibernate extension is not installed; please install it now" );
} else {
  var installedExtensionVersion = extension.version;
  writeOutput( "You have the Hibernate extension version #installedExtensionVersion# installed. " );
}

https://github.com/lucee/Lucee/blob/5.3.8/core/src/main/java/lucee/runtime/functions/system/ExtensionList.java#L0-L1

Nice! thanks for posting details and an example @michaelborn

For anyone looking to add this, you'll need to add a new json file to the data/en directory to document the function.

It's always fun to go to fix an issue and find out you've already fixed it. :-)

This can probably be closed.

thx for letting me know 🥇