Sunday, August 29, 2010

Droopal


The Droopal module offers out of the box support for writing modules in full OOP and accessing other modules via OOP. While not all developers wish to have this functionality, this module is targeted at those who do. Here are some examples of what you can do out of the box, all with zero configuration:



Access any core module using OOP:


<?php
  ModNode
::load()
?>




This would be the equivalent of:


<?php
  node_load
()
?>



Access any core include using OOP:


<?php
  LibCommon
::drupal_add_css()
?>




This would be the equivalent of:


<?php
  drupal_add_css
();
?>



Access any non-core module or include using OOP:


<?php
  ModImagecache
::action_save
?>




This would be the equivalent of:


<?php
  imagecache_action_save
()
?>



Write custom modules using OOP structures:


<?php
 
class ModMyModule {
   
// hook_menu
   
function menu() {
     
//etc...
   
}
   
// hook_nodeapi
   
function nodeapi() {
     
//etc...
   
}
  }
?>




The functionality to make this work is completely hidden and offered at virtually no performance hit. All existing Drupal APIs also remain completely intact.


WARNINGS




  • This module will safely modify your core Drupal files.


  • Upon un-installation, this file will safely restore your core Drupal files, provided you follow the instructions below.


  • If any of the installation instructions below do not make sense to you, don't make assumptions. As with any module, know what you are doing before installing this module.



  • This module has only been designed to work on UNIX based systems.


INSTALLATION INSTRUCTIONS




  1. As always, backup your important files


  2. Make sure the "patch" utility is installed and accessible from from your PHP scripts. This is VERY IMPORTANT. On most OSX, Linux, and Unix Variants the "patch" utility will be installed and accessible by default from PHP.



  3. Download and unzip the module into your modules directory like any other module


  4. Set the permissions to be writeable by your webserver for the following files:

    • includes/menu.inc

    • includes/module.inc

    • includes/theme.inc

    • modules/node/node.module

    • modules/user/user.module


    • sites/all/files or sites/default/files


    THESE PERMISSIONS MUST ALSO BE SET FOR UNINSTALLATION TO SUCCEED



  5. Activate module "Droopal"


  6. For testing and examples, activate module "Droopal Demo OOP", which can

    be compared and contrasted with the module, "Drupal Demo Standard".


2 comments:

Unknown said...

i was very much impressed by seeing this post ,it's an very valuable information you can also find more information at Drupal CMS

murugaaprml said...

Wow. Great post. I felt very interesting reading your post. Thanks for sharing good information with us. Keep going.
If you are planning to buy mobiles at lowest prices and offers, please visit

online mobile stores in Chennai | buy mobile online Chennai | online mobile stores in Coimbatore| mobile stores in Nagercoil