Can I have underscore in my plugin folder name to be published on Moodle plugins directory?

Can I have underscore in my plugin folder name to be published on Moodle plugins directory?

بذریعہ Lawrence Lagerlof -
جوابات کی تعداد: 2

The docs say:

- Frankenstyle component names have a prefix and then a folder name, separated by an underscore.

- The prefix is determined by the type of plugin. For example, the prefix for an activity module is mod.

- The name is the folder name of the plugin, always lower case. For example, the name for Quiz is quiz.


But don't specify if I could use underscore other than the prefix.

e.g. My local plugin can have a name (the directory name) like statistics_plus, and the frankenstyle should be local_statistics_plus.

I know this works because I was using underscores in my private plugins (like the example above).

But now I am preparing my first plugin to be published as an open source project. Does the plugin will pass the validation if its name is like statistics_plus ? Can I use a name like that, with underscores?

درجہ بندی کا اوسط: -
Lawrence Lagerlof کے جواب میں

Re: Can I have underscore in my plugin folder name to be published on Moodle plugins directory?

بذریعہ Davo Smith -
Core developers کی تصویر Particularly helpful Moodlers کی تصویر Peer reviewers کی تصویر Plugin developers کی تصویر
Names with underscores (other than separating the plugin type, from the plugin name) in them are discouraged, but not, as far as I am aware, actively prevented (apologies, I didn't find an obvious reference to this in the docs, but this has certainly come up in conversations before).

Avoid them if possible (there have certainly been occasional bugs in the past with functions that split frankenstyle names by underscore, which choked on plugins which had additional underscores; but these have been very rare).
درجہ بندی کا اوسط:Useful (1)
Lawrence Lagerlof کے جواب میں

Re: Can I have underscore in my plugin folder name to be published on Moodle plugins directory?

بذریعہ Michael Milette -
Core developers کی تصویر Documentation writers کی تصویر Particularly helpful Moodlers کی تصویر Plugin developers کی تصویر Testers کی تصویر Translators کی تصویر
Hi Lawrence,

I recommend that your git repository be named following this format:

moodle-plugintype_pluginname

Example:

moodle-filter_filtercodes

Your when installed in Moodle, the plugin's directory should be simply:

pluginname

... because the plugin type is already shown in its parent directory. Example:

/filter/filtercodes/

In this example, "filter" is the type and "filtercodes" is the plugin name.

All directory and file names should be completely in lowercase. No UPPERCASE, no camelCase.

The plugin name may have an underscore in it as seen with the Configurable Reports plugin: block_configurable_reports

It does work. However, like Davo said, I too have encountered some situations in the past where this has caused a problem. Therefore, I try avoid situations that will potential cause issues whenever possible.

Plugin directory names must never have an extension. Moodle will ignore them if they do. For example, Moodle would never detect the following:

/filter/filter.codes/

Hope you find this information helpful

Best regards,

Michael Milette
درجہ بندی کا اوسط:Useful (1)