Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

notifications.php

Zuletzt modifiziert: 09.10.2024, 12:57 - Dateigröße: 2.67 KiB


 001  <?php
 002  /**
 003  *
 004  * This file is part of the phpBB Forum Software package.
 005  *
 006  * @copyright (c) phpBB Limited <https://www.phpbb.com>
 007  * @license GNU General Public License, version 2 (GPL-2.0)
 008  *
 009  * For full copyright and license information, please see
 010  * the docs/CREDITS.txt file.
 011  *
 012  */
 013   
 014  namespace phpbb\db\migration\data\v310;
 015   
 016  class notifications extends \phpbb\db\migration\migration
 017  {
 018      public function effectively_installed()
 019      {
 020          return $this->db_tools->sql_table_exists($this->table_prefix . 'notifications');
 021      }
 022   
 023      static public function depends_on()
 024      {
 025          return array('\phpbb\db\migration\data\v310\dev');
 026      }
 027   
 028      public function update_schema()
 029      {
 030          return array(
 031              'add_tables'        => array(
 032                  $this->table_prefix . 'notification_types'    => array(
 033                      'COLUMNS'            => array(
 034                          'notification_type'            => array('VCHAR:255', ''),
 035                          'notification_type_enabled'    => array('BOOL', 1),
 036                      ),
 037                      'PRIMARY_KEY'        => array('notification_type', 'notification_type_enabled'),
 038                  ),
 039                  $this->table_prefix . 'notifications'        => array(
 040                      'COLUMNS'            => array(
 041                          'notification_id'                  => array('UINT', null, 'auto_increment'),
 042                          'item_type'                           => array('VCHAR:255', ''),
 043                          'item_id'                          => array('UINT', 0),
 044                          'item_parent_id'                   => array('UINT', 0),
 045                          'user_id'                        => array('UINT', 0),
 046                          'notification_read'                => array('BOOL', 0),
 047                          'notification_time'                => array('TIMESTAMP', 1),
 048                          'notification_data'                   => array('TEXT_UNI', ''),
 049                      ),
 050                      'PRIMARY_KEY'        => 'notification_id',
 051                      'KEYS'                => array(
 052                          'item_ident'        => array('INDEX', array('item_type', 'item_id')),
 053                          'user'                => array('INDEX', array('user_id', 'notification_read')),
 054                      ),
 055                  ),
 056                  $this->table_prefix . 'user_notifications'    => array(
 057                      'COLUMNS'            => array(
 058                          'item_type'            => array('VCHAR:255', ''),
 059                          'item_id'            => array('UINT', 0),
 060                          'user_id'            => array('UINT', 0),
 061                          'method'            => array('VCHAR:255', ''),
 062                          'notify'            => array('BOOL', 1),
 063                      ),
 064                  ),
 065              ),
 066          );
 067      }
 068   
 069      public function revert_schema()
 070      {
 071          return array(
 072              'drop_tables'    => array(
 073                  $this->table_prefix . 'notification_types',
 074                  $this->table_prefix . 'notifications',
 075                  $this->table_prefix . 'user_notifications',
 076              ),
 077          );
 078      }
 079   
 080      public function update_data()
 081      {
 082          return array(
 083              array('module.add', array(
 084                  'ucp',
 085                  'UCP_MAIN',
 086                  array(
 087                      'module_basename'    => 'ucp_notifications',
 088                      'modes'                => array('notification_list'),
 089                  ),
 090              )),
 091              array('module.add', array(
 092                  'ucp',
 093                  'UCP_PREFS',
 094                  array(
 095                      'module_basename'    => 'ucp_notifications',
 096                      'modes'                => array('notification_options'),
 097                  ),
 098              )),
 099              array('config.add', array('load_notifications', 1)),
 100          );
 101      }
 102  }
 103