Comments (12)
@bkuhl dredd has a whitelist of --languages
it supports and if it doesn't recognize it, it will attempt to run the shell command.
So either switch it to --language php
or specify the whole path.
If that doesn't work reopen this issue.
from dredd-hooks-php.
The usage instructions indicate to use dredd-hooks-php
.
Switching to use just php
the output now shows:
verbose: Reading hook files and registering hooks
info: Found Hookfiles: 0=/var/www/html/resources/dredd-hooks.php
verbose: Looking up hooks handler implementation: php
verbose: Dredd instance run finished.
error: PHP hooks handler command not found: dredd-hooks-php
Install php hooks handler by running:
$ composer require ddelnano/dredd-hooks-php --dev
However I already have the package installed:
"require-dev": {
"fzaninotto/faker": "~1.4",
"phpunit/phpunit": "~5.0",
"vluzrmos/tinker": "^1.1",
"barryvdh/laravel-ide-helper": "^2.2",
"squizlabs/php_codesniffer": "^2.6",
"ddelnano/dredd-hooks-php": "^1.1",
"mockery/mockery": "^0.9.5",
"doctrine/dbal": "^2.5"
},
from dredd-hooks-php.
Where are your composer packages installed?
from dredd-hooks-php.
I will update the instructions to be correct but the php language flag should look in vendor/bin/dredd-php-hooks so if you have a local composer install it should just work.
from dredd-hooks-php.
I'm running dredd in it's own Docker container and the working directory in that container was not the same directory where my vendor
is which appears to be the cause of the problem.
Thanks for this package, it's pretty sweet :)
from dredd-hooks-php.
No problem, glad you find it useful.
from dredd-hooks-php.
Still having issues with it not recognizing composer is installed. I'm actually running dredd inside of a docker container where I have my application mounted. Within the dredd container I can show that vendor
is accessible in the default directory:
docker-compose run --rm dredd ls -latr vendor/ddelnano
total 0
drwxr-xr-x 20 root root 680 Oct 14 17:50 dredd-hooks-php
drwxr-xr-x 3 root root 102 Oct 14 17:50 .
drwxr-xr-x 42 root root 1428 Nov 4 12:50 ..
I'm running dredd relative to the root directory with the command:
docker-compose run --rm dredd dredd resources/docs/api-documentation.apib http://web/api/v1 --level=debug --language php --hookfiles resources/dredd-hooks.php
But I still see the error in the output:
error: PHP hooks handler command not found: dredd-hooks-php
Install php hooks handler by running:
$ composer require ddelnano/dredd-hooks-php --dev
It looks like dredd is providing the instructions on how to install this hooks handler as I can't find anywhere in the source for this package where those instructions are included. Am I correct?
from dredd-hooks-php.
What is installed inside your docker container, do you have php? Also I would recommend overriding the entrypoint of your container so you can get a shell and play around with the dredd command inside the container and try and launch the hooks server yourself to see why exactly its not finding the command in your current working directory.
from dredd-hooks-php.
Here is the error you are seeing so if you get a shell inside the dredd container and can't get which dredd-hooks-php
to execute successfully the problem will still exist.
from dredd-hooks-php.
For me, I realized PHP wasn't installed on the Dredd container.
from dredd-hooks-php.
Yea in a docker environment it actually might make sense to have separate containers for the dredd hooks and dredd itself.
from dredd-hooks-php.
Like the application and the dredd hooks would live in a php container with apache / nginx / etc. And the dredd container would just need node.
from dredd-hooks-php.
Related Issues (18)
- Rollback test data HOT 16
- Getting error when running dredd HOT 4
- [Feature request] Support host and port parameters HOT 3
- [Feature request] Support force parameter HOT 6
- Dredd keeps failing to connect to hooks handler HOT 38
- Add GitHub topics HOT 1
- Error connecting to the hook handler. Is the handler running? HOT 6
- Dredd hook not trigger when defining multiple requests within one method HOT 11
- Set hook handler to php HOT 8
- Laravel example: Transactions not working HOT 1
- Changing the database provider when running tests HOT 1
- Release HOT 1
- Add .gitattributes with "export-ignore" options HOT 4
- testing different params for testing similar response HOT 4
- PHP Warning: stream_socket_accept(): accept failed: Operation timed out HOT 2
- How can the hooks output information HOT 3
- Cannot connect to hooks server with Python. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dredd-hooks-php.