Skip to content

Conversation

jdarwood007
Copy link
Member

Drop data and log path in favor of a base path which now contains all the files and logs. The old logic should appear if a older sphinx version is detected

Fixes #31

Drop data and log path in favor of a base path which now contains all the files and logs.  The old logic should appear if a older sphinx version is detected
Comment on lines +165 to +182
// Change settings for older sphinxs
if (!empty($context['sphinx_version']) && version_compare($context['sphinx_version'], '3.5', '>'))
{
$part1 = array_slice($local_config_vars, 0, 3);
$part2 = array_slice($local_config_vars, 4, 5);
$part3 = array_slice($local_config_vars, 7);

$local_config_vars = array_merge(
$part1,
array(
array('text', 'sphinx_data_path', 65, 'default_value' => '/var/sphinx/data', 'subtext' => $txt['sphinx_data_path_subtext']),
array('text', 'sphinx_log_path', 65, 'default_value' => '/var/sphinx/log', 'subtext' => $txt['sphinx_log_path_subtext']),
array('text', 'sphinx_stopword_path', 65, 'default_value' => '', 'subtext' => $txt['sphinx_stopword_path_subtext']),
),
$part2,
$part3
);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps you could add named keys to the old settings and unset() them as needed. Easier to maintain in the future and no index juggling should they ever be rearranged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sphinx config file issues

2 participants