热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

如何确定ColdFusion应用程序使用哪些文件?-HowdoIdeterminewhichfilesaColdFusionapplicationuses?

ImstartingsomeworkonanexistingColdFusionapplicationwithnoversioncontrolandwhatlookl

I'm starting some work on an existing ColdFusion application with no version control and what look like unused cfm files (test.cfm, test2.cfm etc.). I'd like to get a picture of what files are actually part of the application so I can get it into git or subversion in a manageable state.

我正在开始对现有的ColdFusion应用程序进行一些工作,没有版本控制,看起来像未使用的cfm文件(test.cfm,test2.cfm等)。我想了解哪些文件实际上是应用程序的一部分,所以我可以在可管理的状态下将它转换为git或subversion。

How would you go about this? A regex and some methods to find and map cfinclude and cfcomponent tags? Is there some existing tool that does this?

你会怎么做?一个正则表达式和一些方法来查找和映射cfinclude和cfcomponent标签?是否有一些现有工具可以做到这一点?

6 个解决方案

#1


Ben Nadel has a method to examine the live stack trace from a running template. It seems to me that you could easily plop this into your application and log the results to a database. Once you've done that, you've got a good idea of what's in use and what's not.

Ben Nadel有一种方法可以检查正在运行的模板中的实时堆栈跟踪。在我看来,您可以轻松地将其填入您的应用程序并将结果记录到数据库中。一旦你完成了这个,你就会清楚地知道什么是在使用中,什么不是。

I think the easiest way, however, is to enable debugging (standard caveat here about development server, etc). The standard ColdFusion debugger will give you a complete list of every file used during the execution of a single page. ColdFire will do the same thing in a handy Firebug extension (click ColdFusion then click Exec Times).

我认为最简单的方法是启用调试(这里有关于开发服务器的标准警告等)。标准的ColdFusion调试器将为您提供执行单个页面期间使用的每个文件的完整列表。 ColdFire将在一个方便的Firebug扩展中执行相同的操作(单击ColdFusion,然后单击Exec Times)。

It should be pointed out that the built-in debugger even shows you the files included from CFC calls, and the files included from within those calls as well. It is all inclusive.

应该指出的是,内置调试器甚至可以显示CFC调用中包含的文件,以及这些调用中包含的文件。它包罗万象。

Ben Nadel on Stack Traces

Ben Nadel在Stack Traces上

Ray Camden's ColdFire

Ray Camden的ColdFire

Sample of CF Debugging from a live page:
alt text http://i43.tinypic.com/ofvh37.jpg

来自实时页面的CF调试示例:alt text http://i43.tinypic.com/ofvh37.jpg

#2


Put it into git first! Then, if you screw up, you can easily roll back.
(If you're concerned about having a 'clean' repository, when you're finished and fully tested, you have the option to just remove the single .git folder and create a new one.)

先把它放入git!然后,如果你搞砸了,你可以轻松回滚。 (如果您担心拥有'干净'存储库,那么当您完成并经过全面测试后,您可以选择删除单个.git文件夹并创建一个新文件夹。)

Then, as Tomalak suggests, use cflog on every file. Infact I'd say maybe even log twice, at the top and bottom of each script, could potentially help you to map out how the application runs.

然后,正如Tomalak建议的那样,在每个文件上使用cflog。事实上,我可能会说,甚至可以在每个脚本的顶部和底部记录两次,这可能有助于您确定应用程序的运行方式。

#3


A regex is not advisable. Since ColdFusion is quite flexible in the way files can be included or referenced, there will be no way to determine the definitive list of dependencies from the source code alone.

正则表达式是不可取的。由于ColdFusion在包含或引用文件的方式上非常灵活,因此无法单独从源代码确定依赖关系的确定列表。

You could insert a into each file and build a log from the running application. Examine the log after the application was active for a while and all functionality had been accessed at least once.

您可以在每个文件中插入 ,并从正在运行的应用程序中构建日志。在应用程序处于活动状态一段时间后检查日志,并且至少访问过所有功能。

#4


Don't bother instrumenting each file, just cflog the page name in OnRequest inside application.cfc - the target page is an argument.

不要费心检测每个文件,只需在application.cfc中的onRequest中cflog页面名称 - 目标页面是一个参数。

Of course then the issue becomes code coverage and the ability to fully excercise the app.

当然,问题就变成了代码覆盖率和完全锻炼应用程序的能力。


  
  
  
   ...

#5


cfinclude won't tell you if a url is supposed to load the file directly. I've seen system where some files are not included via an index.cfm even when the framework expects it. I have it in my own work where index.cfm loads most code but reset.cfm bypasses the framework to reset configs and session data.

cfinclude不会告诉你url是否应该直接加载文件。我已经看到系统,即使框架需要,也可以通过index.cfm包含一些文件。我有自己的工作,其中index.cfm加载大多数代码,但reset.cfm绕过框架重置配置和会话数据。

#6


