The tag file - is this necessary in production Moodle?

The tag file - is this necessary in production Moodle?

by Kent Parker -
Number of replies: 10

Quote from Martin Dougiamas, 2003:

"For those who've never used tags before, it's a very fast way of jumping around code. You place the cursor over a function call and hit Ctrl-] to jump directly to that function. Ctrl-T brings you back again. You can jump several steps away and return one step at a time. The tags file is just an index to keep things fast."

I gather from this that the tag file is part of Moodle development rather than the running.  I have disabled my tag file and Moodle works just fine, or is it working slower and I haven't noticed yet?

The reason I ask is that this file is rather large in version 1.5.3 (2.8 Mbytes) and I am always mindful of space on my server.

Many thanks

Average of ratings: -
In reply to Kent Parker

Re: The tag file - is this necessary in production Moodle?

by Jan Dierckx -

Yes, you can safely delete the tags file. It is not needed for running Moodle (but is immensely useful when you want to jump around from function to function to find out how Moodle works) Having it around (or for that matter not having it around) doesn't impact Moodle's performance.

I hadn't noticed it was that big in Moodle 1.5.3. In Moodle 1.6 the tags file is only 800 Kb.

In reply to Kent Parker

Re: The tag file - is this necessary in production Moodle?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Kent >You place the cursor over a function call and hit Ctrl-] to jump directly to that function. Ctrl-T brings you back again.

I have no idea what this means. In which PHP development environment are you able to do this Ctrl-] and Ctrl-T jumping?surprise

Joseph
In reply to Joseph Rézeau

Re: The tag file - is this necessary in production Moodle?

by Jan Dierckx -

As far as I know only vim and emacs support the tags file. The instructions about using Ctrl-] and Ctrl-T are for vim.

In vim you can also use the command :tag get_record to find functions like get_record, get_records, get_records_sql, etc...

Place the cursor over a variable, hit * and the variable is highlighted in your complete file.

Vim is incredibly useful, but unfortunately it has a very steep learning curve. Vim uses different modes. Very confusing when I started using it, but now I like it because it means less switching from mouse to keyboard and back.

There are some projects which try to make vim more userfriendly. Cream for Vim is one of them. I don't know if you can use the tags functionality in this simplified versions of vim.

Here is the original post which explained how to lookup functions using the tags file included with Moodle (which made me look at vim in the first place) and here is some more information

In reply to Jan Dierckx

Re: The tag file - is this necessary in production Moodle?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Thanks Jan,
I'm not sure I want to take up a "steep learning curve" right nowsad. But thanks for the info anyway.
Joseph
In reply to Joseph Rézeau

Re: The tag file - is this necessary in production Moodle?

by Jan Dierckx -

Yes, it really takes some weeks to get used to vim. mixed

Just thought I should mention that some less arcane editors also seem to support the tags file:

  • jEdit has a plugin to support such a tags file as is included by Moodle.

  • UltraEdit has built in support for a tags file

I have never actually used any of these, so I can't really say how good they are. Anyone using these editors?

In reply to Jan Dierckx

Re: The tag file - is this necessary in production Moodle?

by Kent Parker -

Yes, in version 1.5.3, the tags file is 2.8 Mb, which is a lot of file.  It seems odd to me that it is distributed with the package when it is only of use to people who are developers and have gone through a steep learning curve with Vim.  Anyway I know now to delete it,

Thank-you

In reply to Kent Parker

Re: The tag file - is this necessary in production Moodle?

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I'm not sure how the tags file got so big, it may contain all of contrib as well by accident

I've rebuilt it in STABLE CVS and it's back down to 800k (and compresses really well).

It's extremely useful to have it there, I use it on practially every installation I run.
In reply to Martin Dougiamas

Re: The tag file - is this necessary in production Moodle?

by Kent Parker -

It doesn't sound so easy to use though.mixed

In reply to Kent Parker

Re: The tag file - is this necessary in production Moodle?

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
No-one's saying you have to use it. It's for developers editing or navigating Moodle code using vim or emacs ... if that's not you then just ignore it or delete it. wink
In reply to Martin Dougiamas

Re: The tag file - is this necessary in production Moodle?

by Kent Parker -

Thanks, Martin

I think I'll be deleting it. 

Moodle is a great piece of software and the vibe you've got going here is fantastic.  You are to be congratulated.

Kent