Drupal Basics 2 (Technologies that drive Drupal)

Drupal is written in the PHP programming language . PHP is a
widely supported, multi-platform, web-centric scripting language. Since Drupal is
written in PHP,We should focused on PHP development.
One specific piece of information should be made explicit: As of Drupal 7, the
minimum PHP version is PHP 5.2 (as of this writing, the current version of PHP
is 5.3.3). Prior versions of Drupal included PHP 4.x support, but this is no longer
the case.
Another thing worth mentioning is the style of PHP coding that Drupal uses. While
many PHP applications are now written using Object Oriented Programming,
Drupal does not follow suit. For many reasons, some historical, some practical,
Drupal is largely written using procedural programming. Rather than relying
strongly on classes and interfaces, Drupal modules are composed of collections
of functions.
Before anyone jumps to conclusions, though, we would like to make a few
qualifications on what we’ve just said:

  • Drupal frequently uses objects
  • Drupal does have certain subsystems that are object-oriented
  • Many Drupal modules are substantially object-oriented
  • Drupal makes frequent use of design patterns, for it is certainly the case that
  • procedural code can use design patterns too

While the majority  uses procedural coding strategies, you will encounter
OOP here and there. If you are not familiar with object oriented conventions and
coding styles, don’t worry. We will explain these pieces as we go.

Databases and MySQL
In the past, Drupal has supported two databases: MySQL and PostgreSQL. Drupal
7 has moved beyond this. Drupal now uses the powerful PDO (PHP Data Objects)
library that is standard in PHP 5. This library is an abstraction layer that allows
developers to support numerous databases including MySQL, PostgreSQL, SQLite,
MariaDB, and many, many others. While Drupal does testing on only a few specific
databases (namely, MySQL, PostgreSQL, and now SQLite), it is possible to move
beyond these to SQL Server, Oracle, DB2, and others.

However, for the sake of size and readability, we have focused our examples on
MySQL. We believe that our SQL should run on MariaDB, PostgreSQL, and SQLite
without modification, but we have not made any attempt to test against other
databases. If you find a bug, we’d appreciate hearing about it. Packt Publishing
tracks errata on their website , and you can submit errors
that you find through the form you find there.
Drupal provides a database API along with some SQL coding conventions (such as “don’t useLIMIT in your SQL”). The intent of these is to combine code and
convention to make it as easy as possible to write portable code. Thus, we not only
illustrate the API throughout here, but we also focus on writing SQL statements
that comply with standard Drupal conventions.

HTML, CSS, and JavaScript
The de facto web data format is HTML (HyperText Markup Language) styled with
CSS (Cascading Style Sheets). Client-side interactive components are scripted with
JavaScript. While you needn’t be a JavaScript ninja to understand the code here,
Other technologies
The Internet thrives on change, it seems, and there are many other web technologies
that have become common. Here and there, we will mention technologies such as
RSS (Really Simple Syndication), XML (eXtensible Markup Language), XML-RPC,
and others. However, these are all of secondary importance to us. While Drupal
offers support for many of these things, using them is not integral to module or
theme development.
The web server
Apache has long been the predominant web server, but it is by no means the only
server. While Drupal was originally written with Apache in mind, many other web
servers (including IIS, LigHTTPD, and nginx) can run Drupal.
We do not explicitly cover the web server layer anywhere here, primarily because
development rarely requires working at that low level. However, Drupal expects
a fair amount of processing from the web server layer, including handling of
URL rewriting.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s