@@ 6830-6865 (lines=36) @@ | ||
6827 | * @param $name The new conf name |
|
6828 | * @return bool|int 0 on success |
|
6829 | */ |
|
6830 | public function updateFtsConfiguration($cfgname, $comment, $name) |
|
6831 | { |
|
6832 | $status = $this->beginTransaction(); |
|
6833 | if ($status != 0) { |
|
6834 | $this->rollbackTransaction(); |
|
6835 | ||
6836 | return -1; |
|
6837 | } |
|
6838 | ||
6839 | $this->fieldClean($cfgname); |
|
6840 | ||
6841 | $status = $this->setComment('TEXT SEARCH CONFIGURATION', $cfgname, '', $comment); |
|
6842 | if ($status != 0) { |
|
6843 | $this->rollbackTransaction(); |
|
6844 | ||
6845 | return -1; |
|
6846 | } |
|
6847 | ||
6848 | // Only if the name has changed |
|
6849 | if ($name != $cfgname) { |
|
6850 | $f_schema = $this->_schema; |
|
6851 | $this->fieldClean($f_schema); |
|
6852 | $this->fieldClean($name); |
|
6853 | ||
6854 | $sql = "ALTER TEXT SEARCH CONFIGURATION \"{$f_schema}\".\"{$cfgname}\" RENAME TO \"{$name}\""; |
|
6855 | $status = $this->execute($sql); |
|
6856 | if ($status != 0) { |
|
6857 | $this->rollbackTransaction(); |
|
6858 | ||
6859 | return -1; |
|
6860 | } |
|
6861 | } |
|
6862 | ||
6863 | return $this->endTransaction(); |
|
6864 | } |
|
6865 | ||
6866 | /** |
|
6867 | * Creates a new FTS dictionary or FTS dictionary template. |
|
6868 | * |
|
@@ 6965-6999 (lines=35) @@ | ||
6962 | * @param $name The new dico's name |
|
6963 | * @return bool|int 0 on success |
|
6964 | */ |
|
6965 | public function updateFtsDictionary($dictname, $comment, $name) |
|
6966 | { |
|
6967 | $status = $this->beginTransaction(); |
|
6968 | if ($status != 0) { |
|
6969 | $this->rollbackTransaction(); |
|
6970 | ||
6971 | return -1; |
|
6972 | } |
|
6973 | ||
6974 | $this->fieldClean($dictname); |
|
6975 | $status = $this->setComment('TEXT SEARCH DICTIONARY', $dictname, '', $comment); |
|
6976 | if ($status != 0) { |
|
6977 | $this->rollbackTransaction(); |
|
6978 | ||
6979 | return -1; |
|
6980 | } |
|
6981 | ||
6982 | // Only if the name has changed |
|
6983 | if ($name != $dictname) { |
|
6984 | $f_schema = $this->_schema; |
|
6985 | $this->fieldClean($f_schema); |
|
6986 | $this->fieldClean($name); |
|
6987 | ||
6988 | $sql = "ALTER TEXT SEARCH DICTIONARY \"{$f_schema}\".\"{$dictname}\" RENAME TO \"{$name}\""; |
|
6989 | $status = $this->execute($sql); |
|
6990 | if ($status != 0) { |
|
6991 | $this->rollbackTransaction(); |
|
6992 | ||
6993 | return -1; |
|
6994 | } |
|
6995 | } |
|
6996 | ||
6997 | return $this->endTransaction(); |
|
6998 | } |
|
6999 | ||
7000 | /** |
|
7001 | * Return all information relating to a FTS dictionary |
|
7002 | * |