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 * Upgrade logic for 5.0
15 class CRM_Upgrade_Incremental_php_FiveZero
extends CRM_Upgrade_Incremental_Base
{
18 * Compute any messages which should be displayed beforeupgrade.
20 * Note: This function is called iteratively for each upcoming
21 * revision to the database.
23 * @param string $preUpgradeMessage
25 * a version number, e.g. '4.4.alpha1', '4.4.beta3', '4.4.0'.
26 * @param null $currentVer
28 public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) {
29 // Example: Generate a pre-upgrade message.
30 //if ($rev == '5.12.34') {
31 // $preUpgradeMessage .= '<p>' . ts('A new permission, "%1", has been added. This permission is now used to control access to the Manage Tags screen.', array(1 => ts('manage tags'))) . '</p>';
36 * Compute any messages which should be displayed after upgrade.
38 * @param string $postUpgradeMessage
41 * an intermediate version; note that setPostUpgradeMessage is called repeatedly with different $revs.
43 public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) {
44 // Example: Generate a post-upgrade message.
45 //if ($rev == '5.12.34') {
46 // $postUpgradeMessage .= '<br /><br />' . ts("By default, CiviCRM now disables the ability to import directly from SQL. To use this feature, you must explicitly grant permission 'import SQL datasource'.");
55 public function upgrade_5_0_0($rev) {
56 $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
60 * Important! All upgrade functions MUST add a 'runSql' task.
61 * Uncomment and use the following template for a new upgrade version
62 * (change the x in the function name):
66 // * Upgrade function.
68 // * @param string $rev
70 // public function upgrade_4_7_x($rev) {
71 // $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
72 // $this->addTask(ts('Do the foo change'), 'taskFoo', ...);
73 // // Additional tasks here...
74 // // Note: do not use ts() in the addTask description because it adds unnecessary strings to transifex.
75 // // The above is an exception because 'Upgrade DB to %1: SQL' is generic & reusable.
78 // public static function taskFoo(CRM_Queue_TaskContext $ctx, ...) {