3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * This class stores logic for managing schema upgrades in CiviCRM extensions.
16 * @copyright CiviCRM LLC https://civicrm.org/licensing
18 class CRM_Extension_Upgrades
{
20 const QUEUE_NAME
= 'ext-upgrade';
23 * Determine whether any extensions have pending upgrades.
27 public static function hasPending() {
28 $checks = CRM_Utils_Hook
::upgrade('check');
29 if (is_array($checks)) {
30 foreach ($checks as $check) {
41 * Fill a queue with upgrade tasks.
43 * @return CRM_Queue_Queue
45 public static function createQueue() {
46 $queue = CRM_Queue_Service
::singleton()->create([
48 'name' => self
::QUEUE_NAME
,
52 CRM_Utils_Hook
::upgrade('enqueue', $queue);