Download the PHP package omranjamal/real-captcha without Composer

On this page you can find all versions of the php package omranjamal/real-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 real-captcha

RealCaptcha

A PHP Library that uses the PHP-GD Extension to generate Captchas with only PHP.
RealCaptcha is released under the MIT License. Visit the project Homepage for more information.

Note: This code is still in its Beta stage so it maybe prone to many bugs...
Note: The Fonts included here are not created or owned by the author of the code, but none the less, their liscenses are open-source, commercial-friendly and permit redistribution, Check them out yourself.

Features

Installation

The simplest method is using Composer. Just require it in your composer.json file as such:

To incluude it in your project, include the composer autoloader and just create new objects of the RealCaptcha class under the omranjamal\RealCaptcha namespace as such:

Alternatively you could manually clone or download this reppository and directly include the Class file in and create an object of omranjamal\RealCaptcha\RealCaptcha

Basic Usage

Basic

Configuring

All three of these code output similar Captchas to the browser in JPG Format.

While Initializing

The Settings you provide at Initialzation will be used everytime the generate() method is called.

Using the set() method

The settings you define with the set() method will overwrite the settings you provided at initialization and will be used every time the generate() method is called.

While Generating

The generate() method will give high priority to the settings passed to it as an argument. These setting will be forgotten as soon as the captcha is finished generating.

Dealing with output

The generate() method returns an Output object it has two methods and a buch of Properties.

The Methods

The Properties

Example

This example generates a captcha and stores the captcha text in a session variable so that it can be matched later and output the captcha image to browser and also daves the image to a file named example.jpg

Saving Captcha to file

To save captcha to file, you can use the file( file_path, format, quality) method.

Full List of settings

Advanced Usage

Setting Background and Text color

Using direct Input

Both these codes are correct but work in different ways and the settings persist for different fractions of the run cycle.

Setting at Initialization

Setting at Generator

It is Completely ok to pass String or an Array as input into the generator method, thus both the following teo lines of code are valid

Using Custom Text Generator Function

Unlike Direct Input , Custom Functions cannot be set and declared at the generator method, custom function usage has to be declared in the initialization settings or through the set() method and the function has to be define through the textFunction() method as the first argument. All prior to calling the generate() method in which you intend to use the Custom function.

Example

Fonts

Liscense

RealCaptcha is released under the Homepage for more information.


All versions of real-captcha with dependencies

PHP Build Version
Package Version
Requires ext-gd Version *
php Version >=5.3.0
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 omranjamal/real-captcha contains the following files

Loading the files please wait ....