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

config_text.php

Zuletzt modifiziert: 09.10.2024, 12:55 - Dateigröße: 2.40 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\tool;
 015   
 016  /**
 017  * Migration config_text tool
 018  */
 019  class config_text implements \phpbb\db\migration\tool\tool_interface
 020  {
 021      /** @var \phpbb\config\db_text */
 022      protected $config_text;
 023   
 024      /**
 025      * Constructor
 026      *
 027      * @param \phpbb\config\db_text $config_text
 028      */
 029      public function __construct(\phpbb\config\db_text $config_text)
 030      {
 031          $this->config_text = $config_text;
 032      }
 033   
 034      /**
 035      * {@inheritdoc}
 036      */
 037      public function get_name()
 038      {
 039          return 'config_text';
 040      }
 041   
 042      /**
 043      * Add a config_text setting.
 044      *
 045      * @param string $config_name The name of the config_text setting
 046      *     you would like to add
 047      * @param mixed $config_value The value of the config_text setting
 048      * @return null
 049      */
 050      public function add($config_name, $config_value)
 051      {
 052          if (!is_null($this->config_text->get($config_name)))
 053          {
 054              return;
 055          }
 056   
 057          $this->config_text->set($config_name, $config_value);
 058      }
 059   
 060      /**
 061      * Update an existing config_text setting.
 062      *
 063      * @param string $config_name The name of the config_text setting you would
 064      *     like to update
 065      * @param mixed $config_value The value of the config_text setting
 066      * @return null
 067      * @throws \phpbb\db\migration\exception
 068      */
 069      public function update($config_name, $config_value)
 070      {
 071          if (is_null($this->config_text->get($config_name)))
 072          {
 073              throw new \phpbb\db\migration\exception('CONFIG_NOT_EXIST', $config_name);
 074          }
 075   
 076          $this->config_text->set($config_name, $config_value);
 077      }
 078   
 079      /**
 080      * Remove an existing config_text setting.
 081      *
 082      * @param string $config_name The name of the config_text setting you would
 083      *     like to remove
 084      * @return null
 085      */
 086      public function remove($config_name)
 087      {
 088          if (is_null($this->config_text->get($config_name)))
 089          {
 090              return;
 091          }
 092   
 093          $this->config_text->delete($config_name);
 094      }
 095   
 096      /**
 097      * {@inheritdoc}
 098      */
 099      public function reverse()
 100      {
 101          $arguments = func_get_args();
 102          $original_call = array_shift($arguments);
 103   
 104          $call = false;
 105          switch ($original_call)
 106          {
 107              case 'add':
 108                  $call = 'remove';
 109              break;
 110   
 111              case 'remove':
 112                  $call = 'add';
 113                  if (sizeof($arguments) == 1)
 114                  {
 115                      $arguments[] = '';
 116                  }
 117              break;
 118          }
 119   
 120          if ($call)
 121          {
 122              return call_user_func_array(array(&$this, $call), $arguments);
 123          }
 124      }
 125  }
 126