查找在PHP(和/或SMARTY)中定义变量的位置?

问题描述:

我目前正在处理一个非常大的项目,并且承受着很快完成该项目的巨大压力,而且我遇到了严重的问题.编写最后定义的变量的程序员用一种非常奇怪的方式-config变量不是全部都在同一个文件中,它们分布在整个项目中,包含500多个文件和100k +行代码,而我拥有弄清楚某个变量在哪里很费时间,所以我可以解决问题.
有没有办法追踪这个变量?我相信他正在使用SMARTY(由于这样的问题,我无法忍受),并且该变量是模板变量.我相当确定我要查找的变量最初定义为PHP变量,然后将该变量传递给SMARTY,因此我想跟踪PHP变量,但是,如果那不可能的话,我该如何跟踪在哪里为SMARTY定义变量?

P.S.我在Vista中,并且没有通过ssh访问服务器,因此'grep'成为不可能.

I'm currently working on a very large project, and am under a lot of pressure to finish it soon, and I'm having a serious problem. The programmer who wrote this last defined variables in a very odd way - the config variables aren't all in the same file, they're spread out across the entire project of over 500 files and 100k+ lines of code, and I'm having a hell of a time figuring out where a certain variable is, so I can fix an issue.
Is there a way to track this variable down? I believe he's using SMARTY (Which I can not stand, due to issues like this), and the variable is a template variable. I'm fairly sure that the variable I'm looking for was initially defined as a PHP variable, then that variable is passed into SMARTY, so I'd like to track down the PHP one, however if that's impossible - how can I track down where he defined the variable for SMARTY?

P.S. I'm in Vista, and don't have ssh access to the server, so 'grep' is out of the question.

这种事情是我安装 Cygwin a>在我所有的Windows计算机上.

This sort of thing is the #1 reason I install Cygwin on all my windows machines.

grep myvariablename `find project_dir -name "*.php"`

我无法想象没有工作的grep编程.

I can't imagine programming without a working grep.