Is there any reason why Drupal decided to use non-standard file extensions, for example node.install, node.module, simple.profile, case.test? Why doesn't Drupal use .php as extension for PHP files?
1 Answer
Because it's easier for the core to know about special files that way.
As a developer you're free to name your module or theme whatever you like, so that means that Drupal core needs another way to find and identify certain important files. Doing this using the file extension is an easy way.
-
I think .module.php is not harder to find than .module Commented Jan 26, 2015 at 19:50
-
@AndyTruong you're right, but what's the point of adding the .php? I can't see a reason where it would be helpful to have.– user5482Commented Jan 26, 2015 at 19:52
-
with .php, developers do not need configure their IDE. Code highlighting in code browser no more mess github.com/drupal/drupal/blob/8.0.x/core/modules/node/… Commented Jan 26, 2015 at 19:54