Closed alexandru-elisei closed 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.
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 personally like php_internal_file. It's very obvious what it is.
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.
php_web_file
skeleton class.php_internal_file
skeleton class does.So we end up with three sorts of PHP files: web, internal and cli.
All db/*.php are internal. All lib.php are internal.
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.
I understand now, reject this pull request and I'll create one with the proposed file classes.
After you're done with this round of merges I'll update the skel classes to use the correct base class.
php_internal_file
. I am not sure thatphp_external_file
would be a good name. Maybe we could havephp_web_file
for files that are supposed to be visited by the web,php_cli_file
for CLI scripts andphp_ajax_file
for AJAX scripts.