0

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 1

2

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.

3
  • 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.
    – user5482
    Commented 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.