Download the PHP package mobicms/captcha without Composer

On this page you can find all versions of the php package mobicms/captcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package captcha

mobicms/captcha

GitHub GitHub release (latest SemVer) Packagist

CI-Analysis CI-Tests Sonar Coverage Quality Gate Status

This library is a simple PHP CAPTCHA. Prevent form spam by generating random Captcha images.

Major features:

Example:

Installation

The preferred method of installation is via Composer. Run the following command to install the package and add it as a requirement to your project's composer.json:

Simply usage (v.5)

Customization (v.5)

You can change CAPTCHA settings through \Mobicms\Captcha\Image class properties.

Image properties

Image: resizing

int $imageWidth = 190, int $imageHeight = 90
Keep in mind that the width of the image will affect the density of the text.
If the characters are very creeping on top of each other and become illegible, then increase the width of the image, reduce the length of the verification code, or the font size.

Image: default font size

int $defaultFontSize = 30
This setting affects the size of all fonts used.

Image: fonts mixer

bool $fontMix = true
If this parameter is set to TRUE (default), a random font will be used for each character in the image.

If you set it to FALSE, then a single, randomly selected font will be used for all characters in the image.

Image: fonts folders

array $fontFolders
You can use your own set of TTF fonts. To do this, specify one or more folders in the array where .ttf font files are located. Keep in mind that this package already has some fonts. If you plan to use them, then merge the arrays.

Image: adjust font

array $fontsTune
Some fonts may have a size that looks too small or large compared to others. In this case, you need to specify an adjustment relative to the default size. Also, if necessary, you can force the specified font to use only uppercase or lowercase characters.

Adjustment parameters are passed to the $fontsTune class property as an array.
Keep in mind that the class already has some adjustments, so if you use fonts from this package, then combine your array of adjustments with an array of $fontsTune properties.

Verification code properties

Verification code: length

int $lengthMin = 4, int $lengthMax = 5
The length of the generated code string will be randomly between the specified minimum and maximum values.

Verification code: character Set

string $characterSet = '23456789ABCDEGHJKMNPQRSTUVXYZabcdeghjkmnpqrstuvxyz'
In this string you can specify a set of characters that will be used randomly when generating the verification code. Avoid using characters that can be interpreted ambiguously, such as O (letter) and 0 (number).

Verification code: excluded сombinations

string $excludedCombinationsPattern = 'rn|rm|mm|ww'
You can use a pattern to specify combinations of adjacent characters that should not appear next to each other. For example, rn can be interpreted as m, and so on...

Verification code: use your own

The Image class already has the ability to generate validation code, which will be sufficient in most use cases. However, if necessary, you can generate the validation code yourself and then pass string to the constructor when the Image class is initialized:

Contributing

Contributions are welcome! Please read Contributing for details.

YAGNI KISS

In our development, we follow the principles of YAGNI and KISS. The source code should not have extra unnecessary functionality and should be as simple and efficient as possible.

License

This package is licensed for use under the MIT License (MIT).
Please see LICENSE for more information.

Our links


All versions of captcha with dependencies

PHP Build Version
Package Version
Requires php Version ~8.2 || ~8.3 || ~8.4
ext-gd Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mobicms/captcha contains the following files

Loading the files please wait ....