https://github.com/manticoresoftware/buddy-plugin-replace
https://github.com/manticoresoftware/buddy-plugin-replace
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/manticoresoftware/buddy-plugin-replace
- Owner: manticoresoftware
- License: gpl-2.0
- Archived: true
- Created: 2024-01-16T15:54:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-22T13:44:33.000Z (over 2 years ago)
- Last Synced: 2024-11-15T23:27:05.511Z (over 1 year ago)
- Language: PHP
- Size: 25.4 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# buddy-plugin-template
This is an initial template of a plugin for [Buddy](https://github.com/manticoresoftware/manticoresearch-buddy/) that you can use to develop.
## How to start
1. Create a repository from this template.
2. Open `composer.json` and edit it with your plugin name, dependencies, and everything else you need.
3. Run `composer install` to make it work.
4. You need to use our official `manticore-executor`; we strictly recommend using the [Docker](#how-to-use-docker-of-manticore-executor-dev) flow.
5. Edit `src/Payload.php`, add logic to parse the request, and prepare the payload structure for your command processing.
6. Edit `src/Handler.php` and implement processing logic and response that will be proxied by Manticore to the client.
## How to use Docker of manticore-executor-dev
1. Clone [Buddy](https://github.com/manticoresoftware/manticoresearch-buddy/) somewhere to your host machine and go into it.
2. Run this command to create a Docker image named `manticore-buddy`:
```bash
docker run --privileged --entrypoint bash -v $(pwd):/workdir -w /workdir --name manticore-buddy --network host -it manticoresearch/manticore-executor-kit:latest
```
3. Now you can edit `/etc/manticore.conf` and configure the development version of Buddy:
```text
buddy_path = manticore-executor-dev /workdir/src/main.php --debug
```
4. Run `searchd --nodetach` to keep the daemon in the foreground and enjoy the development of your new plugin.
## Notes
You can use `pre-commit` to install code style and code analyze hooks by running `pre-commit install`. Check our PHP code style and guide [here](https://github.com/manticoresoftware/php-code-standard).