├── .cflintrc ├── .editorconfig ├── .gitattributes ├── .github └── FUNDING.YML ├── .gitignore ├── .jsbeautifyrc ├── .project ├── apidocs ├── Application.cfc ├── box.json ├── index.cfm ├── internal.cfm ├── server.json └── strategy │ └── commandbox │ ├── CommandBoxStrategy.cfc │ └── resources │ └── templates │ ├── class.cfm │ ├── inc │ ├── common.html │ └── nav.html │ ├── index.cfm │ ├── overview-frame.cfm │ ├── overview-summary.cfm │ ├── package-summary.cfm │ └── packagePages.cfm ├── box-cli ├── box-cli.bat ├── build ├── AppTemplates.xml ├── brew-template.rb ├── build-auto.properties ├── build-ortushq.properties ├── build.properties ├── build.xml ├── lib │ ├── ant-contrib-1.0b3.jar │ ├── ant-deb-0.0.1.jar │ └── maven-ant-tasks-2.1.3.jar └── resource │ └── wget.js ├── license.txt ├── readme.md ├── src ├── bin │ └── box.sh ├── cfml │ ├── .cfformat.json │ ├── modules │ │ └── .gitignore │ └── system │ │ ├── BaseCommand.cfc │ │ ├── BaseTask.cfc │ │ ├── Bootstrap.cfm │ │ ├── Interceptor.cfc │ │ ├── Quotes.txt │ │ ├── Shell.cfc │ │ ├── box.json │ │ ├── config │ │ ├── CacheBox.cfc │ │ ├── CommandBoxDSL.cfc │ │ ├── ESAPI.properties │ │ ├── LogBox.cfc │ │ ├── WireBox.cfc │ │ ├── box.json.txt │ │ ├── box.schema.json │ │ ├── colors.json │ │ ├── server-icons │ │ │ ├── box.png │ │ │ ├── folder.png │ │ │ ├── home.png │ │ │ ├── info.png │ │ │ ├── open.png │ │ │ ├── restart.png │ │ │ ├── run.png │ │ │ ├── runAsync.png │ │ │ ├── runTerminal.png │ │ │ ├── server_settings.png │ │ │ ├── site.png │ │ │ ├── sites.png │ │ │ ├── stop.png │ │ │ ├── trayicon-boxlang-32px.png │ │ │ ├── trayicon-boxlang.png │ │ │ ├── trayicon-cf09-32px.png │ │ │ ├── trayicon-cf09.png │ │ │ ├── trayicon-cf10-32px.png │ │ │ ├── trayicon-cf10.png │ │ │ ├── trayicon-cf11-32px.png │ │ │ ├── trayicon-cf11.png │ │ │ ├── trayicon-cf2016-32px.png │ │ │ ├── trayicon-cf2016.png │ │ │ ├── trayicon-cf2018-32px.png │ │ │ ├── trayicon-cf2018.png │ │ │ ├── trayicon-lucee-32px.png │ │ │ ├── trayicon-lucee.png │ │ │ ├── trayicon-railo-32px.png │ │ │ ├── trayicon-railo.png │ │ │ ├── trayicon.png │ │ │ └── web_settings.png │ │ ├── server.schema.json │ │ ├── urlrewrite-secure.xml │ │ ├── urlrewrite.xml │ │ └── web.xml │ │ ├── endpoints │ │ ├── CFLib-ColdBox.cfc │ │ ├── CFLib.cfc │ │ ├── File.cfc │ │ ├── Folder.cfc │ │ ├── ForgeBox.cfc │ │ ├── Gist.cfc │ │ ├── Git.cfc │ │ ├── Git_HTTP.cfc │ │ ├── Git_HTTPS.cfc │ │ ├── Git_SSH.cfc │ │ ├── Github.cfc │ │ ├── HTTP.cfc │ │ ├── HTTPS.cfc │ │ ├── HTTPS_Cached.cfc │ │ ├── HTTP_Cached.cfc │ │ ├── IEndpoint.cfc │ │ ├── IEndpointInteractive.cfc │ │ ├── Jar.cfc │ │ ├── Java.cfc │ │ ├── Lex.cfc │ │ ├── S3.cfc │ │ └── TempFile.cfc │ │ ├── modules │ │ ├── JSONPrettyPrint │ │ │ ├── ModuleConfig.cfc │ │ │ ├── README.md │ │ │ ├── box.json │ │ │ └── models │ │ │ │ ├── ANSIPrint.cfc │ │ │ │ ├── CFMLPrinter.cfc │ │ │ │ ├── JSONPrettyPrint.cfc │ │ │ │ ├── JSONPrinter.cfc │ │ │ │ └── JSONSimpleParser.cfc │ │ ├── globber │ │ │ ├── ModuleConfig.cfc │ │ │ ├── box.json │ │ │ ├── models │ │ │ │ ├── Globber.cfc │ │ │ │ └── PathPatternMatcher.cfc │ │ │ └── readme.md │ │ ├── jmespath │ │ │ ├── Cheatsheet.md │ │ │ ├── ModuleConfig.cfc │ │ │ ├── README.md │ │ │ ├── box.json │ │ │ ├── models │ │ │ │ ├── JmesPath.cfc │ │ │ │ ├── Lexer.cfc │ │ │ │ ├── Parser.cfc │ │ │ │ ├── Runtime.cfc │ │ │ │ └── TreeInterpreter.cfc │ │ │ ├── server.json │ │ │ ├── test.cfm │ │ │ └── testbox.json │ │ ├── jsondiff │ │ │ ├── LICENSE │ │ │ ├── ModuleConfig.cfc │ │ │ ├── box.json │ │ │ └── models │ │ │ │ └── jsondiff.cfc │ │ ├── propertyFile │ │ │ ├── ModuleConfig.cfc │ │ │ ├── box.json │ │ │ ├── models │ │ │ │ └── PropertyFile.cfc │ │ │ └── readme.md │ │ ├── semver │ │ │ ├── LICENSE │ │ │ ├── ModuleConfig.cfc │ │ │ ├── box.json │ │ │ └── models │ │ │ │ └── SemanticVersion.cfc │ │ └── string-similarity │ │ │ ├── ModuleConfig.cfc │ │ │ ├── box.json │ │ │ ├── models │ │ │ └── StringSimilarity.cfc │ │ │ └── readme.md │ │ ├── modules_app │ │ ├── artifacts-commands │ │ │ ├── ModuleConfig.cfc │ │ │ └── commands │ │ │ │ └── artifacts │ │ │ │ ├── clean.cfc │ │ │ │ ├── help.cfc │ │ │ │ ├── list.cfc │ │ │ │ ├── prune.cfc │ │ │ │ └── remove.cfc │ │ ├── forgebox-commands │ │ │ ├── ModuleConfig.cfc │ │ │ └── commands │ │ │ │ └── forgebox │ │ │ │ ├── endpoint │ │ │ │ ├── help.cfc │ │ │ │ ├── list.cfc │ │ │ │ ├── register.cfc │ │ │ │ ├── remove.cfc │ │ │ │ └── set-default.cfc │ │ │ │ ├── help.cfc │ │ │ │ ├── login.cfc │ │ │ │ ├── logout.cfc │ │ │ │ ├── my-contributions.cfc │ │ │ │ ├── publish.cfc │ │ │ │ ├── register.cfc │ │ │ │ ├── search.cfc │ │ │ │ ├── show.cfc │ │ │ │ ├── slugcheck.cfc │ │ │ │ ├── types.cfc │ │ │ │ ├── unpublish.cfc │ │ │ │ ├── use.cfc │ │ │ │ ├── version-debug.cfc │ │ │ │ └── whoami.cfc │ │ ├── games-commands │ │ │ ├── ModuleConfig.cfc │ │ │ └── commands │ │ │ │ └── game │ │ │ │ └── snake.cfc │ │ ├── package-commands │ │ │ ├── ModuleConfig.cfc │ │ │ ├── commands │ │ │ │ ├── endpoint │ │ │ │ │ ├── login.cfc │ │ │ │ │ ├── logout.cfc │ │ │ │ │ ├── publish.cfc │ │ │ │ │ ├── register.cfc │ │ │ │ │ └── unpublish.cfc │ │ │ │ └── package │ │ │ │ │ ├── bugs.cfc │ │ │ │ │ ├── clear.cfc │ │ │ │ │ ├── documentation.cfc │ │ │ │ │ ├── help.cfc │ │ │ │ │ ├── homepage.cfc │ │ │ │ │ ├── init-wizard.cfc │ │ │ │ │ ├── init.cfc │ │ │ │ │ ├── install.cfc │ │ │ │ │ ├── link.cfc │ │ │ │ │ ├── list.cfc │ │ │ │ │ ├── outdated.cfc │ │ │ │ │ ├── run-script.cfc │ │ │ │ │ ├── set.cfc │ │ │ │ │ ├── show.cfc │ │ │ │ │ ├── uninstall.cfc │ │ │ │ │ ├── unlink.cfc │ │ │ │ │ ├── update.cfc │ │ │ │ │ └── version.cfc │ │ │ ├── interceptors │ │ │ │ ├── PackageScripts.cfc │ │ │ │ └── PackageSystemSettingExpansions.cfc │ │ │ └── models │ │ │ │ └── JGitProgressMonitor.cfc │ │ ├── server-commands │ │ │ ├── ModuleConfig.cfc │ │ │ ├── bin │ │ │ │ ├── server_spawner.sh │ │ │ │ └── www-engine.zip │ │ │ ├── commands │ │ │ │ └── server │ │ │ │ │ ├── cd.cfc │ │ │ │ │ ├── cfpm.cfc │ │ │ │ │ ├── clear.cfc │ │ │ │ │ ├── forget.cfc │ │ │ │ │ ├── help.cfc │ │ │ │ │ ├── java │ │ │ │ │ ├── help.cfc │ │ │ │ │ ├── install.cfc │ │ │ │ │ ├── list.cfc │ │ │ │ │ ├── search.cfc │ │ │ │ │ ├── setDefault.cfc │ │ │ │ │ └── uninstall.cfc │ │ │ │ │ ├── list.cfc │ │ │ │ │ ├── log.cfc │ │ │ │ │ ├── lucee-deploy.cfc │ │ │ │ │ ├── open.cfc │ │ │ │ │ ├── prune.cfc │ │ │ │ │ ├── restart.cfc │ │ │ │ │ ├── run-script.cfc │ │ │ │ │ ├── set.cfc │ │ │ │ │ ├── show.cfc │ │ │ │ │ ├── start.cfc │ │ │ │ │ ├── status.cfc │ │ │ │ │ └── stop.cfc │ │ │ └── interceptors │ │ │ │ ├── ServerCommandLine.cfc │ │ │ │ ├── ServerScripts.cfc │ │ │ │ └── ServerSystemSettingExpansions.cfc │ │ ├── system-commands │ │ │ ├── ModuleConfig.cfc │ │ │ ├── commands │ │ │ │ ├── ask.cfc │ │ │ │ ├── assertEqual.cfc │ │ │ │ ├── assertFalse.cfc │ │ │ │ ├── assertNotEqual.cfc │ │ │ │ ├── assertTrue.cfc │ │ │ │ ├── browse.cfc │ │ │ │ ├── cat.cfc │ │ │ │ ├── cd.cfc │ │ │ │ ├── cfml.cfc │ │ │ │ ├── checksum.cfc │ │ │ │ ├── clear.cfc │ │ │ │ ├── clipboard.cfc │ │ │ │ ├── config │ │ │ │ │ ├── clear.cfc │ │ │ │ │ ├── set.cfc │ │ │ │ │ ├── show.cfc │ │ │ │ │ └── sync │ │ │ │ │ │ ├── diff.cfc │ │ │ │ │ │ ├── pull.cfc │ │ │ │ │ │ └── push.cfc │ │ │ │ ├── confirm.cfc │ │ │ │ ├── cp.cfc │ │ │ │ ├── delete.cfc │ │ │ │ ├── dir.cfc │ │ │ │ ├── echo.cfc │ │ │ │ ├── edit.cfc │ │ │ │ ├── env │ │ │ │ │ ├── clear.cfc │ │ │ │ │ ├── debug.cfc │ │ │ │ │ ├── set.cfc │ │ │ │ │ └── show.cfc │ │ │ │ ├── execute.cfc │ │ │ │ ├── fileAppend.cfc │ │ │ │ ├── fileWrite.cfc │ │ │ │ ├── forEach.cfc │ │ │ │ ├── grep.cfc │ │ │ │ ├── head.cfc │ │ │ │ ├── help.cfc │ │ │ │ ├── history.cfc │ │ │ │ ├── info.cfc │ │ │ │ ├── jq.cfc │ │ │ │ ├── mkdir.cfc │ │ │ │ ├── more.cfc │ │ │ │ ├── mv.cfc │ │ │ │ ├── pathExists.cfc │ │ │ │ ├── pause.cfc │ │ │ │ ├── printColumns.cfc │ │ │ │ ├── printTable.cfc │ │ │ │ ├── prompt.cfc │ │ │ │ ├── propertyFile │ │ │ │ │ ├── clear.cfc │ │ │ │ │ ├── set.cfc │ │ │ │ │ └── show.cfc │ │ │ │ ├── pwd.cfc │ │ │ │ ├── quit.cfc │ │ │ │ ├── recipe.cfc │ │ │ │ ├── reload.cfc │ │ │ │ ├── repl.cfc │ │ │ │ ├── run.cfc │ │ │ │ ├── sed.cfc │ │ │ │ ├── sort.cfc │ │ │ │ ├── sql.cfc │ │ │ │ ├── system-colors.cfc │ │ │ │ ├── system-log.cfc │ │ │ │ ├── tail.cfc │ │ │ │ ├── tokenReplace.cfc │ │ │ │ ├── touch.cfc │ │ │ │ ├── unansi.cfc │ │ │ │ ├── unique.cfc │ │ │ │ ├── upgrade.cfc │ │ │ │ ├── version.cfc │ │ │ │ └── watch.cfc │ │ │ └── interceptors │ │ │ │ ├── ConfigForgeBoxSync.cfc │ │ │ │ └── JSONSystemSettingExpansions.cfc │ │ ├── task-commands │ │ │ ├── ModuleConfig.cfc │ │ │ ├── commands │ │ │ │ └── task │ │ │ │ │ ├── create.cfc │ │ │ │ │ └── run.cfc │ │ │ ├── models │ │ │ │ └── TaskService.cfc │ │ │ └── templates │ │ │ │ └── TaskContent.txt │ │ └── utils-commands │ │ │ ├── ModuleConfig.cfc │ │ │ └── commands │ │ │ └── utils │ │ │ ├── add-eol-at-eof.cfc │ │ │ ├── normalize-indents.cfc │ │ │ ├── normalize-line-endings.cfc │ │ │ └── remove-trailing-spaces.cfc │ │ ├── services │ │ ├── ArtifactService.cfc │ │ ├── CommandService.cfc │ │ ├── ConfigService.cfc │ │ ├── EndpointService.cfc │ │ ├── FRTransService.cfc │ │ ├── InterceptorService.cfc │ │ ├── JSONService.cfc │ │ ├── JavaService.cfc │ │ ├── ModuleService.cfc │ │ ├── PackageService.cfc │ │ ├── S3Service.cfc │ │ ├── ServerEngineService.cfc │ │ └── ServerService.cfc │ │ ├── tmp │ │ └── tmp_files_go_here.txt │ │ ├── util │ │ ├── ANSIConsoleAppender.cfc │ │ ├── AnsiFormatter.cfc │ │ ├── CFMLExecutor.cfc │ │ ├── CommandDSL.cfc │ │ ├── ConsolePainter.cfc │ │ ├── DataConverter.cfc │ │ ├── DiskStore.cfc │ │ ├── FileSystem.cfc │ │ ├── ForgeBox.cfc │ │ ├── Formatter.cfc │ │ ├── InteractiveJob.cfc │ │ ├── MultiSelect.cfc │ │ ├── Parser.cfc │ │ ├── Print.cfc │ │ ├── PrintBuffer.cfc │ │ ├── ProgressBar.cfc │ │ ├── ProgressBarGeneric.cfc │ │ ├── ProgressableDownloader.cfc │ │ ├── REPLParser.cfc │ │ ├── ReaderFactory.cfc │ │ ├── SystemSettings.cfc │ │ ├── TablePrinter.cfc │ │ ├── TaskDSL.cfc │ │ ├── Watcher.cfc │ │ └── jline │ │ │ ├── ArgumentList.cfc │ │ │ ├── CommandCompletor.cfc │ │ │ ├── CommandHighlighter.cfc │ │ │ ├── CommandParser.cfc │ │ │ ├── REPLCompletor.cfc │ │ │ ├── REPLHighlighter.cfc │ │ │ └── SignalHandler.cfc │ │ └── wirebox │ │ ├── box.json │ │ └── system │ │ ├── aop │ │ ├── Matcher.cfc │ │ ├── MethodInterceptor.cfc │ │ ├── MethodInvocation.cfc │ │ ├── Mixer.cfc │ │ ├── MixerUtil.cfc │ │ ├── aspects │ │ │ ├── CFTransaction.cfc │ │ │ └── MethodLogger.cfc │ │ └── tmp │ │ │ └── generationPath.txt │ │ ├── async │ │ ├── AsyncManager.cfc │ │ ├── executors │ │ │ ├── Executor.cfc │ │ │ ├── ExecutorBuilder.cfc │ │ │ └── ScheduledExecutor.cfc │ │ ├── proxies │ │ │ ├── BaseProxy.cfc │ │ │ ├── BiConsumer.cfc │ │ │ ├── BiFunction.cfc │ │ │ ├── Callable.cfc │ │ │ ├── Consumer.cfc │ │ │ ├── Function.cfc │ │ │ ├── FutureFunction.cfc │ │ │ ├── Runnable.cfc │ │ │ └── Supplier.cfc │ │ ├── tasks │ │ │ ├── Future.cfc │ │ │ ├── FutureTask.cfc │ │ │ ├── ScheduledFuture.cfc │ │ │ ├── ScheduledTask.cfc │ │ │ └── Scheduler.cfc │ │ └── time │ │ │ ├── ChronoUnit.cfc │ │ │ ├── Duration.cfc │ │ │ ├── Period.cfc │ │ │ └── TimeUnit.cfc │ │ ├── cache │ │ ├── AbstractCacheBoxProvider.cfc │ │ ├── CacheFactory.cfc │ │ ├── ICacheProvider.cfc │ │ ├── IColdboxApplicationCache.cfc │ │ ├── config │ │ │ ├── CacheBoxConfig.cfc │ │ │ ├── DefaultConfiguration.cfc │ │ │ ├── LogBox.cfc │ │ │ └── samples │ │ │ │ └── Sample.CacheBox.cfc │ │ ├── license.txt │ │ ├── policies │ │ │ ├── AbstractEvictionPolicy.cfc │ │ │ ├── FIFO.cfc │ │ │ ├── IEvictionPolicy.cfc │ │ │ ├── LFU.cfc │ │ │ ├── LIFO.cfc │ │ │ └── LRU.cfc │ │ ├── providers │ │ │ ├── CFColdBoxProvider.cfc │ │ │ ├── CFProvider.cfc │ │ │ ├── CacheBoxColdBoxProvider.cfc │ │ │ ├── CacheBoxProvider.cfc │ │ │ ├── ICacheProvider.cfc │ │ │ ├── IColdBoxProvider.cfc │ │ │ ├── LuceeColdboxProvider.cfc │ │ │ ├── LuceeProvider.cfc │ │ │ ├── MockProvider.cfc │ │ │ ├── cf-lib │ │ │ │ └── CFStats.cfc │ │ │ └── lucee-lib │ │ │ │ └── LuceeStats.cfc │ │ ├── readme.md │ │ ├── report │ │ │ ├── ReportHandler.cfc │ │ │ ├── monitor.cfm │ │ │ └── skins │ │ │ │ └── default │ │ │ │ ├── CacheCharting.cfm │ │ │ │ ├── CacheContentReport.cfm │ │ │ │ ├── CachePanel.cfm │ │ │ │ ├── CacheReport.cfm │ │ │ │ ├── cachebox.css │ │ │ │ ├── cachebox.js │ │ │ │ └── images │ │ │ │ ├── bg-glass.png │ │ │ │ └── bg-glass2.png │ │ ├── store │ │ │ ├── BlackholeStore.cfc │ │ │ ├── ConcurrentSoftReferenceStore.cfc │ │ │ ├── ConcurrentStore.cfc │ │ │ ├── DiskStore.cfc │ │ │ ├── IObjectStore.cfc │ │ │ ├── JDBCStore.cfc │ │ │ ├── indexers │ │ │ │ ├── JDBCMetadataIndexer.cfc │ │ │ │ └── MetadataIndexer.cfc │ │ │ └── sql │ │ │ │ ├── JDBCStore-MSSQL.sql │ │ │ │ ├── JDBCStore-MySQL.sql │ │ │ │ └── JDBCStore-Postgres.sql │ │ └── util │ │ │ ├── CacheStats.cfc │ │ │ ├── ElementCleaner.cfc │ │ │ ├── EventURLFacade.cfc │ │ │ ├── ICacheStats.cfc │ │ │ └── IStats.cfc │ │ ├── core │ │ ├── collections │ │ │ └── ScopeStorage.cfc │ │ ├── conversion │ │ │ ├── CFDocument.cfm │ │ │ ├── DataMarshaller.cfc │ │ │ ├── ObjectMarshaller.cfc │ │ │ └── XMLConverter.cfc │ │ ├── dynamic │ │ │ ├── BeanPopulator.cfc │ │ │ └── MixerUtil.cfc │ │ ├── events │ │ │ ├── EventPool.cfc │ │ │ └── EventPoolManager.cfc │ │ └── util │ │ │ ├── CFMLEngine.cfc │ │ │ ├── CFMappingHelper.cfc │ │ │ ├── LuceeMappingHelper.cfc │ │ │ ├── Util.cfc │ │ │ └── cffeed.cfm │ │ ├── ioc │ │ ├── Builder.cfc │ │ ├── IInjector.cfc │ │ ├── IProvider.cfc │ │ ├── Injector.cfc │ │ ├── Provider.cfc │ │ ├── Scopes.cfc │ │ ├── Types.cfc │ │ ├── config │ │ │ ├── Binder.cfc │ │ │ ├── DefaultBinder.cfc │ │ │ ├── LogBox.cfc │ │ │ ├── Mapping.cfc │ │ │ └── Mixin.cfc │ │ ├── dsl │ │ │ ├── CacheBoxDSL.cfc │ │ │ ├── ColdBoxDSL.cfc │ │ │ ├── IDSLBuilder.cfc │ │ │ └── LogBoxDSL.cfc │ │ ├── license.txt │ │ ├── readme.md │ │ └── scopes │ │ │ ├── CFScopes.cfc │ │ │ ├── CacheBox.cfc │ │ │ ├── IScope.cfc │ │ │ ├── NoScope.cfc │ │ │ ├── RequestScope.cfc │ │ │ └── Singleton.cfc │ │ └── logging │ │ ├── AbstractAppender.cfc │ │ ├── Layout.cfc │ │ ├── LogBox.cfc │ │ ├── LogEvent.cfc │ │ ├── LogLevels.cfc │ │ ├── Logger.cfc │ │ ├── appenders │ │ ├── CFAppender.cfc │ │ ├── ConsoleAppender.cfc │ │ ├── DBAppender.cfc │ │ ├── DummyAppender.cfc │ │ ├── EmailAppender.cfc │ │ ├── FileAppender.cfc │ │ ├── RollingFileAppender.cfc │ │ ├── ScopeAppender.cfc │ │ ├── SocketAppender.cfc │ │ └── TracerAppender.cfc │ │ ├── config │ │ ├── DefaultConfig.cfc │ │ ├── LogBoxConfig.cfc │ │ └── samples │ │ │ └── Sample.LogBox.cfc │ │ ├── license.txt │ │ ├── readme.md │ │ └── util │ │ └── FileRotator.cfc ├── java │ ├── cliloader │ │ ├── BOMInputStream.java │ │ ├── ByteOrderMark.java │ │ ├── LoaderCLIMain.java │ │ ├── NonClosingInputStream.java │ │ ├── ProxyInputStream.java │ │ ├── Util.java │ │ ├── VersionComparator.java │ │ ├── cli.properties │ │ └── version.properties │ └── com │ │ └── ortussolutions │ │ └── commandbox │ │ ├── authentication │ │ └── ProxyAuthenticator.java │ │ └── jgit │ │ ├── CommandCaller.java │ │ ├── GenericSessionFactory.java │ │ └── SSHCallback.java └── resources │ ├── box.ico │ ├── box.png │ ├── error-cli.cfm │ ├── log4j.xml │ ├── log4j2.xml │ ├── trayicon.png │ ├── traymenu-adobe.json │ ├── traymenu-default.json │ ├── traymenu-lucee.json │ └── traymenu-railo.json └── tests ├── Application.cfc ├── HttpAntRunner.cfc ├── RemoteFacade.cfc ├── cfadminpassword.txt ├── cfml ├── commands │ └── TestHelp.cfc └── system │ ├── TestCompletor.cfc │ ├── TestShell.cfc │ ├── services │ └── TestCommandService.cfc │ └── util │ ├── TestPrint.cfc │ ├── TestSemanticVersion.cfc │ └── testREPLparser.cfc ├── config └── WireBox.cfc ├── run.cfm ├── runner.cfm └── tboxrunner.cfm /.editorconfig: -------------------------------------------------------------------------------- 1 | # https://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = false 10 | indent_style = tab 11 | indent_size = 4 12 | tab_width = 4 13 | 14 | [*.yml] 15 | indent_style = space 16 | indent_size = 2 17 | 18 | [*.{md,markdown}] 19 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | .sh eol=lf 3 | * text=auto 4 | 5 | # Custom for Visual Studio 6 | *.cs diff=csharp 7 | *.sln merge=union 8 | *.csproj merge=union 9 | *.vbproj merge=union 10 | *.fsproj merge=union 11 | *.dbproj merge=union 12 | 13 | # Standard to msysgit 14 | *.doc diff=astextplain 15 | *.DOC diff=astextplain 16 | *.docx diff=astextplain 17 | *.DOCX diff=astextplain 18 | *.dot diff=astextplain 19 | *.DOT diff=astextplain 20 | *.pdf diff=astextplain 21 | *.PDF diff=astextplain 22 | *.rtf diff=astextplain 23 | *.RTF diff=astextplain -------------------------------------------------------------------------------- /.github/FUNDING.YML: -------------------------------------------------------------------------------- 1 | patreon: ortussolutions 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build Folders & OS 2 | /dist 3 | /build/build.number 4 | /build/temp 5 | /build/JREs 6 | /build/requires.txt 7 | /lib 8 | /src/cfml/box.json 9 | WEB-INF 10 | tests/results 11 | tests/work 12 | Icon? 13 | src/cfml/logs 14 | build/launch4j-* 15 | build/runwar 16 | tests/testbox 17 | /mxunit 18 | /apidocs/CommandBox-CommandDocs/ 19 | /apidocs/CommandBox-APIDocs/ 20 | build-local.properties 21 | build/resources 22 | src/cfml/.version 23 | org.eclipse.jdt.ui.prefs 24 | apidocs/docbox 25 | commandbox.rb 26 | /testbox 27 | jmimemagic.log 28 | 29 | # CommandBox config 30 | src/CommandBox.json 31 | .classpath 32 | 33 | # IDE 34 | .vscode 35 | settings.xml 36 | .project 37 | src/cfml/system/mdCache 38 | extensions/** 39 | lib-light/** 40 | src/cfml/license.txt 41 | /src/cfml/libExt 42 | -------------------------------------------------------------------------------- /.jsbeautifyrc: -------------------------------------------------------------------------------- 1 | { 2 | "beautify.language": { 3 | "js": ["js","json","cfc"], 4 | "css": ["css", "scss"], 5 | "html": ["htm", "html", "cfml", "cfm"] 6 | }, 7 | "brace_style": "collapse", 8 | "indent_with_tabs": true, 9 | "indent_size": 4, 10 | "indent_level": 0, 11 | "preserve_newlines": true, 12 | "max_preserve_newlines": 5, 13 | "html": { 14 | "allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg", "cfm", "cfml"], 15 | "indent_scripts": "keep", 16 | "indent_inner_html": true, 17 | "indent_body_inner_html": true, 18 | "indent_handlebars": true, 19 | "unformatted": ["code", "pre"], 20 | "content_unformatted": ["pre", "code"], 21 | "wrap_line_length": 0 22 | }, 23 | "css": { 24 | "selector_separator_newline": true 25 | }, 26 | "js": { 27 | "break_chained_methods": true, 28 | "comma_first": false, 29 | "e4x": false, 30 | "jslint_happy": true, 31 | "keep_function_indentation": true, 32 | "keep_array_indentation": true, 33 | "space_after_anon_function": false, 34 | "spaceBeforeConditional": true, 35 | "space_in_paren": true, 36 | "space_in_empty_paren": false, 37 | "space_before_conditional": true, 38 | "operator_position": "before-newline", 39 | "unescape_strings": false, 40 | "wrap_line_length": 0 41 | } 42 | } -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | CommandBox 4 | 5 | 6 | 7 | 8 | 9 | 10 | com.adobe.ide.coldfusion.projectNature 11 | org.eclipse.jdt.core.javanature 12 | 13 | 14 | -------------------------------------------------------------------------------- /apidocs/Application.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * CommandBox CLI 3 | * Copyright since 2012 by Ortus Solutions, Corp 4 | * www.ortussolutions.com/products/commandbox 5 | * --- 6 | * Application Bootstrap 7 | */ 8 | component{ 9 | 10 | this.name = "CommandBox-APIDocs" & hash(getCurrentTemplatePath()); 11 | this.sessionManagement = true; 12 | this.sessionTimeout = createTimeSpan(0,0,1,0); 13 | this.setClientCookies = true; 14 | 15 | // mappings 16 | API_ROOT = getDirectoryFromPath( getCurrentTemplatePath() ); 17 | this.mappings[ "/docbox" ] = API_ROOT & "/docbox"; 18 | 19 | rootPath = REReplaceNoCase( API_ROOT, "apidocs(\\|\/)$", "" ); 20 | this.mappings[ "/root" ] = rootPath; 21 | this.mappings[ "/commandbox" ] = rootPath & "src/cfml"; 22 | this.mappings[ '/wirebox' ] = rootPath & "src/cfml/system/wirebox"; 23 | 24 | // request start 25 | public boolean function onRequestStart( String targetPage ){ 26 | return true; 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /apidocs/box.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"CommandBox API Docs", 3 | "version":"1.0.0", 4 | "slug":"commandbox-apidocs", 5 | "private":true, 6 | "dependencies":{ 7 | "docbox":"https://github.com/Ortus-Solutions/DocBox/archive/v2.0.4.zip" 8 | }, 9 | "devDependencies":{ 10 | 11 | }, 12 | "installPaths":{ 13 | "docbox":"docbox" 14 | } 15 | } -------------------------------------------------------------------------------- /apidocs/index.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | try{ 6 | docName = "CommandBox-CommandDocs"; 7 | docbox = new docBox.DocBox( 8 | strategy = "strategy.commandbox.CommandBoxStrategy", 9 | properties = { 10 | projectTitle = "CommandBox v#url.version#", 11 | outputDir = url.path 12 | } 13 | ); 14 | baseDir = expandPath( '/commandbox' ); 15 | commandDirs = directoryList(path='/commandbox/system/modules_app', recurse=true, filter=function(path){ return reFindNoCase( '.*[/\\]commands$', arguments.path ); } ); 16 | source = [ 17 | ]; 18 | for( dir in commandDirs ) { 19 | source.append( 20 | { 21 | dir : dir, 22 | mapping : listChangeDelims( replaceNoCase( dir, baseDir, 'commandbox' ), '.', '/\' ) 23 | } 24 | ); 25 | } 26 | docbox.generate( source ); 27 | } catch ( Any e ){ 28 | rethrow; 29 | writeOutput( e.message & e.detail ); 30 | writeDump( "
" & e.stacktrace ); 31 | abort; 32 | } 33 |
34 | 35 |

