Drupal 7 API: Include Files Flashcards

Terms Definitions
What are Drupal 7 include files and why are they kept in a separate directory from Drupal 7 modules?
Drupal 7 include files are common resources for all Drupal modules.

A good example are the database connection includes, which gives all modules access to the database.
What is actions.inc for?
This is the actions engine for executing stored actions.
What is ajax.inc for?
Functions for use with Drupal's Ajax framework.
What is archiver.inc for?
Shared classes and interfaces for the archiver system.
What is authorize.inc for?
Helper functions and form handlers used for the authorize.php script.
What is batch.inc for?

What operations usually invoke batches?
Batch processing API for processes to run in multiple HTTP requests. Note that batches are usually invoked by form submissions, which is why the core interaction functions of the batch processing API live in form.inc.
What is batch.queue.inc for?
Queue handlers used by the Batch API.

These implementations:
- Ensure FIFO ordering.
- Allow an item to be repeatedly claimed until it is actually deleted (no notion of lease time or 'expire' date), to allow multi-pass operations.
What is bootstrap.inc for?
Functions that need to be loaded on every Drupal request.
What is cache-install.inc for?
Provides a stub cache implementation to be used during installation.
What is cache.inc for?
Functions and interfaces for cache handling.
What is common.inc for?
Common functions that many Drupal modules will need to reference.
What are these database include files for?
-Core systems for the database layer. Classes required for basic functioning of the database system should be placed in this file. All utility functions should also be placed in this file only, as they cannot auto-load the way classes can.

- Database interface code for engines that need complete control over their result sets. For example, SQLite will prefix some column names by the name of the table. We post-process the data, by renaming the column names using the same convention as MySQL and PostgreSQL.

- Generic Database schema code.
- mysql/database.inc => DB interface code for MySQL db servers.
- mysql/install.inc => Install code for MySQL embedded db engine.
- mysql/query.inc => Query code for MySQL embedded db engine.
- mysql/schema.inc => DB schema code for MySQL db servers.
pgsql ... etc
sqlsrv ... etc
sqlite ... etc
- Database query logger.
- Non-specific Database query code. Used by all engines.
- Interface for extendable query objects. "Extenders" follow the "Decorator" OOP design pattern. That is, they wrap and "decorate" another object. In our case, they implement the same interface as select queries and wrap a select query, to which they delegate almost all operations. Subclasses of this class may implement additional methods or override existing methods as appropriate. Extenders may also wrap other extender objects, allowing for arbitrarily complex "enhanced" queries.
What is the date.inc include files for?
Initializes the list of date formats and their locales.
What is the entity.inc include files for?
Interface for entity controller classes.
All entity controller classes specified via the 'controller class' key returned by hook_entity_info() or hook_entity_info_alter() have to implement this interface.
Most simple, SQL-based entity controllers will do better by extending
DrupalDefaultEntityController instead of implementing this interface directly.
What is the errors.inc include files for?
Functions for error handling.
What is the file.inc include files for?
API for handling file uploads and server file management.
What is the file.mimetypes.inc include files for?
Provides mimetype mappings.
What are the filetransfer include files for?
- Base FileTransfer class. Classes extending this class perform file operations on directories not writable by the webserver. To achieve this, the class should connect back to the server using some backend (for example FTP or SSH). To keep security, the password should always be asked from the user and never stored. For safety, all methods operate only inside a "jail", by default the Drupal root.
- Base class for FTP implementations.
- The local connection class for copying files as the httpd user.
- The SSH connection class for the update module.
What is the form.inc include file for?
Functions for form and batch generation and processing.
What is the graph.inc include file for?
Directed acyclic graph manipulation.
What is the image.inc include file for?
API for manipulating images.
What is the install.core.inc include file for?
API functions for installing Drupal.
What is the install.inc include file for?
API functions for installing modules and themes.
What is the iso.inc include file for?
Provides a list of countries and languages based on ISO standards.
What is the json-encode.inc include file for?
Provides a helper to properly encode HTML-safe JSON prior to PHP 5.3.0.
What is the language.inc include file for?
Language Negotiation API.
@see http://drupal.org/node/1497272
What is the locale.inc include file for?
Administration functions for locale.module.

