-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add prototype for Galach query translator implementation #462
Draft
alexander-schranz
wants to merge
1
commit into
PHP-CMSIG:0.6
Choose a base branch
from
alexander-schranz:feature/query-translator-prototype
base: 0.6
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.gitattributes export-ignore | ||
.gitignore export-ignore | ||
composer.lock export-ignore | ||
/tests export-ignore | ||
phpunit.xml.dist export-ignore | ||
.php-cs-fixer.dist.php export-ignore | ||
phpstan.neon export-ignore | ||
rector.php export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/vendor/ | ||
/composer.phar | ||
/phpunit.xml | ||
/.phpunit.cache | ||
/tests/var | ||
/.php-cs-fixer.php | ||
/.php-cs-fixer.cache | ||
/phpstan.neon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
$phpCsConfig = require(dirname(__DIR__, 2) . '/.php-cs-fixer.dist.php'); | ||
|
||
$finder = (new PhpCsFixer\Finder()) | ||
->in(__DIR__) | ||
->ignoreVCSIgnored(true); | ||
|
||
$phpCsConfig->setFinder($finder); | ||
|
||
return $phpCsConfig->setFinder($finder); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Alexander Schranz | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<div align="center"> | ||
<img alt="SEAL Logo with an abstract seal sitting on a telescope." src="https://avatars.githubusercontent.com/u/120221538?s=400&v=6" width="200" height="200"> | ||
</div> | ||
|
||
<div align="center">Logo created by <a href="https://cargocollective.com/meinewilma">Meine Wilma</a></div> | ||
|
||
<h1 align="center">SEAL <br /> Memory Adapter</h1> | ||
|
||
<br /> | ||
<br /> | ||
|
||
The `MemoryAdapter` write the documents into an in-memory array. | ||
|
||
> **Note**: | ||
> This is part of the `cmsig/search` project create issues in the [main repository](https://github.com/php-cmsig/search). | ||
|
||
> **Note**: | ||
> This project is heavily under development and any feedback is greatly appreciated. | ||
|
||
## Installation | ||
|
||
Use [composer](https://getcomposer.org/) for install the package: | ||
|
||
```bash | ||
composer require cmsig/seal cmsig/seal-memory-adapter | ||
``` | ||
|
||
## Usage | ||
|
||
It is mostly used for testing purposes and as a reference implementation. | ||
|
||
The following code shows how to create an Engine using this Adapter: | ||
|
||
```php | ||
<?php | ||
|
||
use CmsIg\Seal\Adapter\Memory\MemoryAdapter; | ||
use CmsIg\Seal\Engine; | ||
|
||
$engine = new Engine( | ||
new MemoryAdapter(), | ||
$schema, | ||
); | ||
``` | ||
|
||
Via DSN for your favorite framework: | ||
|
||
```env | ||
memory:// | ||
``` | ||
|
||
## Authors | ||
|
||
- [Alexander Schranz](https://github.com/alexander-schranz/) | ||
- [The Community Contributors](https://github.com/php-cmsig/search/graphs/contributors) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"name": "cmsig/seal-query-translator", | ||
"description": "Add support for string query translating for SEAL SearchBuilder.", | ||
"type": "library", | ||
"license": "MIT", | ||
"keywords": [ | ||
"cmsig", | ||
"seal", | ||
"seal-query-transator", | ||
"search-client" | ||
], | ||
"autoload": { | ||
"psr-4": { | ||
"CmsIg\\Seal\\QueryTranslator\\": "src" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"CmsIg\\Seal\\QueryTranslator\\Tests\\": "tests" | ||
} | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Alexander Schranz", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"php": "^8.1", | ||
"cmsig/seal": "^0.6", | ||
"netgen/query-translator": "^1.1" | ||
}, | ||
"require-dev": { | ||
"php-cs-fixer/shim": "^3.51", | ||
"phpstan/extension-installer": "^1.2", | ||
"phpstan/phpstan": "^1.10", | ||
"phpstan/phpstan-phpunit": "^1.3", | ||
"phpunit/phpunit": "^10.3", | ||
"rector/rector": "^1.0" | ||
}, | ||
"scripts": { | ||
"test": [ | ||
"Composer\\Config::disableProcessTimeout", | ||
"vendor/bin/phpunit" | ||
], | ||
"phpstan": "@php vendor/bin/phpstan analyze", | ||
"lint-rector": "@php vendor/bin/rector process --dry-run", | ||
"lint-php-cs": "@php vendor/bin/php-cs-fixer fix --verbose --diff --dry-run", | ||
"lint": [ | ||
"@phpstan", | ||
"@lint-php-cs", | ||
"@lint-rector", | ||
"@lint-composer" | ||
], | ||
"lint-composer": "@composer validate --strict", | ||
"rector": "@php vendor/bin/rector process", | ||
"php-cs-fix": "@php vendor/bin/php-cs-fixer fix", | ||
"fix": [ | ||
"@rector", | ||
"@php-cs-fix" | ||
] | ||
}, | ||
"repositories": [ | ||
{ | ||
"type": "path", | ||
"url": "./../*", | ||
"options": { | ||
"symlink": true | ||
} | ||
} | ||
], | ||
"minimum-stability": "dev", | ||
"config": { | ||
"allow-plugins": { | ||
"phpstan/extension-installer": true | ||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the name yet it generate / create filters out of a Galach query language using netgen/query-translator package.