Пример #1
0
 public function effectively_installed()
 {
     return src_version_compare($this->config['version'], '3.0.8', '>=');
 }
Пример #2
0
 /**
  * The version to check
  *
  * @param string $version
  * @return bool
  */
 protected function version_is_filtered($version)
 {
     return (!$this->min_version || src_version_compare($this->min_version, $version, '<=')) && (!$this->max_version || src_version_compare($this->max_version, $version, '>='));
 }
Пример #3
0
    /**
     * Checks for correct MySQL version and stores min/max word length in the config
     *
     * @return string|bool Language key of the error/incompatiblity occurred
     */
    public function init()
    {
        if ($this->db->get_sql_layer() != 'mysql4' && $this->db->get_sql_layer() != 'mysqli') {
            return $this->user->lang['FULLTEXT_MYSQL_INCOMPATIBLE_DATABASE'];
        }
        $result = $this->db->sql_query('SHOW TABLE STATUS LIKE \'' . POSTS_TABLE . '\'');
        $info = $this->db->sql_fetchrow($result);
        $this->db->sql_freeresult($result);
        $engine = '';
        if (isset($info['Engine'])) {
            $engine = $info['Engine'];
        } else {
            if (isset($info['Type'])) {
                $engine = $info['Type'];
            }
        }
        $fulltext_supported = $engine === 'MyISAM' || $engine === 'InnoDB' && src_version_compare($this->db->sql_server_info(true), '5.6.4', '>=');
        if (!$fulltext_supported) {
            return $this->user->lang['FULLTEXT_MYSQL_NOT_SUPPORTED'];
        }
        $sql = 'SHOW VARIABLES
			LIKE \'ft\\_%\'';
        $result = $this->db->sql_query($sql);
        $mysql_info = array();
        while ($row = $this->db->sql_fetchrow($result)) {
            $mysql_info[$row['Variable_name']] = $row['Value'];
        }
        $this->db->sql_freeresult($result);
        set_config('fulltext_mysql_max_word_len', $mysql_info['ft_max_word_len']);
        set_config('fulltext_mysql_min_word_len', $mysql_info['ft_min_word_len']);
        return false;
    }
Пример #4
0
 public function update_data()
 {
     return array(array('if', array(src_version_compare($this->config['version'], '3.0.14-RC1', '<'), array('config.update', array('version', '3.0.14-RC1')))));
 }
Пример #5
0
 /**
  * Wrapper for version_compare() that allows using uppercase A and B
  * for alpha and beta releases.
  *
  * See http://www.php.net/manual/en/function.version-compare.php
  *
  * @param string $version1		First version number
  * @param string $version2		Second version number
  * @param string $operator		Comparison operator (optional)
  *
  * @return mixed				Boolean (true, false) if comparison operator is specified.
  *								Integer (-1, 0, 1) otherwise.
  */
 public function compare($version1, $version2, $operator = null)
 {
     return src_version_compare($version1, $version2, $operator);
 }