The language is determined using a URL language indicator:
path prefix or domain according to the configuration.
What is the lock.inc include file for?
A database-mediated implementation of a locking mechanism.
What is the mail.inc include file for?
API functions for processing and sending e-mail.
What is the menu.inc include file for?
API for the Drupal menu system.
What is the module.inc include file for?
API for loading and interacting with Drupal modules.
What is the pager.inc include file for?
Functions to aid in presenting database results as a set of pages.
What is the password.inc include file for?
Secure password hashing functions for user authentication.
Based on the Portable PHP password hashing framework.
@see http://www.openwall.com/phpass/
An alternative or custom version of this password hashing API may be used by setting the variable password_inc to the name of the PHP file containing replacement user_hash_password(), user_check_password(), and user_needs_new_hash() functions.
What is the path.inc include file for?
Functions to handle paths in Drupal, including path aliasing.
What is the registry.inc include file for?
This file contains the code registry parser engine.
What is the session.inc include file for?
User session handling functions.
The user-level session storage handlers:
- _drupal_session_open()
- _drupal_session_close()
- _drupal_session_read()
- _drupal_session_write()
- _drupal_session_destroy()
- _drupal_session_garbage_collection()
are assigned by session_set_save_handler() in bootstrap.inc and are called automatically by PHP. These functions should not be called directly. Session data should instead be accessed via the $_SESSION superglobal.
What is the stream_wrappers.inc include file for?
Drupal stream wrapper interface.
Provides a Drupal interface and classes to implement PHP stream wrappers for public, private, and temporary files.
A stream wrapper is an abstraction of a file system that allows Drupal to use the same set of methods to access both local files and remote resources.
Note that PHP 5.2 fopen() only supports URIs of the form "scheme://target" despite the fact that according to RFC 3986 a URI's scheme component delimiter is in general just ":", not "://". Because of this PHP limitation and for consistency Drupal will only accept URIs of form "scheme://target".
What is the tablesort.inc include file for?
Functions to aid in the creation of sortable tables.
All tables created with a call to theme('table') have the option of having column headers that the user can click on to sort the table by that column.
What is the theme.inc include file for?
The theme system, which controls the output of Drupal.
The theme system allows for nearly all output of the Drupal system to be customized by user themes.
What is the theme.maintenance.inc include file for?
Theming for maintenance pages.
What is the token.inc include file for?
Drupal placeholder/token replacement system.
API functions for replacing placeholders in text with meaningful values. For example: When configuring automated emails, an administrator enters standard text for the email. Variables like the title of a node and the date the email was sent can be entered as placeholders like [node:title] and [date:short]. When a Drupal module prepares to send the email, it can call the token_replace() function, passing in the text. The token system will scan the text for placeholder tokens, give other modules an opportunity to replace them with meaningful text, then return the final product to the original module. Tokens follow the form: [$type:$name], where $type is a general class of tokens like 'node', 'user', or 'comment' and $name is the name of a given placeholder. For example, [node:title] or [node:created:since].

In addition to raw text containing placeholders, modules may pass in an array of objects to be used when performing the replacement. The objects should be keyed by the token type they correspond to.
For example:
// Load a node and a user, then replace tokens in the text.
$text = 'On [date:short], [user:name] read [node:title].';
$node = node_load(1);
$user = user_load(1);

// [date:...] tokens use the current date automatically.
$data = array('node' => $node, 'user' => $user);
return token_replace($text, $data);

Some tokens may be chained in the form of [$type:$pointer:$name], where $type is a normal token type, $pointer is a reference to another token type, and $name is the name of a given placeholder. For example, [node:author:mail]. In that example, 'author' is a pointer to the 'user' account that created the node, and 'mail' is a placeholder available for any 'user'.
What is the unicode.entities.inc include file for?
(X)HTML entities, as defined in HTML 4.01.
@see http://www.w3.org/TR/html401/sgml/entities.html
What is the unicode.inc include file for?
Provides Unicode-related conversions and operations.
What is the updater.inc include file for?
Classes used for updating various files in the Drupal webroot. These classes use a FileTransfer object to actually perform the operations.
Normally, the FileTransfer is provided when the site owner is redirected to authorize.php as part of a multistep process.
What is the utility.inc include file for?
Miscellaneous functions.
What is the xmlrpc.inc include file for?
Drupal XML-RPC library.
What is the xmlrpcs.inc include file for?
Provides API for defining and handling XML-RPC requests.
/ 47

Leave a Comment ({[ getComments().length ]})

Comments ({[ getComments().length ]})


{[ comment.comment ]}

View All {[ getComments().length ]} Comments
Ask a homework question - tutors are online