PHPackages                             tad80/optimisticlock - 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. [Database &amp; ORM](/categories/database)
4. /
5. tad80/optimisticlock

ActiveCakephp-plugin[Database &amp; ORM](/categories/database)

tad80/optimisticlock
====================

CakePHP behavior plugin to implement optimistic locking for RDBMS.

1.0.5(11y ago)255GNU GPL version 2PHP

Since Dec 5Pushed 11y ago1 watchersCompare

[ Source](https://github.com/tad80/OptimisticLock)[ Packagist](https://packagist.org/packages/tad80/optimisticlock)[ Docs](https://github.com/tad80/OptimisticLock)[ RSS](/packages/tad80-optimisticlock/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (8)Used By (0)

OptimisticLock
==============

[](#optimisticlock)

CakePHP behavior plugin to implement optimistic locking for RDBMS.

Usage
-----

[](#usage)

Most simply, just load this behavior in your model.

```
class Post extends AppModel {
	public $actsAs = array('OptimisticLock.OptimisticLock');
}
```

You can specify which field to compare and error message shown in Model::validationErrors. Default will be like this.

```
class Post extends AppModel {
	public $actsAs = array(
		'OptimisticLock.OptimisticLock' => array(
			'field' => 'modified',
			'message' => 'Update conflict, another user has already updated the record. Please list and edit the record again.',
		),
	);
}
```

Id and modified timestamp must be sent from your form.

```
$this->Html->form->input('Post.id', array('type' => 'hidden'));
$this->Html->form->input('Post.modified', array('type' => 'hidden', 'name' => 'data[Post][opt_modified]'));
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

Established project with proven stability

 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 ~27 days

Total

6

Last Release

4043d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/868a0f0429e430b5767b3547016994136cf86b056c34351f583faf3adab49fdd?d=identicon)[tad80](/maintainers/tad80)

---

Top Contributors

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

---

Tags

cakephpoptimistic-lock

### Embed Badge

![Health badge](/badges/tad80-optimisticlock/health.svg)

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

###  Alternatives

[josegonzalez/cakephp-upload

CakePHP plugin to handle file uploading sans ridiculous automagic

5451.3M9](/packages/josegonzalez-cakephp-upload)[muffin/trash

Adds soft delete support to CakePHP ORM tables.

851.3M11](/packages/muffin-trash)[admad/cakephp-sequence

Sequence plugin for CakePHP to maintain ordered list of records

46489.9k6](/packages/admad-cakephp-sequence)[cpierce/cakephp-sybasedb

CakePHP plugin to handle PDO MSSQL Connections using dblib

1033.3k](/packages/cpierce-cakephp-sybasedb)[imsamurai/cakephp-serializable-behaviour

Behavior for saving and reading serialized data from/into database

147.7k3](/packages/imsamurai-cakephp-serializable-behaviour)

PHPackages © 2026

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