[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/phpbb/search/sphinx/ -> config_variable.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\search\sphinx;
  15  
  16  /**
  17  * \phpbb\search\sphinx\config_variable
  18  * Represents a single variable inside the sphinx configuration
  19  */
  20  class config_variable
  21  {
  22      private $name;
  23      private $value;
  24      private $comment;
  25  
  26      /**
  27      * Constructs a new variable object
  28      *
  29      * @param    string    $name        Name of the variable
  30      * @param    string    $value        Value of the variable
  31      * @param    string    $comment    Optional comment after the variable in the
  32      *                                config file
  33      *
  34      * @access    public
  35      */
  36  	function __construct($name, $value, $comment)
  37      {
  38          $this->name = $name;
  39          $this->value = $value;
  40          $this->comment = $comment;
  41      }
  42  
  43      /**
  44      * Getter for the variable's name
  45      *
  46      * @return    string    The variable object's name
  47      *
  48      * @access    public
  49      */
  50  	function get_name()
  51      {
  52          return $this->name;
  53      }
  54  
  55      /**
  56      * Allows changing the variable's value
  57      *
  58      * @param    string    $value    New value for this variable
  59      *
  60      * @access    public
  61      */
  62  	function set_value($value)
  63      {
  64          $this->value = $value;
  65      }
  66  
  67      /**
  68      * Turns this object into a string readable by sphinx
  69      *
  70      * @return    string    Config data in textual form
  71      *
  72      * @access    public
  73      */
  74  	function to_string()
  75      {
  76          return "\t" . $this->name . ' = ' . str_replace("\n", " \\\n", $this->value) . ' ' . $this->comment . "\n";
  77      }
  78  }


Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1