Kabang Lucee 5.3 BETA; improvements, fixes and tweaks

featured

#1

The principal focus of Kabang is improvements to the Administrator and Debugging

But that hasn’t stopped the LAS core team from improving, fixing and tweaking a range of other areas in the Lucee engine room.


h/t Juraj Bezak; https://www.artstation.com/artwork/Akb1q

Shrink Memory Footprint

Reduced the memory Lucee occupies by default.

  • Move Core Functionalities to Extensions
    Moved core functionality to extension (Axis, ESAPI, Image), this allows loading of this functionality on demand, only when needed.
  • Removed XML Parsers/Transformers
    Instead of loading external XML parsers and transformers we use the XML functionality provided by the the JVM.
  • Java 8 Minimal Requirement
    By using Java 8 as the minimal requirement, we can give up some legacy stuff which frees memory.

Improve Performance

Reduced CPU usage for executing code.

  • Better Bytecode
    Improved bytecode generated by addressing common patterns with specific bytecode.
    For example, we improved the bytecode generated for the “for” statement by generating specific code for certain scenarios.
  • Bytecode Optimized for Java >=8
    By limiting Lucee to Java 8, Lucee can create bytecode that no longer needs to be compatible with Java 7 which allows using the never feature with bytecode.
  • Remove Unnecessary Buffering
    BufferOutput is no longer used by default which frees memory and CPU usage.

Logging to Datasources

Lucee now allows logging into a database instead of a file. You can simply define a datasource as an appender in the Lucee Administrator.

Language Changes

What is changing code-wise?

Mail Listener

A CFML-based Listener (Component or Function) that can be defined in the Application.cfc/cfapplication and can get triggered when mail is sent (successful or not).

// Application.cfc
component {
	this.Name = "Lucee Mail";
	this.mail.listener=function() {
		systemOutput('Application.cfc->mail listener',1,1);
		systemOutput(arguments,1,1);
	};
}

Public/Private Key Cryption (RSA)

We added a new kind of encryption that allows the use of private and public keys to encrypt and decrypt.

key=generateRSAKeys();
dump(key);

raw="Susi Sorglos föhnte Ihr Haar";
enc=encrypt(raw,key.private,"rsa");
dec=decrypt(enc,key.public,"rsa");
dump(enc);
dump(dec);

enc=encrypt(raw,key.public,"rsa");
dec=decrypt(enc,key.private,"rsa");
dump(enc);
dump(dec);

Extensions Management

You can programatically list extensions.

admin=new Administrator("web","mypassword");

// List Extension Providers
dump(admin.getExtensionProviders());

// List Extensions
dump(admin.getExtensions()); // installed in the current web Context
dump(admin.getServerExtensions());// installed in the server Context
dump(extensionList()); // all extensions

Install and update extensions.

// Install/Update MongoDB
admin=new Administrator("server","mypassword");
admin.updateExtension("E6634E1A-4CC5-4839-A83C67549ECA8D5B");
dump(admin.getExtensions());
dump(extensionExists("E6634E1A-4CC5-4839-A83C67549ECA8D5B"));

// Install an older version of MongoDB
admin=new Administrator("server","mypassword");
admin.updateExtension("E6634E1A-4CC5-4839-A83C67549ECA8D5B","3.2.2.52");
dump(admin.getExtensions());
dump(extensionExists("E6634E1A-4CC5-4839-A83C67549ECA8D5B"));

Even uninstall extensions.

// Uninstall MongoDB
admin=new Administrator("server","mypassword");
admin.removeExtension("E6634E1A-4CC5-4839-A83C67549ECA8D5B");
dump(admin.getExtensions());
dump(extensionExists("E6634E1A-4CC5-4839-A83C67549ECA8D5B"));

Query

Added the Attribute “sql” to the tag query.

<cfquery name="qry" sql="select 1 as one"/>

FTP Resource

Possibility to define FTP credentials in the Application.cfc/cfapplication for FTP resources.

// Application.cfc
component {
	this.ftp.username="myuser";
	this.ftp.password="myverysecretpw";
	this.ftp.host="ftp.lucee.org";
	this.ftp.port=21;
}
// index.cfm
dump(directoryList("ftp:///"));

Try it out!

Get your hands on the 5.3.0.86-BETA; released at May 7, 2018:

And let us know what you think :thinking:

Note, Beta and Release Candidates are a preview for upcoming versions and not ready for production environments.


Announcing Lucee 5.2.9.31 (final)
Kabang Lucee 5.3; ACF Compatibility
#2

the directory watcher has also been improved with better logging and stricter validation of configuration