Download a trial of Dreamweaver and define a ColdFusion site. DW can create a site map and tell you which files are not included, linked, cfmoduled and so forth. I don't know if it can figure out unused CFCs, but CFMs should be easy. Note that I haven't used DW for years, but it had this functionality around CF 4/5.

下载Dreamweaver的试用版并定义ColdFusion站点。 DW可以创建站点地图并告诉您哪些文件未包含,链接,cfmoduled等。我不知道它是否可以找出未使用的CFC,但CFM应该很容易。请注意,我多年没有使用过DW,但它在CF 4/5附近有这个功能。


推荐阅读
  • CF:3D City Model(小思维)问题解析和代码实现
    本文通过解析CF:3D City Model问题,介绍了问题的背景和要求,并给出了相应的代码实现。该问题涉及到在一个矩形的网格上建造城市的情景,每个网格单元可以作为建筑的基础,建筑由多个立方体叠加而成。文章详细讲解了问题的解决思路,并给出了相应的代码实现供读者参考。 ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
  • 本文讨论了如何使用Web.Config进行自定义配置节的配置转换。作者提到,他将msbuild设置为详细模式,但转换却忽略了带有替换转换的自定义部分的存在。 ... [详细]
  • JavaScript与DOM(上)——也适用于新手 – 深入理解JavaScript系列 23
    本文是《JavaScript深度解析》系列文章第23篇(共51篇)文档对象模 ... [详细]
  • JSCoverage-->JavaScript测试覆盖率检测工具(转),Go语言社区,Golang程序员人脉社 ... [详细]
  • 一、选择器性能优化建议1.总是从#id选择器来继承这是jQuery选择器的一条黄金法则。jQuery选择一个元素最快的方法就是用ID来选择了。1$(#content).hide() ... [详细]
  • 云原生边缘计算之KubeEdge简介及功能特点
    本文介绍了云原生边缘计算中的KubeEdge系统,该系统是一个开源系统,用于将容器化应用程序编排功能扩展到Edge的主机。它基于Kubernetes构建,并为网络应用程序提供基础架构支持。同时,KubeEdge具有离线模式、基于Kubernetes的节点、群集、应用程序和设备管理、资源优化等特点。此外,KubeEdge还支持跨平台工作,在私有、公共和混合云中都可以运行。同时,KubeEdge还提供数据管理和数据分析管道引擎的支持。最后,本文还介绍了KubeEdge系统生成证书的方法。 ... [详细]
  • 本文介绍了Java工具类库Hutool,该工具包封装了对文件、流、加密解密、转码、正则、线程、XML等JDK方法的封装,并提供了各种Util工具类。同时,还介绍了Hutool的组件,包括动态代理、布隆过滤、缓存、定时任务等功能。该工具包可以简化Java代码,提高开发效率。 ... [详细]
  • android listview OnItemClickListener失效原因
    最近在做listview时发现OnItemClickListener失效的问题,经过查找发现是因为button的原因。不仅listitem中存在button会影响OnItemClickListener事件的失效,还会导致单击后listview每个item的背景改变,使得item中的所有有关焦点的事件都失效。本文给出了一个范例来说明这种情况,并提供了解决方法。 ... [详细]
  • 成功安装Sabayon Linux在thinkpad X60上的经验分享
    本文分享了作者在国庆期间在thinkpad X60上成功安装Sabayon Linux的经验。通过修改CHOST和执行emerge命令,作者顺利完成了安装过程。Sabayon Linux是一个基于Gentoo Linux的发行版,可以将电脑快速转变为一个功能强大的系统。除了作为一个live DVD使用外,Sabayon Linux还可以被安装在硬盘上,方便用户使用。 ... [详细]
  • 本文介绍了在mac环境下使用nginx配置nodejs代理服务器的步骤,包括安装nginx、创建目录和文件、配置代理的域名和日志记录等。 ... [详细]
  • flowable工作流 流程变量_信也科技工作流平台的技术实践
    1背景随着公司业务发展及内部业务流程诉求的增长,目前信息化系统不能够很好满足期望,主要体现如下:目前OA流程引擎无法满足企业特定业务流程需求,且移动端体 ... [详细]
  • 本文介绍了在Mac上安装Xamarin并使用Windows上的VS开发iOS app的方法,包括所需的安装环境和软件,以及使用Xamarin.iOS进行开发的步骤。通过这种方法,即使没有Mac或者安装苹果系统,程序员们也能轻松开发iOS app。 ... [详细]
  • 启动浏览器、设置profile&加载插件
    一、Driver下载地址:http:docs.seleniumhq.orgdownload二、启动firefox浏览器(不需要下载驱动,原生支持)1、firefox安装在默认路径下 ... [详细]
  • 采集程序【开源项目】
    更新:通过一些朋友的回复,了解到,可能文章太长了,有朋友只是简略浏览,所以还没有明白程序工作流程。简单介绍&# ... [详细]
author-avatar
追梦and寻梦
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有