Skip to content
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

Execute PHAR hook installation without an autoloader #248

Open
JanWennrichPCSG opened this issue Apr 29, 2024 · 2 comments
Open

Execute PHAR hook installation without an autoloader #248

JanWennrichPCSG opened this issue Apr 29, 2024 · 2 comments

Comments

@JanWennrichPCSG
Copy link

Hello everyone,

I'm running CaptainHook in a somewhat "special" environment.
CaptainHook is "installed" as the PHAR file via PHIVE.
The git repository I want to use CaptainHook for, is a plugin for a PHP software.

Therefore my repository/plugin does not have it's own vendor/autoload.php.
The autoloader is buried somewhere deep inside the "parent" software.
Thus I can/want not to specify the path to the autoloader when running php captainhook.phar install.

As I'm using the standalone PHAR version of CaptainHook and do not intend to install CaptainHook plugins/hooks via composer, I was wondering if it is possible to execute the install without an autoloader.

Is this currently possible?

@sebastianfeldmann
Copy link
Collaborator

I have to admit I know this issue for a while now but I haven't gotten around to fix it.
You can trick the Cap'n by using an empty but existing php file as autoloader or if you want you can use the one buried somewhere in your project by using the --bootstrap option

run captainhook install --bootstrap=my/autoloader.php currently the file has to exist. Even if the PHAR file would work without an external autoloader.
I will fix this ASAP, but for now you have to use the --bootstrap workaround.

@JanWennrichPCSG
Copy link
Author

Thank you for your quick response!

Using an empty PHP file works great, I'll stick to this for now - thanks for the tip!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants