PHPackages                             ruskid/sphinx-config-generator-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ruskid/sphinx-config-generator-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ruskid/sphinx-config-generator-php
==================================

Sphinx config generator

1336PHP

Since Sep 25Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ruskid/sphinx-config-generator-php)[ Packagist](https://packagist.org/packages/ruskid/sphinx-config-generator-php)[ RSS](/packages/ruskid-sphinx-config-generator-php/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Sphinx config (.conf) generator in PHP
======================================

[](#sphinx-config-conf-generator-in-php)

Didn't like existing solutions, decided to create my own. Sharing is caring.

Installation
------------

[](#installation)

The preferred way to install this extension is through .

Either run

```
php composer.phar require ruskid/sphinx-config-generator-php "dev-master"
```

or add

```
"ruskid/sphinx-config-generator-php": "dev-master"
```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

```
$handler = new ConfigGenerator([
    'filepath' => __DIR__ . '/sphinx-generated.conf'
]);

//Add Index config
$handler->addConfig(new Config([
    'name' => 'indexer',
    'attributes' => [
        ...
        'mem_limit' => '32M'
        ...
    ]
]));

//Add search daemon config
$handler->addConfig(new Config([
    'name' => 'searchd',
    'attributes' => [
        ...
        'listen' => '9306:mysql41',
        'log' => '/var/log/searchd.log',
        ...
    ]
]));

//Add sources
$handler->addSource(new Source([
    'name' => 'base',
    'attributes' => [
        'type' => 'mysql',
        'sql_host' => 'host',
        'sql_user' => 'username',
        'sql_pass' => 'password',
        'sql_db' => 'database',
        'sql_port' => '3306',
        'sql_query_pre' => [
            'SET CHARACTER_SET_RESULTS=utf8',
            'SET NAMES utf8'
        ],
    ]
]));

$handler->addSource(new Source([
    'name' => 'extending_source',
    'extends' => 'base',
    'attributes' => [
        'sql_field_string' => [
            'label',
        ],
        'sql_attr_string' => ['label_url'],
        'sql_attr_float' => ['latitude', 'longitude'],
        'sql_attr_uint' => ['province_id', 'population']
    ]
]));

//Add indexes
$handler->addIndex(new Index([
    'name' => "extending_source_index",
    'attributes' => [
        ...
        'source' => 'extending_source'
        'path' => "/var/data/extending_source_index",
        ...
    ]
]));

$handler->getContents(); // get contents to be saved to .conf
$handler->saveConfig(); //save config file to filepath
```

Be aware
--------

[](#be-aware)

Maintain order of sources extending base sources...

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/12093591a2c01098c8613b3d765dd14f64e952691b0048cd0f5ee65438a77244?d=identicon)[ruskid](/maintainers/ruskid)

---

Top Contributors

[![ruskid](https://avatars.githubusercontent.com/u/8279841?v=4)](https://github.com/ruskid "ruskid (3 commits)")

### Embed Badge

![Health badge](/badges/ruskid-sphinx-config-generator-php/health.svg)

```
[![Health](https://phpackages.com/badges/ruskid-sphinx-config-generator-php/health.svg)](https://phpackages.com/packages/ruskid-sphinx-config-generator-php)
```

###  Alternatives

[vaersaagod/seomate

SEO, mate! It's important.

4341.6k2](/packages/vaersaagod-seomate)[gkermer/nova-text-auto-complete

A Laravel Nova text autocomplete field.

22115.5k1](/packages/gkermer-nova-text-auto-complete)[maximecolin/satisfaction

A PHP implementation of the specification pattern for DDD

3630.2k](/packages/maximecolin-satisfaction)[markbaker/quadtrees

QuadTree implementation in PHP

1739.2k](/packages/markbaker-quadtrees)[chinayin/ip2region-core

Ip2region (2.0 - xdb) is a offline IP address manager framework and locator with ten microsecond searching performance. xdb engine implementation for many programming languages

2218.3k2](/packages/chinayin-ip2region-core)[kayandra/hashidable

Auto Hashids for Laravel Models and Routes

1319.9k](/packages/kayandra-hashidable)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
