After installing Apache 2.2.9 on Windows Vista I encountered a problem getting mod_rewrite to work. The steps that I finally took to accomplish this were simple. I share them here in hopes that they can help others.
- Edit the httpd.conf file and uncomment the LoadModule rewrite_module modules/mod_rewrite.so line.
- Also in httpd.conf file change AllowOverride None to AllowOverride All.
- Restart Apache and test your redirect URL.
That is all there is to it. My thanks to the post at http://www.wallpaperama.com/disp-post54.html which provided me with the missing step that was keeping mod_rewrite from working.
As a WordPress user I tend to be a minimalist in my selection of plugins to power my blog. Below is the short and hopefully useful list of plugins that I have chosen.
That’s all that is used on my blog. I’ll update this list as new plugins are added.
When you instantiate an object in PHP code it is sometimes desirable to allow for variable parameter setting combinations to create the object. Although this can be done using default parameters passed to the constructor this can become messy when too many variables are available to be set. A simpler approach is to allow for an associative array to be passed to the constructor as in the example below.
class MyClass {
protected $_name = 'Bob' ;
protected $_address = 'Penny Lane' ;
protected $_phone = '555-555-5555' ;
public function __construct ($config = array ()) {
if (array_key_exists ('name', $config))
$this->_name = $config ['name'] ;
if (array_key_exists ('address', $config))
$this->_address = $config ['address'] ;
if (array_key_exists ('phone', $config))
$this->_phone = $config ['phone'] ;
}
Although this is a trivial example it demonstrates how to leverage an array passed to a constructor class to initialize a PHP variable. This is a useful technique that can be employed when building re-usable classes to power your applications.