diff --git a/docs/recipes/README.md b/docs/recipes/README.md index 897bd1b3a..cc82a66ab 100644 --- a/docs/recipes/README.md +++ b/docs/recipes/README.md @@ -263,4 +263,3 @@ How to install, congigure and create WebSockets ## [XML Fast And Easy, using SAX - Listener Functions](/docs/recipes/xml-fast-and-easy.md) This document explains how to use XML parsing in Lucee. - diff --git a/docs/recipes/application-context-update.md b/docs/recipes/application-context-update.md index 5d514a727..f7998eeb3 100644 --- a/docs/recipes/application-context-update.md +++ b/docs/recipes/application-context-update.md @@ -19,6 +19,7 @@ ] } --> + # Application Context update Lucee allows you to update the existing application context defined for example in [cookbook-application-context-basic]. @@ -43,4 +44,4 @@ This example doesn't extend the existing application mappings with this new one, ``` -Of course, it's not only mappings you can update. [tag-application] lets you update all the settings you can do in the Application.cfc! \ No newline at end of file +Of course, it's not only mappings you can update. [tag-application] lets you update all the settings you can do in the Application.cfc! diff --git a/docs/recipes/archives-creating-and-deploy.md b/docs/recipes/archives-creating-and-deploy.md index 116d74274..d9d55c76d 100644 --- a/docs/recipes/archives-creating-and-deploy.md +++ b/docs/recipes/archives-creating-and-deploy.md @@ -15,6 +15,7 @@ ] } --> + # Archives - Creating and deploying Lucee Archives (.lar files) This document explains how to deploy an Application on a live server without using a single CFML file. @@ -45,8 +46,8 @@ resource: **Full folder path**/component/ After creating the mapping, you need to create an archive file for the CFC. -* Go to the detail view of mycfc mapping page, -* Click the button **assign archive to mapping**. +- Go to the detail view of mycfc mapping page, +- Click the button **assign archive to mapping**. An archive (lar file) is created automatically and saved in `WEB-INF/lucee/context/archives`. @@ -73,8 +74,8 @@ After creating the mapping in the Administrator, you can create an archive file Now you can see both lar files in the `WEB-INF/lucee/context/archives` folder: -* One is `lucee/context/archives/xxx-deploy.lar` file, -* Another one is `lucee/context/archives/xxx-mycfc.lar` +- One is `lucee/context/archives/xxx-deploy.lar` file, +- Another one is `lucee/context/archives/xxx-mycfc.lar` Now you can place the archive files on your target server. @@ -86,4 +87,4 @@ You can now view mappings in the admin. Here you can see the above details in a video: -[Lucee Deploy Archive file](https://www.youtube.com/watch?time_continue=473&v=E9Z0KvspBAY) \ No newline at end of file +[Lucee Deploy Archive file](https://www.youtube.com/watch?time_continue=473&v=E9Z0KvspBAY) diff --git a/docs/recipes/basic-date.md b/docs/recipes/basic-date.md index a0aaf4ce2..4e26da217 100644 --- a/docs/recipes/basic-date.md +++ b/docs/recipes/basic-date.md @@ -14,6 +14,7 @@ ] } --> + # Basic Date - Output the current date The following examples show you how to output the current date. @@ -34,4 +35,4 @@ You can then configure a different locale for the current request in the Applica

The time is #lsDateTimeFormat(date:now(),locale:'de_CH')#

