Merge pull request #13069 from eileenmcnaughton/master
[civicrm-core.git] / CRM / Upgrade / Incremental / php / FiveZero.php
CommitLineData
7f650d27
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
fee14197 4 | CiviCRM version 5 |
7f650d27
TO
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License along with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
25 */
26
27/**
28 * Upgrade logic for 5.0
29 */
30class CRM_Upgrade_Incremental_php_FiveZero extends CRM_Upgrade_Incremental_Base {
31
32 /**
33 * Compute any messages which should be displayed beforeupgrade.
34 *
35 * Note: This function is called iteratively for each upcoming
36 * revision to the database.
37 *
38 * @param string $preUpgradeMessage
39 * @param string $rev
40 * a version number, e.g. '4.4.alpha1', '4.4.beta3', '4.4.0'.
41 * @param null $currentVer
42 */
43 public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) {
44 // Example: Generate a pre-upgrade message.
45 //if ($rev == '5.12.34') {
e1a49d48 46 // $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>';
7f650d27
TO
47 //}
48 }
49
50 /**
51 * Compute any messages which should be displayed after upgrade.
52 *
53 * @param string $postUpgradeMessage
54 * alterable.
55 * @param string $rev
56 * an intermediate version; note that setPostUpgradeMessage is called repeatedly with different $revs.
57 */
58 public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) {
59 // Example: Generate a post-upgrade message.
60 //if ($rev == '5.12.34') {
61 // $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'.");
62 //}
63 }
64
65 /**
66 * Upgrade function.
67 *
68 * @param string $rev
69 */
70 public function upgrade_5_0_0($rev) {
71 $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
72 }
73
74 /*
75 * Important! All upgrade functions MUST add a 'runSql' task.
76 * Uncomment and use the following template for a new upgrade version
77 * (change the x in the function name):
78 */
79
80 // /**
81 // * Upgrade function.
82 // *
83 // * @param string $rev
84 // */
85 // public function upgrade_4_7_x($rev) {
86 // $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
87 // $this->addTask(ts('Do the foo change'), 'taskFoo', ...);
88 // // Additional tasks here...
89 // // Note: do not use ts() in the addTask description because it adds unnecessary strings to transifex.
90 // // The above is an exception because 'Upgrade DB to %1: SQL' is generic & reusable.
91 // }
92
93 // public static function taskFoo(CRM_Queue_TaskContext $ctx, ...) {
94 // return TRUE;
95 // }
96
97}