{"id":16757241,"url":"https://github.com/zspitzer/lucee-cfml-resource-provider","last_synced_at":"2026-01-02T19:18:03.029Z","repository":{"id":97746834,"uuid":"339486614","full_name":"zspitzer/lucee-cfml-resource-provider","owner":"zspitzer","description":"Lucee CFML resource provider per scope","archived":false,"fork":false,"pushed_at":"2021-03-08T17:29:42.000Z","size":396,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-22T19:48:11.356Z","etag":null,"topics":["lucee"],"latest_commit_sha":null,"homepage":"","language":"ColdFusion","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zspitzer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-16T18:07:00.000Z","updated_at":"2021-03-08T17:29:44.000Z","dependencies_parsed_at":"2023-03-09T06:15:13.059Z","dependency_job_id":null,"html_url":"https://github.com/zspitzer/lucee-cfml-resource-provider","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zspitzer%2Flucee-cfml-resource-provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zspitzer%2Flucee-cfml-resource-provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zspitzer%2Flucee-cfml-resource-provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zspitzer%2Flucee-cfml-resource-provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zspitzer","download_url":"https://codeload.github.com/zspitzer/lucee-cfml-resource-provider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243837851,"owners_count":20355954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lucee"],"created_at":"2024-10-13T03:43:15.256Z","updated_at":"2026-01-02T19:18:02.966Z","avatar_url":"https://github.com/zspitzer.png","language":"ColdFusion","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Experimental Lucee CFML resource provider\n\nThis is an experiment to see if I could implement the following feature request via a cfml extension\n\nInspired by add session and request based ram drives https://luceeserver.atlassian.net/browse/LDEV-2914\n\nWhich I first proposed way back in 2009! https://www.bennadel.com/blog/1650-learning-coldfusion-9-the-virtual-file-system-ram-disk.htm#comments_19299\n\nRecently I realised that Lucee supports adding Resource Providers via extensions in CFML\n\ni.e.  eventually `FileWrite(\"request://tempfile.png\", imageObject );`\n\nMailing List Discussion https://dev.lucee.org/t/experimental-cfml-based-resource-provider/7993\n\nCFML based Virtual File Systems\n\nhttps://docs.lucee.org/guides/lucee-5/extensions.html#cfml-based-virtual-file-system\n\nhttps://docs.lucee.org/guides/cookbooks/Vitural-FileSystem.html\n\n### Plans / Ideas\n\nInitially it would be a simple CFC stored in the relevant scope, a purely ram implementaion. When the scope is ends, so does the file system.\n\nMapping this to the file system would interesting too, but ideally,  it would auto cleanup, especially for `request://tempfile.tmp`, but there is no onRequestEnd and the scope listeners for Application and Sessions need to be set in `Application.cfc` i.e. `onApplicationEnd` and `onSessionEnd`\n\nThere is an old proposal *Add Hooks for Java Event Listeners* which could be useful here\nhttps://luceeserver.atlassian.net/browse/LDEV-672\n\nThis could also be adapted/extended to do some interesting stuff like automatically creating resized version of images on save or other workflows\n\n**PRs are very welcome!**\n\n### Build\n\nUsing commandbox, Run `box buildExtension.cfm` to build a .lex file, then manually upload via the admin\n\nYou need to restart Lucee if you make any changes to the installed files under `\\lucee-server\\context\\components\\org\\lucee\\extension\\cfml\\scopeResourceProvider` rather than rebuilding and uploading a .lex file each time.\n\n### Tests\n\nUsing Testbox, see the `/tests` folder\n\n### Status\n\nCurrently up and running, now in an early BETA state, see `test.cfm`.\n\n**You need to manually add the Configuration to `lucee-server.xml` in the `resources` section**\n\nPretty much all working except for the file input and output streams, which is need for `DirectoryCopy()`\n\n### Configation / Storage Options\n\nYou can either specifiy a `scope` or path to a `storageCFC` which implements the `vfsStore.cfc` interfaces\n\n#### Scope Based\n\n`\u003cresource-provider arguments=\"lock-timeout:10000;scope:server\" component=\"org.lucee.extension.cfml.scopeResourceProvider.requestProvider\" scheme=\"server\"/\u003e`\n\nUsing scopes doesn't work yet due to this bug https://luceeserver.atlassian.net/browse/LDEV-3292\n\n`\u003cresource-provider arguments=\"lock-timeout:10000;scope:request\" component=\"org.lucee.extension.cfml.scopeResourceProvider.requestProvider\" scheme=\"request\"/\u003e`\n\n`\u003cresource-provider arguments=\"lock-timeout:10000;scope:application\" component=\"org.lucee.extension.cfml.scopeResourceProvider.requestProvider\" scheme=\"application\"/\u003e`\n\n`\u003cresource-provider arguments=\"lock-timeout:10000;scope:session\" component=\"org.lucee.extension.cfml.scopeResourceProvider.requestProvider\" scheme=\"session\"/\u003e`\n\n#### storageCFC\n\n`\u003cresource-provider arguments=\"lock-timeout:10000;scope:server;storageCFC:vfsStoreFileSystem\" component=\"org.lucee.extension.cfml.scopeResourceProvider.requestProvider\" scheme=\"temp\"/\u003e`\n\nYou can pass in a custom dir as an argument to `vfsStoreFileSystem`, otherwise, it defaults to `dir:#getTempDirectory()#` (not sure about the syntax with windows paths??)\n\n`\u003cresource-provider arguments=\"lock-timeout:10000;scope:server;storageCFC:vfsStoreFileSystem\" component=\"org.lucee.extension.cfml.scopeResourceProvider.requestProvider\" scheme=\"temp\"/\u003e`\n\nWhich then enables `\"temp://\"` which maps to your temp dir. i.e `DirectoryList(\"temp://\");`\n\n`\u003cresource-provider arguments=\"lock-timeout:10000;storageCFC:mapped.path.to.myCoolIdea\" component=\"org.lucee.extension.cfml.scopeResourceProvider.requestProvider\" scheme=\"myCoolIdea\"/\u003e`\n\n### Performance\n\nYou can benchmark against the built in `ram://` VFS drive by calling `test.cfm?scheme=ram\u0026dump=true`\n\nThis cfml resource provider is **about 75% as fast as the built in ram drive**.\n\nRam drives return more metadata to `DirectoryList` which makes the `test.cfm` run slower, you can disable the dumps in `test.cfm` with `?dump=false`\n\nAt the moment, I am using `onMissingMethod` to see just which methods need to be supported for a bare bones resource provider, which is some overhead plus a fake `onMissingProperty` https://luceeserver.atlassian.net/browse/LDEV-3260\n\nhttps://github.com/zspitzer/lucee-cfml-resource-provider/blob/master/components/org/lucee/extension/cfml/scopeResourceProvider/vfsDebugWrapper.cfc#L14\n\nAll the resource provider calls are logged out to `application.log` for debugging, there is a `variables.debug=boolean` in 'vfsBase.cfc`\n\n### Example\n\nBen Nadel had a problem with the performance for `\u003ccfimport\u003e` on Mac Docker\n\nhttps://dev.lucee.org/t/cfmodule-vs-cfimport-radically-different-performance/7999/32?u=zac_spitzer\n\n### Bugs\n\nThe extension now installs, thanks @cfmitrah for pointing out the problem with the `MANIFEST.MF` https://luceeserver.atlassian.net/browse/LDEV-3285\n\nBut it doesn't show up as a resource provider (yet) see `listResourceProviders.cfm`\n\nTurns out cfml extension resource providers don't get installed (yet) https://luceeserver.atlassian.net/browse/LDEV-3286\n\nCfml resource providers can't see the calling scopes https://luceeserver.atlassian.net/browse/LDEV-3292\n\nThere are outstanding bugs relating to resources in Lucee https://luceeserver.atlassian.net/issues/?jql=labels%20%3D%20resources\n\n`DirectoryList(\"request://\");` has a stray / character on windows (affects other resource providers too)\n\nInit args passed to a cfml resource provider are a java hashmap https://luceeserver.atlassian.net/browse/LDEV-3291\n\n`DirectoryCopy()` only throws a mysterious ApplicationException, without cause https://luceeserver.atlassian.net/browse/LDEV-3299  (needed a filter=\"*\" to work)\n\n### Todo\n\n- more testing\n- get fileinput and output streams working\n\n### See also\n\nhttps://github.com/paulklinkenberg/lucee-azure-provider\nhttps://markdrew.io/fun-with-mappings-and-resources-part-3-db-resources\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzspitzer%2Flucee-cfml-resource-provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzspitzer%2Flucee-cfml-resource-provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzspitzer%2Flucee-cfml-resource-provider/lists"}