wp-hooks / generator

Generates a JSON representation of the WordPress actions and filters in your code
https://packagist.org/packages/wp-hooks/generator
78 stars 6 forks source link

Error on executing the binary #7

Closed qriouslad closed 2 years ago

qriouslad commented 2 years ago

@johnbillion

I'm including this library in my plugin via composer and then tried executing "php ./vendor/bin/wp-hooks-generator " from plugin's root folder in the command line (Ubuntu server) but got the following error:

`dir=$(cd "${0%[/\]*}" > /dev/null; cd ../johnbillion/wp-hooks-generator/bin && pwd)

if [ -d /proc/cygdrive ]; then case $(which php) in $(readlink -n /proc/cygdrive)/*)

We are in Cygwin using Windows php, so the path must be translated

        dir=$(cygpath -m "$dir");
        ;;
esac

fi

"${dir}/wp-hooks-generator" "$@"`

Any idea what went wrong? ...or further examples on how to use this library properly?

My intention is to use the generator to list all hooks from all the WordPress plugins installed. So, gussing I should put the plugins root folder in the --src= parameter, but can not proceed to that step just yet.

Thanks!

johnbillion commented 2 years ago

Just to let you know that I don't have any time to look into this for a good while, and it's a rather cryptic output that I suspect is coming from Composer. None of that code is in this library. Maybe try searching for similar problems with Composer?

qriouslad commented 2 years ago

@johnbillion thank you for the clue. I was indeed using composer inside WSL (Windows Subsystem for Linux). Just tried it directly over SSH on a Linux server and it works beautifully! I'm planning to use this library to parse action and filter hooks from active plugins inside a WordPress install, for a plugin I'll submit to .org soon.

johnbillion commented 2 years ago

In that case I'll close this off because AFAICT this isn't anything specific to this library. Hope you get it sorted and please feel free to reopen if there is anything I need to do to support WSL.

qriouslad commented 2 years ago

@johnbillion thanks! Just wanted to let you know that I've managed to use the library to auto-generate list of hooks from active plugins and theme in a WP install. Still tidying things up but I'm glad you made this library, which is just working so wonderfully well!

If you're interested, I posted the original problem that led me to your library at this post on the Advanced WordPress facebook group, where you can also see a screenshot of an earlier version of the plugin I'm building. It's not at the level of where QM is at by any stretch, but I'm quite stoked about it as I'm just learning my way into creating plugins and submitting them to the .org repo. This one would be my third.

Have a great weekend John!

johnbillion commented 2 years ago

Glad to hear it's useful!

qriouslad commented 2 years ago

Hi @johnbillion

Just a quick update that my plugin that uses wp-hooks-generator has been approved for the .org repo: https://wordpress.org/plugins/system-dashboard/

Thanks again and have a great weekend! Bowo