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

PHP: Publish as composer package and provide composer installation steps #14

Closed
JPustkuchen opened this issue Oct 5, 2022 · 6 comments

Comments

@JPustkuchen
Copy link

JPustkuchen commented Oct 5, 2022

Hi and thank you for this GREAT project! :)

We're currently writing a Drupal CMS integration module for IconCaptcha (as extension to the widely used CAPTCHA module).
Drupal 8+ uses composer just as many many other PHP projects, so I'd like to suggest to provide installation steps using composer here: https://github.com/fabianwennink/IconCaptcha-Plugin-jQuery-PHP/wiki/How-To-Use#download as alternative to download.

Currently no IconCaptcha composer package can be found here: https://packagist.org/?query=iconcaptcha
But it would be great, if you could add it. It's quite simple and connects to you GitHub repo:

In a later step one could discuss to split the JS part of into a separate package or even use NPM, but that's a second step and I created a separate issue for this: fabianwennink/IconCaptcha-Widget#3

To easily publish your package on composer, see the "Publishing Packages" steps on the page linked above.

Thanks! :)

--
Tracking the status of this dependency for Drupal here: https://www.drupal.org/project/icon_captcha/issues/3313589

@JPustkuchen JPustkuchen changed the title Provide composer installation steps for PHP PHP: Publish as composer package and provide composer installation steps Oct 5, 2022
@fabianwennink
Copy link
Owner

fabianwennink commented Oct 10, 2022

Hi @JPustkuchen! Support for Composer is something I've been wanting to add to IconCaptcha for a while now, but I just never got around to actually adding it. As you stated, it shouldn't be too difficult to add Composer to the project. However due to the way the captcha-request.php file works in combination with the JS ajax call, I will have to figure out a way to still be able to call the code in the captcha-request.php, without having the JS code call a script in the vendor folder... Perhaps moving the code to a class, and providing public functions which (can be implemented by developers themselves in a routing file of some sort) might do the trick. Installation instructions for standalone PHP installations (not using Composer) will also need to be updated accordingly.

I'll work on this for a bit when I have time over the next couple of days. You can follow the development in the feature/composer branch.

@JPustkuchen
Copy link
Author

JPustkuchen commented Oct 12, 2022

@fabianwennink thanks a lot for your response! The issue you mention is based on the missing separation of the API logic from the public standalone .php file controller implementation captcha-request.php.

Only the library with the API methods (see #15) should live in composer. The standalone implementation (controller captcha-request.php file) uses that library, but isn't installed from composer, as it's just one example how to use the API, should be simplified and put into the public webserver directory by the user, not by composer.

@fabianwennink
Copy link
Owner

fabianwennink commented Nov 9, 2022

Hi @JPustkuchen. Support for Composer has been added to the project in the feature/composer branch, which was merged into the develop branch a couple of days ago. Once development of v4 is completed, I will publish the package to Packagist. For now, you can use the new development version by directly using the repository in your project if you wish to do so. However, do note that I'm still actively developing the next version and that a lot might still change in the upcoming week(s).

I'm closing this issue in favor of continuing the conversation in issue #15.

@JPustkuchen
Copy link
Author

Great work @fabianwennink, very busy currently, but I'll keep an eye on the progress here and the discussion in #15 - once your refactoring is done or you need feedback, feel free to contact me over there! :)

Willing to help asap, sorry!

@menturion
Copy link

Hi,
Is there an expected release date for v4?
I would like to wait for the composer package before using this really nice Captcha library.

Repository owner deleted a comment from JPustkuchen Jul 26, 2023
@fabianwennink
Copy link
Owner

fabianwennink commented Jul 26, 2023

Hi @menturion! This issue was closed in favor of continuing the conversation in discussion #29.

I'll post an update there later, but for now: development of v4 is basically finished, some minor changes still need to be implemented, as well as refactoring and updating the readme + wiki pages. Once that is all done, I'll release v4. I can't really give you any accurate release date, as IconCaptcha is a hobby project of mine which I work on if I have time after work (which won't be much at the moment). But mid-October, at about the 1 year mark since development of 4v started seems like a good date to strive for. For now, feel free to try out the development version in the develop branch.

Edit: the update has also been posted in the mentioned discussion.

Repository owner locked as resolved and limited conversation to collaborators Jul 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants