PHPackages                             gueff/phimcap - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. gueff/phimcap

ActiveLibrary[Image &amp; Media](/categories/media)

gueff/phimcap
=============

phimcap provides a captcha image you could use in your own html forms.

1.0.0(3y ago)21.2k↓33.3%GPL-3.0-or-laterPHPPHP &gt;=7.4

Since May 7Pushed 3y ago1 watchersCompare

[ Source](https://github.com/gueff/phimcap)[ Packagist](https://packagist.org/packages/gueff/phimcap)[ RSS](/packages/gueff-phimcap/feed)WikiDiscussions 1.0.x Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

**this class provides a captcha image you could use in your own html forms.**

Requirements
============

[](#requirements)

- Linux
- php &gt;=7.4
    - GD Library extension
- existance of a true type font like `FreeMono.ttf`

---

Install
-------

[](#install)

```
{
  "require": {
    "gueff/phimcap":"1.0.*"
  }
}
```

---

How to use
----------

[](#how-to-use)

### ... a `forgotPassword` - Example using [myMVC 3.2.x](https://mymvc.ueffing.net/)

[](#-a-forgotpassword---example-using-mymvc-32x)

assuming your primary working Module is called `Foo`:

#### 1) dealing with html form

[](#1-dealing-with-html-form)

*create a MIX `/forgotPassword/` route, leading to `\Foo\Controller\Index::forgotPassword`*

```
\MVC\Route::MIX(
    ['GET', 'POST'],
    '/forgotPassword/',
    '\Foo\Controller\Index::forgotPassword',
    $oDTRoutingAdditional
        ->set_sLayout($sTheme . '/Frontend/layout/index.tpl')
        ->set_sContent($sTheme . '/Frontend/content/forgotPassword.tpl')
        ->getPropertyJson()
);
```

*`\Foo\Controller\Index::forgotPassword`: create new captcha text &amp; save to Session*

```
public function forgotPassword()
{
    // grab for POSTed captcha; sanitize
    $sCaptcha = substr(
        preg_replace("/[^\\p{L}\\p{N}']+/u", '', get($_POST['captcha'])),
        0,
        strlen(Session::is()->get('mymvc.captcha'))
    );

    if (
        ($sCaptcha === Session::is()->get('mymvc.captcha'))
    )
    {
        // stuff...
    }

    // create new captcha text & save to session
    $sCaptchaText = \Phimcap::text();
    Session::is()->set('mymvc.captcha', $sCaptchaText);

    $sContent = $this->oView->loadTemplateAsString('/Frontend/content/forgotPassword.tpl');
    $this->oView->assign('sContent', $sContent);
}
```

*template `/Frontend/content/forgotPassword.tpl`*

```

    Captcha

```

#### 2) serving the captcha image

[](#2-serving-the-captcha-image)

*create `\Foo\Controller\Index::captcha`*

```
public function captcha()
{
    \Phimcap::image(
        Session::is()->get('mymvc.captcha')
    );
}
```

- here the captcha text for the image is taken from session

*create a `/captcha/` route, leading to `\Foo\Controller\Index::captcha`*

```
\MVC\Route::GET(
    '/captcha/',
    '\Foo\Controller\Index::captcha'
);
```

So the captcha image is callable via

```

```

---

### Customizing

[](#customizing)

#### using different Font

[](#using-different-font)

Phimcap uses `/usr/share/fonts/truetype/freefont/FreeMono.ttf`, which is likely to be installed by default on Ubuntu Linux systems.

If you want a different Font, add the absolute path as second parameter:

```
\Phimcap::image(
    Session::is()->get('mymvc.captcha'),
    '/usr/share/fonts/truetype/msttcorefonts/andalemo.ttf'
);
```

#### text length

[](#text-length)

per default the text length is set to `5`.

you can change it to a value between `5` up to `10` by adding a value as parameter.

```
$sCaptchaText = \Phimcap::text(10);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1105d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1abd030fbb2b4fb3fd4d7e1e58179bd8bc1c7378046fbfdf67427e39e8cf0920?d=identicon)[gueff](/maintainers/gueff)

---

Top Contributors

[![gueff](https://avatars.githubusercontent.com/u/12727687?v=4)](https://github.com/gueff "gueff (2 commits)")

---

Tags

captchaimage-captchaphpphpimagecaptchaphimcap

### Embed Badge

![Health badge](/badges/gueff-phimcap/health.svg)

```
[![Health](https://phpackages.com/badges/gueff-phimcap/health.svg)](https://phpackages.com/packages/gueff-phimcap)
```

###  Alternatives

[stefangabos/zebra_image

A single-file, lightweight PHP library designed for efficient image manipulation featuring methods for modifying images and applying filters

141110.4k6](/packages/stefangabos-zebra-image)[dantsu/php-image-editor

PHP library to easily edit image with GD extension.

34152.1k2](/packages/dantsu-php-image-editor)[lciolecki/php-image-optimizer

PHP image file optimizer (uses https://github.com/bensquire/php-image-optim)

347.4k](/packages/lciolecki-php-image-optimizer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
