Gregwar / Captcha

PHP Captcha library
MIT License
1.73k stars 290 forks source link

Flexible composer install, remove php dependency #34

Closed ekoisa closed 7 years ago

ekoisa commented 8 years ago

Server not always installed natively in local server like ampps, wamp, dkk. So no need php dependency

pawl-rs commented 8 years ago

Having the "ext-gd" requirement is a good idea IMO. It makes it really easy to figure out if the server is missing the dependency.

ampps, wamp, and dkk don't satisfy the php dependency? that seems odd

Gregwar commented 8 years ago

I agree, if there is problem with the dependency itself, guess it's should be reported at composer

ekoisa commented 8 years ago

this is captcha plugin not full stack framework, i think better just notify in readme there's need "php ext-gd" so composer no need to download ext-gd, because every server environment has specific setup

chippyash commented 7 years ago

I think it is reasonable to state the minimum PHP version that the code will run on. On the other hand it is also useful to state the same in the readme. It's what I do in my own readmes (see Strongtype - check out the source to see how I do it using the Shields service.)

I also think that if ext-gd is required, then again it is right to put it in the composer.json file, (and state it in the readme.)

As a side note, looking at the code for Formidable, the readme says users will need to install your captcha lib to use captcha. In fact, you require it in composer. Would be better to make it a composer suggestion, put trap code in the Formidable class that uses your lib to die if it isn't installed, and then have the ext-gd requirement in the captcha lib

madmatt commented 7 years ago

It is recommended by Composer that you include the PHP versions (and extensions required) when creating packages.

As someone installing Composer modules, you can use --ignore-platform-reqs to specifically ignore these platform-level dependencies if you know for example that the machine you are installing composer deps on is not the same as your target infrastructure (e.g. if you are building a package to be deployed to a separate cluster).

Gregwar commented 7 years ago

OK, I agreee @chippyash about the Formidable dependency