PHPackages                             thefredfox/cakephp-ip-behavior - 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. thefredfox/cakephp-ip-behavior

ActiveCakephp-plugin

thefredfox/cakephp-ip-behavior
==============================

IpBehavior plugin for CakePHP

11481PHP

Since Mar 14Pushed 10y ago1 watchersCompare

[ Source](https://github.com/TheFRedFox/cakephp-ip-behavior)[ Packagist](https://packagist.org/packages/thefredfox/cakephp-ip-behavior)[ RSS](/packages/thefredfox-cakephp-ip-behavior/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

IpBehavior plugin for CakePHP
=============================

[](#ipbehavior-plugin-for-cakephp)

Description
-----------

[](#description)

An Ip Behavior for the Database Framework of CakePHP, which fills a specified field of an entity with the current client ip taken from the current request.

This plugin should work lovely with the [IpType](https://github.com/TheFRedFox/cakephp-ip-type) plugin.

Installation
------------

[](#installation)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).

The recommended way to install composer packages is:

```
composer require thefredfox/cakephp-ip-behavior
```

After that you have to load the plugin in your application's bootstrap file and map the type for the database as follows:

```
Plugin::load('IpBehavior', ['bootstrap' => true]);
```

In the Table class itself you have to add this behavior:

```
// in your Entity Table class (eg. UsersTable)

public function initialize(array $config) {
    //...
    $this->addBehavior('IpBehavior.Ip');
    //...
}
```

The default is, that the behavior will use the field named 'ip', but you can change the configurations like this:

```
// in your Entity Table class (eg. UsersTable)

public function initialize(array $config) {
    //...
    $this->addBehavior('IpBehavior.Ip', ['fields' => ['other_ip_field']);
    //...
}
```

and if you want that the ip should always be stored:

```
// in your Entity Table class (eg. UsersTable)

public function initialize(array $config) {
    //...
    $this->addBehavior('IpBehavior.Ip', ['fields' => ['ip' => 'always']);
    // respectively
    $this->addBehavior('IpBehavior.Ip', ['fields' => ['other_ip_field' => 'always']);
    //...
}
```

In that way you can store the creators and the modifiers ip:

```
// in your Entity Table class (eg. UsersTable)

public function initialize(array $config) {
    //...
    $this->addBehavior('IpBehavior.Ip', ['fields' => ['ip', 'other_ip_field' => 'always']);
    //...
}
```

The 'new' configuration is default and you don't need to explicitly set it.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

[![TheFRedFox](https://avatars.githubusercontent.com/u/5676670?v=4)](https://github.com/TheFRedFox "TheFRedFox (13 commits)")

---

Tags

behaviorcakephpcakephp3ipmodelplugin

### Embed Badge

![Health badge](/badges/thefredfox-cakephp-ip-behavior/health.svg)

```
[![Health](https://phpackages.com/badges/thefredfox-cakephp-ip-behavior/health.svg)](https://phpackages.com/packages/thefredfox-cakephp-ip-behavior)
```

PHPackages © 2026

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