I'm writing a Pull Request to add a feature to core where a contrib module already exists. During hook_install, I would like to check to see if the contrib module is present and enabled, if so, I'll provide an upgrade path.

I'm looking for example code that shows how to do this.

Accepted answer