crazy-max/cws-captcha

This package is abandoned and no longer maintained. No replacement package was suggested.

PHP class to generate a captcha to avoid spam.

1.7.2 2019-10-24 21:41 UTC

This package is auto-updated.

Last update: 2019-11-14 15:30:25 UTC


README

Latest Stable Version Minimum PHP Version Build Status Code Quality Become a sponsor Donate Paypal

⚠️ Abandoned project

This project is not maintained anymore and is abandoned. Feel free to fork and make your own changes if needed.

Thanks to everyone for their valuable feedback and contributions.

About

PHP class to generate a captcha to avoid spam.

Installation

composer require crazy-max/cws-captcha

And download the code:

composer install # or update

Getting started

See tests/test.php, tests/testCaptcha.php files samples to help you.

To create a captcha, copy/edit testCaptcha.php file and insert this in your HTML :

<img src="testCaptcha.php" />

Example

Methods

process - Process the captcha generation.
check - Static method that checks the captcha code entered.

getWidth - Captcha width in px.
setWidth - Set the captcha width in px.
getHeight - Captcha height in px.
setHeight - Set the captcha height in px.
getMinLength - Captcha minimum length.
setMinLength - Set the captcha minimum length.
getMaxLength - Captcha maximum length.
setMaxLength - Set the captcha maximum length.
getBgdColor - Hexadecimal background color.
setBgdColor - Set the hexadecimal background color.
getBgdTransparent - The background transparent for PNG image type.
setBgdTransparent - Set background transparent for PNG image type. If enabled, this will disable the background color.
getFgdColors - Hexadecimal foreground colors list for font letters.
setFgdColors - Set the Hexadecimal foreground colors list for font letters.
getFonts - Fonts definition (letter_space, min and max size, filename).
getMaxRotation - Max clockwise rotations for a letter.
setMaxRotation - Set the max clockwise rotations for a letter.
getPeriod - Generated image period (x, y).
setPeriod - Set the generated image period (x, y).
getAmplitude - Generated image amplitude (x, y).
setAmplitude - Set the generated image amplitude (x, y).
getBlur - The blur effect using the Gaussian method.
setBlur - Add blur effect using the Gaussian method.
getEmboss - The emboss effect.
setEmboss - Add emboss effect.
getPixelate - The pixelate effect.
setPixelate - Add pixelate effect.
getFormat - Image format.
setPngFormat - Set the png image format. (default)
setJpegFormat - Set the jpeg image format.
getError - The last error.

How can I help ?

All kinds of contributions are welcome 🙌! The most basic way to show your support is to star 🌟 the project, or to raise issues 💬 You can also support this project by becoming a sponsor on GitHub 👏 or by making a Paypal donation to ensure this journey continues indefinitely! 🚀

Thanks again for your support, it is much appreciated! 🙏

License

MIT. See LICENSE for more details.