From 2012808bc605471992a1c281750bbf1026a2dff6 Mon Sep 17 00:00:00 2001 From: Olaf Date: Fri, 3 Jan 2020 00:43:31 +0100 Subject: [PATCH] docs (Readme) update README.md --- README.md | 100 ++++++++++++------------------------------------------ 1 file changed, 21 insertions(+), 79 deletions(-) diff --git a/README.md b/README.md index ec9397a..dcbd7ec 100644 --- a/README.md +++ b/README.md @@ -11,106 +11,45 @@ It uses [gregwar/captcha](https://github.com/Gregwar/Captcha) as captcha generat Compatibility with Symfony ========================== -If you are using Symfony `< 2.8`, you should use version `1.*` +| CaptchaBundle | Symfony | +|:---------------:|:-------:| +| 3.* | 5.* | +| 2.* | \>= 2.8 | +| 1.* | < 2.8 | -If you are using Symfony `>= 2.8`, you should use version `2.*` Installation ============ ### Step 1: Download the GregwarCaptchaBundle -Ultimately, the GregwarCaptchaBundle files should be downloaded to the -'vendor/bundles/Gregwar/CaptchaBundle' directory. - -You can accomplish this several ways, depending on your personal preference. -The first method is the standard Symfony method. - -***Using Composer*** - -Use composer require to download and install the package. +Use composer require to download and install the package. +At the end of the installation you can automaticly create the configuration thanks to the Symfony recipe. ``` bash composer require gregwar/captcha-bundle ``` -***Using the vendors script*** - -Add the following lines to your `deps` file: - -``` - [GregwarCaptchaBundle] - git=http://github.com/Gregwar/CaptchaBundle.git - target=/bundles/Gregwar/CaptchaBundle - version=origin/2.0 <- add this if you are using Symfony 2.0 -``` - -Now, run the vendors script to download the bundle: - -``` bash -$ php bin/vendors install -``` - -***Using submodules*** - -If you prefer instead to use git submodules, then run the following: - -``` bash -$ git submodule add git://github.com/Gregwar/CaptchaBundle.git vendor/bundles/Gregwar/CaptchaBundle -$ git submodule update --init -``` - -### Step 2: Configure the Autoloader - -If you use composer, you can skip this step. - -Now you will need to add the `Gregwar` namespace to your autoloader: - -``` php -registerNamespaces(array( - // ... - 'Gregwar' => __DIR__.'/../vendor/bundles', -)); -``` -### Step 3: Enable the bundle - -Finally, enable the bundle in the kernel: - -```php -add('captcha', CaptchaType::class); // That's all ! - // If you're using php<5.5, you can use instead: - $builder->add('captcha', 'Gregwar\CaptchaBundle\Type\CaptchaType'); // ... ``` @@ -123,7 +62,7 @@ Options You can define the following configuration options globally: * **image_folder**: name of folder for captcha images relative to public web folder in case **as_file** is set to true (default="captcha") -* **web_path**: absolute path to public web folder (default="%kernel.root_dir%/../web") +* **web_path**: absolute path to public web folder (default='%kernel.project_dir%/public') * **gc_freq**: frequency of garbage collection in fractions of 1 (default=100) * **expiration**: maximum lifetime of captcha image files in minutes (default=60) @@ -155,7 +94,7 @@ number of lines depends on the size of the image). (default=null) Example : -```php +``` php