TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   search for a string through multiple php documents (http://www.talkphp.com/absolute-beginners/5418-search-string-through-multiple-php-documents.html)

jac4b 05-19-2010 05:18 AM

search for a string through multiple php documents
 
Howdy, can anyone tell me how to search for a string through multiple php documents?

For example I see text I'd like to change in osCommerce but I can't seem to find it.

Also, is there an easier way to see the structure of all the nested phps besides reading through each one and finding all the includes?

Village Idiot 05-19-2010 06:06 AM

Quote:

Originally Posted by jac4b (Post 30468)
Howdy, can anyone tell me how to search for a string through multiple php documents?

For example I see text I'd like to change in osCommerce but I can't seem to find it.

Also, is there an easier way to see the structure of all the nested phps besides reading through each one and finding all the includes?

Do you need to create a script or are you looking for a tool? I use a program called agent ransack for mass searches, it's extremely fast.

khr2003 05-19-2010 06:52 AM

I always use notepad++ for this purpose. Go to search, then find in files.
It has three modes of search:
normal - just a normal search
extended (\n,\r,\t ...) - use special charcters such as line break, tab space .. etc.
Regular expression - use regular expression to find what you are looking for.

Program website:
http://notepad-plus.sourceforge.net/uk/site.htm

jac4b 05-19-2010 08:05 AM

Thanks but i'm on a Mac.

TexFinderX seems to work.
http://sw.ixoft.com/texfinder.html

delayedinsanity 05-19-2010 03:42 PM

Dreamweaver is pretty cheap and *extremely* powerful. Komodo or Netbeans are free, but since I don't work on a Mac I can't attest to their features.

maeltar 05-19-2010 05:36 PM

if you have shell access you could always use

grep -rl "text to find"

that will look at files in the current and sub directories and give you the file name and the line of text containing the text string...

Think about this a bit more, if it's s string replacement you could use sed...

sed -i 's/foo/foo_bar/g' *.php

* -i = edit the file "in-place": sed will directly modify the file if it finds anything to replace
* s = substitute the following text
* foo = the text string to be substituted
* foo_bar = the replacement string
* g = global, match all occurrences in the line


you need to be sure that the string your are searching for is unique !


All times are GMT. The time now is 06:40 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0