{"repo":"Gregwar/Captcha","free":true,"listed":false,"github":"https://github.com/Gregwar/Captcha","clone":"git clone https://github.com/Gregwar/Captcha.git","description":"PHP Captcha library","language":"PHP","stars":1815,"topics":["captcha","php","security","bots","anti-bot","anti-spam"],"license":"MIT","category":"security-tools","readme_excerpt":"Captcha ======= Installation ============ With composer : composer require gregwar/captcha Usage ===== You can create a captcha with the CaptchaBuilder : You can then save it to a file : Or output it directly : Or inline it directly in the HTML page: You'll be able to get the code and compare it with a user input : You can compare the phrase with user input: API === You can use these functions : construct($phrase = null) , constructs the builder with the given phrase, if the phrase is null, a random one will be generated getPhrase() , allow you to get the phrase contents setDistortion($distortion) , enable or disable the distortion, call it before build() isOCRReadable() , returns true if the OCR can be read using the ocrad software, you'll need to have shell exec enabled, imagemagick and ocrad installed buildAgainstOCR($width = 150, $height = 40, $font = null) , builds a code until it is not readable by ocrad build($width = 150, $height = 40, $font = null) , builds a code with the given $width, $height and $font. By default, a random font will be used from the library save($filename, $quality = 80) , saves the captcha in the $filename, with the given quality get($quality = 80) , returns the image data output($quality = 80) , directly outputs the image inline($quality = 80) , returns the jpeg code directly in the HTML page setBackgroundColor($r, $g, $b) , sets the background color to force it (this will disable many effects and is not recommended) setBackgroundAlpha($alpha) ,","default_branch":null,"files":null,"tree":[],"storefront":"/r/Gregwar","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Gregwar/Captcha/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}