This hook is called when an administrator visits the "Manage Extensions" screen to determine if there are any pending upgrades.
As of version 4.7, it is also called periodically by CiviCRM's system status utility.
If there are upgrades, and if the administrator chooses to execute them, the hook is called a second time to construct a list of upgrade tasks.
hook_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL)
- $op - the type of operation being performed; 'check' or 'enqueue'
- $queue - (for 'enqueue') the modifiable list of pending up upgrade tasks
- For 'check' operations, return array(bool) (TRUE if an upgrade is required)
- For 'enqueue' operations, return void