GithubHelp home page GithubHelp logo

Comments (12)

ddelnano avatar ddelnano commented on June 26, 2024

@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.

bkuhl avatar bkuhl commented on June 26, 2024

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.

ddelnano avatar ddelnano commented on June 26, 2024

Where are your composer packages installed?

from dredd-hooks-php.

ddelnano avatar ddelnano commented on June 26, 2024

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.

bkuhl avatar bkuhl commented on June 26, 2024

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.

ddelnano avatar ddelnano commented on June 26, 2024

No problem, glad you find it useful.

from dredd-hooks-php.

bkuhl avatar bkuhl commented on June 26, 2024

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.

ddelnano avatar ddelnano commented on June 26, 2024

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.

ddelnano avatar ddelnano commented on June 26, 2024

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.

bkuhl avatar bkuhl commented on June 26, 2024

For me, I realized PHP wasn't installed on the Dredd container.

from dredd-hooks-php.

ddelnano avatar ddelnano commented on June 26, 2024

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.

ddelnano avatar ddelnano commented on June 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.