|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * |
| 4 | + * Pages extension for the phpBB Forum Software package. |
| 5 | + * |
| 6 | + * @copyright (c) 2016 phpBB Limited <https://www.phpbb.com> |
| 7 | + * @license GNU General Public License, version 2 (GPL-2.0) |
| 8 | + * |
| 9 | + */ |
| 10 | + |
| 11 | +namespace phpbb\pages\migrations\v10x; |
| 12 | + |
| 13 | +/** |
| 14 | + * Migration stage 7: Rename reparser cron configs |
| 15 | + */ |
| 16 | +class m7_reparser_cron_update extends \phpbb\db\migration\migration |
| 17 | +{ |
| 18 | + /** |
| 19 | + * Assign migration file dependencies for this migration |
| 20 | + * |
| 21 | + * @return array Array of migration files |
| 22 | + * @static |
| 23 | + * @access public |
| 24 | + */ |
| 25 | + static public function depends_on() |
| 26 | + { |
| 27 | + return array('\phpbb\pages\migrations\v10x\m6_reparser_cron'); |
| 28 | + } |
| 29 | + |
| 30 | + /** |
| 31 | + * Check if the migration is effectively installed (entirely optional) |
| 32 | + * |
| 33 | + * @return bool True if this migration is installed, False if this migration is not installed |
| 34 | + */ |
| 35 | + public function effectively_installed() |
| 36 | + { |
| 37 | + return $this->config->offsetExists('phpbb.pages.text_reparser.page_text_cron_interval'); |
| 38 | + } |
| 39 | + |
| 40 | + /** |
| 41 | + * Add or update data in the database |
| 42 | + * |
| 43 | + * @return array Array of table data |
| 44 | + * @access public |
| 45 | + */ |
| 46 | + public function update_data() |
| 47 | + { |
| 48 | + return array( |
| 49 | + array('config.add', array('phpbb.pages.text_reparser.page_text_cron_interval', $this->config['text_reparser.phpbb_pages_text_cron_interval'])), |
| 50 | + array('config.add', array('phpbb.pages.text_reparser.page_text_last_cron', $this->config['text_reparser.phpbb_pages_text_last_cron'])), |
| 51 | + |
| 52 | + array('config.remove', array('text_reparser.phpbb_pages_text_cron_interval')), |
| 53 | + array('config.remove', array('text_reparser.phpbb_pages_text_last_cron')), |
| 54 | + ); |
| 55 | + } |
| 56 | +} |
0 commit comments