Skip to content

Commit

Permalink
Merge pull request #38 from ripaclub/develop
Browse files Browse the repository at this point in the history
v0.7.1
  • Loading branch information
leogr committed Apr 11, 2015
2 parents f0c4bd1 + ce33de2 commit a3d06b1
Show file tree
Hide file tree
Showing 66 changed files with 1,103 additions and 123 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ php:
- 5.3.3
- 5.4
- 5.5
- 5.6
- 7
- hhvm
- hhvm-nightly

branches:
only:
Expand All @@ -26,3 +30,10 @@ after_script:

notifications:
email: false

matrix:
fast_finish: true
allow_failures:
- php: 7
- php: hhvm
- php: hhvm-nightly
87 changes: 87 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Contributing

Contributions to ShinxSearch library are always welcomed and encouraged.

You make our lives easier by sending us your contributions through github pull requests.

* Coding standard for the project is [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)

* Any contribution must provide tests for additional introduced conditions

## Team members

The core team members are:

| Name | Nickname |
|:---------------:|:------------------------------------:|
| Leo Di Donato | [leodido](http://github.com/leodido) |
| Leonardo Grasso | [leogr](http://github.com/leogr) |

## Got a question or problem?

If you have questions about how to use ShinxSearch library please write us at <ripaclub@gmail.com>.

Other communication channels will be activated soon. In the mean time you can also contact us writing a [new issue](https://github.com/ripaclub/sphinxsearch/issues/new).

Due to time constraints, we are not always able to respond as quickly as we would like. Please do not take delays personal and feel free to remind us.

## New features

You can request a new feature by submitting an issue to our github repository. If you would like to implement a new feature then consider what kind of change it is:

* **Major changes**

This kind of contribution should be discussed first with us in issues. This way we can better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted into the project.

* **Small changes**

Can be crafted and submitted to the github repository as a pull request.

## Bug triage

Bug triaging is managed via github [issues](https://github.com/ripaclub/sphinxsearch/issues).

You can help report bugs by filing them [here](https://github.com/ripaclub/sphinxsearch/issues).

Before submitting new bugs please verify that similar ones do not exists yet. This will help us to reduce the duplicates and the references between issues.

Is desiderable that you provide reproducible behaviours attaching (failing) tests.

## Testing

To facilitate the process of running integration tests locally we also provide SphinxSearch docker images [here](https://github.com/leodido/dockerfiles).

If you already have [docker](https://github.com/docker/docker) installed and you have already pulled one of the aforementioned docker images, you can setup a SphinxSearch environment for tests executing:

```bash
$ cd sphinxsearch/
$ docker run -i -t -v $PWD/tests/sphinx:/usr/local/etc -p 9306:9306 -d leodido/sphinxsearch:latest ./searchd.sh
```

The PHPUnit version to be used is the one installed as a dev-dependency via [composer](https://getcomposer.org/).

```bash
$ ./vendor/bin/phpunit
```

## Contributing process

What branch to issue the pull request against?

For **new features**, or fixes that introduce **new elements to the public API** (such as new public methods or properties), issue the pull request against the `develop` branch.

For **hotfixes** against the stable release, issue the pull request against the `master` branch.

1. **Fork** the sphinxsearch [repository](https://github.com/ripaclub/sphinxsearch/fork)

2. **Checkout** the forked repository

3. Retrieve **dependencies** using [composer](https://getcomposer.org/)

4. Create your **local branch**, **commit** your code and **push** your local branch to your github fork

5. Send us a **pull request** as descripted for your changes to be included

Please remember that **any contribution must provide tests** for additional introduced conditions. Accepted coverage for new contributions is 75%. Any contribution not satisfying this requirement won't be merged.

Don't get discouraged!
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Sphinx Search [![Build Status](https://travis-ci.org/ripaclub/sphinxsearch.png?branch=master)](https://travis-ci.org/ripaclub/sphinxsearch)&nbsp;[![Latest Stable Version](https://poser.pugx.org/ripaclub/sphinxsearch/v/stable.png)](https://packagist.org/packages/ripaclub/sphinxsearch)&nbsp;[![Code Coverage](https://scrutinizer-ci.com/g/ripaclub/sphinxsearch/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/ripaclub/sphinxsearch/?branch=master)&nbsp;[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/ripaclub/sphinxsearch/badges/quality-score.png?s=ee5fd3ec2556ba441dc3ca598cee7ebdb41daa3c)](https://scrutinizer-ci.com/g/ripaclub/sphinxsearch/)
Sphinx Search
=============

[![Build Status](https://travis-ci.org/ripaclub/sphinxsearch.png?branch=master)](https://travis-ci.org/ripaclub/sphinxsearch)&nbsp;[![Latest Stable Version](https://poser.pugx.org/ripaclub/sphinxsearch/v/stable.png)](https://packagist.org/packages/ripaclub/sphinxsearch)&nbsp;[![Code Coverage](https://scrutinizer-ci.com/g/ripaclub/sphinxsearch/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/ripaclub/sphinxsearch/?branch=master)&nbsp;[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/ripaclub/sphinxsearch/badges/quality-score.png?s=ee5fd3ec2556ba441dc3ca598cee7ebdb41daa3c)](https://scrutinizer-ci.com/g/ripaclub/sphinxsearch/)&nbsp;[![Dependency Status](https://www.versioneye.com/user/projects/5432dbea84981f174e0000a5/badge.svg)](https://www.versioneye.com/user/projects/5432dbea84981f174e0000a5)&nbsp;[![Total Downloads](https://poser.pugx.org/ripaclub/sphinxsearch/downloads.svg)](https://packagist.org/packages/ripaclub/sphinxsearch)


Sphinx Search library provides SphinxQL indexing and searching features.

- [Introduction](#introduction)
Expand All @@ -22,10 +25,10 @@ Sphinx Search library provides SphinxQL indexing and searching features.

This Library aims to provide:

- A SphinxQL query builder based upon [Zend\Db\Sql](http://framework.zend.com/manual/2.2/en/modules/zend.db.sql.html)
- A SphinxQL query builder based upon [Zend\Db\Sql](http://framework.zend.com/manual/2.4/en/modules/zend.db.sql.html)
- A simple `Search` class
- An `Indexer` class to work with RT indices
- Factories for SphinxQL connection through [Zend\Db\Adapter](http://framework.zend.com/manual/2.2/en/modules/zend.db.adapter.html)
- Factories for SphinxQL connection through [Zend\Db\Adapter](http://framework.zend.com/manual/2.4/en/modules/zend.db.adapter.html)

###### Note

Expand All @@ -40,7 +43,7 @@ Add the following to your `composer.json` file:
```json
"require": {
"php": ">=5.3.3",
"ripaclub/sphinxsearch": "~0.6",
"ripaclub/sphinxsearch": "~0.7.1",
}
```

Expand Down Expand Up @@ -116,7 +119,7 @@ $rowset = $search->search('foo', function(Select $select) {
});
```

The `SphinxSearch\Db\Sql\Select` class (like [`Zend\Db\Sql\Select`](http://framework.zend.com/manual/2.2/en/modules/zend.db.sql.html#zend-db-sql-select) which we extend from) supports the following methods related to SQL standard clauses:
The `SphinxSearch\Db\Sql\Select` class (like [`Zend\Db\Sql\Select`](http://framework.zend.com/manual/2.4/en/modules/zend.db.sql.html#zend-db-sql-select) which we extend from) supports the following methods related to SQL standard clauses:

```php
$select->from($table)
Expand Down Expand Up @@ -182,7 +185,7 @@ Use `SphinxSearch\Db\Adapter\AdapterServiceFactory` (see [Configuration](#config
)
```

For the abstract factory configuration refer to [Zend Db Adpater Abstract Factory documentation](http://framework.zend.com/manual/2.2/en/modules/zend.mvc.services.html#zend-db-adapter-adapterabstractservicefactory).
For the abstract factory configuration refer to [Zend Db Adpater Abstract Factory documentation](http://framework.zend.com/manual/2.4/en/modules/zend.mvc.services.html#zend-db-adapter-adapterabstractservicefactory).

Only two drivers are supported:

Expand Down Expand Up @@ -241,7 +244,7 @@ Useful link: [Sphinx Attributes Docs](http://sphinxsearch.com/docs/current.html#

### SQL Objects

As [Zend\Db\Sql](http://framework.zend.com/manual/2.2/en/modules/zend.db.sql.html) this library provides a set of SQL objects:
As [Zend\Db\Sql](http://framework.zend.com/manual/2.4/en/modules/zend.db.sql.html) this library provides a set of SQL objects:

* `SphinxSearch\Db\Sql\Select` explained in [Search](#search) paragraph
* `SphinxSearch\Db\Sql\Insert`
Expand Down Expand Up @@ -340,7 +343,7 @@ The library source code (**on master**) is 100% covered by unit tests.
Once installed development dependencies through composer you can run `phpunit`.

```
./vendor/bin/phpunit -c tests/
./vendor/bin/phpunit
```

Code quality
Expand All @@ -366,4 +369,4 @@ Run [pdepend](https://github.com/pdepend/pdepend).

---

[![Analytics](https://ga-beacon.appspot.com/UA-49655829-1/ripaclub/sphinxsearch)](https://github.com/igrigorik/ga-beacon)
[![Analytics](https://ga-beacon.appspot.com/UA-49655829-1/ripaclub/sphinxsearch)](https://github.com/igrigorik/ga-beacon)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://github.com/ripaclub/sphinxsearch
* @copyright Copyright (c) 2014,
* Leonardo Di Donato <leodidonato at gmail dot com>,
* Leo Di Donato <leodidonato at gmail dot com>,
* Leonardo Grasso <me at leonardograsso dot com>
* @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
*/
Expand Down
8 changes: 8 additions & 0 deletions compatibility/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Compatibility for ZF from 2.1.x to ZF 2.3.x
=============

Due to Zend\Db\Sql BCs introduced in ZF 2.4.x series, this folder contains legacy version of some classes in order to mantain compatibility with old Zend Framework versions.

This folder should be not autoloaded because lastest version of this package will polyfill classes loading the correct ones.

Polyfill may be removed in newer versions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://github.com/ripaclub/sphinxsearch
* @copyright Copyright (c) 2014,
* Leonardo Di Donato <leodidonato at gmail dot com>,
* Leo Di Donato <leodidonato at gmail dot com>,
* Leonardo Grasso <me at leonardograsso dot com>
* @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
*/
Expand Down Expand Up @@ -480,4 +480,4 @@ protected function processOption(

return array($options);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://github.com/ripaclub/sphinxsearch
* @copyright Copyright (c) 2014,
* Leonardo Di Donato <leodidonato at gmail dot com>,
* Leo Di Donato <leodidonato at gmail dot com>,
* Leonardo Grasso <me at leonardograsso dot com>
* @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
*/
Expand Down
27 changes: 13 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
"license": "BSD-2-Clause",
"require": {
"php": ">=5.3.3",
"zendframework/zend-db": "~2.2",
"zendframework/zend-servicemanager": "~2.2",
"zendframework/zend-stdlib": "~2.2"
"zendframework/zend-db": "~2.1",
"zendframework/zend-servicemanager": "~2.1",
"zendframework/zend-stdlib": "~2.1",
"zendframework/zend-version": "~2.1"
},
"require-dev": {
"phpunit/phpunit": "4.2.*",
"phpmd/phpmd": "2.0.*",
"phpunit/phpunit": "~4.2",
"phpmd/phpmd": "~2.0",
"pdepend/pdepend": "2.0.*",
"squizlabs/php_codesniffer": "1.5.*"
},
Expand All @@ -28,17 +29,14 @@
}
],
"autoload": {
"psr-0": {
"SphinxSearch": "library/",
"SphinxSearchTest": "tests/"
},
"classmap": [
"./"
]
"psr-4": {
"SphinxSearch\\": "library",
"SphinxSearchTest\\": "tests"
}
},
"suggest": {
"ripaclub/zf2-sphinxsearch": "ZF2 integration module for SphinxSearch library",
"ripaclub/zf2-sphinxsearch-tool": "ZF2 module/tool that provides a set of tools to configure and handle SphinxSearch engine"
"ripaclub/zf2-sphinxsearch-tool": "Utility that provides a set of tools to create and handle Sphinx Search configs and sources"
},
"keywords": [
"sphinx",
Expand All @@ -47,6 +45,7 @@
"indexing",
"search engine",
"query builder",
"zf2"
"zf2",
"pdo"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://github.com/ripaclub/sphinxsearch
* @copyright Copyright (c) 2014,
* Leonardo Di Donato <leodidonato at gmail dot com>,
* Leo Di Donato <leodidonato at gmail dot com>,
* Leonardo Grasso <me at leonardograsso dot com>
* @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
*/
Expand Down Expand Up @@ -70,7 +70,8 @@ public function getQueryMode()
}

/**
* @param AbstractSql $sqlObject
* @todo Use
* @param AbstractSql $sqlObject // TODO (for 0.8.x) use Zend\Db\Sql\SqlInterface
* @param null $usePreparedStatement
* @return \Zend\Db\Adapter\Driver\ResultInterface
* @throws Exception\InvalidArgumentException
Expand All @@ -91,9 +92,12 @@ public function executeSqlObject(AbstractSql $sqlObject, $usePreparedStatement =
return $this->getAdapter()->getDriver()->getConnection()->execute($sql);
}

// TODO (for 0.8.x) remove
// @codeCoverageIgnoreStart
throw new Exception\InvalidArgumentException(
'$sqlObject must be an instance of SqlInterface or PreparableSqlInterface'
);
// @codeCoverageIgnoreEnd
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://github.com/ripaclub/sphinxsearch
* @copyright Copyright (c) 2014,
* Leonardo Di Donato <leodidonato at gmail dot com>,
* Leo Di Donato <leodidonato at gmail dot com>,
* Leonardo Grasso <me at leonardograsso dot com>
* @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://github.com/ripaclub/sphinxsearch
* @copyright Copyright (c) 2014,
* Leonardo Di Donato <leodidonato at gmail dot com>,
* Leo Di Donato <leodidonato at gmail dot com>,
* Leonardo Grasso <me at leonardograsso dot com>
* @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://github.com/ripaclub/sphinxsearch
* @copyright Copyright (c) 2014,
* Leonardo Di Donato <leodidonato at gmail dot com>,
* Leo Di Donato <leodidonato at gmail dot com>,
* Leonardo Grasso <me at leonardograsso dot com>
* @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://github.com/ripaclub/sphinxsearch
* @copyright Copyright (c) 2014,
* Leonardo Di Donato <leodidonato at gmail dot com>,
* Leo Di Donato <leodidonato at gmail dot com>,
* Leonardo Grasso <me at leonardograsso dot com>
* @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://github.com/ripaclub/sphinxsearch
* @copyright Copyright (c) 2014,
* Leonardo Di Donato <leodidonato at gmail dot com>,
* Leo Di Donato <leodidonato at gmail dot com>,
* Leonardo Grasso <me at leonardograsso dot com>
* @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
*/
Expand Down
Loading

0 comments on commit a3d06b1

Please sign in to comment.