Hotaru provides a built-in method for checking if another plugin is enabled. This is especially helpful if your own plugin depends on that plugin.

PHP Code:
$h->isActive('avatar'); // is the a plugin of type avatar enabled?

$h->isActive('gravatar'); // is the Gravatar plugin enabled? 
At the top of every plugin is a comment block, and some plugins, such as Gravatar, include both a plugin folder and a plugin type, i.e.:

PHP Code:
 nameGravatar
 
descriptionEnables Gravatar avatars for users
 
version0.8
 
foldergravatar
 
* class: Gravatar
 
typeavatar
 
requiresusers 1.1 
The isActive method in Hotaru.php takes a single parameter, e.g. "avatar" and returns true if there is a plugin with that type. If not, it then checks to see if there is a plugin with that folder name. If so, it returns true, otherwise false.

This is useful when there are alternative plugins available. For example, different voting plugins are of the same type:

PHP Code:
 nameVote
 
descriptionAdds voting ability to posted stories.
 * 
version1.5
 
foldervote
 
* class: Vote
 
typevote 
PHP Code:
 nameUp Down Voting
 
descriptionAdds voting ability to posted stories.
 * 
version0.3
 
folderupdown_voting
 
* class: UpdownVoting
 
typevote 
This way you can switch plugins without breaking anything that tests for a type "vote" plugin.