Category Archives: PHP

Static Caching in Drupal

If you’re a PHP veteran, then you know static caching is a relatively simple thing to do in PHP, but it can result in inconsistent behavior and sloppy code, such as adding an extra parameter to a function for the sole purpose of resetting that function’s internal cache.

Drupal’s static caching system improves upon the old way by providing a simple and consistent way for creating your own cache store and resetting cache stores set by other systems within Drupal.  The entire functionality of this system is wrapped up in the drupal_static() function, with a side function, drupal_static_reset(), for resetting any existing cache store.
Continue reading

Magento Customization

Magento is an e-commerce framework that is used as an online shopping cart. I am going to talk a little bit about Magento extensions and why they are useful when wanting to customize your shopping cart. Magento extensions allow you to change functionality of the shopping cart while modifying little to none of the source code.  Since you do not have to touch the source code it gives you the ability to upgrade to newer versions and not lose the custom code.  Another advantage of these extensions comes from Magento allowing you to run multiple websites from the same code base.  Now that you are using the same source code for multiple websites these extensions allow you to have certain features for one website and different features of another website by simply having the extensions in your website’s directory.  A good tutorial for creating an extension is provided by Magento.