What debugger is used to debug Drupal?

Since I’m working on module development and deals with so many websites during my projects, I found Xdebug is a great tool to debug Drupal modules. I am listing here step by step process to debug drupal using xdebug and Eclipse with your WAMP. Download Eclipse PDT from here http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/… Download php_xdebug-2.0.4-5.2.8.dll dll and place in C:\wamp\bin\php5.2.6\ext directory Edit your php.ini file with the following code at the end of file. [xdebug] zend_extension_ts=”C:\wamp\bin\php5.2.6\ext\php_xdebug-2.0.4-5.2.8.dll” xdebug.remote_enable=1 xdebug.remote_host=”localhost” xdebug.remote_port=9000 xdebug.remote_handler=”dbgp” Note: Carefully check the path and PHP version…

Continue reading »

What hook functions are generally included in .install file?

In Drupal, when you want to install a custom module, you must have a mycustommodule.install file. Implementations of the hooks below should be placed in a mycustommodule.install file in the same directory as mycustommodule.module. Some hooks are optional depends on how large your module is. For example, if your module doesn’t require any database table or variable, you wouldn’t have hook_schema in your .install file. hook_disable Perform necessary actions before module is disabled. hook_enable Perform necessary actions after module is enabled. hook_install Install the current…

Continue reading »

hook_requirements($phase)

Check installation requirements and do status reporting. This hook must be located in .install file. Use parameter $phase to check installation requirements ($phase == ‘install’ ) and status reporting ($phase == ‘runtime’). Parameters $phase: There’re 2 phases to check the requirements during the installation and runtime. ‘install’: the module is being installed. ‘runtime’: the runtime requirements are being checked and shown on the status report page. Return value A keyed array of requirements. ‘title’: the name of the requirement. ‘value’: the current value (e.g. version,…

Continue reading »

hook_install()

Install the current version of the database schema, and any other setup tasks. The hook will be called the first time a module is installed, and the module’s schema version will be set to the module’s greatest numbered update hook. The implementation of hook_install() will need to explicitly load the module before any declared functions may be invoked. Anything added or modified in this function that can be removed during uninstall should be removed with hook_uninstall(). Parameters No parameters Return value none Usage sample /*…

Continue reading »