mudrd8mz / moodle-tool_pluginskel

Generator of Moodle plugins skeletons
https://moodle.org/plugins/tool_pluginskel
Other
51 stars 46 forks source link

Create the skeleton type php_file #20

Closed alexandru-elisei closed 8 years ago

mudrd8mz commented 8 years ago
alexandru-elisei commented 8 years ago

About me thinking that db/install.php and db/uninstall.php should not be internal. Been looking at your moodle-mod_newmodule and justin hunt's moodle-mod_newmodule and the files aren't moodle internal.

But after looking at the same files that come with official moodle plugins they are defined as moodle internal.

What is right? Now I am leaning towards making them internal.

alexandru-elisei commented 8 years ago

I don't think php_web_file is a good name. Is lib.php supposed to be visited from the web site? Because it is moodle internal.

alexandru-elisei commented 8 years ago

I personally like php_internal_file. It's very obvious what it is.

mudrd8mz commented 8 years ago

I don't think php_web_file is a good name. Is lib.php supposed to be visited from the web site? Because it is moodle internal.

I do not think we are on the same wave here. Let me try and explain things better.

Up until Moodle 2.9 there were four basic sorts of PHP files used in Moodle.

So we end up with three sorts of PHP files: web, internal and cli.

All db/*.php are internal. All lib.php are internal.

mudrd8mz commented 8 years ago

And yes, sometimes templates that are used around the world forget to start with the MOODLE_INTERNAL check. That is why this our tool does a better job than others as it forces us to explicitly say what sort of PHP file each one is.

alexandru-elisei commented 8 years ago

I understand now, reject this pull request and I'll create one with the proposed file classes.

alexandru-elisei commented 8 years ago

After you're done with this round of merges I'll update the skel classes to use the correct base class.