[ Index ]

PHP Cross Reference of phpBB-3.1.12-deutsch

title

Body

[close]

/phpbb/db/migration/data/v30x/ -> release_3_0_3_rc1.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * For full copyright and license information, please see
  10  * the docs/CREDITS.txt file.
  11  *
  12  */
  13  
  14  namespace phpbb\db\migration\data\v30x;
  15  
  16  class release_3_0_3_rc1 extends \phpbb\db\migration\migration
  17  {
  18  	public function effectively_installed()
  19      {
  20          return phpbb_version_compare($this->config['version'], '3.0.3-RC1', '>=');
  21      }
  22  
  23  	static public function depends_on()
  24      {
  25          return array('\phpbb\db\migration\data\v30x\release_3_0_2');
  26      }
  27  
  28  	public function update_schema()
  29      {
  30          return array(
  31              'add_columns' => array(
  32                  $this->table_prefix . 'styles_template' => array(
  33                      'template_inherits_id' => array('UINT:4', 0),
  34                      'template_inherit_path' => array('VCHAR', ''),
  35                  ),
  36                  $this->table_prefix . 'groups' => array(
  37                      'group_max_recipients' => array('UINT', 0),
  38                  ),
  39              ),
  40          );
  41      }
  42  
  43  	public function revert_schema()
  44      {
  45          return array(
  46              'drop_columns' => array(
  47                  $this->table_prefix . 'styles_template' => array(
  48                      'template_inherits_id',
  49                      'template_inherit_path',
  50                  ),
  51                  $this->table_prefix . 'groups' => array(
  52                      'group_max_recipients',
  53                  ),
  54              ),
  55          );
  56      }
  57  
  58  	public function update_data()
  59      {
  60          return array(
  61              array('config.add', array('enable_queue_trigger', '0')),
  62              array('config.add', array('queue_trigger_posts', '3')),
  63              array('config.add', array('pm_max_recipients', '0')),
  64              array('custom', array(array(&$this, 'set_group_default_max_recipients'))),
  65              array('config.add', array('dbms_version', $this->db->sql_server_info(true))),
  66              array('permission.add', array('u_masspm_group', true, 'u_masspm')),
  67              array('custom', array(array(&$this, 'correct_acp_email_permissions'))),
  68  
  69              array('config.update', array('version', '3.0.3-RC1')),
  70          );
  71      }
  72  
  73  	public function correct_acp_email_permissions()
  74      {
  75          $sql = 'UPDATE ' . $this->table_prefix . 'modules
  76              SET module_auth = \'acl_a_email && cfg_email_enable\'
  77              WHERE module_class = \'acp\'
  78                  AND module_basename = \'email\'';
  79          $this->sql_query($sql);
  80      }
  81  
  82  	public function set_group_default_max_recipients()
  83      {
  84          // Set maximum number of recipients for the registered users, bots, guests group
  85          $sql = 'UPDATE ' . GROUPS_TABLE . ' SET group_max_recipients = 5
  86              WHERE ' . $this->db->sql_in_set('group_name', array('GUESTS', 'REGISTERED', 'REGISTERED_COPPA', 'BOTS'));
  87          $this->sql_query($sql);
  88      }
  89  }


Generated: Thu Jan 11 00:25:41 2018 Cross-referenced by PHPXref 0.7.1