Command Help Done!

36 | Go to Docs! 37 |
-------------------------------------------------------------------------------- /apidocs/internal.cfm: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | try{ 9 | docName = "CommandBox-APIDocs"; 10 | docbox = new docBox.DocBox( 11 | properties = { 12 | projectTitle = "CommandBox Internal v#url.version#", 13 | outputDir = url.path 14 | } 15 | ); 16 | docbox.generate( 17 | source = expandPath( "/commandbox/system" ), 18 | mapping = "commandbox.system", 19 | excludes = "system\/(modules),system\/(modules_app)" 20 | ); 21 | } catch ( Any e ){ 22 | writeOutput( e.message & e.detail ); 23 | writeDump( "
" & e.stacktrace ); 24 | abort; 25 | } 26 |
27 | 28 |

Command Internal API Docs Done!

29 | Go to Docs! 30 |
-------------------------------------------------------------------------------- /apidocs/server.json: -------------------------------------------------------------------------------- 1 | { 2 | "force":true, 3 | "jvm":{ 4 | "heapSize":"1024" 5 | }, 6 | "openbrowser":"false", 7 | "web":{ 8 | "http":{ 9 | "port":8989 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /apidocs/strategy/commandbox/resources/templates/inc/common.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /apidocs/strategy/commandbox/resources/templates/index.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | #arguments.projecttitle# Command API Documentation 7 | 18 | 19 | 20 | 21 | 22 | 23 | <H2> 24 | Frame Alert</H2> 25 | 26 | <P> 27 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 28 | <BR> 29 | Link to<a href="overview-summary.html">Non-frame version.</a> 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /apidocs/strategy/commandbox/resources/templates/overview-summary.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Overview - #arguments.projectTitle# 7 | 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Namespace Overview
#arguments.qPackages.namespace#
32 |
33 | 34 | 35 | 36 |
-------------------------------------------------------------------------------- /apidocs/strategy/commandbox/resources/templates/packagePages.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | currentDir = this.getOutputDir() & "/" & replace( package, ".", "/", "all" ); 4 | ensureDirectory( currentDir ); 5 | qPackage = getMetaSubquery( arguments.qMetaData, "package = '#package#'", "name asc" ); 6 | qClasses = getMetaSubquery( qPackage, "type='component'", "name asc"); 7 | qInterfaces = getMetaSubquery( qPackage, "type='interface'", "name asc"); 8 | 9 | writeTemplate( 10 | path = currentDir & "/package-summary.html", 11 | template = "#variables.TEMPLATE_PATH#/package-summary.cfm", 12 | projectTitle = this.getProjectTitle(), 13 | package = package, 14 | qClasses = qClasses, 15 | qInterfaces = qInterfaces, 16 | qMetadata = arguments.qMetadata, 17 | namespace = arguments.qMetadata.namespace 18 | ); 19 | 20 | /** 21 | writeTemplate( 22 | path = currentDir & "/package-frame.html", 23 | template = "#variables.TEMPLATE_PATH#/package-frame.cfm", 24 | projectTitle = this.getProjectTitle(), 25 | package = package, 26 | qClasses = qClasses, 27 | qInterfaces = qInterfaces); 28 | **/ 29 | 30 | buildClassPages( qPackage, arguments.qMetadata ); 31 | 32 | -------------------------------------------------------------------------------- /build/AppTemplates.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | App Template Copies From ColdBox Core 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /build/brew-template.rb: -------------------------------------------------------------------------------- 1 | class Commandbox < Formula 2 | desc "CFML embedded server, package manager, and app scaffolding tools" 3 | homepage "https://www.ortussolutions.com/products/commandbox" 4 | url "@repoPRDURL@/ortussolutions/commandbox/@stable-version@/commandbox-bin-@stable-version@.zip" 5 | sha256 "@stable-sha256@" 6 | license "Apache-2.0" 7 | 8 | head do 9 | url "@repoURL@/ortussolutions/commandbox/@version@/commandbox-bin-@version@.zip?build=@buildnumber@" 10 | sha256 "@sha256@" 11 | end 12 | 13 | livecheck do 14 | url :homepage 15 | regex(/Download CommandBox v?(\d+(?:\.\d+)+)/i) 16 | end 17 | 18 | bottle do 19 | sha256 cellar: :any_skip_relocation, all: "45b01d0263bf8842d6b060ed23202a77ab6b33d2a3c1c2a89be80eb4c50324ba" 20 | end 21 | 22 | # not yet compatible with Java 17 on ARM 23 | depends_on "openjdk@11" 24 | 25 | resource "apidocs" do 26 | url "@repoPRDURL@/ortussolutions/commandbox/@stable-version@/commandbox-apidocs-@stable-version@.zip" 27 | sha256 "@apidocs.stable-sha256@" 28 | end 29 | 30 | def install 31 | (libexec/"bin").install "box" 32 | (bin/"box").write_env_script libexec/"bin/box", Language::Java.java_home_env("11") 33 | doc.install resource("apidocs") 34 | end 35 | 36 | test do 37 | system "#{bin}/box", "--commandbox_home=~/", "version" 38 | system "#{bin}/box", "--commandbox_home=~/", "help" 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /build/build-auto.properties: -------------------------------------------------------------------------------- 1 | #java build 2 | java.pack200=false 3 | local.build=false 4 | 5 | #build locations 6 | build.type=auto 7 | artifact.baseDir=/var/www/vhosts/stg.ortussolutions.com/integration/artifacts/ 8 | artifact.dir=${artifact.baseDir}${distro.groupID}/${distro.name} 9 | dist.dir=${artifact.dir}/${commandbox.version} 10 | url.api=http://integration.stg.ortussolutions.com/box-cli/apidocs/commandDocs.cfm? 11 | api.dir=/var/www/vhosts/stg.ortussolutions.com/integration/box-cli/build/temp/apidocs 12 | 13 | #debian+rpm repos 14 | rpm.repo=/var/www/vhosts/stg.ortussolutions.com/integration/artifacts/RPMS/noarch 15 | deb.repo=/var/www/vhosts/stg.ortussolutions.com/integration/artifacts/debs/noarch 16 | rpm.repo.stable=/var/www/vhosts/stg.ortussolutions.com/integration/artifacts/RPMS-stable/noarch 17 | deb.repo.stable=/var/www/vhosts/stg.ortussolutions.com/integration/artifacts/debs-stable/noarch 18 | #mvn.type=snapshot# -------------------------------------------------------------------------------- /build/build-ortushq.properties: -------------------------------------------------------------------------------- 1 | #java build 2 | java.pack200=false 3 | local.build=false 4 | 5 | #build locations 6 | build.type=auto 7 | artifact.baseDir=/opt/shared-data/artifacts/ 8 | artifact.dir=${artifact.baseDir}${distro.groupID}/${distro.name} 9 | dist.dir=${artifact.dir}/${commandbox.version} 10 | 11 | #debian+rpm repos 12 | rpm.repo=${artifact.baseDir}/RPMS-be/noarch 13 | deb.repo=${artifact.baseDir}/debs-be/noarch 14 | rpm.repo.stable=${artifact.baseDir}/RPMS-stable/noarch 15 | deb.repo.stable=${artifact.baseDir}/debs-stable/noarch 16 | #mvn.type=snapshot# -------------------------------------------------------------------------------- /build/lib/ant-contrib-1.0b3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/build/lib/ant-contrib-1.0b3.jar -------------------------------------------------------------------------------- /build/lib/ant-deb-0.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/build/lib/ant-deb-0.0.1.jar -------------------------------------------------------------------------------- /build/lib/maven-ant-tasks-2.1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/build/lib/maven-ant-tasks-2.1.3.jar -------------------------------------------------------------------------------- /build/resource/wget.js: -------------------------------------------------------------------------------- 1 | var WinHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1"); 2 | // arg 0 = website URL 3 | // arg 1 = filename 4 | WinHttpReq.Open("GET", WScript.Arguments(0), /*async=*/false); 5 | WinHttpReq.Send(); 6 | 7 | BinStream = new ActiveXObject("ADODB.Stream"); 8 | BinStream.Type = 1; 9 | BinStream.Open(); 10 | BinStream.Write(WinHttpReq.ResponseBody); 11 | BinStream.SaveToFile(WScript.Arguments(1)); -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | ******************************************************************************** 2 | Copyright Since 2014 CommandBox CLI by Ortus Solutions, Corp 3 | www.ortussolutions.com 4 | ******************************************************************************** 5 | CommandBox is open source. However, if you use this product please know that it is bound to the following License. 6 | If you use CommandBox, please make mention of it in your code or web site or add a Powered By CommandBox icon. 7 | 8 | Apache License, Version 2.0 9 | 10 | Copyright Since [2014] [Ortus Solutions,Corp] 11 | 12 | Licensed under the Apache License, Version 2.0 (the "License"); 13 | you may not use this file except in compliance with the License. 14 | You may obtain a copy of the License at 15 | 16 | http://www.apache.org/licenses/LICENSE-2.0 17 | 18 | Unless required by applicable law or agreed to in writing, software 19 | distributed under the License is distributed on an "AS IS" BASIS, 20 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | See the License for the specific language governing permissions and 22 | limitations under the License. -------------------------------------------------------------------------------- /src/cfml/modules/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore -------------------------------------------------------------------------------- /src/cfml/system/box.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"CommandBox System Core", 3 | "version":"@build.version@+@build.number@", 4 | "author":"Brad Wood", 5 | "shortDescription":"This tracks the CommandBox core dependencies", 6 | "dependencies":{ 7 | "string-similarity":"^1.0.0", 8 | "semver":"^1.2.3", 9 | "globber":"^3.0.4", 10 | "JSONPrettyPrint":"^1.0.0", 11 | "propertyFile":"^1.0.9", 12 | "JMESPath":"^2.4.0", 13 | "jsondiff":"^1.1.3" 14 | }, 15 | "devDependencies":{}, 16 | "installPaths":{ 17 | "string-similarity":"modules\\string-similarity", 18 | "semver":"modules/semver/", 19 | "globber":"modules/globber/", 20 | "JSONPrettyPrint":"modules\\JSONPrettyPrint", 21 | "propertyFile":"modules\\propertyFile", 22 | "jsondiff":"modules/jsondiff/" 23 | } 24 | } -------------------------------------------------------------------------------- /src/cfml/system/config/CacheBox.cfc: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | ******************************************************************************** 5 | * The default ColdBox CacheBox configuration object that is used when the cache factory is created by itself 6 | **/ 7 | component{ 8 | 9 | /** 10 | * Configure CacheBox, that's it! 11 | */ 12 | function configure(){ 13 | 14 | // The CacheBox configuration structure DSL 15 | cacheBox = { 16 | 17 | // Scope registration, automatically register the cachebox factory instance on any CF scope 18 | // By default it registers itself on server scope 19 | scopeRegistration = { 20 | enabled = true, 21 | scope = "application", // server, cluster, session 22 | key = "cacheBox" 23 | }, 24 | 25 | // The defaultCache has an implicit name "default" which is a reserved cache name 26 | // It also has a default provider of cachebox which cannot be changed. 27 | // All timeouts are in minutes 28 | defaultCache = { 29 | objectDefaultTimeout = 60, 30 | objectDefaultLastAccessTimeout = 30, 31 | useLastAccessTimeouts = true, 32 | reapFrequency = 2, 33 | freeMemoryPercentageThreshold = 0, 34 | evictionPolicy = "LRU", 35 | evictCount = 1, 36 | maxObjects = 200, 37 | objectStore = "ConcurrentSoftReferenceStore" 38 | }, 39 | 40 | // Register all the custom named caches you like here 41 | caches = { 42 | metadataCache = { 43 | provider="wirebox.system.cache.providers.CacheBoxProvider", 44 | properties = { 45 | objectDefaultTimeout="0", 46 | objectStore="commandbox.system.util.DiskStore", 47 | directoryPath='/commandbox/system/mdCache' 48 | } 49 | } 50 | } 51 | }; 52 | } 53 | 54 | } -------------------------------------------------------------------------------- /src/cfml/system/config/ESAPI.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/ESAPI.properties -------------------------------------------------------------------------------- /src/cfml/system/config/LogBox.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2005 ColdBox Platform by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * LogBox Configuration 7 | */ 8 | component { 9 | 10 | function configure(){ 11 | 12 | logBox = {}; 13 | 14 | // Define Appenders 15 | logBox.appenders = { 16 | fileAppender = { 17 | class="wirebox.system.logging.appenders.RollingFileAppender", 18 | properties = { 19 | fileMaxArchives = 5, 20 | filename = "commandbox", 21 | filepath = expandpath( '/commandbox-home' ) & "/logs", 22 | autoExpand=false 23 | } 24 | }, 25 | ANSIConsoleAppender = { 26 | class="commandbox.system.util.ANSIConsoleAppender" 27 | } 28 | }; 29 | 30 | // Root Logger 31 | logBox.root = { 32 | levelmax="INFO", 33 | levelMin="FATAL", 34 | appenders="fileAppender" 35 | }; 36 | 37 | logBox.categories = { 38 | "console" : { appenders="ANSIConsoleAppender" } 39 | }; 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/cfml/system/config/box.json.txt: -------------------------------------------------------------------------------- 1 | { 2 | "name":"", 3 | "version":"1.0.0", 4 | "author":"", 5 | "location":"forgeboxStorage", 6 | "directory":"", 7 | "createPackageDirectory":true, 8 | "packageDirectory":"", 9 | "homepage":"", 10 | "documentation":"", 11 | "repository":{ 12 | "type":"", 13 | "URL":"" 14 | }, 15 | "bugs":"", 16 | "slug":"", 17 | "shortDescription":"", 18 | "description":"", 19 | "instructions":"", 20 | "changelog":"", 21 | "type":"", 22 | "keywords":[ 23 | 24 | ], 25 | "private":false, 26 | "engines":[ 27 | { 28 | "type":"", 29 | "version":"" 30 | } 31 | ], 32 | "defaultEngine":"", 33 | "defaultPort":0, 34 | "projectURL":"", 35 | "license":[ 36 | { 37 | "type":"", 38 | "URL":"" 39 | } 40 | ], 41 | "contributors":[ 42 | 43 | ], 44 | "dependencies":{ 45 | 46 | }, 47 | "devDependencies":{ 48 | 49 | }, 50 | "installPaths":{ 51 | 52 | }, 53 | "scripts":{ 54 | 55 | }, 56 | "ignore":[ 57 | 58 | ], 59 | "testbox":{ 60 | "runner":[ 61 | { 62 | "default":"" 63 | } 64 | ], 65 | "labels":"", 66 | "excludes":"", 67 | "reporter":"", 68 | "bundles":"", 69 | "recurse":true, 70 | "directory":"tests.specs", 71 | "testBundles":"", 72 | "testSuites":"", 73 | "testSpecs":"", 74 | "verbose":true, 75 | "watchDelay":500, 76 | "watchPaths":"**.cfc", 77 | "options":{} 78 | }, 79 | "reinitWatchDirectory" : "", 80 | "reinitWatchDelay" : 500, 81 | "reinitWatchPaths" : "", 82 | } 83 | -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/box.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/folder.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/home.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/info.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/open.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/restart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/restart.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/run.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/runAsync.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/runAsync.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/runTerminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/runTerminal.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/server_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/server_settings.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/site.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/site.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/sites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/sites.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/stop.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/trayicon-boxlang-32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/trayicon-boxlang-32px.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/trayicon-boxlang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/trayicon-boxlang.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/trayicon-cf09-32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/trayicon-cf09-32px.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/trayicon-cf09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/trayicon-cf09.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/trayicon-cf10-32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/trayicon-cf10-32px.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/trayicon-cf10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/trayicon-cf10.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/trayicon-cf11-32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/trayicon-cf11-32px.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/trayicon-cf11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/trayicon-cf11.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/trayicon-cf2016-32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/trayicon-cf2016-32px.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/trayicon-cf2016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/trayicon-cf2016.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/trayicon-cf2018-32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/trayicon-cf2018-32px.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/trayicon-cf2018.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/trayicon-cf2018.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/trayicon-lucee-32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/trayicon-lucee-32px.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/trayicon-lucee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/trayicon-lucee.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/trayicon-railo-32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/trayicon-railo-32px.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/trayicon-railo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/trayicon-railo.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/trayicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/trayicon.png -------------------------------------------------------------------------------- /src/cfml/system/config/server-icons/web_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/config/server-icons/web_settings.png -------------------------------------------------------------------------------- /src/cfml/system/config/urlrewrite.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Generic Front-Controller URLs 6 | 7 | ^/(flex2gateway|flashservices/gateway|messagebroker|lucee|rest|cfide|CFIDE|cfformgateway|jrunscripts|cf_scripts|mapping-tag|CFFileServlet)/.* 8 | 9 | ^/tuckey-status 10 | 11 | ^/pms$ 12 | 13 | ^/favicon.ico 14 | 16 | ^/.*\.cf(m|ml)/.* 17 | 18 | 19 | 20 | 21 | ^/(.+)$ 22 | /index.cfm/$1 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/cfml/system/endpoints/Folder.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano, Denny Valliant 7 | * 8 | * I am the folder endpoint. I get packages from a local folder. 9 | */ 10 | component accessors="true" implements="IEndpoint" singleton { 11 | 12 | // DI 13 | property name="packageService" inject="packageService"; 14 | property name="semanticVersion" inject="provider:semanticVersion@semver"; 15 | 16 | // Properties 17 | property name="namePrefixes" type="string"; 18 | 19 | function init() { 20 | setNamePrefixes( 'folder' ); 21 | return this; 22 | } 23 | 24 | public string function resolvePackage( required string package, string currentWorkingDirectory="", boolean verbose=false ) { 25 | 26 | package = packageService.findPackageRoot( package ); 27 | 28 | return package; 29 | 30 | } 31 | 32 | /** 33 | * Determines the name of a package based on its ID if there is no box.json 34 | */ 35 | public function getDefaultName( required string package ) { 36 | return listLast( arguments.package, '/\' ); 37 | } 38 | 39 | public function getUpdate( required string package, required string version, boolean verbose=false ) { 40 | var result = { 41 | isOutdated = false, 42 | version = 'unknown' 43 | }; 44 | 45 | if( directoryExists( arguments.package ) ) { 46 | var boxJSON = packageService.readPackageDescriptor( arguments.package ); 47 | result.isOutdated = semanticVersion.isNew( current=arguments.version, target=boxJSON.version ); 48 | result.version = boxJSON.version; 49 | } 50 | 51 | return result; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/cfml/system/endpoints/Gist.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano, Denny Valliant 7 | * 8 | * I am the gist endpoint 9 | * 10 | * - gist: 11 | * - gist:# 12 | * - gist:/ 13 | * - gist:/# 14 | * 15 | * If no is specified, then master is used. 16 | * 17 | */ 18 | component accessors=true implements="IEndpoint" extends="commandbox.system.endpoints.Git" singleton { 19 | 20 | // Properties 21 | property name="namePrefixes" type="string"; 22 | 23 | function init() { 24 | setNamePrefixes( 'gist' ); 25 | return this; 26 | } 27 | 28 | private function getProtocol() { 29 | return 'https://gist.github.com/'; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/cfml/system/endpoints/Git_HTTP.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano, Denny Valliant 7 | * 8 | * I am the git+http endpoint. 9 | */ 10 | component accessors="true" implements="IEndpoint" extends="commandbox.system.endpoints.Git" singleton { 11 | 12 | // Properties 13 | property name="namePrefixes" type="string"; 14 | 15 | function init() { 16 | setNamePrefixes( 'git+http' ); 17 | return this; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/cfml/system/endpoints/Git_SSH.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano, Denny Valliant 7 | * 8 | * I am the git+ssh endpoint. 9 | */ 10 | component accessors="true" implements="IEndpoint" extends="commandbox.system.endpoints.Git" singleton { 11 | 12 | // Properties 13 | property name="namePrefixes" type="string"; 14 | 15 | function init() { 16 | setNamePrefixes( 'git+ssh' ); 17 | return this; 18 | } 19 | 20 | // Set SSH listener 21 | private function secureCloneCommand( required any cloneCommand, string GitURL ) { 22 | // This is our custom SSH callback 23 | var SSHCallback = createObject( 'java', 'com.ortussolutions.commandbox.jgit.SSHCallback' ).init(); 24 | cloneCommand.setTransportConfigCallback( SSHCallback ); 25 | return cloneCommand; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/cfml/system/endpoints/Github.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano, Denny Valliant 7 | * 8 | * I am the github endpoint. I install 'shortcut' packages listed as "user/repo[#committ-ish]" 9 | */ 10 | component accessors="true" implements="IEndpoint" extends="commandbox.system.endpoints.Git" singleton { 11 | 12 | // Properties 13 | property name="namePrefixes" type="string"; 14 | 15 | function init() { 16 | setNamePrefixes( 'github' ); 17 | return this; 18 | } 19 | 20 | public string function resolvePackage( required string package, string currentWorkingDirectory="", boolean verbose=false ) { 21 | if( listLen( arguments.package, '##' ) == 2 ) { 22 | return super.resolvePackage( '//github.com/' & listFirst( arguments.package, '##' ) & '.git' & '##' & listLast( arguments.package, '##' ), currentWorkingDirectory, arguments.verbose ); 23 | } else { 24 | return super.resolvePackage( '//github.com/' & arguments.package & '.git', currentWorkingDirectory, arguments.verbose ); 25 | } 26 | } 27 | 28 | public function getDefaultName( required string package ) { 29 | // Remove committ-ish 30 | var baseURL = listFirst( arguments.package, '##' ); 31 | 32 | // Find last segment of URL (may or may not be a repo name) 33 | return listLast( baseURL, '/' ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/cfml/system/endpoints/HTTPS.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano, Denny Valliant 7 | * 8 | * I am the HTTPS endpoint. I get packages from an HTTPS URL. 9 | */ 10 | component accessors="true" implements="IEndpoint" extends="commandbox.system.endpoints.HTTP" singleton { 11 | 12 | // Properties 13 | property name="namePrefixes" type="string"; 14 | 15 | function init() { 16 | setNamePrefixes( 'HTTPS' ); 17 | return this; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/cfml/system/endpoints/HTTPS_Cached.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano, Denny Valliant 7 | * 8 | * I am the HTTP endpoint. I get packages from an HTTP URL. 9 | */ 10 | component accessors=true implements="IEndpoint" singleton extends="commandbox.system.endpoints.HTTP_Cached" { 11 | 12 | // Properties 13 | property name="namePrefixes" type="string"; 14 | 15 | function init() { 16 | setNamePrefixes( 'HTTPS+cached' ); 17 | return this; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/cfml/system/endpoints/IEndpoint.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano, Denny Valliant 7 | * 8 | * I am an endpoint. I can retrieve packages for you. 9 | */ 10 | interface { 11 | 12 | /** 13 | * Accepts the name of a package, retrieves it, and returns a local folder path where the package is 14 | * 15 | * @throws endpointException 16 | */ 17 | public string function resolvePackage( required string package, string currentWorkingDirectory="", boolean verbose=false ); 18 | 19 | /** 20 | * Determines the name of a package based on its ID if there is no box.json 21 | */ 22 | public function getDefaultName( required string package ); 23 | 24 | /** 25 | * Checks to see if there is an update to the package 26 | * @returns a struct specifying if the currently installed version 27 | * is outdated as well as the newly available version. 28 | * The default return struct is this: 29 | * 30 | * { 31 | * isOutdated = false, 32 | * version = '' 33 | * } 34 | * 35 | * @throws endpointException 36 | */ 37 | public function getUpdate( required string package, required string version, boolean verbose=false ); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/cfml/system/endpoints/IEndpointInteractive.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano, Denny Valliant 7 | * 8 | * I am an interactive endpoint. That means I can not only resolve packages, 9 | * but be logged into and can have packages published to me. 10 | */ 11 | interface extends="IEndpoint" { 12 | 13 | // Returns access token 14 | public string function createUser( 15 | required string username, 16 | required string password, 17 | required string email, 18 | required string firstName, 19 | required string lastName ); 20 | 21 | // Returns access token 22 | public string function login( required string userName, required string password ); 23 | 24 | public function logout( string userName='' ); 25 | 26 | public function publish( required string path, string zipPath, boolean force ); 27 | 28 | public function unpublish( required string path, string version='' ); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/cfml/system/endpoints/TempFile.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano 7 | * 8 | * I am a file endpoint that deletes the zip when finished 9 | */ 10 | component accessors="true" implements="IEndpoint" extends="commandbox.system.endpoints.File" singleton { 11 | 12 | // Properties 13 | property name="namePrefixes" type="string"; 14 | 15 | function init() { 16 | setNamePrefixes( 'tempFile' ); 17 | return this; 18 | } 19 | 20 | // Override 21 | function cleanUp( package ) { 22 | fileDelete( package ); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/cfml/system/modules/JSONPrettyPrint/ModuleConfig.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | this.name = "JSONPrettyPrint"; 4 | this.author = ""; 5 | this.webUrl = "https://github.com//JSONPrettyPrint"; 6 | 7 | function configure() { 8 | // 9 | } 10 | } -------------------------------------------------------------------------------- /src/cfml/system/modules/JSONPrettyPrint/box.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"JSONPrettyPrint", 3 | "version":"1.4.2", 4 | "author":"", 5 | "homepage":"https://github.com/Ortus-Solutions/JSONPrettyPrint", 6 | "documentation":"https://github.com/Ortus-Solutions/JSONPrettyPrint", 7 | "repository":{ 8 | "type":"git", 9 | "URL":"https://github.com/Ortus-Solutions/JSONPrettyPrint" 10 | }, 11 | "bugs":"https://github.com/Ortus-Solutions/JSONPrettyPrint/issues", 12 | "slug":"JSONPrettyPrint", 13 | "shortDescription":"Pretty print JSON objects", 14 | "description":"Pretty print JSON objects", 15 | "type":"modules", 16 | "dependencies":{}, 17 | "devDependencies":{ 18 | "coldbox":"^4.3.0+188", 19 | "testbox":"^2.4.0+80" 20 | }, 21 | "installPaths":{ 22 | "testbox":"testbox", 23 | "coldbox":"tests/resources/app/coldbox" 24 | }, 25 | "scripts":{ 26 | "onRelease":"forgebox use ortus && publish", 27 | "postPublish":"!git push --tags" 28 | }, 29 | "ignore":[ 30 | "**/.*", 31 | "test", 32 | "tests" 33 | ] 34 | } -------------------------------------------------------------------------------- /src/cfml/system/modules/JSONPrettyPrint/models/ANSIPrint.cfc: -------------------------------------------------------------------------------- 1 | component accessors="true" { 2 | 3 | property ANSIDefaults; 4 | 5 | function init() { 6 | setANSIDefaults( { 7 | 'constant' : chr( 27 ) & '[38;5;0m', 8 | 'key' : chr( 27 ) & '[38;5;0m', 9 | 'number' : chr( 27 ) & '[38;5;0m', 10 | 'string' : chr( 27 ) & '[38;5;0m' 11 | } ); 12 | return this; 13 | } 14 | 15 | function wrap( str, type, colors ) { 16 | var code = 0; 17 | 18 | if ( type == 'key' ) { 19 | code = colors.key; 20 | } else if ( left( str, 1 ) == '"' ) { 21 | code = colors.string; 22 | } else if ( len( str ) > 3 && arrayFind( [ 'true', 'false', 'null' ], str ) ) { 23 | code = colors.constant; 24 | } else { 25 | code = colors.number; 26 | } 27 | 28 | if ( code.len() ) { 29 | return code & str & ANSIReset(); 30 | } 31 | return str; 32 | } 33 | 34 | private function ANSIReset() { 35 | return chr( 27 ) & '[0m'; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/cfml/system/modules/globber/ModuleConfig.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | this.name = "globber"; 4 | this.author = ""; 5 | this.webUrl = "https://github.com/Ortus-Solutions/globber/"; 6 | 7 | function configure() { 8 | binder.map( 'globber' ).toDSL( 'globber@globber' ); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/cfml/system/modules/globber/box.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"Globber", 3 | "version":"3.1.5", 4 | "author":"Brad Wood", 5 | "homepage":"https://github.com/Ortus-Solutions/globber/", 6 | "documentation":"https://github.com/Ortus-Solutions/globber/", 7 | "repository":{ 8 | "type":"Git", 9 | "URL":"https://github.com/Ortus-Solutions/globber" 10 | }, 11 | "bugs":"https://github.com/Ortus-Solutions/globber/issues", 12 | "slug":"globber", 13 | "shortDescription":"I am a utility to match file system path patterns.", 14 | "type":"modules", 15 | "dependencies":{}, 16 | "devDependencies":{ 17 | "testbox":"^4.4.0-snapshot", 18 | "coldbox":"^4.3.0+188" 19 | }, 20 | "installPaths":{ 21 | "coldbox":"tests/resources/app/coldbox/", 22 | "testbox":"testbox/" 23 | }, 24 | "scripts":{ 25 | "onRelease":"forgebox use ortus && publish", 26 | "postPublish":"!git push --follow-tags" 27 | }, 28 | "ignore":[ 29 | "**/.*", 30 | "test", 31 | "tests" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /src/cfml/system/modules/jmespath/ModuleConfig.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | this.name = 'JMESPath'; 4 | this.title = 'JMESPath'; 5 | this.author = 'Scott Steinbeck'; 6 | this.webURL = 'https://github.com/scottsteinbeck/jmespath'; 7 | this.description = 'An JMESPath port for Coldfusion. A query language for JSON.'; 8 | this.version = '2.4.0'; 9 | this.autoMapModels = true; 10 | 11 | function configure() { 12 | binder.map('jmespath').to('#moduleMapping#.models.jmespath'); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/cfml/system/modules/jmespath/box.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"JMESPath", 3 | "slug":"jmespath", 4 | "version":"2.4.0", 5 | "author":"Scott Steinbeck ", 6 | "location":"https://github.com/scottsteinbeck/jmespath", 7 | "Documentation":"https://jmespath.org/tutorial.html", 8 | "Repository":{ 9 | "type":"git", 10 | "URL":"https://github.com/scottsteinbeck/jmespath" 11 | }, 12 | "Bugs":"https://github.com/scottsteinbeck/jmespath/issues", 13 | "shortDescription":"An JMESPath port for Coldfusion. A query language for JSON", 14 | "keywords":[ 15 | "json query language", 16 | "jql", 17 | "james path", 18 | "jmes path", 19 | "json query", 20 | "jq" 21 | ], 22 | "private":"false", 23 | "engines":[ 24 | { 25 | "type":"lucee", 26 | "version":">=4.5.x" 27 | } 28 | ], 29 | "Contributors":[ 30 | "Scott Steinbeck " 31 | ], 32 | "DevDependencies":{ 33 | "testbox":"^4.2.1+400" 34 | }, 35 | "installPaths":{ 36 | "testbox":"testbox/" 37 | }, 38 | "type":"modules" 39 | } -------------------------------------------------------------------------------- /src/cfml/system/modules/jmespath/models/JmesPath.cfc: -------------------------------------------------------------------------------- 1 | component singleton { 2 | property name="jmesPathLexer" inject="Lexer@JMESPath"; 3 | property name="jmesPathParser" inject="Parser@JMESPath"; 4 | property name="jmesPathRuntime" inject="Runtime@JMESPath"; 5 | property name="jmesPathTreeInterpreter" inject="TreeInterpreter@JMESPath"; 6 | 7 | function compile(stream) { 8 | var ast = jmesPathParser.parse(stream); 9 | return ast; 10 | } 11 | function tokenize(stream) { 12 | return jmesPathLexer.tokenize(stream); 13 | } 14 | function search(data, expression) { 15 | var node = jmesPathParser.parse(expression); 16 | return jmesPathTreeInterpreter.search(node, data); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/cfml/system/modules/jmespath/server.json: -------------------------------------------------------------------------------- 1 | { 2 | "app":{ 3 | "cfengine":"lucee@5.2.9+31" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/cfml/system/modules/jmespath/test.cfm: -------------------------------------------------------------------------------- 1 | 2 | fileContent = fileRead(expandPath("./testbox.json"), "utf-8") 3 | jmespath = new models.jmespath(); 4 | result = jmespath.search(deserializeJSON(fileContent),'to_entries(dependencies)[?contains(key,`co`)].key'); 5 | dump(serializeJSON(result)) 6 | -------------------------------------------------------------------------------- /src/cfml/system/modules/jsondiff/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Scott Steinbeck 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/cfml/system/modules/jsondiff/ModuleConfig.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | this.name = 'JSON-Diff'; 4 | this.title = 'JSON-Diff'; 5 | this.author = 'Scott Steinbeck'; 6 | this.webURL = 'https://github.com/scottsteinbeck/json-diff'; 7 | this.description = 'An ColdFusion utility for checking if 2 JSON objects have differences'; 8 | this.version = '1.0.4'; 9 | this.autoMapModels = false; 10 | this.dependencies = []; 11 | 12 | function configure() { 13 | binder.map('jsondiff').to('#moduleMapping#.models.jsondiff'); 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /src/cfml/system/modules/jsondiff/box.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"JSON-Diff", 3 | "slug":"jsondiff", 4 | "version":"1.1.3", 5 | "License":[ 6 | { 7 | "type":"MIT", 8 | "URL":"https://github.com/scottsteinbeck/json-diff/blob/master/LICENSE" 9 | } 10 | ], 11 | "author":"Scott Steinbeck ", 12 | "Documentation":"https://github.com/scottsteinbeck/json-diff", 13 | "Repository":{ 14 | "type":"git", 15 | "URL":"https://github.com/scottsteinbeck/json-diff" 16 | }, 17 | "scripts":{ 18 | "postVersion":"publish", 19 | "onRelease":"!git push --follow-tags" 20 | }, 21 | "Bugs":"https://github.com/scottsteinbeck/json-diff/issues", 22 | "shortDescription":"An ColdFusion utility for checking if 2 JSON objects have differences", 23 | "keywords":[ 24 | "json diff", 25 | "json-diff", 26 | "json differences" 27 | ], 28 | "private":"false", 29 | "engines":[ 30 | { 31 | "type":"lucee", 32 | "version":">=4.5.x" 33 | } 34 | ], 35 | "Contributors":[ 36 | "Scott Steinbeck " 37 | ], 38 | "DevDependencies":{ 39 | "testbox":"^4.2.1+400" 40 | }, 41 | "installPaths":{ 42 | "testbox":"testbox/" 43 | }, 44 | "type":"modules", 45 | "dependencies":{} 46 | } -------------------------------------------------------------------------------- /src/cfml/system/modules/propertyFile/ModuleConfig.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | this.autoMapModels = true; 4 | 5 | function configure(){ 6 | } 7 | 8 | } -------------------------------------------------------------------------------- /src/cfml/system/modules/propertyFile/box.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"PropertyFile Util", 3 | "version":"1.3.2", 4 | "author":"Brad Wood", 5 | "location":"forgeboxStorage", 6 | "homepage":"https://github.com/bdw429s/PropertyFile/", 7 | "documentation":"https://github.com/bdw429s/PropertyFile/blob/master/readme.md", 8 | "repository":{ 9 | "type":"Git", 10 | "URL":"https://github.com/bdw429s/PropertyFile" 11 | }, 12 | "bugs":"https://github.com/bdw429s/PropertyFile/issues", 13 | "slug":"propertyFile", 14 | "shortDescription":"A library for managing Java property files", 15 | "type":"modules", 16 | "keywords":"java,property,files", 17 | "projectURL":"https://github.com/bdw429s/PropertyFile/", 18 | "scripts":{ 19 | "postVersion":"publish", 20 | "postPublish":"!git push --follow-tags" 21 | }, 22 | "ignore":[ 23 | "**/.*", 24 | "test", 25 | "tests" 26 | ] 27 | } -------------------------------------------------------------------------------- /src/cfml/system/modules/semver/ModuleConfig.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | function configure() { 4 | 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/cfml/system/modules/semver/box.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"Semantic Version", 3 | "version":"1.2.8", 4 | "author":"Brad Wood", 5 | "homepage":"https://github.com/Ortus-Solutions/semanticVersion/", 6 | "documentation":"https://github.com/Ortus-Solutions/semanticVersion/", 7 | "repository":{ 8 | "type":"Git", 9 | "URL":"git@github.com:Ortus-Solutions/semanticVersion.git" 10 | }, 11 | "bugs":"https://github.com/Ortus-Solutions/semanticVersion/issues", 12 | "slug":"semver", 13 | "shortDescription":"This is a library that implements npm-style semantic versioning for CFML.", 14 | "type":"modules", 15 | "scripts":{ 16 | "onRelease":"publish", 17 | "postPublish":"!git push --follow-tags" 18 | }, 19 | "devDependencies":{ 20 | "testbox":"^5.1.0+2" 21 | }, 22 | "installPaths":{ 23 | "testbox":"testbox/" 24 | }, 25 | "ignore":[ 26 | "**/.*", 27 | "/tests/", 28 | "/server.json", 29 | "**/*.md" 30 | ], 31 | "dependencies":{} 32 | } 33 | -------------------------------------------------------------------------------- /src/cfml/system/modules/string-similarity/ModuleConfig.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | function configure() { 4 | 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/cfml/system/modules/string-similarity/box.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"String Similarity", 3 | "version":"1.0.0", 4 | "author":"Brad Wood", 5 | "location":"bdw429s/string-similarity#v1.0.0", 6 | "homepage":"https://github.com/bdw429s/string-similarity/", 7 | "documentation":"https://github.com/bdw429s/string-similarity/", 8 | "repository":{ 9 | "type":"Git", 10 | "URL":"git@github.com:bdw429s/string-similarity.git" 11 | }, 12 | "bugs":"https://github.com/bdw429s/string-similarity/issues", 13 | "slug":"string-similarity", 14 | "shortDescription":"A small string comparison library to highlight differences between to strings ", 15 | "type":"modules", 16 | "ignore":[ 17 | "**/.*", 18 | "test", 19 | "tests" 20 | ] 21 | } -------------------------------------------------------------------------------- /src/cfml/system/modules/string-similarity/readme.md: -------------------------------------------------------------------------------- 1 | # String Similarity 2 | 3 | This is a small library based on the Levenshtein Distance Algorithm tha compares small strings to look for the number of characters that's different between them. It returns the longest common string (LCS), a percentage of similarity, and can also wrap the differences in HTML tags of your choice to highlight the differences. 4 | 5 | Read more about how it works here: 6 | 7 | http://www.codersrevolution.com/blog/ColdFusion-Levenshtein-Distance-String-comparison-and-highlighting 8 | 9 | ```html 10 | 16 | 17 | 23 | 24 | 25 | 26 | 27 | Roughly #comparison_result.distance# characters are different between the two strings.
28 | The strings are a #numberformat(comparison_result.similarity*100)#% match.
29 | The Longest Common String is #comparison_result.lcs#.
30 |
31 | 32 | 33 | 36 | 39 | 40 |
34 | #replacenocase(comparison_result.s1,chr(10),"
","all")# 35 |
37 | #replacenocase(comparison_result.s2,chr(10),"
","all")# 38 |
41 |
42 | ``` 43 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/artifacts-commands/ModuleConfig.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano 7 | */ 8 | component { 9 | function configure() { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/artifacts-commands/commands/artifacts/clean.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Remove all packages from the artifacts cache. Cached packages will be removed from the file system. 3 | * Use this command to force the "install" command to re-download the files fresh. 4 | * . 5 | * {code:bash} 6 | * artifacts clean 7 | * {code} 8 | * . 9 | * Use the "force" parameter to skip the prompt. 10 | * . 11 | * {code:bash} 12 | * artifacts clean --force 13 | * {code} 14 | * 15 | **/ 16 | component { 17 | 18 | // DI 19 | property name='artifactService' inject='artifactService'; 20 | 21 | /** 22 | * @force.hint Clean artifacts cache without confirmation 23 | * 24 | **/ 25 | function run( boolean force=false ) { 26 | 27 | if( arguments.force || confirm( "Really wipe out the entire artifacts cache? [y/n]" ) ){ 28 | var results = artifactService.cleanArtifacts(); 29 | print.redLine( "Artifacts directory cleaned of '#results.len()#' items." ); 30 | } 31 | 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/artifacts-commands/commands/artifacts/help.cfc: -------------------------------------------------------------------------------- 1 | component excludeFromHelp=true { 2 | 3 | function run() { 4 | 5 | print.line() 6 | .yellowLine( 'The artifacts command will allow you to control your artifacts cache.' ) 7 | .yellowLine( 'From Listing its content to removing and purging.' ) 8 | .line().line(); 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/artifacts-commands/commands/artifacts/list.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * List all packages in the CommandBox artifact cache. 3 | * . 4 | * {code:bash} 5 | * artifacts list 6 | * {code} 7 | * . 8 | * Use the "package" parameter to show results for a specific package. 9 | * {code:bash} 10 | * artifacts list coldbox-platform 11 | * {code} 12 | * 13 | **/ 14 | component { 15 | 16 | // DI 17 | property name='artifactService' inject='artifactService'; 18 | 19 | /** 20 | * @package An optional package to filter the results by 21 | * @package.optionsUDF packageComplete 22 | * @JSON Output data as JSON 23 | **/ 24 | function run( package='', boolean JSON=false ) { 25 | var results = artifactService.listArtifacts( arguments.package ); 26 | 27 | if( arguments.JSON ) { 28 | print.text( results.map( (packageName,packageVersions)=>{ 29 | return packageVersions.reduce( (versions,v)=>{ 30 | versions[ v ] = artifactService.getArtifactPath( packageName, v, false ); 31 | return versions; 32 | }, {} ); 33 | } ) ); 34 | return; 35 | } 36 | if( !results.count() ) { 37 | print.yellowText( 'No artifacts found in cache.' ); 38 | return; 39 | } 40 | 41 | print.boldBlueLine( "Found #results.count()# artifact(s) (#artifactService.getArtifactDir()#)" ); 42 | 43 | for( var package in results ) { 44 | print.boldCyanLine( package & " - #results[ package ].size()# version(s)" ); 45 | for( var ver in results[ package ] ) { 46 | print.yellowLine( " *#ver#" ); 47 | } 48 | } 49 | 50 | } 51 | 52 | function packageComplete() { 53 | return artifactService.listArtifacts() 54 | .keyArray(); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/artifacts-commands/commands/artifacts/prune.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Prune unused artifacts in the CommandBox artifact cache. 3 | * . 4 | * {code:bash} 5 | * artifacts prune 6 | * {code} 7 | * . 8 | * Use the "days" parameter to limit how old artifacts need to be to be pruned. 9 | * {code:bash} 10 | * artifacts prune 30 11 | * {code} 12 | * 13 | **/ 14 | component { 15 | 16 | // DI 17 | property name='artifactService' inject='artifactService'; 18 | 19 | /** 20 | * @days forget artifacts whose last used date is greater or equal to days you set 21 | * @force skip the "are you sure" confirmation 22 | **/ 23 | function run( 24 | numeric days = 90, 25 | boolean force = false 26 | ) { 27 | 28 | if( arguments.force || confirm( "Really wipe out all artifacts older than #days# day(s) old? [y/n]" ) ){ 29 | var results = artifactService.cleanArtifacts( days ); 30 | print.redLine( "Artifacts directory cleaned of '#results.len()#' items." ) 31 | .line(); 32 | 33 | print.table( results, 'package,version,lastModified', 'Package,Version,Last Modified Date' ); 34 | } 35 | 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/forgebox-commands/ModuleConfig.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano 7 | */ 8 | component { 9 | function configure() { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/forgebox-commands/commands/forgebox/endpoint/help.cfc: -------------------------------------------------------------------------------- 1 | component excludeFromHelp=true { 2 | 3 | function run() { 4 | 5 | print.line() 6 | .yellow( 'The ' ).boldYellow( 'forgebox endpoint' ).yellowLine( ' namespace helps you manage different enterprise ForgeBox installs' ) 7 | .yellowLine( 'Use these commands to list your registered ForgeBox endpoints as well as add/remove them' ) 8 | .line() 9 | .yellowLine( 'Type help before any command name to get additional information on how to call that specific command.' ) 10 | .line(); 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/forgebox-commands/commands/forgebox/endpoint/list.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Lists the registered ForgeBox endpoints 3 | * . 4 | * {code:bash} 5 | * forgebox endpoint list 6 | * {code} 7 | **/ 8 | component { 9 | property name="configService" inject="configService"; 10 | 11 | /** 12 | **/ 13 | function run(){ 14 | 15 | print.line(); 16 | 17 | var defaultForgeBoxEndpoint = configService.getSetting( 'endpoints.defaultForgeBoxEndpoint', 'forgebox' ); 18 | var endpoints = duplicate( configService.getSetting( 'endpoints', {} ) ); 19 | 20 | // Ensure the default ForgeBox endpoint is present 21 | endpoints[ 'forgebox' ] = endpoints.forgebox ?: {}; 22 | endpoints.forgebox.APIURL = endpoints.forgebox.APIURL ?: 'https://www.forgebox.io/api/v1/'; 23 | 24 | endpoints 25 | .filter( function( endpointName ) { 26 | return (endpointName.lcase().startsWith( 'forgebox-' ) || endpointName == 'forgebox' ); 27 | } ) 28 | .each( function( endpointName, endpointData ) { 29 | endpointName = endpointName.replaceNoCase( 'forgebox-', '' ); 30 | if( isStruct( endpointData ) ) { 31 | print.boldCyan( 'Endpoint: #endpointName#' ); 32 | if( defaultForgeBoxEndpoint == endpointName ) { 33 | print.boldRedLine( ' (Default)' ); 34 | } else { 35 | print.line(); 36 | } 37 | print.indentedLine( 'API URL: #( endpointData.APIURL ?: '' )#' ); 38 | 39 | var APIToken = endpointData.APIToken ?: ''; 40 | var tokens = endpointData.tokens ?: {}; 41 | if( APIToken.len() ) { 42 | tokens.each( function( username, token ) { 43 | if( token == APIToken ) { 44 | print.indentedLine( 'Authenticated As: #username#' ); 45 | } 46 | } ); 47 | } 48 | 49 | print.line(); 50 | } 51 | } ); 52 | 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/forgebox-commands/commands/forgebox/endpoint/remove.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Removes a ForgeBox-based endpoint registration including any stored API Tokens 3 | * . 4 | * {code:bash} 5 | * forgebox endpoint remove myEndpoint 6 | * {code} 7 | **/ 8 | component { 9 | property name="configService" inject="configService"; 10 | 11 | /** 12 | * @endpointName The name of the ForgeBox-based endpoint to remove 13 | * @endpointName.optionsUDF endpointNameComplete 14 | **/ 15 | function run( required string endpointName ){ 16 | 17 | if( !configService.settingExists( 'endpoints.forgebox-#endpointName#' ) ) { 18 | error( 'Endpoint [#endpointName#] does not exists.' ); 19 | } 20 | 21 | var defaultForgeBoxEndpoint = configService.getSetting( 'endpoints.defaultForgeBoxEndpoint', 'forgebox' ); 22 | if( defaultForgeBoxEndpoint == endpointName ) { 23 | print.yellowLine( 'You are removing your default endpoint. Removing default setting as well.' ); 24 | configService.removeSetting( 'endpoints.defaultForgeBoxEndpoint' ); 25 | 26 | } 27 | 28 | configService.removeSetting( 'endpoints.forgebox-#endpointName#' ); 29 | 30 | print.greenLine( 'ForgeBox endpoint [#endpointName#] removed!' ); 31 | } 32 | 33 | function endpointNameComplete() { 34 | return getInstance( 'endpointService' ).forgeboxEndpointNameComplete(); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/forgebox-commands/commands/forgebox/endpoint/set-default.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Sets the default ForgeBox endpoint to use when running any forgebox command such as "forgebox search" 3 | * . 4 | * {code:bash} 5 | * forgebox endpoint set-default myEndpoint 6 | * {code} 7 | **/ 8 | component { 9 | property name="configService" inject="configService"; 10 | 11 | /** 12 | * @endpointName The name of the ForgeBox-based endpoint to set as the default 13 | * @endpointName.optionsUDF endpointNameComplete 14 | **/ 15 | function run( required string endpointName ){ 16 | var endpoints = configService.getSetting( 'endpoints', {} ); 17 | 18 | if( endpointName != 'forgebox' && !endpoints.keyArray().findNoCase( 'forgebox-#endpointName#' ) ) { 19 | error( 'Endpoint [#endpointName#] does not exist, or isn''t a ForgeBox-based endpoint.' ); 20 | } 21 | 22 | configService.setSetting( 'endpoints.defaultForgeBoxEndpoint', endpointName ); 23 | 24 | print.greenLine( 'Default ForgeBox endpoint set to [#endpointName#]' ); 25 | } 26 | 27 | function endpointNameComplete() { 28 | return getInstance( 'endpointService' ).forgeboxEndpointNameComplete(); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/forgebox-commands/commands/forgebox/help.cfc: -------------------------------------------------------------------------------- 1 | component excludeFromHelp=true { 2 | 3 | function run() { 4 | 5 | print.line() 6 | .yellow( 'The ' ).boldYellow( 'forgebox' ).yellowLine( ' namespace helps you interact with the ForgeBox online code repo.' ) 7 | .yellowLine( 'Use these commands to browse ForgeBox entries as well as download and install ForgeBox projects into your code.' ) 8 | .yellowLine( 'You can also use these commands to manage your own ForgeBox entries.' ) 9 | .yellow( 'To get started, look around by using the "' ).boldYellow( 'forgebox show' ).yellowLine( '" command to search the online repo. Ex:' ) 10 | .line() 11 | .cyan( '#print.tab#> ' ).yellowLine( 'forgebox show popular modules' ) 12 | .cyan( '#print.tab#> ' ).yellowLine( 'forgebox show new interceptors' ) 13 | .cyan( '#print.tab#> ' ).yellowLine( 'forgebox show recent' ) 14 | .cyan( '#print.tab#> ' ).yellowLine( 'forgebox show "slugName"' ) 15 | .line() 16 | .yellowLine( 'Type help before any command name to get additional information on how to call that specific command.' ) 17 | .line(); 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/forgebox-commands/commands/forgebox/logout.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Un-authenticates a user from the ForgeBox endpoint. This command is a passthrough for the generic "endpoint logout" command. 3 | * . 4 | * Logout a single user 5 | * {code:bash} 6 | * forgebox logout username 7 | * {code} 8 | * . 9 | * Logout ALL users 10 | * {code:bash} 11 | * forgebox logout 12 | * {code} 13 | **/ 14 | component { 15 | property name="configService" inject="configService"; 16 | property name="endpointService" inject="endpointService"; 17 | 18 | /** 19 | * @username.hint Username for this user 20 | * @endpointName Name of custom forgebox endpoint to use 21 | * @endpointName.optionsUDF endpointNameComplete 22 | **/ 23 | function run( 24 | string username='', 25 | string endpointName 26 | ){ 27 | 28 | endpointName = endpointName ?: configService.getSetting( 'endpoints.defaultForgeBoxEndpoint', 'forgebox' ); 29 | 30 | // Defer to the generic command 31 | command( 'endpoint logout' ) 32 | .params( argumentCollection=arguments ) 33 | .run(); 34 | } 35 | 36 | function endpointNameComplete() { 37 | return getInstance( 'endpointService' ).forgeboxEndpointNameComplete(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/forgebox-commands/commands/forgebox/my-contributions.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Description of command 3 | **/ 4 | component { 5 | 6 | /** 7 | * 8 | **/ 9 | function run( ) { 10 | print.line( "Command not implemented!" ); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/forgebox-commands/commands/forgebox/publish.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Publishes a package with the ForgeBox endpoint. This command is a passthrough for the generic "endpoint publish" command. 3 | * . 4 | * {code:bash} 5 | * forgebox publish 6 | * {code} 7 | **/ 8 | component aliases="publish" { 9 | 10 | property name="configService" inject="configService"; 11 | property name="endpointService" inject="endpointService"; 12 | 13 | /** 14 | * @directory The directory to publish 15 | * @force Force the publish 16 | * @endpointName Name of custom forgebox endpoint to use 17 | * @endpointName.optionsUDF endpointNameComplete 18 | **/ 19 | function run( 20 | string directory='', 21 | boolean force = false, 22 | string endpointName 23 | ){ 24 | endpointName = endpointName ?: configService.getSetting( 'endpoints.defaultForgeBoxEndpoint', 'forgebox' ); 25 | 26 | try { 27 | var APIToken = endpointService.getEndpoint( endpointName ).getAPIToken(); 28 | } catch( EndpointNotFound var e ) { 29 | error( e.message, e.detail ?: '' ); 30 | } 31 | 32 | if( !APIToken.len() ) { 33 | print.yellowLine( 'Please log into Forgebox to continue' ); 34 | command( 'forgebox login' ).run(); 35 | } 36 | 37 | // Default the endpointName 38 | arguments.endpointName = endpointName; 39 | 40 | // Defer to the generic command 41 | command( 'endpoint publish' ) 42 | .params( argumentCollection=arguments ) 43 | .run(); 44 | 45 | } 46 | 47 | function endpointNameComplete() { 48 | return getInstance( 'endpointService' ).forgeboxEndpointNameComplete(); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/forgebox-commands/commands/forgebox/register.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Registers a new user with the Forgebox endpoint. This command is a passthrough for the generic "endpoint register" command. 3 | * . 4 | * {code:bash} 5 | * forgebox register 6 | * {code} 7 | **/ 8 | component { 9 | property name="configService" inject="configService"; 10 | 11 | /** 12 | * @username.hint Username for this user 13 | * @password.hint Password for this user 14 | * @email.hint E-mail address 15 | * @firstName.hint First name of the user 16 | * @lastName.hint Last name of the user 17 | * @endpointName Name of custom forgebox endpoint to use 18 | * @endpointName.optionsUDF endpointNameComplete 19 | **/ 20 | function run( 21 | required string username, 22 | required string password, 23 | required string email, 24 | required string firstName, 25 | required string lastName, 26 | string endpointName ) { 27 | 28 | endpointName = endpointName ?: configService.getSetting( 'endpoints.defaultForgeBoxEndpoint', 'forgebox' ); 29 | 30 | // Defer to the generic command 31 | command( 'endpoint register' ) 32 | .params( argumentCollection=arguments ) 33 | .run(); 34 | 35 | } 36 | 37 | function endpointNameComplete() { 38 | return getInstance( 'endpointService' ).forgeboxEndpointNameComplete(); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/forgebox-commands/commands/forgebox/slugcheck.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Verifies a slug against ForgeBox. 3 | * . 4 | * {code:bash} 5 | * forgebox slugcheck MyApp 6 | * {code} 7 | * . 8 | 9 | **/ 10 | component { 11 | 12 | // DI 13 | property name="configService" inject="configService"; 14 | property name="endpointService" inject="endpointService"; 15 | 16 | /** 17 | * @slug.hint The slug to verify in ForgeBox 18 | * @endpointName Name of custom forgebox endpoint to use 19 | * @endpointName.optionsUDF endpointNameComplete 20 | */ 21 | function run( required slug, string endpointName ) { 22 | 23 | endpointName = endpointName ?: configService.getSetting( 'endpoints.defaultForgeBoxEndpoint', 'forgebox' ); 24 | 25 | try { 26 | var oEndpoint = endpointService.getEndpoint( endpointName ); 27 | } catch( EndpointNotFound var e ) { 28 | error( e.message, e.detail ?: '' ); 29 | } 30 | 31 | var forgebox = oEndpoint.getForgebox(); 32 | var APIToken = oEndpoint.getAPIToken(); 33 | 34 | if( !len( arguments.slug ) ) { 35 | return error( "Slug cannot be an empty string" ); 36 | } 37 | 38 | try { 39 | var exists = forgebox.isSlugAvailable( arguments.slug, APIToken ); 40 | } catch( forgebox var e ) { 41 | error( e.message, e.detail ?: '' ); 42 | } 43 | 44 | if( exists ){ 45 | print.greenBoldLine( "The slug '#arguments.slug#' does not exist in ForgeBox and can be used!" ); 46 | } else { 47 | print.redBoldLine( "The slug '#arguments.slug#' already exists in ForgeBox!" ); 48 | } 49 | 50 | } 51 | 52 | function endpointNameComplete() { 53 | return getInstance( 'endpointService' ).forgeboxEndpointNameComplete(); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/forgebox-commands/commands/forgebox/types.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Shows all of the valid forgebox types you can use when filtering records using the "forgebox show" command. 3 | * . 4 | * {code:bash} 5 | * forgebox types 6 | * {code} 7 | * . 8 | 9 | **/ 10 | component { 11 | 12 | // DI 13 | property name="configService" inject="configService"; 14 | property name="endpointService" inject="endpointService"; 15 | 16 | /** 17 | * Run Command 18 | * @endpointName Name of custom forgebox endpoint to use 19 | * @endpointName.optionsUDF endpointNameComplete 20 | */ 21 | function run( string endpointName ) { 22 | endpointName = endpointName ?: configService.getSetting( 'endpoints.defaultForgeBoxEndpoint', 'forgebox' ); 23 | 24 | try { 25 | var oEndpoint = endpointService.getEndpoint( endpointName ); 26 | } catch( EndpointNotFound var e ) { 27 | error( e.message, e.detail ?: '' ); 28 | } 29 | 30 | var forgebox = oEndpoint.getForgebox(); 31 | var APIToken = oEndpoint.getAPIToken(); 32 | 33 | // typetotal,typename,typeid,typeslug 34 | print.line() 35 | .line( "Here is a listing of the available types in ForgeBox" ) 36 | .line() 37 | .blackOnWhiteLine( 'Name(Number of Packages) (slug)' ); 38 | 39 | try { 40 | for( var type in forgeBox.getCachedTypes( APIToken=APIToken ) ) { 41 | print.boldText( type.typeName & "(#type.numberOfActiveEntries#)" ) 42 | .line( ' (#type.typeSlug#)' ); 43 | } 44 | } catch( forgebox var e ) { 45 | error( e.message, e.detail ?: '' ); 46 | } 47 | 48 | } 49 | 50 | function endpointNameComplete() { 51 | return getInstance( 'endpointService' ).forgeboxEndpointNameComplete(); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/forgebox-commands/commands/forgebox/unpublish.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Unpublishes a package from the ForgeBox endpoint. This command is a passthrough for the generic "endpoint unpublish" command. 3 | * . 4 | * {code:bash} 5 | * forgebox unpublish 6 | * {code} 7 | **/ 8 | component aliases="unpublish" { 9 | property name="configService" inject="configService"; 10 | 11 | /** 12 | * @version The version to publish 13 | * @directory The directory to publish 14 | * @force Skip the prompt 15 | * @endpointName Name of custom forgebox endpoint to use 16 | * @endpointName.optionsUDF endpointNameComplete 17 | **/ 18 | function run( 19 | string version='', 20 | string directory='', 21 | boolean force=false, 22 | string endpointName 23 | ){ 24 | 25 | endpointName = endpointName ?: configService.getSetting( 'endpoints.defaultForgeBoxEndpoint', 'forgebox' ); 26 | 27 | // Defer to the generic command 28 | command( 'endpoint unpublish' ) 29 | .params( argumentCollection=arguments ) 30 | .run(); 31 | 32 | } 33 | 34 | function endpointNameComplete() { 35 | return getInstance( 'endpointService' ).forgeboxEndpointNameComplete(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/games-commands/ModuleConfig.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano 7 | */ 8 | component { 9 | function configure() { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/package-commands/ModuleConfig.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano 7 | */ 8 | component { 9 | function configure() { 10 | interceptors = [ 11 | { class="#moduleMapping#.interceptors.PackageScripts" }, 12 | { class="#moduleMapping#.interceptors.PackageSystemSettingExpansions" } 13 | ]; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/package-commands/commands/endpoint/login.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Authenticates a user with an endpoint. The endpoint must be interactive. 3 | * . 4 | * {code:bash} 5 | * endpoint login 6 | * {code} 7 | **/ 8 | component { 9 | 10 | property name="EndpointService" inject="EndpointService"; 11 | 12 | /** 13 | * @endpointName.hint Name of the endpoint to log in to 14 | * @username.hint Username for this user 15 | * @password.hint Password for this user 16 | **/ 17 | function run( 18 | required string endpointName, 19 | required string username, 20 | required string password ) { 21 | 22 | try { 23 | 24 | endpointService.loginEndpointUser( argumentCollection=arguments ); 25 | 26 | } catch( endpointException var e ) { 27 | // This can include "expected" errors such as "Email already in use" 28 | error( e.message, e.detail ); 29 | } 30 | 31 | print.greenLine( 'User [#arguments.username#] authenticated successfully with [#arguments.endpointName#]' ); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/package-commands/commands/endpoint/logout.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Un-authenticates a user with an endpoint. The endpoint must be interactive. 3 | * . 4 | * {code:bash} 5 | * endpoint logout 6 | * {code} 7 | **/ 8 | component { 9 | 10 | property name="EndpointService" inject="EndpointService"; 11 | 12 | /** 13 | * @endpointName.hint Name of the endpoint to log out of 14 | * @username.hint Username for this user 15 | **/ 16 | function run( 17 | required string endpointName, 18 | string username='' ) { 19 | 20 | try { 21 | 22 | endpointService.logoutEndpointUser( argumentCollection=arguments ); 23 | 24 | } catch( endpointException var e ) { 25 | // This can include "expected" errors such as "Email already in use" 26 | error( e.message, e.detail ); 27 | } 28 | 29 | if( len( arguments.username ) ) { 30 | print.greenLine( 'User [#arguments.username#] logged out successfully with [#arguments.endpointName#]' ); 31 | } else { 32 | print.greenLine( 'All users logged out successfully with [#arguments.endpointName#]' ); 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/package-commands/commands/endpoint/publish.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Publishes a package with an endpoint. The endpoint must be interactive. 3 | * . 4 | * {code:bash} 5 | * endpoint publish 6 | * {code} 7 | **/ 8 | component { 9 | 10 | property name="endpointService" inject="EndpointService"; 11 | property name="packageService" inject="PackageService"; 12 | property name='interceptorService' inject='interceptorService'; 13 | 14 | /** 15 | * @endpointName Name of the endpoint for which to publish the package 16 | * @directory The directory being published 17 | * @force Force the publish 18 | **/ 19 | function run( 20 | required string endpointName, 21 | string directory='', 22 | boolean force = false 23 | ){ 24 | // This will make each directory canonical and absolute 25 | arguments.directory = resolvePath( arguments.directory ); 26 | var boxJSON = packageService.readPackageDescriptor( arguments.directory ); 27 | 28 | interceptorService.announceInterception( 'prePublish', { publishArgs=arguments, boxJSON=boxJSON } ); 29 | 30 | try { 31 | 32 | endpointService.publishEndpointPackage( argumentCollection=arguments ); 33 | 34 | } catch( endpointException var e ) { 35 | // This can include "expected" errors such as "Email already in use" 36 | error( e.message, e.detail ); 37 | } 38 | 39 | interceptorService.announceInterception( 'postPublish', { publishArgs=arguments, boxJSON=boxJSON } ); 40 | 41 | print.greenLine( 'Package published successfully in [#arguments.endpointName#]' ); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/package-commands/commands/endpoint/register.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Registers a new user with an endpoint. The endpoint must be interactive. 3 | * . 4 | * {code:bash} 5 | * endpoint register 6 | * {code} 7 | **/ 8 | component { 9 | 10 | property name="EndpointService" inject="EndpointService"; 11 | 12 | /** 13 | * @endpointName.hint Name of the endpoint for which to create the user 14 | * @username.hint Username for this user 15 | * @password.hint Password for this user 16 | * @email.hint E-mail address 17 | * @firstName.hint First name of the user 18 | * @lastName.hint Last name of the user 19 | **/ 20 | function run( 21 | required string endpointName, 22 | required string username, 23 | required string password, 24 | required string email, 25 | required string firstName, 26 | required string lastName ) { 27 | 28 | try { 29 | 30 | endpointService.createEndpointUser( argumentCollection=arguments ); 31 | 32 | } catch( endpointException var e ) { 33 | // This can include "expected" errors such as "Email already in use" 34 | error( e.message, e.detail ); 35 | } 36 | 37 | print.greenLine( 'User [#arguments.username#] created successfully in [#arguments.endpointName#]' ); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/package-commands/commands/package/bugs.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Opens a package's bugs URL if found 3 | * . 4 | * {code:bash} 5 | * package bugs 6 | * {code} 7 | * . 8 | * Via alias 9 | * {code:bash} 10 | * bugs 11 | * {code} 12 | **/ 13 | component aliases="bugs" { 14 | 15 | property name="packageService" inject="PackageService"; 16 | 17 | /** 18 | * run 19 | **/ 20 | function run(){ 21 | 22 | // package check 23 | if( !packageService.isPackage( getCWD() ) ) { 24 | return error( '#getCWD()# is not a package!' ); 25 | } 26 | 27 | var boxJSON = packageService.readPackageDescriptor( getCWD() ); 28 | 29 | if( len( boxJSON.bugs ) and isValid( "URL", boxJSON.bugs ) ){ 30 | print.greenLine( "Opening: #boxJSON.bugs#" ); 31 | openURL( boxJSON.bugs ); 32 | } else { 33 | print.redLine( "The 'bugs' set in the descriptor is not valid: " & boxJSON.bugs ); 34 | } 35 | 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/package-commands/commands/package/documentation.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Opens a package's bugs URL if found 3 | * . 4 | * {code:bash} 5 | * package bugs 6 | * {code} 7 | * . 8 | * Via alias 9 | * {code:bash} 10 | * bugs 11 | * {code} 12 | **/ 13 | component aliases="docs,documentation" { 14 | 15 | property name="packageService" inject="PackageService"; 16 | 17 | /** 18 | * run 19 | **/ 20 | function run(){ 21 | 22 | // package check 23 | if( !packageService.isPackage( getCWD() ) ) { 24 | return error( '#getCWD()# is not a package!' ); 25 | } 26 | 27 | var boxJSON = packageService.readPackageDescriptor( getCWD() ); 28 | 29 | if( len( boxJSON.documentation ) and isValid( "URL", boxJSON.documentation ) ){ 30 | print.greenLine( "Opening: #boxJSON.documentation#" ); 31 | openURL( boxJSON.documentation ); 32 | } else { 33 | print.redLine( "The 'documentation' set in the descriptor is not valid: " & boxJSON.documentation ); 34 | } 35 | 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/package-commands/commands/package/help.cfc: -------------------------------------------------------------------------------- 1 | component excludeFromHelp=true { 2 | 3 | function run() { 4 | 5 | print.line(); 6 | print.yellow( 'The ' ); print.boldYellow( 'package' ); print.yellowLine( ' namespace is for dealing with packages and their box.json descriptor file' ); 7 | print.yellowLine( 'Use these commands to initialize a package, set, and retrieve values from the box.json descriptor.' ); 8 | print.yellowLine( 'Type help before any command name to get additional information on how to call that specific command.' ); 9 | 10 | print.line(); 11 | print.line(); 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/package-commands/commands/package/homepage.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Opens a package's homepage URL if found 3 | * . 4 | * {code:bash} 5 | * package homepage 6 | * {code} 7 | * . 8 | * Via alias 9 | * {code:bash} 10 | * homepage 11 | * {code} 12 | **/ 13 | component aliases="homepage" { 14 | 15 | property name="packageService" inject="PackageService"; 16 | 17 | /** 18 | * run 19 | **/ 20 | function run(){ 21 | 22 | // package check 23 | if( !packageService.isPackage( getCWD() ) ) { 24 | return error( '#getCWD()# is not a package!' ); 25 | } 26 | 27 | var boxJSON = packageService.readPackageDescriptor( getCWD() ); 28 | 29 | if( len( boxJSON.homepage ) and isValid( "URL", boxJSON.homepage ) ){ 30 | print.greenLine( "Opening: #boxJSON.homepage#" ); 31 | openURL( boxJSON.homepage ); 32 | } else { 33 | print.redLine( "The 'homepage' set in the descriptor is not valid: " & boxJSON.homepage ); 34 | } 35 | 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/package-commands/commands/package/init-wizard.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Initialize a package in the current directory by creating a default box.json file using our lovely wizard 3 | **/ 4 | component extends="init" aliases="" { 5 | 6 | /** 7 | * @name The human-readable name for this package 8 | * @slug The ForgeBox or unique slug for this package (no spaces or special chars) 9 | * @version The version for this package, please use semantic versioning - 0.0.0 10 | * @private Mark your package as private, so that if it is published to ForgeBox, only you can see it. 11 | * @shortDescription A short description for the package 12 | * @author The author of the package, you! 13 | * @keywords A nice list of keywords that describe your package 14 | * @homepage Your package's homepage URL 15 | * @ignoreList Add commonly ignored files to the package's ignore list 16 | **/ 17 | function run( 18 | required name, 19 | required slug, 20 | required version, 21 | required boolean private, 22 | required shortDescription, 23 | required author, 24 | required keywords, 25 | required homepage, 26 | required boolean ignoreList 27 | ){ 28 | // turn off wizard 29 | arguments.wizard = false; 30 | super.run( argumentCollection=arguments ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/package-commands/commands/package/run-script.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Runs a package script, by name. Scripts are stored in box.json. 3 | * . 4 | * {code:bash} 5 | * run-script myScript 6 | * {code} 7 | * . 8 | * Positional parameters can be passed and will be available as environment variables inside the script as ${1}, ${2}, etc 9 | * . 10 | * {code:bash} 11 | * run-script myScript param1 param2 12 | * {code} 13 | * . 14 | * . 15 | * Named parameters can be passed and will be available as environment variables inside the script as ${name1}, ${name2}, etc 16 | * Note in this case, ALL parameters much be named including the scriptName param to the command. 17 | * . 18 | * {code:bash} 19 | * run-script scriptName=myScript name1=value1 name2=value2 20 | * {code} 21 | * . 22 | **/ 23 | component aliases="run-script" { 24 | 25 | property name="packageService" inject="PackageService"; 26 | 27 | /** 28 | * @scriptName Name of the script to run 29 | * @scriptName.optionsUDF scriptNameComplete 30 | **/ 31 | function run( required string scriptname ){ 32 | 33 | // package check 34 | if( !packageService.isPackage( getCWD() ) ) { 35 | error( '#getCWD()# is not a package!' ); 36 | } 37 | 38 | // Add any additional arguments as env vars for the script to access 39 | arguments 40 | .filter( ( k, v ) => k != 'scriptName' ) 41 | .each( ( k, v ) => { 42 | // Decrement positional params so they start at 1 43 | if( isNumeric( k ) && k > 1 ) { 44 | k -= 1; 45 | } 46 | systemSettings.setSystemSetting( k, v ); 47 | } ); 48 | 49 | packageService.runScript( scriptName=arguments.scriptName, ignoreMissing=false ); 50 | 51 | } 52 | 53 | function scriptNameComplete() { 54 | var boxJSON = packageService.readPackageDescriptor( shell.pwd() ); 55 | return boxJSON.scripts.keyArray(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/package-commands/interceptors/PackageSystemSettingExpansions.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * 7 | * I am an interceptor that listens for system setting expansions 8 | * 9 | */ 10 | component { 11 | 12 | property name="packageService" inject="packageService"; 13 | property name="systemSettings" inject="SystemSettings"; 14 | property name="JSONService" inject="JSONService"; 15 | property name="fileSystemUtil" inject="fileSystem"; 16 | 17 | function onSystemSettingExpansion( struct interceptData ) { 18 | 19 | // ${boxjson.slug} 20 | if( interceptData.setting.lcase().startsWith( 'boxjson.' ) ) { 21 | 22 | var settingName = interceptData.setting.replaceNoCase( 'boxjson.', '', 'one' ); 23 | 24 | var boxJSON = packageService.readpackageDescriptor( shell.pwd() ); 25 | interceptData.setting = JSONService.show( boxJSON, settingName, interceptData.defaultValue ); 26 | 27 | if( !isSimpleValue( interceptData.setting ) ) { 28 | interceptData.setting = serializeJSON( interceptData.setting ); 29 | } 30 | 31 | // Stop processing expansions on this setting 32 | interceptData.resolved=true; 33 | return true; 34 | } 35 | 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /src/cfml/system/modules_app/server-commands/ModuleConfig.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano 7 | */ 8 | component { 9 | function configure() { 10 | interceptors = [ 11 | { class="#moduleMapping#.interceptors.ServerScripts" }, 12 | { class="#moduleMapping#.interceptors.ServerCommandLine" }, 13 | { class="#moduleMapping#.interceptors.ServerSystemSettingExpansions" } 14 | ]; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/server-commands/bin/server_spawner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # In *nix OS's we need to separate the server process from the CLI process 4 | # so SIGINTs from Ctrl-C won't also kill previously started servers 5 | 6 | # Save name of log file 7 | log_file=$1 8 | 9 | # Initialize log file as empty 10 | > "$log_file" 11 | 12 | # Remove log file from argument list 13 | shift 14 | 15 | # Pass all remaining args through to "nohup" which will make the server process ignore 16 | # 'hangup' signals so it stays running and it not part of the thread group that the CLI is in. 17 | nohup "$@" > "$log_file" 2>&1 & 18 | 19 | # Grab the PID of our server (last backgrounded job) 20 | p_name=$! 21 | 22 | # Tail the log file starting from the beginning in the background 23 | tail -f -n +0 "$log_file" & 24 | 25 | # Wait for the server launcher process to end 26 | wait $p_name 27 | server_status=$? 28 | 29 | # Kill the tail 30 | kill $! 31 | 32 | # Pass the exit code back 33 | exit $server_status 34 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/server-commands/bin/www-engine.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/modules_app/server-commands/bin/www-engine.zip -------------------------------------------------------------------------------- /src/cfml/system/modules_app/server-commands/commands/server/cd.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * CD into the web root of a saved server by using its short name. 3 | * . 4 | * {code:bash} 5 | * server cd myServer 6 | * {code} 7 | **/ 8 | component { 9 | 10 | // DI 11 | property name="serverService" inject="ServerService"; 12 | property name='parser' inject='Parser'; 13 | 14 | /** 15 | * @name.hint the short name of the server to cd into 16 | * @name.optionsUDF serverNameComplete 17 | **/ 18 | function run( string name="" ){ 19 | 20 | // Discover by shortname 21 | var serverInfo = serverService.getServerInfoByName( arguments.name ); 22 | 23 | // Verify server info 24 | if( structIsEmpty( serverInfo ) ){ 25 | error( "The server you requested was not found.", "You can use the 'server list' command to get all the available servers." ); 26 | } 27 | 28 | var cdCommand = 'cd ' & '"#parser.escapeArg( serverInfo.webroot )#"'; 29 | print.yellowLine( '> ' & cdCommand ); 30 | runCommand( cdCommand ); 31 | 32 | } 33 | 34 | function serverNameComplete() { 35 | return serverService.serverNameComplete(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/server-commands/commands/server/help.cfc: -------------------------------------------------------------------------------- 1 | component excludeFromHelp=true { 2 | 3 | function run() { 4 | 5 | print.line() 6 | .yellow( 'The ' ).boldYellow( 'server' ).yellowLine( ' namespace contains commands that allow you to start, stop, ' ) 7 | .yellowLine( 'and manage the embedded CFML server to run your code quickly and easily.' ) 8 | .yellowLine( 'Each server will start in its own process and run until you stop it.' ) 9 | .line() 10 | .line(); 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/server-commands/commands/server/java/help.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | */ 3 | component excludeFromHelp=true { 4 | 5 | function run() { 6 | 7 | print.line() 8 | .yellow( 'The ' ).boldYellow( 'server java' ).yellowLine( ' namespace contains commands that allow you to ' ) 9 | .yellowLine( 'view, manage and configure the default versions of Java used to start your servers.' ) 10 | .yellowLine( 'CommandBox can automatically fetch any OpenJDK build from https://adoptopenjdk.net/.' ) 11 | .line() 12 | .line(); 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/server-commands/commands/server/java/install.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Install a version of Java for your servers to use. 3 | * . 4 | * {code:bash} 5 | * server java install openjdk11 6 | * {code} 7 | * 8 | * Set a Java install to be the default server JRE at the same time you install with --setDefault 9 | * . 10 | * {code:bash} 11 | * server java install openjdk11 --setDefault 12 | * {code} 13 | * 14 | * Note, the default will be set to exactly what you type, so if you don't type a specific release version 15 | * then CommandBox will still check the API for the latest version every time and download on demand. 16 | * 17 | * To set a default version of Java and have CommandBox never check again, set a very specific release version 18 | * . 19 | * {code:bash} 20 | * server java install openjdk8_jdk8u192-b12 --setDefault 21 | * {code} 22 | * 23 | **/ 24 | component aliases='java install' { 25 | 26 | // DI 27 | property name="javaService" inject="JavaService"; 28 | 29 | /** 30 | * @ID Full name of the Java install you wish to install 31 | * @id.options openjdk8,openjdk9,openjdk10,openjdk11,openjdk12,openjdk13 32 | * @verbose Show verbose installation information 33 | * @setDefault Set this Java install to be the default after installing 34 | */ 35 | function run( 36 | required string ID, 37 | boolean verbose=false, 38 | boolean setDefault=false 39 | ){ 40 | try { 41 | javaService.installJava( ID, verbose ); 42 | } catch( endpointException var e ) { 43 | error( e.message, e.detail ?: '' ); 44 | } 45 | 46 | if( setDefault ) { 47 | configService.setSetting( 'server.defaults.jvm.javaVersion', ID ); 48 | } 49 | 50 | command( 'server java list' ).run(); 51 | } 52 | 53 | 54 | } -------------------------------------------------------------------------------- /src/cfml/system/modules_app/server-commands/commands/server/java/uninstall.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Uninstall a version of Java that you don't need any longer. 3 | * You must use the FULL name of the version to remove any ambiguity. 4 | * . 5 | * {code:bash} 6 | * server java uninstall openjdk9_jre_x64_windows_hotspot_jdk-9.0.4+11 7 | * {code} 8 | **/ 9 | component aliases='java uninstall' { 10 | 11 | // DI 12 | property name="javaService" inject="JavaService"; 13 | 14 | /** 15 | * @ID Full name of the Java install you wish to remove 16 | * @ID.optionsUDF javaVersionComplete 17 | */ 18 | function run( 19 | required string ID 20 | ){ 21 | if( !javaService.javaInstallExists( ID ) ) { 22 | error( 23 | '[#ID#] is not a valid java install. Please use the full name that shows in the "server java list" command.', 24 | 'Valid names are [#javaService.listJavaInstalls().keyList()#]' 25 | ); 26 | } 27 | 28 | javaService.uninstallJava( ID ); 29 | 30 | command( 'server java list' ).run(); 31 | } 32 | 33 | /** 34 | * Complete java versions 35 | */ 36 | function javaVersionComplete() { 37 | return javaService 38 | .listJavaInstalls() 39 | .keyArray() 40 | .map( ( i ) => { 41 | return { name : i, group : 'Java Versions' }; 42 | } ); 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /src/cfml/system/modules_app/server-commands/interceptors/ServerScripts.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood 7 | * 8 | * I am an interceptor that listens to all the server interception points and runs server scripts for them if they exist. 9 | * 10 | */ 11 | component { 12 | property name="serverService" inject="ServerService"; 13 | property name="shell" inject="shell"; 14 | 15 | function init() { 16 | variables.inScript=false; 17 | } 18 | 19 | function preServerStart() { processScripts( 'preServerStart', shell.pwd(), interceptData ); } 20 | function onServerInstall() { processScripts( 'onServerInstall', interceptData.serverinfo.webroot, interceptData ); } 21 | function onServerInitialInstall() { processScripts( 'onServerInitialInstall', interceptData.serverinfo.webroot, interceptData ); } 22 | function onServerStart() { processScripts( 'onServerStart', interceptData.serverinfo.webroot, interceptData ); } 23 | function onServerStop() { processScripts( 'onServerStop', interceptData.serverinfo.webroot, interceptData ); } 24 | function preServerForget() { processScripts( 'preServerForget', interceptData.serverinfo.webroot, interceptData ); } 25 | function postServerForget() { processScripts( 'postServerForget', interceptData.serverinfo.webroot, interceptData ); } 26 | 27 | function processScripts( required string interceptionPoint, string directory=shell.pwd(), interceptData={} ) { 28 | inScript=true; 29 | try { 30 | serverService.runScript( arguments.interceptionPoint, arguments.directory, true, interceptData ); 31 | } finally { 32 | inScript=false; 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/ModuleConfig.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano 7 | */ 8 | component { 9 | function configure() { 10 | interceptors = [ 11 | { class="#moduleMapping#.interceptors.JSONSystemSettingExpansions" }, 12 | { class="#moduleMapping#.interceptors.ConfigForgeBoxSync" } 13 | ]; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/ask.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Prompt the user for an answer and return it. Requires an interactive terminal. 3 | * . 4 | * Output a single file 5 | * {code:bash} 6 | * set color=`ask "favorite Color? "` 7 | * echo "you said ${color}" 8 | * {code} 9 | * 10 | **/ 11 | component { 12 | 13 | /** 14 | * @question Question to ask the user 15 | * @defaultResponse Default what shows in the buffer 16 | * @mask Set to a char like * to hide passwords, etc 17 | **/ 18 | function run( 19 | required string question, 20 | string defaultResponse='', 21 | string mask='' 22 | ) { 23 | return ask( message=question, defaultResponse=defaultResponse, mask=mask ); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/assertEqual.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a passing (0) or failing (1) exit code if both parameters match. Command outputs nothing. 3 | * Comparison is case insensitive. 4 | * . 5 | * {code:bash} 6 | * assertEqual `package show name` "My Package" || package set name="My Package" 7 | * assertEqual ${ENVIRONMENT} production && install --production 8 | * {code} 9 | * 10 | * Values are not trimmed, but you can trim them if you want 11 | * . 12 | * {code:bash} 13 | * assertEqual "brad" `ECHO " BRAD " | #trim` && ECHO HI 14 | * {code} 15 | * 16 | **/ 17 | component { 18 | 19 | /** 20 | * @value1 A value to be compared to value2 21 | * @value2 A value to be compared to value1 22 | **/ 23 | function run( required string value1, required string value2 ) { 24 | 25 | if( value1 != value2 ) { 26 | setExitCode( 1 ); 27 | } 28 | 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/assertFalse.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a passing (0) or failing (1) exit code if a falsey parameter passed. Command outputs nothing. 3 | * Falsey values are arenything OTHER than "yes", "true" and positive integers. 4 | * . 5 | * {code:bash} 6 | * assertFalse `package show private` && run-script foo 7 | * assertFalse ${GOOD_THINGS} && run-doom 8 | * assertFalse `#fileExists foo.txt` && echo "it's not there!" 9 | * {code} 10 | **/ 11 | component { 12 | 13 | /** 14 | * @predicate A value that is truthy or falsy. 15 | **/ 16 | function run( required string predicate ) { 17 | 18 | if( isBoolean( predicate ) && predicate ) { 19 | setExitCode( 1 ); 20 | } 21 | 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/assertNotEqual.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a passing (0) or failing (1) exit code if parameters do not match. Command outputs nothing. 3 | * Comparison is case insensitive. 4 | * . 5 | * {code:bash} 6 | * assertNotEqual `package show name` "My Package" && package set name="My Package" 7 | * assertNotEqual ${ENVIRONMENT} development && install --production 8 | * {code} 9 | * 10 | **/ 11 | component { 12 | 13 | /** 14 | * @value1 A value to be compared to value2 15 | * @value2 A value to be compared to value1 16 | **/ 17 | function run( required string value1, required string value2 ) { 18 | 19 | if( value1 == value2 ) { 20 | setExitCode( 1 ); 21 | } 22 | 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/assertTrue.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a passing (0) or failing (1) exit code if truthy parameter passed. Command outputs nothing. 3 | * Truthy values are "yes", "true" and positive integers. 4 | * All other values are considered falsey 5 | * . 6 | * {code:bash} 7 | * assertTrue `package show private` && run-script foo 8 | * assertTrue ${ENABLE_DOOM} && run-doom 9 | * assertTrue `#fileExists foo.txt` && echo "it's there!" 10 | * {code} 11 | **/ 12 | component { 13 | 14 | /** 15 | * @predicate A value that is truthy or falsy. 16 | **/ 17 | function run( required string predicate ) { 18 | 19 | if( isBoolean( predicate ) && predicate ) { 20 | // Nothing 21 | } else { 22 | setExitCode( 1 ); 23 | } 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/browse.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Open a browser to the passed URI. 3 | * . 4 | * {code:bash} 5 | * browse localhost:8116 6 | * {code} 7 | * 8 | **/ 9 | component { 10 | 11 | /** 12 | * @URI The URI to open as you would type it into your browser's address bar 13 | * @browser The preferred browser to use for your URI 14 | * @browser.optionsUDF browserList 15 | **/ 16 | function run( required URI, browser='' ) { 17 | 18 | if( fileSystemUtil.openBrowser( arguments.URI, arguments.browser ) ){ 19 | print.text( "Browser opened!" ); 20 | } else { 21 | error( "Unsupported OS" ); 22 | }; 23 | } 24 | 25 | array function browserList() { 26 | return fileSystemUtil.browserList(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/clear.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Clear any output on the terminal. 3 | * . 4 | * {code:bash} 5 | * clear 6 | * {code} 7 | * 8 | **/ 9 | component aliases="cls" { 10 | 11 | function run() { 12 | shell.clearScreen(); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/clipboard.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Stores text inputted into OS clipboard. 3 | * . 4 | * {code:bash} 5 | * echo "Hello World!" | clipboard 6 | * {code} 7 | * . 8 | * Output the text and copy it to the clipboard with the --echo flag 9 | * . 10 | * {code:bash} 11 | * ls --tree | clipboard --echo 12 | * {code} 13 | **/ 14 | component { 15 | 16 | /** 17 | * @text The text to store on clipboard 18 | * @echo Echo text out to console as well 19 | **/ 20 | function run( String text="", Boolean echo=false ) { 21 | if( FileSystemUtil.isWindows() ) { 22 | var binary = 'clip'; 23 | } else if( FileSystemUtil.isMac() ) { 24 | var binary = 'pbcopy'; 25 | } else if( FileSystemUtil.isLinux() ) { 26 | try { 27 | var whichXclip = command( '!which xclip' ).run( returnOutput=true ); 28 | } catch( any e ) { 29 | var whichXclip = ''; 30 | } 31 | if( len( trim( whichXclip ) ) ) { 32 | var binary = 'xclip'; 33 | } else { 34 | error( 'xclip binary not installed for Linux. Please install xclip and try again.' ); 35 | } 36 | } else { 37 | error( 'Unsupported OS for "clipboard" [#getSystemSetting( 'os.name' )#]' ); 38 | } 39 | command( '!' & binary ) 40 | .run( piped=print.unansi( text ) ); 41 | 42 | if( echo ) { 43 | print.text( text ); 44 | } else { 45 | print.greenLine( 'Copied to clipboard!' ); 46 | } 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/config/clear.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Remove a setting out of the commandbox.json. 3 | * Nested attributes may be set by specifying dot-delimited names or using array notation. 4 | * . 5 | * {code:bash} 6 | * config clear description 7 | * {code} 8 | * 9 | **/ 10 | component { 11 | 12 | property name="ConfigService" inject="ConfigService"; 13 | property name="JSONService" inject="JSONService"; 14 | 15 | /** 16 | * @property.hint Name of the property to clear 17 | * @property.optionsUDF completeProperty 18 | **/ 19 | function run( required string property ) { 20 | 21 | var configSettings = ConfigService.getconfigSettings( noOverrides=true ); 22 | 23 | try { 24 | JSONService.clear( configSettings, arguments.property ); 25 | } catch( JSONException var e ) { 26 | error( e.message, e.detail ); 27 | } catch( any var e ) { 28 | rethrow; 29 | } 30 | 31 | print.greenLine( 'Removed #arguments.property#' ); 32 | 33 | // Write the file back out. 34 | ConfigService.setConfigSettings( configSettings ); 35 | 36 | } 37 | 38 | // Dynamic completion for property name based on contents of box.json 39 | function completeProperty() { 40 | return ConfigService.completeProperty(); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/config/show.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * View configuration properties in CommandBox. Call with no parameters to view all config properties. 3 | * . 4 | * Output setting 5 | * {code:bash} 6 | * config show settingName 7 | * {code} 8 | * . 9 | * Nested attributes may be accessed by specifying dot-delimited names or using array notation. 10 | * If the accessed property is a complex value, the JSON representation will be displayed 11 | * . 12 | * {code:bash} 13 | * config show modules.myModule.settingName 14 | * {code} 15 | * . 16 | * {code:bash} 17 | * config show mySettingArray[1] 18 | * {code} 19 | * . 20 | **/ 21 | component { 22 | 23 | property name="ConfigService" inject="ConfigService"; 24 | property name="JSONService" inject="JSONService"; 25 | 26 | /** 27 | * @property.hint The name of the property to show. Can nested to get "deep" properties 28 | * @property.optionsUDF completeProperty 29 | **/ 30 | function run( string property='' ) { 31 | 32 | var configSettings = ConfigService.getconfigSettings(); 33 | 34 | try { 35 | 36 | var propertyValue = JSONService.show( configSettings, arguments.property ); 37 | print.text( propertyValue ); 38 | 39 | } catch( JSONException var e ) { 40 | error( e.message, e.detail ); 41 | } catch( any var e ) { 42 | rethrow; 43 | } 44 | 45 | } 46 | 47 | // Dynamic completion for property name based on contents of commandbox.json 48 | function completeProperty() { 49 | return ConfigService.completeProperty(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/confirm.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Prompt the user for a yes/no. Requires an interactive terminal. 3 | * An exit code of 0 is returned for a true response, and an exit code of 1 is retured for a false response. 4 | * . 5 | * Output a single file 6 | * {code:bash} 7 | * confirm "do you want to update? " && update 8 | * {code} 9 | * 10 | **/ 11 | component { 12 | 13 | /** 14 | * @question Question to ask the user 15 | * @defaultResponse Default what shows in the buffer 16 | * @mask Set to a char like * to hide passwords, etc 17 | **/ 18 | function run( required string question ) { 19 | if( confirm( question ) ) { 20 | setExitCode( 0 ); 21 | } else { 22 | setExitCode( 1 ); 23 | } 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/cp.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copy a file or directory. 3 | * . 4 | * Create a copy of sample.html in the current directory and call it test.html 5 | * {code:bash} 6 | * cp sample.html test.html 7 | * {code} 8 | * . 9 | * Create a copy index.cfm in another directory with the same name 10 | * {code:bash} 11 | * cp index.cfm testing/index.cfm 12 | * {code} 13 | * . 14 | * Create a copy of a directory 15 | * {code:bash} 16 | * cp foo/ bar/ 17 | * {code} 18 | * 19 | **/ 20 | component aliases="copy" { 21 | 22 | /** 23 | * @path.hint The file or directory source 24 | * @newPath.hint The new name file or directory location 25 | * @recurse.hint Include subdirectories as well. 26 | * @filter.hint A directory copy filter string that uses "*" as a wildcard, for example, "*.cfm" 27 | **/ 28 | function run( required Globber path, required newPath, boolean recurse=false, string filter="*" ) { 29 | 30 | // Make path canonical and absolute 31 | var thisNewPath = resolvePath( arguments.newPath ); 32 | 33 | if( path.count() > 1 && !directoryExists( thisNewPath ) ) { 34 | error( '[#thisNewPath#] is not a directory.' ); 35 | } 36 | 37 | path.apply( function( thisPath ){ 38 | 39 | // It's a directory 40 | if( directoryExists( thisPath ) ) { 41 | // rename directory 42 | directoryCopy( thisPath, thisNewPath, recurse, filter, true ); 43 | print.greenLine( "Directory copied to #thisNewPath#" ); 44 | // It's a file 45 | } else if( fileExists( thisPath ) ){ 46 | // Copy file 47 | DirectoryCreate( getDirectoryFromPath( thisNewPath ), true, true ); 48 | fileCopy( thisPath, thisNewPath ); 49 | print.greenLine( "File copied to #thisNewPath#" ); 50 | } else { 51 | return error( "File/directory does not exist: #thisPath#" ); 52 | } 53 | 54 | } ); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/echo.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Outputs the text entered. 3 | * . 4 | * {code:bash} 5 | * echo "Hello World!" 6 | * {code} 7 | * . 8 | * This can be useful in CommandBox Recipes, or to pipe arbitrary text into another command. 9 | * . 10 | * {code:bash} 11 | * echo "Step 3 complete" >> log.txt 12 | * {code} 13 | * 14 | **/ 15 | component { 16 | 17 | /** 18 | * @text.hint The text to output 19 | **/ 20 | function run( String text="" ) { 21 | print.text( arguments.text ); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/edit.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Open a path in the native OS application in order to edit it. If you pass in a 3 | * folder, it will try to open the folder in an explorer or finder window. 4 | * Passing no path, or an empty string will open the current working directory 5 | * . 6 | * {code:bash} 7 | * edit index.cfm 8 | * open myApp/ 9 | * {code} 10 | * 11 | **/ 12 | component aliases="open" { 13 | 14 | /** 15 | * @path.hint Path to open natively. 16 | **/ 17 | function run( Globber path=globber( getCWD().left(-1) ) ) { 18 | 19 | path.apply( function( thisPath ) { 20 | 21 | if( fileSystemUtil.openNatively( thisPath ) ){ 22 | print.text( "Resource Opened!" ); 23 | } else { 24 | error( "Unsupported OS, cannot open path." ); 25 | }; 26 | 27 | } ); 28 | 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/env/clear.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Clears a System Setting from the current environment 3 | * . 4 | * {code:bash} 5 | * env set foo=bar 6 | * env clear for 7 | * {code} 8 | * 9 | * No error is thrown if the var doesn't exist. 10 | **/ 11 | component { 12 | 13 | /** 14 | * @name The env var to clear 15 | * @name.optionsUDF nameComplete 16 | */ 17 | function run( required string name ) { 18 | var env = systemSettings.getCurrentEnvironment( true ); 19 | env.delete( name, false ); 20 | print.text( '#name# cleared' ); 21 | } 22 | 23 | function nameComplete() { 24 | return systemSettings.getCurrentEnvironment( true ).keyArray(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/env/debug.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Debugs what env vars are loaded in what environments 3 | * . 4 | * {code:bash} 5 | * env debug 6 | * {code} 7 | * 8 | * This command does not include Java system properties or OS environment variables even though 9 | * they are included in the lookup order for System Setting resolution. 10 | */ 11 | component { 12 | 13 | /** 14 | * 15 | */ 16 | function run() { 17 | print.text( systemSettings.getAllEnvironments() ); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/env/set.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Sets a System Setting in the current environment 3 | * . 4 | * {code:bash} 5 | * set foo=bar 6 | * {code} 7 | **/ 8 | component aliases="set" { 9 | 10 | /** 11 | * 12 | */ 13 | function run() { 14 | for( var arg in arguments ) { 15 | systemSettings.setSystemSetting( arg, arguments[ arg ], true ); 16 | print.text( '#arg#=#arguments[ arg ]#' ); 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/env/show.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Shows a System Setting from the current environment 3 | * . 4 | * {code:bash} 5 | * env set foo=bar 6 | * env show foo 7 | * {code} 8 | * . 9 | * If you don't pass a name, you will get a JSON representation of the entire environment struct. 10 | * . 11 | * {code:bash} 12 | * env show 13 | * {code} 14 | * 15 | * This command does not include Java system properties or OS environment variables even though 16 | * they are included in the lookup order for System Setting resolution. 17 | **/ 18 | component { 19 | 20 | /** 21 | * @name The env var to show 22 | * @defaultValue Value to return if this env var doesn't exist. 23 | */ 24 | function run( string name='', defaultValue='' ) { 25 | if( name.len() ) { 26 | print.text( systemSettings.getSystemSetting( name, defaultValue ) ); 27 | } else { 28 | print.text( systemSettings.getAllEnvironmentsFlattened() ); 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/fileAppend.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Append to existing text in a file. Will add a newline automatically 3 | * . 4 | * {code:bash} 5 | * fileAppend "My new line" file.txt 6 | * {code} 7 | * . 8 | * You can pipe text into it. 9 | * . 10 | * {code:bash} 11 | * echo "My new line" | fileAppend file.txt 12 | * {code} 13 | * . 14 | * This command is also used internally for redirection when you use the >> symbol. 15 | * . 16 | * {code:bash} 17 | * echo "Step 3 complete" >> log.txt 18 | * {code} 19 | * 20 | **/ 21 | component excludeFromHelp=true { 22 | 23 | /** 24 | * @contents.hint Contents to append to the file 25 | * @file.hint File to append to 26 | **/ 27 | function run( required contents='', required string file ) { 28 | 29 | // This will make the file path canonical and absolute 30 | arguments.file = resolvePath( arguments.file ); 31 | 32 | directoryCreate( getDirectoryFromPath( file ), true, true ); 33 | 34 | // Clean out any ANI escape codes from the text 35 | arguments.contents = print.unansi( arguments.contents ); 36 | 37 | // Append to the file 38 | file 39 | action = "append" 40 | file = "#arguments.file#" 41 | output = "#arguments.contents#" 42 | addNewLine = "yes"; 43 | 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/fileWrite.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Write a file, overwriting it if it exists. 3 | * . 4 | * {code:bash} 5 | * fileWrite "My file contents" file.txt 6 | * {code} 7 | * . 8 | * You can pipe text into it. 9 | * . 10 | * {code:bash} 11 | * echo "My file contents" | fileWrite file.txt 12 | * {code} 13 | * . 14 | * This command is also used internally for redirection when you use the > symbol. 15 | * . 16 | * {code:bash} 17 | * dir > fileList.txt 18 | * {code} 19 | * 20 | **/ 21 | component excludeFromHelp=true { 22 | 23 | /** 24 | * @contents.hint Contents to write to the file 25 | * @file.hint File to write to 26 | **/ 27 | function run( required contents='', required string file ) { 28 | 29 | // This will make the file path canonical and absolute 30 | arguments.file = resolvePath( arguments.file ); 31 | 32 | directoryCreate( getDirectoryFromPath( file ), true, true ); 33 | 34 | // Clean out any ANI escape codes from the text 35 | arguments.contents = print.unansi( arguments.contents ); 36 | 37 | // Write the file 38 | fileWrite( arguments.file, arguments.contents ); 39 | 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/grep.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Search through string input and filter only matching lines. Pipe input in and supply a regular expression. 3 | * . 4 | * Find Brad's ForgeBox entries 5 | * {code:bash} 6 | * forgebox show | grep Brad 7 | * {code} 8 | * . 9 | * Find recent install commands 10 | * {code:bash} 11 | * history | grep install 12 | * {code} 13 | * . 14 | * Search log file for certain errors 15 | * {code:bash} 16 | * cat myLogFile.txt | grep "variable .* undefined" 17 | * {code} 18 | * 19 | **/ 20 | component excludeFromHelp=true { 21 | 22 | /** 23 | * @input.hint The piped input to be checked. 24 | * @expression.hint A regular expression to match against each line of the input. Only matching lines will be output. 25 | * @count.hint Return only a count of the matched rows 26 | **/ 27 | function run( input='', expression='', boolean count=false ) { 28 | // Turn output into an array, breaking on carriage returns 29 | var content = listToArray( arguments.input, chr(13)&chr(10) ); 30 | var result = createObject( 'java', 'java.lang.StringBuilder' ).init( '' ); 31 | var numMatches = 0; 32 | 33 | // Loop over content 34 | for( var line in content ) { 35 | 36 | // Does it match 37 | if( arguments.expression == '' || reFindNoCase( arguments.expression, line ) ) { 38 | if( count ) { 39 | numMatches++; 40 | } else { 41 | result.append( line & server.separator.line ); 42 | } 43 | } 44 | 45 | } 46 | 47 | if( count ) { 48 | print.text( numMatches ); 49 | } else { 50 | print.text( result.toString() ); 51 | } 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/mkdir.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Create a new directory. 3 | * . 4 | * {code:bash} 5 | * mkdir newDir 6 | * {code} 7 | * 8 | * You can also change your current working directory to the new path with the cd flag. 9 | * . 10 | * {code:bash} 11 | * mkdir newDir --cd 12 | * {code} 13 | * 14 | **/ 15 | component { 16 | 17 | /** 18 | * @directory.hint The directory to create 19 | * @cd.hint CD into the directory after creating 20 | **/ 21 | function run( required String directory, boolean cd=false ) { 22 | 23 | // Validate directory 24 | if( !len( arguments.directory ) ) { 25 | return error( 'Please provide a directory name.' ); 26 | } 27 | 28 | // This will make each directory canonical and absolute 29 | arguments.directory = resolvePath( arguments.directory ); 30 | 31 | // Create dir. Ignore if it exists and also create parent folders if missing 32 | directorycreate( arguments.directory, true, true ); 33 | 34 | print.greenLine( 'Created #arguments.directory#' ); 35 | 36 | // Optionally change into the new dir 37 | if( arguments.cd ) { 38 | command( 'cd' ) 39 | .params( arguments.directory ) 40 | .run(); 41 | } 42 | 43 | } 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/mv.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Rename/move a file or directory to a new name and path 3 | * . 4 | * Rename a file 5 | * {code:bash} 6 | * mv sample.html sample.htm 7 | * {code} 8 | * . 9 | * Move a file 10 | * {code:bash} 11 | * mv sample.html /test/sample.htm 12 | * {code} 13 | * . 14 | * Rename a directory 15 | * {code:bash} 16 | * mv foo/ bar/ 17 | * {code} 18 | * . 19 | * Move a directory 20 | * {code:bash} 21 | * mv foo/ bar/foo/ 22 | * {code} 23 | * 24 | **/ 25 | component aliases="rename" { 26 | 27 | /** 28 | * @path.hint The file or directory source to rename 29 | * @newPath.hint The new name of the file or directory 30 | **/ 31 | function run( required Globber path, required newPath ) { 32 | 33 | // Make path canonical and absolute 34 | var thisNewPath = resolvePath( arguments.newPath ); 35 | 36 | if( path.count() > 1 && !directoryExists( thisNewPath ) ) { 37 | error( '[#thisNewPath#] is not a directory.' ); 38 | } 39 | 40 | path.apply( function( thisPath ){ 41 | // It's a directory 42 | if( directoryExists( thisPath ) ) { 43 | // rename directory 44 | directoryRename( thisPath, thisNewPath, true ); 45 | print.greenLine( "Directory renamed/moved to #thisNewPath#" ); 46 | // It's a file 47 | } else if( fileExists( thisPath ) ){ 48 | // move file 49 | fileMove( thisPath, thisNewPath ); 50 | print.greenLine( "File renamed/moved to #thisNewPath#" ); 51 | } else { 52 | return error( "File/directory does not exist: #thisPath#" ); 53 | } 54 | } ); 55 | 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/pathExists.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a passing (0) or failing (1) exit code whether the path exists. Command outputs nothing. 3 | * . 4 | * {code:bash} 5 | * pathExists box.json && package show 6 | * {code} 7 | * . 8 | * You can specify if the path needs to be a file or a folder. 9 | * . 10 | * {code:bash} 11 | * pathExists --file server.json && server show 12 | * pathExists --directory foo || mkdir foo 13 | * {code} 14 | **/ 15 | component { 16 | 17 | /** 18 | * @thePath The path to check 19 | * @file Validate that the path is a file 20 | * @directory Validate that the path is a directory 21 | **/ 22 | function run( string thePath='', boolean file=false, boolean directory=false ) { 23 | 24 | // if nothing is passed, then yeah... I dunno. 25 | if( !thePath.len() ) { 26 | error( 'Path not provided!' ); 27 | } 28 | 29 | thepath = resolvePath( thepath ); 30 | 31 | // Must be a file 32 | if( file ) { 33 | if( !fileExists( thePath ) ) { 34 | setExitCode( 1 ); 35 | } 36 | // Must be a directory 37 | } else if( directory ) { 38 | if( !directoryExists( thePath ) ) { 39 | setExitCode( 1 ); 40 | } 41 | // Can be file or directory 42 | } else if( !fileExists( thePath ) && !directoryExists( thepath ) ) { 43 | setExitCode( 1 ); 44 | } 45 | 46 | } 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/pause.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * This command waits for the user to press a key to continue. You could use this in a boxr recipe 3 | * to pause execution so you can see the previous commands' output before the windows closes if 4 | * calling it from a shortcut to a native OS prompt that closes as soon as it's complete. 5 | * . 6 | * {code:bash} 7 | * pause 8 | * {code} 9 | **/ 10 | component excludeFromHelp=true { 11 | 12 | 13 | function run() { 14 | waitForKey( 'Press any key to continue...' ); 15 | print.line(); 16 | } 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/printColumns.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Prints a list or array of information as columns 3 | * 4 | * JSON or list data can be passed in the first param or piped into the command: 5 | * {code:bash} 6 | * printColumns [1,2,3] 7 | * ls --simple | printColumns 8 | * {code} 9 | */ 10 | component { 11 | 12 | /** 13 | * Outputs a list of items in column form 14 | * @data JSON serialized array or list 15 | * @delimiter List delimiter (default to new line) 16 | */ 17 | 18 | public string function run( 19 | String data='', 20 | String delimiter=chr(13)&chr(10) 21 | ) { 22 | 23 | data = print.unAnsi( data ); 24 | 25 | //deserialize data if in a JSON format 26 | if( isJSON( data) ) { 27 | data = deserializeJSON( data ); 28 | if( isSimpleValue( data ) ) { 29 | data = [ data ]; 30 | } else if( !isArray( data ) ) { 31 | error( 'Only JSON arrays can be used with the printColumn command' ); 32 | } 33 | } else { 34 | data = data.listToArray( delimiter ); 35 | } 36 | 37 | print.columns( data ); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/prompt.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Set prompt of the shell to your own string. This defaults to "CommandBox>". You can revert to the 3 | * default prompt by using the "reload" command. Don't forget to include a space at the end of the prompt 4 | * so it doesn't run up against your text. 5 | * . 6 | * {code:bash} 7 | * prompt "My Cool Shell> " 8 | * {code} 9 | **/ 10 | component { 11 | 12 | /** 13 | * @prompt.hist The new text to use as the shell prompt 14 | **/ 15 | function run( required prompt ) { 16 | shell.setPrompt( arguments.prompt ); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/propertyFile/clear.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Remove a property from a property file. 3 | * . 4 | * {code:bash} 5 | * propertyFile clear myFile.properties mySetting 6 | * {code} 7 | * 8 | **/ 9 | component { 10 | 11 | /** 12 | * @propertyFilePath The path to the property file to interact with 13 | * @propertyName The name of the property to clear 14 | **/ 15 | function run( 16 | required string propertyFilePath, 17 | required string propertyName 18 | ) { 19 | 20 | // This will make each directory canonical and absolute 21 | propertyFilePath = resolvePath( propertyFilePath ); 22 | 23 | // Create and load property file object 24 | propertyFile( propertyFilePath ) 25 | .remove( propertyName ) 26 | .store(); 27 | 28 | print 29 | .greenLine( 'Property removed!' ) 30 | .line( propertyName ); 31 | 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/propertyFile/set.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Set property into a property file. 3 | * . 4 | * {code:bash} 5 | * propertyFile set myFile.properties mySetting myValue 6 | * {code} 7 | * 8 | **/ 9 | component { 10 | 11 | /** 12 | * @propertyFilePath The path to the property file to interact with 13 | * @propertyName The name of the property to set 14 | * @propertyValue The value of the property to set 15 | **/ 16 | function run( 17 | required string propertyFilePath, 18 | required string propertyName, 19 | required string propertyValue 20 | ) { 21 | 22 | // This will make each directory canonical and absolute 23 | propertyFilePath = resolvePath( propertyFilePath ); 24 | 25 | // Create and load property file object 26 | if( fileExists( propertyFilePath ) ){ 27 | var pf = propertyFile( propertyFilePath ); 28 | } else { 29 | var pf = propertyFile(); 30 | } 31 | pf 32 | .set( propertyName, propertyValue ) 33 | .store( propertyFilePath ); 34 | 35 | print 36 | .greenLine( 'Property set!' ) 37 | .line( propertyName & ' = ' & propertyValue ); 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/propertyFile/show.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * View the contents of a .properties file 3 | * . 4 | * Output a single property, all properties, or all properties as JSON. 5 | * {code:bash} 6 | * propertyFile show myFile.properties 7 | * propertyFile show myFile.properties property.name.here 8 | * propertyFile show myFile.properties --JSON 9 | * {code} 10 | * 11 | **/ 12 | component { 13 | 14 | /** 15 | * @propertyFilePath The path to the property file to interact with 16 | * @propertyName The name of the property to show 17 | * @JSON Return all the properties in the file as JSON 18 | **/ 19 | function run( 20 | required string propertyFilePath, 21 | string propertyName='', 22 | boolean JSON=false 23 | ) { 24 | 25 | // This will make each directory canonical and absolute 26 | propertyFilePath = resolvePath( propertyFilePath ); 27 | 28 | // Create and load property file object 29 | var propertyFile = propertyFile( propertyFilePath ); 30 | 31 | // JSON output takes precedence 32 | if( JSON ) { 33 | print.text( propertyFile.getAsStruct() ); 34 | // Output single property 35 | } else if( propertyName.len() ) { 36 | print.text( propertyFile.get( propertyName ) ); 37 | // Output all properties 38 | } else { 39 | var properties = propertyFile.getAsStruct(); 40 | properties 41 | .each( function( i ) { 42 | print.line( i & ' = ' & properties[ i ] ); 43 | } ); 44 | } 45 | 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/pwd.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Output the current working directory of the shell. This can be changed by using the "cd" command. 3 | * . 4 | * {code:bash} 5 | * pwd 6 | * {code} 7 | * 8 | **/ 9 | component { 10 | 11 | function run() { 12 | return getCWD(); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/quit.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Exits out of the shell. If the CommandBox binary was executed directly, the shell will close. If the 3 | * CommandBox binary was run from your OS's native shell, you will be returned there. 4 | * . 5 | * {code:bash} 6 | * exit 7 | * {code} 8 | * . 9 | * You can exit the shell with a specific exit code like this: 10 | * . 11 | * {code:bash} 12 | * exit 1 13 | * {code} 14 | * . 15 | * Please note, any embedded servers started during your session will continue to run as they are in a separate 16 | * process. Use the icon in your OS's command tray to interact with the servers, or start CommandBox back up 17 | * at a later time and "cd" to the root folder of the server. 18 | * 19 | **/ 20 | component aliases="exit,q,e" { 21 | 22 | /** 23 | * @exitCode The exitCode for the box process to return 24 | */ 25 | function run( exitCode=0 ) { 26 | if( !isNumeric( exitCode ) ) { 27 | error( 'Exit code [#exitCode#] is invalid. Please supply a numeric input' ); 28 | } 29 | setExitCode( exitCode ); 30 | shell.exit(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/reload.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Reload CommandBox. This is a maintenance operation to recreate the shell and reload all commands in 3 | * the command folders. Use this if developing commands to quickly reload your changes after modifying 4 | * the command's CFC file. All files will be recreated except /system/BootStrap.cfm. 5 | * . 6 | * {code:bash} 7 | * reload 8 | * {code} 9 | **/ 10 | component aliases="r" excludeFromHelp=true { 11 | 12 | /** 13 | * @clearScreen.hint Clear the screen after reload 14 | **/ 15 | function run( Boolean clearScreen=true ) { 16 | print.boldLine( 'Reloading shell...' ); 17 | shell.reload( arguments.clearScreen ); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/sort.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Sort a list of input lines. You can control direction and type of sort. 3 | * . 4 | * {code:bash} 5 | * cat names.txt | sort 6 | * {code} 7 | * . 8 | * You can do a case sensitive or numeric sort 9 | * . 10 | * {code:bash} 11 | * cat names.txt | sort type=text 12 | * cat names.txt | sort type=numeric 13 | * {code} 14 | * . 15 | * You can also change the direction of the sort 16 | * . 17 | * {code:bash} 18 | * cat names.txt | sort direction=desc 19 | * {code} 20 | * 21 | **/ 22 | component { 23 | 24 | /** 25 | * @input The piped input to be checked. 26 | * @type Sort by "text" (case sensitive), "textnocase" (case insensitive), or "numeric" 27 | * @direction Sort "asc" (ascending), or "desc" (descending) 28 | * @type.options text,textnocase,numeric 29 | * @direction.options asc,desc 30 | **/ 31 | function run( input='', type="textnocase", direction="asc" ) { 32 | print.text( 33 | listToArray( arguments.input, chr(13)&chr(10) ) 34 | .sort( type, direction ) 35 | .toList( CR ) 36 | ); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/system-log.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Outputs the path to the system log file 3 | * . 4 | * {code:bash} 5 | * system-log 6 | * {code} 7 | * 8 | * Combine with other commands to print the contents of the log to the console 9 | * or open the log file in the default editor. 10 | * . 11 | * {code:bash} 12 | * system-log | open 13 | * system-log | cat 14 | * system-log | tail 15 | * {code} 16 | **/ 17 | component { 18 | 19 | /** 20 | * @open Open the file 21 | **/ 22 | function run() { 23 | 24 | var logFilePath = expandpath( '/commandbox-home' ) & "/logs/commandbox.log"; 25 | 26 | print.text( logFilePath ); 27 | 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/unansi.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Outputs the text entered but with ANSI formatting stripped. Useful when you want to pipe output into a command which doesn't understand or need ANSI formatting. 3 | * . 4 | * {code:bash} 5 | * package show | unansi 6 | * {code} 7 | * 8 | **/ 9 | component { 10 | 11 | /** 12 | * @text.hint The text to output without ANSI formatting 13 | **/ 14 | function run( String text="" ) { 15 | print.text( print.unansi( arguments.text ) ); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/unique.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Search through string input and filter duplicate lines. Only unique results will be returned. 3 | * . 4 | * {code:bash} 5 | * cat names.txt | unique 6 | * {code} 7 | * . 8 | * You can also get results with the occurrence count preceding each item 9 | * . 10 | * {code:bash} 11 | * cat names.txt | unique --count 12 | * {code} 13 | * 14 | **/ 15 | component { 16 | 17 | /** 18 | * @input The piped input to be checked. 19 | * @count Precede each line with the number of times that item appeared 20 | **/ 21 | function run( input='', count=false ) { 22 | // Turn output into an array, breaking on carriage returns 23 | var content = listToArray( arguments.input, chr(13)&chr(10) ); 24 | var uniqueMap = {}; 25 | 26 | // Loop over content 27 | for( var line in content ) { 28 | uniqueMap[ line ] = uniqueMap[ line ] ?: 0 29 | uniqueMap[ line ]++; 30 | } 31 | uniqueMap.each( (k,v)=>{ 32 | print.line( (count ? v & ' ' : '' ) & k ); 33 | } ); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/system-commands/commands/version.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Outputs CommandBox version currently installed 3 | * . 4 | * {code:bash} 5 | * version 6 | * {code} 7 | * . 8 | * Show the CLI Loader version with the --loader flag 9 | * . 10 | * {code:bash} 11 | * version --loader 12 | * {code} 13 | * . 14 | **/ 15 | component aliases="ver" { 16 | 17 | /** 18 | * @loader.hint Show the version of the CLI loader 19 | */ 20 | function run( boolean loader=false ) { 21 | if( arguments.loader ) { 22 | print.text( 'CLI Loader #shell.getLoaderVersion()#' ); 23 | } else { 24 | print.text( 'CommandBox #shell.getVersion()#' ); 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/task-commands/ModuleConfig.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano 7 | */ 8 | component { 9 | function configure() { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/cfml/system/modules_app/task-commands/templates/TaskContent.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Description of task 3 | */ 4 | component { 5 | 6 | /** 7 | * 8 | */ 9 | function |targetName|() { 10 | print.greenLine( 'Complete!' ); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /src/cfml/system/modules_app/utils-commands/ModuleConfig.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2017 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Mark Skelton 7 | * @description Module Configuration for config module 8 | */ 9 | component { 10 | function configure(){} 11 | } 12 | -------------------------------------------------------------------------------- /src/cfml/system/tmp/tmp_files_go_here.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/tmp/tmp_files_go_here.txt -------------------------------------------------------------------------------- /src/cfml/system/util/jline/CommandParser.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano, Denny Valliant 7 | * 8 | * CommandBox Command Line Parser and Tokenizer 9 | * 10 | */ 11 | component { 12 | 13 | // DI 14 | property name='parser' inject='parser'; 15 | 16 | function parse( string line, numeric cursor, any context ) { 17 | // Call CommandBox parser to parse the line. 18 | var tokens = parser.tokenizeInput( line ); 19 | 20 | // JLine expects there to be an empty string on the end of the array of the line ends with a space 21 | tokens = ( line.endsWith( ' ' ) ? tokens.append( '' ) : tokens ); 22 | 23 | return createDynamicProxy( 24 | new ArgumentList( line, cursor, tokens, context ), 25 | [ 'org.jline.reader.ParsedLine', 'org.jline.reader.CompletingParsedLine' ] 26 | ); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/cfml/system/util/jline/SignalHandler.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2005 ColdBox Platform by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano 7 | * I am a JLine highlighter class that handles terminal signals 8 | */ 9 | component { 10 | property name='shell' inject='shell'; 11 | 12 | function handle( signal ) { 13 | if( signal.toString() == 'INT' ) { 14 | shell.getMainThread().interrupt(); 15 | } 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/box.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"WireBox DI/AOP", 3 | "version":"6.5.2+37", 4 | "location":"https://downloads.ortussolutions.com/ortussolutions/wirebox/6.5.2/wirebox-6.5.2.zip", 5 | "author":"Ortus Solutions ", 6 | "slug":"wirebox", 7 | "type":"di", 8 | "packageDirectory":"wirebox", 9 | "keywords":"di,aop,dependeny injection,ioc", 10 | "homepage":"https://www.coldbox.org", 11 | "documentation":"https://wirebox.ortusbooks.com", 12 | "repository":{ 13 | "type":"git", 14 | "url":"https://github.com/coldbox/coldbox-platform" 15 | }, 16 | "bugs":"https://ortussolutions.atlassian.net/browse/WIREBOX", 17 | "shortDescription":"AOP and Dependency Injection Framework", 18 | "license":[ 19 | { 20 | "type":"Apache2", 21 | "url":"http://www.apache.org/licenses/LICENSE-2.0.html" 22 | } 23 | ], 24 | "contributors":[ 25 | "Brad Wood ", 26 | "Curt Gratz " 27 | ], 28 | "ignore":[ 29 | "**/.*", 30 | "tests", 31 | "apidocs", 32 | "*/.md" 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/aop/MethodInterceptor.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * --- 5 | * Our AOP Method Interceptor Interface 6 | */ 7 | interface{ 8 | 9 | /** 10 | * Invoke an AOP method invocation 11 | * @invocation The invocation object 12 | * @invocation.doc_generic wirebox.system.aop.methodInvocation 13 | */ 14 | function invokeMethod( required invocation ) output="false"; 15 | 16 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/aop/aspects/MethodLogger.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * --- 5 | * A simple interceptor that logs method calls and their results 6 | */ 7 | component implements="wirebox.system.aop.MethodInterceptor" 8 | accessors="true"{ 9 | 10 | // DI 11 | property name="log" inject="logbox:logger:{this}"; 12 | 13 | /** 14 | * Log results 15 | */ 16 | property name="logResults" type="boolean" default="true"; 17 | 18 | /** 19 | * Constructor 20 | * @logResults Log results or not 21 | */ 22 | function init( boolean logResults=true){ 23 | variables.logResults = arguments.logResults; 24 | return this; 25 | } 26 | 27 | /** 28 | * Invoke an AOP method invocation 29 | * @invocation The invocation object 30 | * @invocation.doc_generic wirebox.system.aop.methodInvocation 31 | */ 32 | function invokeMethod( required invocation ) output="false"{ 33 | var refLocal = {}; 34 | var debugString = "target: #arguments.invocation.getTargetName()#,method: #arguments.invocation.getMethod()#,arguments:#serializeJSON(arguments.invocation.getArgs())#"; 35 | 36 | // log incoming call 37 | if( log.canDebug() ){ 38 | log.debug( debugString ); 39 | } 40 | 41 | // proceed execution 42 | refLocal.results = arguments.invocation.proceed(); 43 | 44 | // result logging and returns 45 | if( structKeyExists( refLocal, "results") ){ 46 | if( variables.logResults and log.canDebug() ){ 47 | log.debug( "#debugString#, results:", refLocal.results ); 48 | } 49 | return refLocal.results; 50 | } 51 | } 52 | 53 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/aop/tmp/generationPath.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/wirebox/system/aop/tmp/generationPath.txt -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/async/proxies/BiConsumer.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Functional interface that maps to java.util.function.BiFunction 3 | * See https://docs.oracle.com/javase/8/docs/api/java/util/function/BiConsumer.html 4 | */ 5 | component extends="BaseProxy" { 6 | 7 | /** 8 | * Constructor 9 | * 10 | * @f a function to be applied to to the previous element to produce a new element 11 | */ 12 | function init( required f ){ 13 | super.init( arguments.f ); 14 | return this; 15 | } 16 | 17 | /** 18 | * Performs this operation on the given arguments. 19 | * See https://docs.oracle.com/javase/8/docs/api/java/util/function/BiConsumer.html#accept-T-U- 20 | */ 21 | function accept( required t, required u ){ 22 | loadContext(); 23 | try { 24 | lock name="#getConcurrentEngineLockName()#" type="exclusive" timeout="60" { 25 | variables.target( arguments.t, arguments.u ); 26 | } 27 | } finally { 28 | unLoadContext(); 29 | } 30 | } 31 | 32 | function andThen( required after ){ 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/async/proxies/BiFunction.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Functional interface that maps to java.util.function.BiFunction 3 | * See https://docs.oracle.com/javase/8/docs/api/java/util/function/BiFunction.html 4 | */ 5 | component extends="BaseProxy" { 6 | 7 | /** 8 | * Constructor 9 | * 10 | * @f a function to be applied to to the previous element to produce a new element 11 | */ 12 | function init( required f ){ 13 | super.init( arguments.f ); 14 | return this; 15 | } 16 | 17 | /** 18 | * Functional interface for the apply functional interface 19 | * See https://docs.oracle.com/javase/8/docs/api/java/util/function/BiFunction.html#apply-T-U- 20 | */ 21 | function apply( t, u ){ 22 | loadContext(); 23 | try { 24 | lock name="#getConcurrentEngineLockName()#" type="exclusive" timeout="60" { 25 | return variables.target( 26 | isNull( arguments.t ) ? javaCast( "null", "" ) : arguments.t, 27 | isNull( arguments.u ) ? javaCast( "null", "" ) : arguments.u 28 | ); 29 | } 30 | } finally { 31 | unLoadContext(); 32 | } 33 | } 34 | 35 | function andThen( required after ){ 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/async/proxies/Callable.cfc: -------------------------------------------------------------------------------- 1 | component extends="Supplier" { 2 | 3 | /** 4 | * Functional interface for supplier to get a result 5 | * See https://docs.oracle.com/javase/8/docs/api/java/util/function/Supplier.html 6 | */ 7 | function call(){ 8 | loadContext(); 9 | try { 10 | lock name="#getConcurrentEngineLockName()#" type="exclusive" timeout="60" { 11 | if ( isClosure( variables.target ) || isCustomFunction( variables.target ) ) { 12 | return variables.target(); 13 | } else { 14 | return invoke( variables.target, variables.method ); 15 | } 16 | } 17 | } finally { 18 | unLoadContext(); 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/async/proxies/Consumer.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Functional interface that maps to java.util.function.Consumer 3 | * See https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Consumer.html 4 | */ 5 | component extends="BaseProxy" { 6 | 7 | /** 8 | * Constructor 9 | * 10 | * @f a function to be applied to to the previous element to produce a new element 11 | */ 12 | function init( required f ){ 13 | super.init( arguments.f ); 14 | return this; 15 | } 16 | 17 | /** 18 | * Performs this operation on the given arguments. 19 | * See https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Consumer.html#accept-T-U- 20 | */ 21 | function accept( required t ){ 22 | loadContext(); 23 | try { 24 | lock name="#getConcurrentEngineLockName()#" type="exclusive" timeout="60" { 25 | variables.target( arguments.t ); 26 | } 27 | } finally { 28 | unLoadContext(); 29 | } 30 | } 31 | 32 | function andThen( required after ){ 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/async/proxies/Function.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Functional Interface that maps to java.util.function.Function 3 | * See https://docs.oracle.com/javase/8/docs/api/java/util/function/Function.html 4 | */ 5 | component extends="BaseProxy" { 6 | 7 | /** 8 | * Constructor 9 | * 10 | * @f The lambda or closure to be used in the apply() method 11 | * @debug Add debugging or not 12 | * @loadAppContext By default, we load the Application context into the running thread. If you don't need it, then don't load it. 13 | */ 14 | function init( 15 | required f, 16 | boolean debug = false, 17 | boolean loadAppContext = true 18 | ){ 19 | super.init( 20 | arguments.f, 21 | arguments.debug, 22 | arguments.loadAppContext 23 | ); 24 | return this; 25 | } 26 | 27 | /** 28 | * Represents a function that accepts one argument and produces a result. 29 | */ 30 | function apply( t ){ 31 | loadContext(); 32 | try { 33 | lock name="#getConcurrentEngineLockName()#" type="exclusive" timeout="60" { 34 | if( isNull( arguments.t ) ){ 35 | return variables.target(); 36 | } 37 | return variables.target( arguments.t ); 38 | } 39 | } finally { 40 | unLoadContext(); 41 | } 42 | } 43 | 44 | function andThen( after ){ 45 | } 46 | 47 | function compose( before ){ 48 | } 49 | 50 | function identity(){ 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/async/proxies/FutureFunction.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Functional Interface that maps to java.util.function.Function 3 | * but will return the native future which is expected in the result 4 | * of the called target 5 | */ 6 | component extends="Function" { 7 | 8 | /** 9 | * Represents a function that accepts one argument and produces a result. 10 | * I have to use it like this because `super` does not work on ACF in a proxy 11 | */ 12 | function apply( t ){ 13 | loadContext(); 14 | try { 15 | lock name="#getConcurrentEngineLockName()#" type="exclusive" timeout="60" { 16 | var oFuture = variables.target( arguments.t ); 17 | if ( isNull( oFuture ) || !structKeyExists( oFuture, "getNative" ) ) { 18 | throw( 19 | type = "IllegalFutureException", 20 | message = "The return of the function is NOT a ColdBox Future" 21 | ); 22 | } 23 | return oFuture.getNative(); 24 | } 25 | } finally { 26 | unLoadContext(); 27 | } 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/async/proxies/Runnable.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Functional Interface that maps to java.lang.Runnable 3 | * See https://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html 4 | */ 5 | component extends="BaseProxy" { 6 | 7 | /** 8 | * Constructor 9 | * 10 | * @target The lambda or closure that will be the task 11 | * @method An optional method in case the supplier is a CFC instead of a closure 12 | * @debug Add debugging or not 13 | * @loadAppContext By default, we load the Application context into the running thread. If you don't need it, then don't load it. 14 | */ 15 | function init( 16 | required target, 17 | method = "run", 18 | boolean debug = false, 19 | boolean loadAppContext = true 20 | ){ 21 | super.init( 22 | arguments.target, 23 | arguments.debug, 24 | arguments.loadAppContext 25 | ); 26 | variables.method = arguments.method; 27 | return this; 28 | } 29 | 30 | function run(){ 31 | loadContext(); 32 | try { 33 | lock name="#getConcurrentEngineLockName()#" type="exclusive" timeout="60" { 34 | if ( isClosure( variables.target ) || isCustomFunction( variables.target ) ) { 35 | variables.target(); 36 | } else { 37 | invoke( variables.target, variables.method ); 38 | } 39 | } 40 | } finally { 41 | unLoadContext(); 42 | } 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/async/proxies/Supplier.cfc: -------------------------------------------------------------------------------- 1 | component extends="BaseProxy" { 2 | 3 | /** 4 | * Constructor 5 | * 6 | * @supplier The lambda or closure that will supply the elements 7 | * @method An optional method in case the supplier is a CFC instead of a closure 8 | * @debug Add debugging or not 9 | * @loadAppContext By default, we load the Application context into the running thread. If you don't need it, then don't load it. 10 | */ 11 | function init( 12 | required supplier, 13 | method = "run", 14 | boolean debug = false, 15 | boolean loadAppContext = true 16 | ){ 17 | super.init( 18 | arguments.supplier, 19 | arguments.debug, 20 | arguments.loadAppContext 21 | ); 22 | variables.method = arguments.method; 23 | return this; 24 | } 25 | 26 | /** 27 | * Functional interface for supplier to get a result 28 | * See https://docs.oracle.com/javase/8/docs/api/java/util/function/Supplier.html 29 | */ 30 | function get(){ 31 | loadContext(); 32 | try { 33 | lock name="#getConcurrentEngineLockName()#" type="exclusive" timeout="60" { 34 | if ( isClosure( variables.target ) || isCustomFunction( variables.target ) ) { 35 | return variables.target(); 36 | } else { 37 | return invoke( variables.target, variables.method ); 38 | } 39 | } 40 | } finally { 41 | unLoadContext(); 42 | } 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/async/tasks/ScheduledFuture.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a ColdBox Scheduled Future object modeled and backed by Java's ScheduledFuture & Future interface but with Dynamic Goodness! 3 | * 4 | * @see https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ScheduledFuture.html 5 | */ 6 | component accessors="true" extends="FutureTask" { 7 | 8 | /** 9 | * Build the ColdBox ScheduledFuture with the Java native class 10 | * 11 | * @native The native ScheduledFuture class we are wrapping 12 | */ 13 | ScheduledFuture function init( native ){ 14 | if ( isNull( arguments.native ) ) { 15 | arguments.native = createObject( 16 | "java", 17 | "java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask" 18 | ); 19 | } 20 | variables.native = arguments.native; 21 | return this; 22 | } 23 | 24 | /** 25 | * Returns true if the scheduled task is periodic or not 26 | */ 27 | boolean function isPeriodic(){ 28 | return variables.native.isPeriodic(); 29 | } 30 | 31 | /** 32 | * Get the delay of the scheduled task in the given time unit 33 | * 34 | * @timeUnit The time unit to use, available units are: days, hours, microseconds, milliseconds, minutes, nanoseconds, and seconds. The default is milliseconds 35 | */ 36 | numeric function getDelay( timeUnit = "milliseconds" ){ 37 | return variables.native.getDelay( this.$timeUnit.get( arguments.timeUnit ) ); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/async/time/TimeUnit.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Static class to map ColdFusion strings units to Java units 3 | * A TimeUnit does not maintain time information, 4 | * but only helps organize and use time representations that may be maintained separately across various contexts 5 | */ 6 | component singleton { 7 | 8 | // The static java class 9 | variables.jTimeUnit = createObject( "java", "java.util.concurrent.TimeUnit" ); 10 | 11 | /** 12 | * Get the appropriate Java timeunit class according to string conventions 13 | * 14 | * @timeUnit The time unit to use, available units are: days, hours, microseconds, milliseconds, minutes, nanoseconds, and seconds. The default is milliseconds 15 | * 16 | * @return The Java time unit class 17 | */ 18 | function get( required timeUnit = "milliseconds" ){ 19 | switch ( arguments.timeUnit ) { 20 | case "days": { 21 | return variables.jTimeUnit.DAYS; 22 | } 23 | case "hours": { 24 | return variables.jTimeUnit.HOURS; 25 | } 26 | case "microseconds": { 27 | return variables.jTimeUnit.MICROSECONDS; 28 | } 29 | case "milliseconds": { 30 | return variables.jTimeUnit.MILLISECONDS; 31 | } 32 | case "minutes": { 33 | return variables.jTimeUnit.MINUTES; 34 | } 35 | case "nanoseconds": { 36 | return variables.jTimeUnit.NANOSECONDS; 37 | } 38 | case "seconds": { 39 | return variables.jTimeUnit.SECONDS; 40 | } 41 | } 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/cache/config/LogBox.cfc: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | ******************************************************************************** 5 | The logging configuration object for CacheBox Standalone version. 6 | You can make changes here to determine how CacheBox logs information. For more 7 | information about logBox visit: http://wiki.coldbox.org/wiki/LogBox.cfm 8 | **/ 9 | component{ 10 | 11 | /** 12 | * Configure logBox 13 | */ 14 | function configure(){ 15 | variables.logBox = { 16 | // Define Appenders 17 | appenders = { 18 | console = { 19 | class="ConsoleAppender" 20 | } 21 | }, 22 | // Root Logger 23 | root = { levelmax="INFO", appenders="*" } 24 | }; 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/cache/license.txt: -------------------------------------------------------------------------------- 1 | ******************************************************************************** 2 | Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | www.ortussolutions.com 4 | ******************************************************************************** 5 | ColdBox is open source. However, if you use this product please know that it is bound to the following Licence. 6 | If you use ColdBox, please make mention of it in your code or web site or add a Powered By Coldbox icon. 7 | 8 | Apache License, Version 2.0 9 | 10 | Copyright [2007] [Luis Majano and Ortus Solutions,Corp] 11 | 12 | Licensed under the Apache License, Version 2.0 (the "License"); 13 | you may not use this file except in compliance with the License. 14 | You may obtain a copy of the License at 15 | 16 | http://www.apache.org/licenses/LICENSE-2.0 17 | 18 | Unless required by applicable law or agreed to in writing, software 19 | distributed under the License is distributed on an "AS IS" BASIS, 20 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | See the License for the specific language governing permissions and 22 | limitations under the License. -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/cache/policies/FIFO.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * ---- 5 | * This is a FIFO eviction Policy meaning that the first object placed on cache 6 | * will be the first one to come out. 7 | * 8 | * More information can be found here: 9 | * http://en.wikipedia.org/wiki/FIFO 10 | */ 11 | component extends="wirebox.system.cache.policies.AbstractEvictionPolicy"{ 12 | 13 | /** 14 | * Constructor 15 | * 16 | * @cacheProvider The associated cache provider of type: wirebox.system.cache.providers.ICacheProvider" doc_generic="wirebox.system.cache.providers.ICacheProvider 17 | */ 18 | FIFO function init ( required any cacheProvider ){ 19 | super.init( arguments.cacheProvider ); 20 | 21 | return this; 22 | } 23 | 24 | /** 25 | * Execute the policy 26 | */ 27 | void function execute (){ 28 | // Get searchable index 29 | try{ 30 | var index = getAssociatedCache() 31 | .getObjectStore() 32 | .getIndexer() 33 | .getSortedKeys( "created", "numeric", "asc" ); 34 | // process evictions 35 | processEvictions( index ); 36 | } catch( Any e ) { 37 | getLogger().error( "Error sorting via store indexer #e.message# #e.detail# #e.stackTrace#." ); 38 | } 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/cache/policies/IEvictionPolicy.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * ---- 5 | * 6 | * CacheBox Eviction policy interface 7 | */ 8 | interface{ 9 | 10 | /** 11 | * Execute the eviction policy on the associated cache 12 | */ 13 | void function execute(); 14 | 15 | /** 16 | * Get the Associated Cache Provider of type: wirebox.system.cache.providers.ICacheProvider 17 | * 18 | * @return wirebox.system.cache.providers.ICacheProvider 19 | */ 20 | any function getAssociatedCache(); 21 | 22 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/cache/policies/LFU.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.coldbox.org | www.luismajano.com | www.ortussolutions.com 4 | * ---- 5 | * @author original: Luis Majano, cfscript: Ben Koshy 6 | * LFU Eviction Policy Command 7 | * Removes entities from the cache that are used the least. 8 | * More information can be found here: 9 | * http://en.wikipedia.org/wiki/Least_Frequently_Used 10 | */ 11 | component extends = "wirebox.system.cache.policies.AbstractEvictionPolicy"{ 12 | 13 | /** 14 | * Constructor 15 | * @cacheProvider The associated cache provider of type: wirebox.system.cache.providers.ICacheProvider" doc_generic="wirebox.system.cache.providers.ICacheProvider 16 | */ 17 | LFU function init( required any cacheProvider ){ 18 | super.init( arguments.cacheProvider ); 19 | 20 | return this; 21 | } 22 | 23 | /** 24 | * Execute the policy 25 | */ 26 | void function execute(){ 27 | // Get searchable index 28 | try { 29 | var index = getAssociatedCache() 30 | .getObjectStore() 31 | .getIndexer() 32 | .getSortedKeys( "hits", "numeric", "asc" ); 33 | // process evictions 34 | processEvictions( index ); 35 | } 36 | catch( any e ){ 37 | getLogger().error( "Error sorting via store indexer #e.message# #e.detail# #e.stackTrace#." ); 38 | } 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/cache/policies/LIFO.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * ---- 5 | * @author original: Luis Majano, cfscript: Francesco Pepe 6 | * 7 | * This is a LIFO eviction Policy meaning that the first object placed on cache 8 | * will be the last one to come out. This is usually a structure that represents 9 | * a stack. 10 | * 11 | * More information can be found here: 12 | * http://en.wikipedia.org/wiki/FIFO 13 | */ 14 | component extends="wirebox.system.cache.policies.AbstractEvictionPolicy"{ 15 | 16 | /** 17 | * This is the constructor 18 | * @cacheProvider The associated cache provider of type: wirebox.system.cache.providers.ICacheProvider" doc_generic="wirebox.system.cache.providers.ICacheProvider 19 | */ 20 | LIFO function init( required any cacheProvider ){ 21 | super.init( arguments.cacheProvider ); 22 | 23 | return this; 24 | } 25 | 26 | /** 27 | * Execute the policy 28 | */ 29 | void function execute(){ 30 | // Get searchable index 31 | try{ 32 | var index = getAssociatedCache() 33 | .getObjectStore() 34 | .getIndexer() 35 | .getSortedKeys( "Created", "numeric", "desc" ); 36 | // process evictions 37 | processEvictions( index ); 38 | } catch( Any e ) { 39 | getLogger().error( "Error sorting via store indexer #e.message# #e.detail# #e.stackTrace#." ); 40 | } 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/cache/policies/LRU.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * ---- 5 | * 6 | * This is the LRU or least recently used algorithm for cachebox. 7 | * It basically discards the least recently used items first according to the last accessed date. 8 | * This is also the default algorithm for CacheBox. 9 | * 10 | * For more information visit: http://en.wikipedia.org/wiki/Least_Recently_Used 11 | */ 12 | component extends="wirebox.system.cache.policies.AbstractEvictionPolicy"{ 13 | 14 | /** 15 | * This is the constructor 16 | * @cacheProvider The associated cache provider of type: wirebox.system.cache.providers.ICacheProvider" doc_generic="wirebox.system.cache.providers.ICacheProvider 17 | */ 18 | LRU function init( required any cacheProvider ){ 19 | super.init( arguments.cacheProvider ); 20 | 21 | return this; 22 | } 23 | 24 | /** 25 | * Execute the policy 26 | */ 27 | void function execute(){ 28 | // Get searchable index 29 | try{ 30 | var index = getAssociatedCache() 31 | .getObjectStore() 32 | .getIndexer() 33 | .getSortedKeys( "LastAccessed", "numeric", "asc" ); 34 | // process evictions 35 | processEvictions( index ); 36 | } catch( Any e ) { 37 | getLogger().error( "Error sorting via store indexer #e.message# #e.detail# #e.stackTrace#." ); 38 | } 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/cache/report/skins/default/images/bg-glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/wirebox/system/cache/report/skins/default/images/bg-glass.png -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/cache/report/skins/default/images/bg-glass2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/cfml/system/wirebox/system/cache/report/skins/default/images/bg-glass2.png -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/cache/store/sql/JDBCStore-MySQL.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `cacheBox` ( 2 | `id` varchar(100) NOT NULL, 3 | `objectKey` varchar(255) NOT NULL, 4 | `objectValue` longtext NOT NULL, 5 | `hits` int(11) NOT NULL DEFAULT '1', 6 | `timeout` int(11) NOT NULL, 7 | `lastAccessTimeout` int(11) NOT NULL, 8 | `created` datetime NOT NULL, 9 | `lastAccessed` datetime NOT NULL, 10 | `isExpired` tinyint(4) NOT NULL DEFAULT '0', 11 | `isSimple` tinyint(4) NOT NULL DEFAULT '1', 12 | PRIMARY KEY (`id`), 13 | KEY `hits` (`hits`), 14 | KEY `created` (`created`), 15 | KEY `lastAccessed` (`lastAccessed`), 16 | KEY `timeout` (`timeout`), 17 | KEY `isExpired` (`isExpired`) 18 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/cache/store/sql/JDBCStore-Postgres.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE cachebox ( 2 | id VARCHAR(100) NOT NULL, 3 | objectKey VARCHAR(255) NOT NULL, 4 | objectValue text NOT NULL, 5 | hits integer NOT NULL DEFAULT '1', 6 | timeout integer NOT NULL, 7 | lastAccessTimeout integer NOT NULL, 8 | created timestamp NOT NULL, 9 | lastAccessed timestamp NOT NULL, 10 | isExpired boolean NOT NULL DEFAULT true, 11 | isSimple boolean NOT NULL DEFAULT false, 12 | PRIMARY KEY (id) 13 | ) 14 | CREATE INDEX created 15 | ON cachebox 16 | USING btree 17 | (created); 18 | CREATE INDEX hits 19 | ON cachebox 20 | USING btree 21 | (hits); 22 | CREATE INDEX "isExpired" 23 | ON cachebox 24 | USING btree 25 | (isexpired); 26 | CREATE INDEX "lastAccessed" 27 | ON cachebox 28 | USING btree 29 | (lastaccessed); 30 | CREATE INDEX timeout 31 | ON cachebox 32 | USING btree 33 | (timeout); -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/cache/util/IStats.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * --- 5 | * @author Luis Majano 6 | * 7 | * The main interface for a CacheBox cache provider statistics object 8 | */ 9 | interface { 10 | 11 | /** 12 | * Get the cache's performance ratio 13 | */ 14 | numeric function getCachePerformanceRatio(); 15 | 16 | /** 17 | * Get the associated cache's live object count 18 | */ 19 | numeric function getObjectCount(); 20 | 21 | /** 22 | * Clear the stats 23 | * 24 | * @return IStats 25 | */ 26 | function clearStatistics(); 27 | 28 | /** 29 | * Get the total cache's garbage collections 30 | */ 31 | numeric function getGarbageCollections(); 32 | 33 | /** 34 | * Get the total cache's eviction count 35 | */ 36 | numeric function getEvictionCount(); 37 | 38 | /** 39 | * Get the total cache's hits 40 | */ 41 | numeric function getHits(); 42 | 43 | /** 44 | * Get the total cache's misses 45 | */ 46 | numeric function getMisses(); 47 | 48 | /** 49 | * Get the date/time of the last reap the cache did 50 | * 51 | * @return date/time or empty 52 | */ 53 | function getLastReapDatetime(); 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/core/conversion/CFDocument.cfm: -------------------------------------------------------------------------------- 1 | 2 | #arguments.data# 3 | -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/core/util/CFMLEngine.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * --- 5 | * Allows you to manipulate determine CFML engine capabilities 6 | */ 7 | component { 8 | 9 | // setup the engine properties 10 | this.ADOBE = "ADOBE"; 11 | this.LUCEE = "LUCEE"; 12 | 13 | // JDK Version 14 | this.JDK_VERSION = createObject( "java", "java.lang.System" ).getProperty( "java.version" ); 15 | 16 | /** 17 | * Constructor 18 | */ 19 | function init(){ 20 | // Feature map 21 | variables.features = { adobe : {}, lucee : {} }; 22 | 23 | return this; 24 | } 25 | 26 | // ------------------------------------------- PUBLIC ------------------------------------------- 27 | 28 | /** 29 | * Returns the current running CFML major version 30 | */ 31 | numeric function getVersion(){ 32 | return listFirst( server.coldfusion.productversion ); 33 | } 34 | 35 | /** 36 | * Returns the current running CFML full version 37 | */ 38 | string function getFullVersion(){ 39 | return server.coldfusion.productversion; 40 | } 41 | 42 | /** 43 | * Get the current CFML Engine 44 | */ 45 | string function getEngine(){ 46 | var engine = this.adobe; 47 | 48 | if ( server.coldfusion.productname eq "Lucee" ) { 49 | engine = this.lucee; 50 | } 51 | 52 | return engine; 53 | } 54 | 55 | /** 56 | * Feature Active Check 57 | * 58 | * @feature The feature to check 59 | * @engine The engine we are checking 60 | */ 61 | boolean function featureCheck( required feature, required engine ){ 62 | return variables.features[ arguments.engine ][ arguments.feature ]; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/core/util/CFMappingHelper.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * --- 5 | * Allows you to manipulate CF mappings 6 | */ 7 | component { 8 | 9 | /** 10 | * Add a ColdFusion mapping 11 | * 12 | * @name The name of the mapping 13 | * @path The path of the mapping 14 | */ 15 | CFMappingHelper function addMapping( required string name, required string path ){ 16 | var appSettings = getApplicationMetadata(); 17 | appSettings.mappings[ arguments.name ] = arguments.path; 18 | return this; 19 | } 20 | 21 | /** 22 | * Register a struct of CF Mappings 23 | * 24 | * @mappings The struct of mappings to register 25 | */ 26 | CFMappingHelper function addMappings( required mappings ){ 27 | getApplicationMetadata().mappings.append( arguments.mappings ); 28 | return this; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/core/util/cffeed.cfm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/ioc/IInjector.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * --- 5 | * An interface that enables any CFC to act like a parent injector within WireBox. 6 | **/ 7 | interface { 8 | 9 | /** 10 | * Link a parent Injector with this injector and return itself 11 | * 12 | * @injector A WireBox Injector to assign as a parent to this Injector 13 | * @injector.doc_generic wirebox.system.ioc.Injector 14 | * 15 | * @return IInjector 16 | */ 17 | function setParent( required injector ); 18 | 19 | /** 20 | * Get a reference to the parent injector instance, else an empty simple string meaning nothing is set 21 | * 22 | * @return wirebox.system.ioc.Injector 23 | */ 24 | function getParent(); 25 | 26 | /** 27 | * Locates, Creates, Injects and Configures an object model instance 28 | * 29 | * @name The mapping name or CFC instance path to try to build up 30 | * @initArguments The constructor structure of arguments to passthrough when initializing the instance 31 | * @dsl The dsl string to use to retrieve the instance model object, mutually exclusive with 'name' 32 | * @targetObject The object requesting the dependency, usually only used by DSL lookups 33 | */ 34 | function getInstance( name, struct initArguments, dsl, targetObject="" ); 35 | 36 | /** 37 | * Checks if this injector can locate a model instance or not 38 | * 39 | * @name The object name or alias to search for if this container can locate it or has knowledge of it 40 | */ 41 | boolean function containsInstance( required name ); 42 | 43 | /** 44 | * Shutdown the injector gracefully by calling the shutdown events internally 45 | * 46 | * @return IInjector 47 | */ 48 | function shutdown(); 49 | 50 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/ioc/IProvider.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * --- 5 | * A WireBox provider object that retrieves objects by using the provider pattern. 6 | **/ 7 | interface { 8 | 9 | /** 10 | * Get the provided object 11 | */ 12 | public any function $get(); 13 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/ioc/Scopes.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * --- 5 | * A scope enum CFC that gives you the scopes that WireBox uses by default 6 | **/ 7 | component{ 8 | 9 | // DECLARED SCOPES 10 | this.NOSCOPE = "NoScope"; 11 | this.PROTOTYPE = "NoScope"; 12 | this.SINGLETON = "singleton"; 13 | this.SESSION = "session"; 14 | this.APPLICATION = "application"; 15 | this.REQUEST = "request"; 16 | this.SERVER = "server"; 17 | this.CACHEBOX = "cachebox"; 18 | 19 | /** 20 | * Verify if an incoming scope is valid 21 | * 22 | * @scope The scope to check 23 | */ 24 | boolean function isValidScope( required scope ){ 25 | for( var key in this ){ 26 | if( isSimpleValue( this[ key ] ) and this[ key ] eq arguments.scope ){ 27 | return true; 28 | } 29 | } 30 | return false; 31 | } 32 | 33 | /** 34 | * Get all valid scopes as an array 35 | */ 36 | array function getValidScopes(){ 37 | var scopes = {}; 38 | for( var key in this){ 39 | if( isSimpleValue( this[ key ] ) ){ 40 | scopes[ key ] = this[ key ]; 41 | } 42 | } 43 | return structKeyArray( scopes ); 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/ioc/Types.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * --- 5 | * A lookup static CFC that gives you the instantiation types that WireBox can talk to. 6 | **/ 7 | component{ 8 | 9 | // DECLARED WIREBOX INSTANTIATION TYPES 10 | this.CFC = "cfc"; 11 | this.JAVA = "java"; 12 | this.WEBSERVICE = "webservice"; 13 | this.RSS = "rss"; 14 | this.DSL = "dsl"; 15 | this.CONSTANT = "constant"; 16 | this.FACTORY = "factory"; 17 | this.PROVIDER = "provider"; 18 | 19 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/ioc/config/LogBox.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * --- 5 | * The logging configuration object for WireBox Standalone version. 6 | * You can make changes here to determine how WireBox logs information. For more 7 | * information about logBox visit: https://logbox.ortusbooks.com 8 | */ 9 | component{ 10 | 11 | /** 12 | * Configure logBox 13 | */ 14 | function configure(){ 15 | logBox = { 16 | // Define Appenders 17 | appenders = { 18 | console = { 19 | class = "ConsoleAppender" 20 | } 21 | }, 22 | // Root Logger 23 | root = { levelmax = "INFO", appenders = "*" } 24 | }; 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/ioc/config/Mixin.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | function $init( required mixins ){ 4 | // Include the mixins 5 | for ( var thisMixin in arguments.mixins ) { 6 | thisMixin = trim( thisMixin ); 7 | if ( listLast( thisMixin, "." ) != "cfm" ) { 8 | include "#thisMixin#.cfm"; 9 | } else { 10 | include "#thisMixin#"; 11 | } 12 | } 13 | 14 | // Expose them 15 | for ( var key in variables ) { 16 | if ( isCustomFunction( variables[ key ] ) AND !structKeyExists( this, key ) ) { 17 | this[ key ] = variables[ key ]; 18 | } 19 | } 20 | 21 | return this; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/ioc/dsl/IDSLBuilder.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * --- 5 | * The main interface to produce WireBox namespace DSL Builders 6 | **/ 7 | interface{ 8 | 9 | /** 10 | * Configure the DSL Builder for operation and returns itself 11 | * 12 | * @injector The linked WireBox Injector 13 | * @injector.doc_generic wirebox.system.ioc.Injector 14 | * 15 | * @return wirebox.system.ioc.dsl.IDSLBuilder 16 | */ 17 | function init( required injector ); 18 | 19 | /** 20 | * Process an incoming DSL definition and produce an object with it 21 | * 22 | * @definition The injection dsl definition structure to process. Keys: name, dsl 23 | * @targetObject The target object we are building the DSL dependency for. If empty, means we are just requesting building 24 | * 25 | * @return wirebox.system.ioc.dsl.IDSLBuilder 26 | */ 27 | function process( required definition, targetObject ); 28 | 29 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/ioc/license.txt: -------------------------------------------------------------------------------- 1 | ******************************************************************************** 2 | Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | www.ortussolutions.com 4 | ******************************************************************************** 5 | ColdBox is open source. However, if you use this product please know that it is bound to the following Licence. 6 | If you use ColdBox, please make mention of it in your code or web site or add a Powered By Coldbox icon. 7 | 8 | Apache License, Version 2.0 9 | 10 | Copyright [2007] [Luis Majano and Ortus Solutions,Corp] 11 | 12 | Licensed under the Apache License, Version 2.0 (the "License"); 13 | you may not use this file except in compliance with the License. 14 | You may obtain a copy of the License at 15 | 16 | http://www.apache.org/licenses/LICENSE-2.0 17 | 18 | Unless required by applicable law or agreed to in writing, software 19 | distributed under the License is distributed on an "AS IS" BASIS, 20 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | See the License for the specific language governing permissions and 22 | limitations under the License. -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/ioc/scopes/IScope.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * --- 5 | * The main interface to produce WireBox storage scopes 6 | **/ 7 | interface{ 8 | 9 | /** 10 | * Configure the scope for operation and returns itself 11 | * 12 | * 13 | * @injector The linked WireBox injector 14 | * @injector.doc_generic wirebox.system.ioc.Injector 15 | * 16 | * @return wirebox.system.ioc.scopes.IScope 17 | */ 18 | function init( required injector ); 19 | 20 | /** 21 | * Retrieve an object from scope or create it if not found in scope 22 | * 23 | * 24 | * @mapping The linked WireBox injector 25 | * @mapping.doc_generic wirebox.system.ioc.config.Mapping 26 | * @initArguments The constructor struct of arguments to passthrough to initialization 27 | */ 28 | function getFromScope( required mapping, struct initArguments ); 29 | 30 | 31 | /** 32 | * Indicates whether an object exists in scope 33 | * 34 | * @mapping The linked WireBox injector 35 | * @mapping.doc_generic wirebox.system.ioc.config.Mapping 36 | * 37 | * @return wirebox.system.ioc.scopes.IScope 38 | */ 39 | boolean function exists( required mapping ); 40 | 41 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/logging/Layout.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * --- 5 | * This is a base layout object that will help you create custom layout's for messages in appenders 6 | **/ 7 | component accessors="true"{ 8 | /** 9 | * The LogBox appender this layotu is linked to. 10 | */ 11 | property name="appender"; 12 | 13 | // The log levels enum as a public property 14 | this.logLevels = new wirebox.system.logging.LogLevels(); 15 | // A line Sep Constant, man, wish we had final in CF. 16 | this.LINE_SEP = chr(13) & chr(10); 17 | 18 | /** 19 | * Constructor 20 | * 21 | * @appender The appender this layout is linked to. 22 | */ 23 | function init( required appender ){ 24 | variables.appender = arguments.appender; 25 | return this; 26 | } 27 | 28 | /** 29 | * Format a logging event message into your own format 30 | * 31 | * @logEvent The LogBox logging event object 32 | */ 33 | function format( required logEvent ){ 34 | throw( 35 | message = "You must implement this layout's format() method", 36 | type = "FormatNotImplementedException" 37 | ) 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/logging/appenders/DummyAppender.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * --- 5 | * A dummy appender that goes nowhere 6 | **/ 7 | component accessors="true" extends="wirebox.system.logging.AbstractAppender" { 8 | 9 | /** 10 | * Constructor 11 | * 12 | * @name The unique name for this appender. 13 | * @properties A map of configuration properties for the appender" 14 | * @layout The layout class to use in this appender for custom message rendering. 15 | * @levelMin The default log level for this appender, by default it is 0. Optional. ex: LogBox.logLevels.WARN 16 | * @levelMax The default log level for this appender, by default it is 5. Optional. ex: LogBox.logLevels.WARN 17 | */ 18 | function init( 19 | required name, 20 | struct properties={}, 21 | layout="", 22 | levelMin=0, 23 | levelMax=4 24 | ){ 25 | // Init supertype 26 | super.init( argumentCollection=arguments ); 27 | 28 | return this; 29 | } 30 | 31 | /** 32 | * Write an entry into the appender. You must implement this method yourself. 33 | * 34 | * @logEvent The logging event to log 35 | */ 36 | AbstractAppender function logMessage( required wirebox.system.logging.LogEvent logEvent ){ 37 | return this; 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/logging/config/DefaultConfig.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * --- 5 | * The default logging configuration for a vanilla LogBox instance 6 | **/ 7 | component{ 8 | 9 | /** 10 | * Configure logBox 11 | */ 12 | function configure(){ 13 | logBox = { 14 | // Define Appenders 15 | appenders = { 16 | console = { 17 | class="ConsoleAppender" 18 | } 19 | }, 20 | // Root Logger 21 | root = { levelmax="INFO", appenders="*" } 22 | }; 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/logging/config/samples/Sample.LogBox.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | * www.ortussolutions.com 4 | * --- 5 | * The default LogBox configuration object 6 | **/ 7 | component{ 8 | 9 | /** 10 | * Configure LogBox, that's it! 11 | */ 12 | function configure(){ 13 | logBox = { 14 | // Define Appenders 15 | appenders = { 16 | coldboxTracer = { 17 | class="wirebox.system.logging.appenders.ConsoleAppender", 18 | layout="coldbox.testing.cases.logging.MockLayout", 19 | properties = { 20 | name = "awesome" 21 | } 22 | } 23 | }, 24 | // Root Logger 25 | root = { levelmax="INFO", levelMin=0, appenders="*" }, 26 | // Categories 27 | categories = { 28 | "coldbox.system" = { levelMax="INFO" }, 29 | "wirebox.system.interceptors" = { levelMin=0, levelMax="DEBUG", appenders="*" }, 30 | "hello.model" = {levelMax=4, appenders="*" } 31 | }, 32 | debug = [ "coldbox.system", "model.system" ], 33 | info = [ "hello.model", "yes.wow.wow" ], 34 | warn = [ "hello.model", "yes.wow.wow" ], 35 | error = [ "hello.model", "yes.wow.wow" ], 36 | fatal = [ "hello.model", "yes.wow.wow" ], 37 | OFF = [ "hello.model", "yes.wow.wow" ] 38 | }; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/cfml/system/wirebox/system/logging/license.txt: -------------------------------------------------------------------------------- 1 | ******************************************************************************** 2 | Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp 3 | www.ortussolutions.com 4 | ******************************************************************************** 5 | ColdBox is open source. However, if you use this product please know that it is bound to the following Licence. 6 | If you use ColdBox, please make mention of it in your code or web site or add a Powered By Coldbox icon. 7 | 8 | Apache License, Version 2.0 9 | 10 | Copyright [2007] [Luis Majano and Ortus Solutions,Corp] 11 | 12 | Licensed under the Apache License, Version 2.0 (the "License"); 13 | you may not use this file except in compliance with the License. 14 | You may obtain a copy of the License at 15 | 16 | http://www.apache.org/licenses/LICENSE-2.0 17 | 18 | Unless required by applicable law or agreed to in writing, software 19 | distributed under the License is distributed on an "AS IS" BASIS, 20 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | See the License for the specific language governing permissions and 22 | limitations under the License. -------------------------------------------------------------------------------- /src/java/cliloader/cli.properties: -------------------------------------------------------------------------------- 1 | name=CommandBox 2 | shell=/cfml/system/Bootstrap.cfm 3 | cfml.cli.autoupdate=true 4 | usage=USAGE: box execute /path/to/script [-box_home=/path/to/dir] [-debug] /n\ 5 | Ex: 'box execute test.cfm' or 'box' to enter shell/n\ 6 | Or for server mode: 'box -server --port=8088'/n\ 7 | [-webroot=/path/to/web] [-background] /n\ 8 | And to update your CommandBox home (default is ${user.home}.CommandBox/) after updating binary: 'box -update' -------------------------------------------------------------------------------- /src/java/cliloader/version.properties: -------------------------------------------------------------------------------- 1 | cli.version=${cfml.loader.version}+${build.number} -------------------------------------------------------------------------------- /src/java/com/ortussolutions/commandbox/authentication/ProxyAuthenticator.java: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano 7 | * 8 | * I implement proxy authentication 9 | */ 10 | package com.ortussolutions.commandbox.authentication; 11 | 12 | import java.net.Authenticator; 13 | import java.net.PasswordAuthentication; 14 | 15 | public class ProxyAuthenticator extends Authenticator { 16 | 17 | private String user, password; 18 | 19 | public ProxyAuthenticator(String user, String password) { 20 | this.user = user; 21 | this.password = password; 22 | } 23 | 24 | protected PasswordAuthentication getPasswordAuthentication() { 25 | return new PasswordAuthentication(user, password.toCharArray()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/java/com/ortussolutions/commandbox/jgit/GenericSessionFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano 7 | * 8 | * I extend the abstract session factory class for jGit. 9 | */ 10 | package com.ortussolutions.commandbox.jgit; 11 | 12 | import org.eclipse.jgit.transport.JschConfigSessionFactory; 13 | import org.eclipse.jgit.transport.OpenSshConfig; 14 | import com.jcraft.jsch.Session; 15 | 16 | public class GenericSessionFactory extends JschConfigSessionFactory { 17 | 18 | @Override 19 | protected void configure( OpenSshConfig.Host host, Session session ) { 20 | // This prevents users from having the host in "~/.ssh/known_hosts" 21 | java.util.Properties config = new java.util.Properties(); 22 | config.put("StrictHostKeyChecking", "no"); 23 | session.setConfig( config ); 24 | } 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/java/com/ortussolutions/commandbox/jgit/SSHCallback.java: -------------------------------------------------------------------------------- 1 | /** 2 | ********************************************************************************* 3 | * Copyright Since 2014 CommandBox by Ortus Solutions, Corp 4 | * www.coldbox.org | www.ortussolutions.com 5 | ******************************************************************************** 6 | * @author Brad Wood, Luis Majano 7 | * 8 | * I implement the SSH callback class for jGit to support SSH 9 | */ 10 | package com.ortussolutions.commandbox.jgit; 11 | 12 | import org.eclipse.jgit.api.TransportConfigCallback; 13 | import org.eclipse.jgit.transport.*; 14 | import com.ortussolutions.commandbox.jgit.GenericSessionFactory; 15 | 16 | public class SSHCallback implements TransportConfigCallback { 17 | 18 | public void configure(Transport transport) { 19 | 20 | JschConfigSessionFactory genericSessionFactory = new GenericSessionFactory(); 21 | 22 | SshTransport sshTransport = ( SshTransport )transport; 23 | sshTransport.setSshSessionFactory( genericSessionFactory ); 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/resources/box.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/resources/box.ico -------------------------------------------------------------------------------- /src/resources/box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/resources/box.png -------------------------------------------------------------------------------- /src/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/resources/trayicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ortus-Solutions/commandbox/358574dbb887b8fa24840920d5854221e26f9633/src/resources/trayicon.png -------------------------------------------------------------------------------- /src/resources/traymenu-adobe.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"label":"Stop Server (${runwar.processName})", "action":"stopserver"} 3 | ,{"label":"Open Browser", "action":"openbrowser", "url":"http://${runwar.host}:${runwar.port}/"} 4 | ,{"label":"Open Server Admin", "action":"openbrowser", "url":"http://${runwar.host}:${runwar.port}/CFIDE/administrator/enter.cfm"} 5 | ] 6 | -------------------------------------------------------------------------------- /src/resources/traymenu-default.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"label":"Stop Server (${runwar.processName})", "action":"stopserver"} 3 | ,{"label":"Open Browser", "action":"openbrowser", "url":"http://${runwar.host}:${runwar.port}/"} 4 | ] 5 | -------------------------------------------------------------------------------- /src/resources/traymenu-lucee.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"label":"Stop Server (${runwar.processName})", "action":"stopserver"} 3 | ,{"label":"Open Browser", "action":"openbrowser", "url":"http://${runwar.host}:${runwar.port}/"} 4 | ,{"label":"Open Server Admin", "action":"openbrowser", "url":"http://${runwar.host}:${runwar.port}/lucee/admin/server.cfm"} 5 | ,{"label":"Open Web Admin", "action":"openbrowser", "url":"http://${runwar.host}:${runwar.port}/lucee/admin/web.cfm"} 6 | ] 7 | -------------------------------------------------------------------------------- /src/resources/traymenu-railo.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"label":"Stop Server (${runwar.processName})", "action":"stopserver"} 3 | ,{"label":"Open Browser", "action":"openbrowser", "url":"http://${runwar.host}:${runwar.port}/"} 4 | ,{"label":"Open Server Admin", "action":"openbrowser", "url":"http://${runwar.host}:${runwar.port}/railo-context/admin/server.cfm"} 5 | ,{"label":"Open Web Admin", "action":"openbrowser", "url":"http://${runwar.host}:${runwar.port}/railo-context/admin/web.cfm"} 6 | ] 7 | -------------------------------------------------------------------------------- /tests/Application.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | this.name="CommandBox Testing Harness - " & hash( getCurrentTemplatePath() ); 4 | this.applicationTimeout = createTimeSpan( 0, 0, 5, 0 ); 5 | this.sessionTimeout = createTimeSpan( 0, 0, 5, 0 ); 6 | this.sessionmanagement="true"; 7 | 8 | // mappings 9 | this.mappings[ "/tests" ] = getDirectoryFromPath( getCurrentTemplatePath() ); 10 | this.mappings[ '/testbox' ] = 'testbox'; 11 | this.mappings[ '/commandbox' ] = '../src/cfml'; 12 | this.mappings[ '/wirebox' ] = '../src/cfml/system/wirebox'; 13 | this.mappings[ '/mxunit' ] = '/testbox/system/compat'; 14 | 15 | boolean function onRequestStart( required targetPage ){ 16 | new wirebox.system.ioc.Injector( 'tests.config.WireBox' ); 17 | return true; 18 | } 19 | 20 | function onRequestEnd( required targetPage ){ 21 | structDelete( application, "wirebox" ); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /tests/HttpAntRunner.cfc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/RemoteFacade.cfc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cfadminpassword.txt: -------------------------------------------------------------------------------- 1 | testtest -------------------------------------------------------------------------------- /tests/cfml/commands/TestHelp.cfc: -------------------------------------------------------------------------------- 1 | component name="TestHelp" extends="mxunit.framework.TestCase" { 2 | 3 | public void function testCommandService() { 4 | shell = application.wirebox.getInstance( 'Shell' ); 5 | // helpCommand = application.wirebox.getInstance( 'commandbox.system.commands.help' ); 6 | 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /tests/config/WireBox.cfc: -------------------------------------------------------------------------------- 1 | component extends="commandbox.system.config.WireBox"{ 2 | 3 | function configure(){ 4 | super.configure(); 5 | 6 | var testString = ""; 7 | var bain = createObject( "java", "java.io.ByteArrayInputStream" ).init( testString.getBytes() ); 8 | var baos = createObject( "java", "java.io.ByteArrayOutputStream" ).init(); 9 | 10 | 11 | // map Shell 12 | unmap( "Shell" ); 13 | map( "Shell" ) 14 | .to( "commandbox.system.Shell" ) 15 | .initArg( name="inStream", value=bain ) 16 | .initArg( name="outputStream", value=baos ) 17 | //.initArg( name="userDir", value=expandPath( "/tests/temp" ) ) 18 | .initArg( name="tempDir", value=expandPath( "/tests/temp" ) ) 19 | .initArg( name="asyncLoad", value=false ) 20 | 21 | 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /tests/run.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

8 | #dir# 9 |

10 | 11 | 12 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | #results.getResultsOutput(URL.output)# 27 | 28 | 29 | 30 | #recenthtml# 31 | 32 | 33 | 34 | 35 | #recenthtml# 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /tests/runner.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/tboxrunner.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | request.webadminpassword="testtest"; 9 | // create testbox 10 | if( directoryExists( expandPath("/coldbox/system/testing" ) ) ){ 11 | testBox = new coldbox.system.testing.TestBox(); 12 | } else { 13 | testBox = new testbox.system.testing.TestBox(); 14 | } 15 | // clean up 16 | for( key in URL ){ 17 | url[ key ] = xmlFormat( trim( url[ key ] ) ); 18 | } 19 | // execute tests 20 | if( len( url.target ) ){ 21 | // directory or CFC, check by existence 22 | try { 23 | if( left(url.railoversion,3) EQ "4.1") { 24 | // using testbox mxunit really, thus TestSuite().testSuite() and ANTJunit vs JUnitxml 25 | results = new mxunit.framework.TestSuite().testSuite().addAll(url.target).run().getResultsOutput('ANTJunit'); 26 | } else if( !directoryExists( expandPath( "/#replace( url.target, '.', '/', 'all' )#" ) ) ){ 27 | results = testBox.run( bundles=url.target, reporter=url.reporter, labels=url.labels ); 28 | } else { 29 | results = testBox.run( directory={ mapping=url.target, recurse=url.recurse }, reporter=url.reporter, labels=url.labels ); 30 | } 31 | results = trim(results); 32 | } catch (any e) { 33 | results = ''; 34 | } 35 | } else { 36 | results = 'No tests selected for running!'; 37 | } 38 | 39 | --------------------------------------------------------------------------------