diff options
| author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-07-27 22:27:26 -0400 | 
|---|---|---|
| committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-07-27 22:27:26 -0400 | 
| commit | 7fd1a166da4c040532bb8ff35584b330348366d2 (patch) | |
| tree | eb804d8cdea2fee1ef694edbd11b97cd2e4cf3e2 /phpBB/includes/search/sphinx/config_variable.php | |
| parent | d1e56868667234b4d8ea61a79463c3e3e47efa80 (diff) | |
| parent | f1729281e6f69202730c0926f3799da516fd3ae9 (diff) | |
| download | forums-7fd1a166da4c040532bb8ff35584b330348366d2.tar forums-7fd1a166da4c040532bb8ff35584b330348366d2.tar.gz forums-7fd1a166da4c040532bb8ff35584b330348366d2.tar.bz2 forums-7fd1a166da4c040532bb8ff35584b330348366d2.tar.xz forums-7fd1a166da4c040532bb8ff35584b330348366d2.zip | |
Merge PR #865 branch 'dhruvgoel92/feature/sphinx-fulltext-search' into develop
* dhruvgoel92/feature/sphinx-fulltext-search: (57 commits)
  [feature/sphinx-fulltext-search] add sphinx to Authors file
  [feature/sphinx-fulltext-search] add sphinxapi.php file
  [feature/sphinx-fulltext-search] fix auth bug
  [feature/sphinx-fulltext-search] remove unused property
  [feature/sphinx-fulltext-search] use 9312 as default port
  [feature/sphinx-fulltext-search] fix language of host config
  [feature/sphinx-fulltext-search] fix sphinx for arbitary host
  [feature/sphinx-fulltext-search] coding changes acc to phbb conventions
  [feature/sphinx-fulltext-search] fixing comments
  [feature/sphinx-fulltext-search] add trailing slash in language
  [feature/sphinx-fulltext-search] improve port option
  [feature/sphinx-fulltext-search] remove stopwords and config path
  [feature/sphinx-fulltext-search] makes sql host configurable
  [feature/sphinx-fulltext-search] use readonly instead of disabled
  [feature/sphinx-fulltext-search] fix language keys' typo
  [feature/sphinx-fulltext-search] remove note from db_tools
  [feature/sphinx-fulltext-search] add support for postgres
  [feature/sphinx-fulltext-search] add pgsql functionality
  [feature/sphinx-fulltext-search] use Update in sphinx query
  [feature/sphinx-fulltext-search] use CASE instead of IF
  ...
Diffstat (limited to 'phpBB/includes/search/sphinx/config_variable.php')
| -rw-r--r-- | phpBB/includes/search/sphinx/config_variable.php | 80 | 
1 files changed, 80 insertions, 0 deletions
| diff --git a/phpBB/includes/search/sphinx/config_variable.php b/phpBB/includes/search/sphinx/config_variable.php new file mode 100644 index 0000000000..35abe281cb --- /dev/null +++ b/phpBB/includes/search/sphinx/config_variable.php @@ -0,0 +1,80 @@ +<?php +/** +* +* @package search +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ +	exit; +} + +/** +* phpbb_search_sphinx_config_variable +* Represents a single variable inside the sphinx configuration +*/ +class phpbb_search_sphinx_config_variable +{ +	private $name; +	private $value; +	private $comment; + +	/** +	* Constructs a new variable object +	* +	* @param	string	$name		Name of the variable +	* @param	string	$value		Value of the variable +	* @param	string	$comment	Optional comment after the variable in the +	*								config file +	* +	* @access	public +	*/ +	function __construct($name, $value, $comment) +	{ +		$this->name = $name; +		$this->value = $value; +		$this->comment = $comment; +	} + +	/** +	* Getter for the variable's name +	* +	* @return	string	The variable object's name +	* +	* @access	public +	*/ +	function get_name() +	{ +		return $this->name; +	} + +	/** +	* Allows changing the variable's value +	* +	* @param	string	$value	New value for this variable +	* +	* @access	public +	*/ +	function set_value($value) +	{ +		$this->value = $value; +	} + +	/** +	* Turns this object into a string readable by sphinx +	* +	* @return	string	Config data in textual form +	* +	* @access	public +	*/ +	function to_string() +	{ +		return "\t" . $this->name . ' = ' . str_replace("\n", "\\\n", $this->value) . ' ' . $this->comment . "\n"; +	} +} | 