-``` \ No newline at end of file +``` diff --git a/docs/recipes/cached-within-request.md b/docs/recipes/cached-within-request.md index 408431fc4..caf6db077 100644 --- a/docs/recipes/cached-within-request.md +++ b/docs/recipes/cached-within-request.md @@ -19,6 +19,7 @@ ] } --> + # Cache a Query for the current request Perhaps you're familiar with the "cachedwithin" attribute of the tag [tag-query], which is normally used as follows: @@ -41,4 +42,4 @@ Request query caching is a simple solution to this problem. Replace the timespan ``` -Then the query is cached for only the current request, independent of how long the request takes! \ No newline at end of file +Then the query is cached for only the current request, independent of how long the request takes! diff --git a/docs/recipes/caches-defined-in-application-cfc.md b/docs/recipes/caches-defined-in-application-cfc.md index f1efdebb8..7eb284524 100644 --- a/docs/recipes/caches-defined-in-application-cfc.md +++ b/docs/recipes/caches-defined-in-application-cfc.md @@ -21,6 +21,7 @@ ] } --> + # Caches defined in Application.cfc It is possible to add cache connections in Lucee 5.1+ on a per-application basis by adding configuration to your `Application.cfc`. You can also select the default object cache, query cache, function cache, etc. Note if these caches use an extension that provides the cache driver, the extension must be installed already. @@ -57,16 +58,17 @@ The easiest way to generate the code block above is to follow these steps: Let's take a look at some of the keys used to define a cache connection. -* **class** - This is the Java class of the driver for the cache engine. -* **bundleName** - Optional. The name of the OSGI bundle to load the `class` from. -* **bundleVersion** - Optional. The version of the OSGI bundle to load the `class` from. -* **storage** - A boolean that flags whether this cache can be used for client or session storage. -* **custom** - A struct of key/value pairs for configuring the cache. This struct is entirely dependent on the cache driver in use, so refer to the docs for that cache driver to see the possible values. Note, some of these custom values might be required for some cache drivers to work. -* **default** - Optional. If you want this cache to be used as a default cache, then give this one of these values: `function`, `object`, `template`, `query`, `resource`, `include`, `http`, `file`, `webservice`. +- **class** - This is the Java class of the driver for the cache engine. +- **bundleName** - Optional. The name of the OSGI bundle to load the `class` from. +- **bundleVersion** - Optional. The version of the OSGI bundle to load the `class` from. +- **storage** - A boolean that flags whether this cache can be used for client or session storage. +- **custom** - A struct of key/value pairs for configuring the cache. This struct is entirely dependent on the cache driver in use, so refer to the docs for that cache driver to see the possible values. Note, some of these custom values might be required for some cache drivers to work. +- **default** - Optional. If you want this cache to be used as a default cache, then give this one of these values: `function`, `object`, `template`, `query`, `resource`, `include`, `http`, `file`, `webservice`. ## Default Caches When declaring a cache, you can make it the default cache for creation operations, but it is also possible to configure the default caches for each operation all at once in your `Application.cfc` like so: + ```lucee this.cache.object = "myCache"; this.cache.template = "AnotherCache"; @@ -79,4 +81,4 @@ this.cache.file = ""; this.cache.webservice = ""; ``` -A single cache can only be the default storage location for a single operation at a time. For example, a cache named "myCache" cannot both be the default cache for objects as well as queries. \ No newline at end of file +A single cache can only be the default storage location for a single operation at a time. For example, a cache named "myCache" cannot both be the default cache for objects as well as queries. diff --git a/docs/recipes/check-for-changes.md b/docs/recipes/check-for-changes.md index 5fe3cb857..50bbd0483 100644 --- a/docs/recipes/check-for-changes.md +++ b/docs/recipes/check-for-changes.md @@ -13,6 +13,7 @@ ] } --> + # Check for changes in your configuration file automatically Lucee can automatically check for changes in your configuration files from the complete server or a single web context. @@ -51,4 +52,4 @@ And add the same changes from above: Lucee will now check for any changes in the Lucee configuration files every minute, and if there is a change, reload it and enable those changes. -A very handy little feature for those automated deployments! \ No newline at end of file +A very handy little feature for those automated deployments! diff --git a/docs/recipes/checksum.md b/docs/recipes/checksum.md index fe0e083db..b16e1ebf4 100644 --- a/docs/recipes/checksum.md +++ b/docs/recipes/checksum.md @@ -12,6 +12,7 @@ ] } --> + # Checksum This document explains how to use a checksum in Lucee. @@ -53,9 +54,9 @@ dump("something went wrong! give it another try?"); ``` -* Download the jar file by using cfhttp. -* Dump the file response header. You can see the "X-Checksum-MD5" "X-Checksum-SHA1" keys from the file itself. -* Save the file, and dump(fileInfo(localFile.checksum)). Check to see if the dump matches the value of the downloaded file response["X-Checksum-MD5"] header. +- Download the jar file by using cfhttp. +- Dump the file response header. You can see the "X-Checksum-MD5" "X-Checksum-SHA1" keys from the file itself. +- Save the file, and dump(fileInfo(localFile.checksum)). Check to see if the dump matches the value of the downloaded file response["X-Checksum-MD5"] header. Checksum values are hashed from the binaryfile itself. @@ -145,4 +146,4 @@ The above code checks and validates the downloaded file. ## Footnotes You can see the details in this video: -[Checksum](https://www.youtube.com/watch?v=Kb_zSsRDEOg) \ No newline at end of file +[Checksum](https://www.youtube.com/watch?v=Kb_zSsRDEOg) diff --git a/docs/recipes/configuration-administrator-cfc.md b/docs/recipes/configuration-administrator-cfc.md index 0e4b9b03e..36312839c 100644 --- a/docs/recipes/configuration-administrator-cfc.md +++ b/docs/recipes/configuration-administrator-cfc.md @@ -13,6 +13,7 @@ ] } --> + # Configure Lucee within your application Lucee provides a web frontend to configure the server and each web context, but you can also do this configuration from within your application. @@ -31,4 +32,4 @@ admin.updateCharset(resourceCharset: "UTF-8"); // set the resource charset ## cfadmin Tag The component "Administrator" is far from being feature complete, so if you miss a functionality, best consult the unofficial tag "cfadmin" (undocumented) and check out how this tag is used inside the [Lucee Administrator](https://github.com/lucee/Lucee/blob/5.2/core/src/main/java/resource/component/org/lucee/cfml/Administrator.cfc). -Of course, it would be great if you could contribute your addition to the "Administrator" component. \ No newline at end of file +Of course, it would be great if you could contribute your addition to the "Administrator" component. diff --git a/docs/recipes/convert-a-cfml-func-to-java.md b/docs/recipes/convert-a-cfml-func-to-java.md index 9cefa23d8..c3eda0c5c 100644 --- a/docs/recipes/convert-a-cfml-func-to-java.md +++ b/docs/recipes/convert-a-cfml-func-to-java.md @@ -15,6 +15,7 @@ ] } --> + # Convert a CFML Function/Component to use in Java Lucee allows you to convert user-defined functions or components so you can use them in Java. @@ -42,7 +43,7 @@ component { Then you can pass that component to a Java method needing a specific interface/class. ```lucee -// This class has a method that takes as an argument a CharSequence. +// This class has a method that takes as an argument a CharSequence. // This way we can force Lucee to convert/wrap our component to that interface. HashUtil = createObject("java", "lucee.commons.digest.HashUtil"); @@ -76,4 +77,4 @@ numeric function echoInt(numeric i) { if (i == 1) throw "Test output!!!"; return i * 2; } -``` \ No newline at end of file +``` diff --git a/docs/recipes/datasource-how-to-define-them.md b/docs/recipes/datasource-how-to-define-them.md index e8e918298..00f3a7adb 100644 --- a/docs/recipes/datasource-how-to-define-them.md +++ b/docs/recipes/datasource-how-to-define-them.md @@ -13,6 +13,7 @@ ] } --> + # Datasource - How to define them To execute queries, you need a datasource definition, which points to a specific local or remote datasource. There are different ways to do so. @@ -85,4 +86,4 @@ this.datasource = { username: 'root', password: 'encrypted:5120611ea34c6123fd85120a0c27ab23fd81ea34cb854' }; -``` \ No newline at end of file +``` diff --git a/docs/recipes/docker.md b/docs/recipes/docker.md index 927b9603f..f14976fd1 100644 --- a/docs/recipes/docker.md +++ b/docs/recipes/docker.md @@ -23,6 +23,7 @@ Docker is a platform that enables developers to automate the deployment, scaling ## What are the benefits of running Lucee in Docker Running Lucee in Docker provides several key benefits: + - **Consistency and Portability**: Docker containers ensure that Lucee and its dependencies are packaged together, eliminating compatibility issues and reducing setup time. This makes it easier to develop, test, and deploy applications consistently across different environments. - **Scalability**: Docker's lightweight nature allows for efficient scaling of Lucee applications. You can quickly scale up or down based on demand, making it ideal for both small and large-scale deployments. - **Resource Efficiency**: Docker containers share the host system's kernel, which leads to efficient utilization of system resources and improved performance compared to traditional virtual machines. @@ -76,7 +77,7 @@ You can customize your Lucee container by creating your own Dockerfile and addin For more complex setups, consider using Docker Compose to manage multiple services and their dependencies. Below is an example `docker-compose.yml` file to run Lucee with an Nginx reverse proxy: ```yaml -version: '3' +version: "3" services: lucee: diff --git a/docs/recipes/encryption_decryption.md b/docs/recipes/encryption_decryption.md index 3779d4c9c..9c36b80b8 100644 --- a/docs/recipes/encryption_decryption.md +++ b/docs/recipes/encryption_decryption.md @@ -22,16 +22,17 @@ ] } --> -# Encryption/Decryption + +# Encryption/Decryption This document explains about Encryption/Decryption with public and private keys with simple examples. Encryption/Decryption is a new functionality in Lucee 5.3. We have a new way to encrypt/decrypt string values. First we start with keys. In this case, there are two keys: -* Private key to encrypt -* Public key to decrypt +- Private key to encrypt +- Public key to decrypt -## Example 1: +## Example 1: ```luceescript //index.cfm @@ -75,4 +76,4 @@ This is a full detailed example of encrypt/decrypt functions. We create a key an Here you can see these details in the video also: -[Encryption/Decryption with public and private keys](https://www.youtube.com/watch?v=2fgfq-3nWfk) \ No newline at end of file +[Encryption/Decryption with public and private keys](https://www.youtube.com/watch?v=2fgfq-3nWfk) diff --git a/docs/recipes/event-gateway-create.md b/docs/recipes/event-gateway-create.md index 12fbb21f0..a887ed66d 100644 --- a/docs/recipes/event-gateway-create.md +++ b/docs/recipes/event-gateway-create.md @@ -16,6 +16,7 @@ ] } --> + # Custom Event Gateways Here you will find a short introduction into writing your own Event Gateway type. @@ -24,9 +25,9 @@ Since you can write these in pure CFML (and Java when you want it), it is really There are 2 to 3 files you need to create: -* the Gateway CFC -* the Gateway Driver CFC -* A listener CFC +- the Gateway CFC +- the Gateway Driver CFC +- A listener CFC ## The Gateway CFC @@ -36,18 +37,18 @@ Also, it is the file which is instantiated by Lucee when the gateway starts. You can take the following files as an example: -* {Lucee-install}/lib/lucee-server/context/gateway/lucee/extension/gateway/DirectoryWatcher.cfc -* {Lucee-install}/lib/lucee-server/context/gateway/lucee/extension/gateway/MailWatcher.cfc +- {Lucee-install}/lib/lucee-server/context/gateway/lucee/extension/gateway/DirectoryWatcher.cfc +- {Lucee-install}/lib/lucee-server/context/gateway/lucee/extension/gateway/MailWatcher.cfc The example code shown underneath is a modified version of the DirectoryWatcher.cfc, which, at time of writing, is in line for reviewing at the Lucee team. By default, you need to have the following functions: -* An init function, which receives the necessary config data. -* A start function, which continues to run while variables.state="running". -* A stop and restart function. -* A getState function, which returns the current state of the gateway instance (running, stopping, stopped). -* A sendMessage function, which will be called when the CFML sendGatewayMessage function is used. +- An init function, which receives the necessary config data. +- A start function, which continues to run while variables.state="running". +- A stop and restart function. +- A getState function, which returns the current state of the gateway instance (running, stopping, stopped). +- A sendMessage function, which will be called when the CFML sendGatewayMessage function is used. The following is all the code you need: @@ -141,4 +142,4 @@ Minimalsize: the minimum filesize in bytes. After executing the cfadmin code, or going through the admin screens, you should now have an instance of your own Event Gateway type running! -When creating a Socket gateway or an Instant messaging gateway, you will need to do a bit more coding, but hopefully this instruction helped you out! \ No newline at end of file +When creating a Socket gateway or an Instant messaging gateway, you will need to do a bit more coding, but hopefully this instruction helped you out! diff --git a/docs/recipes/event-gateway-in-app-cfc.md b/docs/recipes/event-gateway-in-app-cfc.md index dc5383903..e645534f6 100644 --- a/docs/recipes/event-gateway-in-app-cfc.md +++ b/docs/recipes/event-gateway-in-app-cfc.md @@ -37,6 +37,7 @@ ] } --> + # Event Handling in Application.cfc Lucee provides several event handling functions within `Application.cfc` that can be used to manage different stages and types of requests. Here is an overview of these functions and their usage. @@ -65,7 +66,7 @@ component { } ``` -### OnRequestStart ### +### OnRequestStart This method is triggered at the start of each request. @@ -115,7 +116,7 @@ component { As arguments you receive the exception (cfcatch block) and the eventName. -## OnAbort +## OnAbort This method is triggered when a request is ended with help of the tag ``. @@ -127,7 +128,7 @@ component { } ``` -## OnDebug +## OnDebug This method is triggered when debugging is enabled for this request. @@ -153,7 +154,7 @@ component { ## Application.cfc Default Template -Below you can find an Application.cfc template that may serve as a starting point for your own applications settings with Lucee CFML engine. +Below you can find an Application.cfc template that may serve as a starting point for your own applications settings with Lucee CFML engine. When creating an Application.cfc for the first time, you can configure all the settings within the Lucee Server or Web Administrator and use its "Export" tool (Lucee Administrator => Settings => Export) to move (by copy and paste) the settings into your Application.cfc file. @@ -261,4 +262,4 @@ component { } } -``` \ No newline at end of file +``` diff --git a/docs/recipes/event-gateways-how-they-work.md b/docs/recipes/event-gateways-how-they-work.md index 5d79f7d38..39bdc5f3d 100644 --- a/docs/recipes/event-gateways-how-they-work.md +++ b/docs/recipes/event-gateways-how-they-work.md @@ -16,6 +16,7 @@ ] } --> + # Event Gateway - How they work? An event gateway is a background process that continuously runs. @@ -34,9 +35,9 @@ Lucee comes with 2 gateways: a Directory watcher and a Mail watcher. This event gateway checks a given directory for file changes. These changes (events) can be: -* new files -* changed files -* removed files +- new files +- changed files +- removed files When this gateway starts, it first takes a snapshot of the current state of the directory. This is the starting point from where changes are calculated. @@ -48,8 +49,8 @@ So if you already have some files in the directory you want to watch, these file You can apply filters for what you exactly want to watch changes for: -* **Watch subdirectories**: same as the "Recurse" option in `` and `directoryList()` -* **Extensions**: an optional list of comma-delimited file extensions. The default is "*", which obviously means "all files". +- **Watch subdirectories**: same as the "Recurse" option in `` and `directoryList()` +- **Extensions**: an optional list of comma-delimited file extensions. The default is "\*", which obviously means "all files". Note: the Extensions setting might be changed in the near future, due to an enhancement request. @@ -63,8 +64,8 @@ Make sure you regularly check the logs, because when anything goes wrong, Lucee Lucee logs can be found here: -* `{Lucee-server}/context/logs/` -* `{Lucee-web}/lucee/logs/` +- `{Lucee-server}/context/logs/` +- `{Lucee-web}/lucee/logs/` You can also view the logs in your web/server admin by installing the Log Analyzer plugin. @@ -121,4 +122,4 @@ Add or update a gateway instance: ```lucee -``` \ No newline at end of file +``` diff --git a/docs/recipes/event-gateways.md b/docs/recipes/event-gateways.md index eb158833b..986ff8e99 100644 --- a/docs/recipes/event-gateways.md +++ b/docs/recipes/event-gateways.md @@ -20,14 +20,15 @@ ] } --> + # Event Gateways First of all, it is necessary to explain how Event Gateways (EG) are working in the first place. EG's are another way to communicate with your Lucee server and are kind of a service running on Lucee, reacting to certain events. These kinds of events could be something along the lines of: -* SMS sent to a certain receiver -* File change happening in a directory -* Mail received on a mail server -* Slack notification received +- SMS sent to a certain receiver +- File change happening in a directory +- Mail received on a mail server +- Slack notification received What then can be done with these events is to trigger some actions that react to these events. For instance, if an SMS is sent to the server asking for the current heap memory space, the server could respond with an SMS returning the details. So you basically have an event producer and an event consumer. @@ -41,8 +42,8 @@ In Lucee, EG's can be written in CFML, and this is what this description is all There are 2 components that are important for writing an event gateway: -* Gateway driver -* Event Gateway +- Gateway driver +- Event Gateway The gateway driver is a CFC that is always instantiated and running. It is responsible for managing the lifecycle of the event gateway. The event gateway is the actual implementation of the event handling logic. @@ -64,7 +65,7 @@ Now the sanity checks kick in and prevent faulty data from being sent to the Gat ``` -We receive the expected blank page. In the background, the message has been passed to the Gateway through the sendGateway() method and the data will be written by the start() endless loop into the logfile with the help of the method _log(). +We receive the expected blank page. In the background, the message has been passed to the Gateway through the sendGateway() method and the data will be written by the start() endless loop into the logfile with the help of the method \_log(). How you actually write your EG is totally up to you. But now, do it in CFML! @@ -72,9 +73,9 @@ How you actually write your EG is totally up to you. But now, do it in CFML! Above we have introduced the possibility to asynchronously log some data to a log file. There are additional other Event Gateways you can think of or use: -* ICQ watcher -* Slack Channel inspector -* Listen to a socket -* On incoming email +- ICQ watcher +- Slack Channel inspector +- Listen to a socket +- On incoming email -The possibilities are huge and we expect several new event gateways to emerge in the next few months. Have fun with Lucee. \ No newline at end of file +The possibilities are huge and we expect several new event gateways to emerge in the next few months. Have fun with Lucee. diff --git a/docs/recipes/event-handling-in-app-cfc.md b/docs/recipes/event-handling-in-app-cfc.md index 503d687d6..87c887f46 100644 --- a/docs/recipes/event-handling-in-app-cfc.md +++ b/docs/recipes/event-handling-in-app-cfc.md @@ -37,6 +37,7 @@ ] } --> + # Event Handling in Application.cfc Lucee provides several event handling functions within `Application.cfc` that can be used to manage different stages and types of requests. Here is an overview of these functions and their usage. @@ -153,7 +154,7 @@ component { ## Application.cfc Default Template -Below you can find an Application.cfc template that may serve as a starting point for your own applications settings with Lucee CFML engine. +Below you can find an Application.cfc template that may serve as a starting point for your own applications settings with Lucee CFML engine. When creating an Application.cfc for the first time, you can configure all the settings within the Lucee Server or Web Administrator and use its "Export" tool (Lucee Administrator => Settings => Export) to move (by copy and paste) the settings into your Application.cfc file. @@ -261,4 +262,4 @@ component { } } -``` \ No newline at end of file +``` diff --git a/docs/recipes/exception-cause.md b/docs/recipes/exception-cause.md index 50540c696..ebe780402 100644 --- a/docs/recipes/exception-cause.md +++ b/docs/recipes/exception-cause.md @@ -13,6 +13,7 @@ ] } --> + # Exception - Cause Lucee 6.1 improves its support for exception causes, providing better debugging and error handling capabilities. @@ -40,7 +41,6 @@ catch(ex) { Thanks to this enhancement, you get not only the tag context and Java stack trace from the top-level exception, but also the same information for the "cause" exception. - ## Parent Thread Context When you throw an exception from a child thread, for example, a `cfhttp` call executed in parallel or an exception inside the `cfthread` tag, you can now see the stack trace from where that thread was started. Previously, you only saw the stack trace within the child thread. With Lucee 6.1, you also get the information from the parent thread as the cause. Consider the following example: @@ -57,4 +57,3 @@ dump(cfthread["testexception"].error.cause.Message); ``` The error not only includes the exception information from within the cfthread tag but also provides information from outside, making debugging much easier as you can see where the tag was called from. - diff --git a/docs/recipes/exception-output.md b/docs/recipes/exception-output.md index c000d47d5..aa8788f3b 100644 --- a/docs/recipes/exception-output.md +++ b/docs/recipes/exception-output.md @@ -22,6 +22,7 @@ ] } --> + # Exceptions Output How to catch and display exceptions @@ -40,7 +41,7 @@ catch ( any e ){ Go on with your code ``` - [tag-Dump] shows the full exception structure without blocking your code. Dump includes all stack trace with it. +[tag-Dump] shows the full exception structure without blocking your code. Dump includes all stack trace with it. ## Example 2 @@ -58,4 +59,4 @@ Go on with your code Here we simply echo the exception. It shows the normal exception without blocking your code. -[https://www.youtube.com/watch?v=vM-4R2A-ZsM](https://www.youtube.com/watch?v=vM-4R2A-ZsM) \ No newline at end of file +[https://www.youtube.com/watch?v=vM-4R2A-ZsM](https://www.youtube.com/watch?v=vM-4R2A-ZsM) diff --git a/docs/recipes/externalizing-strings.md b/docs/recipes/externalizing-strings.md index 1c9ba9d9d..36495f6bf 100644 --- a/docs/recipes/externalizing-strings.md +++ b/docs/recipes/externalizing-strings.md @@ -12,6 +12,7 @@ ] } --> + # Externalize strings Externalize strings from generated class files to separate files. This method is used to reduce the memory of the static contents for templates. We explain this method with a simple example below: @@ -51,4 +52,4 @@ So, the string 'year' is no longer in memory. When the bytecode is called, it lo Here you can see the above details in video -[Externalize strings](https://youtu.be/AUcsHkVFXHE) \ No newline at end of file +[Externalize strings](https://youtu.be/AUcsHkVFXHE) diff --git a/docs/recipes/file-extensions.md b/docs/recipes/file-extensions.md index 1becd4bae..d31f430a5 100644 --- a/docs/recipes/file-extensions.md +++ b/docs/recipes/file-extensions.md @@ -13,6 +13,7 @@ ] } --> + # File Extensions Lucee supports several file extensions for different types of templates and components. The most common extensions are `.cfm`, `.cfc`, `.cfml`, and `.cfs`. Each serves a specific purpose in CFML development. @@ -64,4 +65,4 @@ Since version 6.0, Lucee supports templates with the extension `.cfs`. These tem ```cfs writeOutput("Hello from a .cfs file!"); -``` \ No newline at end of file +``` diff --git a/docs/recipes/function-listeners.md b/docs/recipes/function-listeners.md index 46d8ece13..0275b8f3c 100644 --- a/docs/recipes/function-listeners.md +++ b/docs/recipes/function-listeners.md @@ -13,9 +13,10 @@ ] } --> + # Function Listeners -Lucee 6.1 introduced a new feature called "Function Listeners". This allows you to execute a function (of any kind) in parallel, so you do not have to wait for the result of the execution, similar to using the `cfthread` tag. Function Listeners provide an easy syntax to not only execute a function in parallel but also include support to handle the result by simply adding a listener after the function call. This listener can handle the result or exception of a function. +Lucee 6.1 introduced a new feature called "Function Listeners". This allows you to execute a function (of any kind) in parallel, so you do not have to wait for the result of the execution, similar to using the `cfthread` tag. Function Listeners provide an easy syntax to not only execute a function in parallel but also include support to handle the result by simply adding a listener after the function call. This listener can handle the result or exception of a function. ## Simple Version @@ -38,7 +39,7 @@ dump(request.testFunctionListener ?: "undefined1"); ## Join thread thread -Instead of "run and forget" you can also join the thread with help of the function `threadJoin` (or the tags ``). You get a name from the call and that name you can use to join it. The thread information is available in the scope `cfhread` like a regular thread. +Instead of "run and forget" you can also join the thread with help of the function `threadJoin` (or the tags ``). You get a name from the call and that name you can use to join it. The thread information is available in the scope `cfhread` like a regular thread. ```run @@ -118,7 +119,6 @@ dump(cfthread[threadName].result); ``` - ## Listening on a Component Instantiation You can also listen to a component instantiation. @@ -136,7 +136,7 @@ dump(getMetadata(cfthread[threadName].result).fullname); ``` -## Listening on a Static Component Function +## Listening on a Static Component Function You can also listen to a static component function. @@ -153,7 +153,6 @@ dump(cfthread[threadName].result.columnlist); ``` - ## Function Collection Listener A listener does not need to be a function, it also can be a function collection (multiple functions inside a struct). @@ -180,7 +179,6 @@ dump(cfthread[threadName1].success); ``` - ## Component Listener You can also define a component instance as a listener, in this case we do a inline component. @@ -191,11 +189,11 @@ function mySuccess() { return "Susi Sorglos"; } -threadName1=mySuccess():new component { +threadName1=mySuccess():new component { function onSuccess(result) { thread.success=result; } -}; +}; // wait for the thread to finish threadJoin(threadName1); @@ -203,7 +201,6 @@ dump(cfthread[threadName1].success); ``` - ## No Listener In case you wanna simply a asynchron execution, but you don't care about the outcome, you can define no listener at all, simply pass `null` (in this case i use the function `nullValue()`, because only with full null support enabled, the constant `null` is available).