Thursday, September 26, 2013

If two modules both defined the same menu path in 'hook_menu', which one Drupal will choose?

If there are two modules that define the same menu callback for the same value of $path, the last module present in the array returned by module_implements() will override the value defined from a previous module.

Thursday, July 25, 2013

What is entity in Drupal 7

Entity

An entity is a container for bundles. Entities can contain multiple bundles. Examples of an eitity are Node, User, File, Taxonomy term, Taxonomy vocabulary.

Friday, July 12, 2013

What is Contextual Filter?

Views is a highly flexible module to start with, but the contextual filters increase the use cases for the module by an order of magnitude. Contextual filters work similarly to regular filters, but there is one important difference. Instead of setting a filter value manually, the value is fetched from variables sent programmatically to the view. A regular filter could give you all nodes written by a specified user. A contextual filter for a node author would be able to display all nodes written by the currently viewed user, or the same user who wrote the currently viewed node. The concept is that contextual filters prepare a view for filtering, but the filter value is not yet determined. When the view is eventually called, it is also provided with data used to complete the contextual filters.

What is the difference between REST & SOAP?

  1. SOAP is a XML-based message protocol, while REST is an architectural style
  2. SOAP uses WSDL for communication between consumer and provider, whereas REST just uses XML or JSON to send and receive data
  3. SOAP invokes services by calling RPC method, REST just simply calls services via URL path
  4. SOAP doesn't return human readable result, whilst REST result is readable with is just plain XML or JSON
  5. SOAP is not just over HTTP, it also uses other protocols such as SMTP, FTP, etc, REST is over only HTTP

What is REST API

REST (REpresentational State Transfer) is a simple stateless architecture that generally runs over HTTP.
REST involves reading a designated Web page that contains an XML  file. The XML file describes and includes the desired content. 
REST is often used in mobile applications, social networking Web sites, mashup tools and automated business processes. The REST style emphasizes that interactions between clients and services is enhanced by having a limited number of operations (verbs). Flexibility is provided by assigning resources (nouns) their own unique universal resource indicators (URIs). Because each verb has a specific meaning (GET, POST, PUT and DELETE), REST avoids ambiguity.
As described in a dissertation by Roy Fielding, REST is an "architectural style" that basically exploits the existing technology and protocols of the Web, including HTTP (Hypertext Transfer Protocol) and XML. REST is simpler to use than the well-known SOAP (Simple Object Access Protocol) approach, which requires writing or using a provided server program (to serve data) and a client program (to request data). 

What is SOAP

SOAP, originally defined as Simple Object Access Protocol, is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks. It relies on XML Information Set for its message format, and usually relies on other Application Layer protocols, most notably Hypertext Transfer Protocol (HTTP) or Simple Mail Transfer Protocol(SMTP), for message negotiation and transmission.

What is memcache?

Memcached is a general-purpose distributed memory caching system that was originally developed by Danga Interactive forLiveJournal, but is now used by many other sites. It is often used to speed up dynamic database-driven websites by caching data and objects inRAM to reduce the number of times an external data source (such as a database or API) must be read. Memcached runs on UnixLinuxWindowsand Mac OS X and is distributed under a permissive free software license.[3]
Memcached's APIs provide a giant hash table distributed across multiple machines. When the table is full, subsequent inserts cause older data to be purged in least recently used (LRU) order.[4][5] Applications using Memcached typically layer requests and additions into RAM before falling back on a slower backing store, such as a database.