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 2w 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 61% 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

4134d 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

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.6k10](/packages/helsingborg-stad-municipio)[andreyryabin/sprint.migration

bitrix migration module

206212.7k2](/packages/andreyryabin-sprintmigration)[pressbooks/pressbooks-book

This theme is named after Canadian media theorist Marshall McLuhan, who coined the phrase “the medium is the message.” It is designed for academic writing and is also suitable for fiction. Headings are set in Cormorant Garamond, and body type is set in Lora.

226.7k](/packages/pressbooks-pressbooks-book)[cpierce/cakephp-sybasedb

CakePHP plugin to handle PDO MSSQL Connections using dblib

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

Behavior for saving and reading serialized data from/into database

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

PHPackages © 2026

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