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