find a function on moodle files

find a function on moodle files

Manuel NT -
回帖数:5
Thank,s for  help , one last question , when I see a funcion on moodle code get_records_sql by example, How can I find the  file that hold this. Ex:  what file has the funcion xxx or  yyy ? Many includes make a hard  work to find a funcion and see the implementation, parameter type etc...
回复Manuel NT

Re: find a function on moodle files

Ângelo Rigo -
you can also use the get_included_files() native php function, so you have a list of all included files.
回复Manuel NT

Re: find a function on moodle files

Mark Johnson -
Core developers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像
You could also open the moodle source code in PHP Eclipse then ctrl+Click on the function you want to see the definition for, and it'll take you to the file (or files) where it's defined.
回复Mark Johnson

Re: find a function on moodle files

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像
Yes. A good editor should let you navigate the code with mouse-clicks and/or keyboard shortcuts. It is worth getting one.

It is worth also having full-text-search, either command line grep -R, or something else. For example you may want to find all the places that call get_records_sql to see examples of how it is used.