A module is a bundle of PHP code and supporting files that
use Drupal’s APIs and architecture to integrate new functional components into
the Drupal framework.The Drupal site will have three kinds of modules:
- Core modules that ship with Drupal and are approved by core developers and the community
- Contributed module which is written by Drupal community and shared under the same GPL as Drupal
- Costom modules created by website developers
Drupal Module Architecture
Drupal’s module mechanism is designed to provide a uniform
method of extending Drupal’s capabilities. To create a Drupal module, one must first be
familiar with Drupal framework and its APIs. The files that make up modules are
grouped into specific locations under Drupal’s directory structure. During the
Drupal installation on a server’s file system, Drupal modules must reside in a
few specific locations. When Drupal needs any information about its modules, it
will look into these pre-specified locations.
Each Drupal module contains in its own directory and has at
least two files –
- One describing module content
- One or more files containing code and other supporting material
Once the module has been created, it has to be enabled by the
Drupal administrator before it can be used.
Developer Module
The Devel Module on Drupal offers several tools that are
extremely useful in Drupal
development, including cache management, SQL debugging tools, investigation
tools, module reinstaller API reference tool among others. Devel module provides these tools as items in
a block. Once the module has been installed, the developer goes to-
Administer | Site building | Modules and enable the module,
and then go to Administer | Site building | Blocks to tell Drupal where to display
the new content.
The Devel module also includes tools for building themes, a
macro generator to simulate form data entry and a tool to generate testing
data. As the module continues to improve, new features will be added.
Coder Module
Drupal developers have to follow
rigid conventions in their code and the Coder Module has been designed to
locate and fix codes that do not adhere to these conventions. Coder module also helps in doing some basic
security auditing regarding how text is handled which is useful for spotting
mistakes before they become security risks.
Coder can also help in developing “Drupalish” code which
adheres to coding guidelines and makes use of data structures common in Drupal.
Drupal’s architecture is very rigid and the developers adhere
to certain styles, practices and approaches that mesh well with Drupal
philosophy.