Download the PHP package ergnuor/sphinx-config without Composer

On this page you can find all versions of the php package ergnuor/sphinx-config. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sphinx-config

SphinxConfig

Build Status

About

This is the Sphinx configuration helper, which extends block inheritance and allows you to integrate configuration into your application through the possibility of using placeholders.

Usage

Standalone

For that case you may use common console command:

And /path/to/sphinx/config/preciousConfig.conf file should contents something like this:

Application integrated

You may integrate SphinxConfig into your application and create script that generates configuration file and runs desired Sphinx command. So script may looks like this:

In any case you need to describe a source configuration.

Prerequisites

SphinxConfig has no dependencies except for PHP 5.6+

Structure

Configuration structure

At this moment configuration is described by PHP arrays (more formats are planned). Here is a simple example of configuration structure:

Source and index sections consist of blocks. Blocks, as well as indexer, searchd and common sections, contain parameters.

File structure convention

Here is a typical full file structure of configuration:

├── preciousConfig
│   ├── sectionType
│   │   └── blockName.php      # Block is located in a separate file
│   └── sectionType.php        # Section is located in a separate file
└── preciousConfig.php         # Whole configuration is located in one file

You don't have to describe a structure of configuration as comprehensively as shown above. You can choose one of the following options or combine them at your own discretion:

Inheritance

To inherit blocks you should use 'extends' parameter with the name of parent block as a value.
For example:

Inheritance of multi-value parameters

Values of a multi-value parameter are appended to values of a parent block parameter by default. To ignore values of the parent block, you must use :clear modifier.
For example:

You can also specify an alias for the value of the multi-value parameter. So, you can refer to the value in child blocks and override it.
For example:

And get the following configuration as a result:

With this approach you don’t need to copy all values of the multi-value parameter from the parent block. This example can be made even shorter by using placeholders.

Inheritance between configurations

You can refer to the blocks from other configurations. For that you need to specify the configuration name and separate it from the block name with @ symbol. Note that configurations should be located in the same directory.

The example of usage is storing database connection settings in /path/to/configs/common/source/connection.php block and referring to it from other configurations via 'extends' => 'common@connection' parameter.

Note that in internal representation indexer, searchd and common sections are converted into sections containing self-titled blocks. This allows them to be used in the same way as source and index sections. So, as in the last example, you can store common settings for indexer, searchd and common sections in separate blocks and inherit from them.

Placeholders

Each value of Sphinx parameter may contain a placeholder in ::path.to.value:: format. Placeholder uses dot notation, so it is possible to extract values from multidimensional arrays. The replacement values themselves can contain placeholders. So placeholders are dereferenced recursively.

There are two ways of passing values:

And get the following configuration as a result:

Parameter values

Multiline values are automatically padded with a trailing slash. This is useful when formatting queries.

Custom parameters

Parameter will be ignored if its name starts with an underscore. This allows you to add parameters for internal use, for example, if the configuration is being pre-processed and you want to be able to configure this process.

Configuration parameters list


All versions of sphinx-config with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ergnuor/sphinx-config contains the following files

Loading the files please wait ....