joomla/joomla-cms — pull request #1321 by dongilbert (2013-06-22 18:14:34+00:00)
Title: Automatically set  and  in plugin if those properties exist

I find my self many times overriding the constructor in my plugins simply to add a reference to `$this->app` and `$this->db` for easy access to the application object and the database object within my plugin methods. The proposed update takes care of this by adding a bit of magic to the JPlugin constructor. It checks to see if the `app` and `db` properties exist within your plugin class, and if they do (and are null) it will set them to `JFactory::getApplication()` and `JFactory::getDbo()` automatically.

It's a minor change, but it makes J! programming that easier.