PHPackages                             travy/cake-tracking - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. travy/cake-tracking

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

travy/cake-tracking
===================

Request tracking middleware used for CakePHP 3 applications

1.0.0(8y ago)112MITPHP

Since Sep 11Pushed 8y ago1 watchersCompare

[ Source](https://github.com/travy/cake-tracking)[ Packagist](https://packagist.org/packages/travy/cake-tracking)[ RSS](/packages/travy-cake-tracking/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

Cake Tracking Plugin
====================

[](#cake-tracking-plugin)

[![Build Status](https://camo.githubusercontent.com/e80dbc926cc9418c4c5c866f82c2362da8d216aed7077b02185988f6d99dd9fd/68747470733a2f2f7472617669732d63692e6f72672f74726176792f63616b652d747261636b696e672e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/travy/cake-tracking)

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

[](#description)

The Cake Tracking Plugin provides Middleware which will record all Request made to a web application. All logging can be customized per application but there is also a default logger which will write to the file system.

In addition, external IP addresses can be blacklisted from the site by adding the address to a blacklist file.

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

[](#installation)

Add the package to your CakePHP projects `composer.json`

```
composer require travy/cake-tracking:1.0
```

Next, be sure to add the plugin to the `config/bootstrap.php` file by executing the following command in the command prompt

```
bin/cake plugin load cake-tracking
```

Now the Middleware can be loaded into the application pipeline by appending it to the MiddlewareQueue found in `src/Application.php'

```
class Application extends BaseApplication
{
    public function middleware($middlewareQueue)
    {
        $middlewareQueue
            ->add(ErrorHandlerMiddleware::class)
            ->add(AssetMiddleware::class)
            ->add(new RoutingMiddleware($this))

            //  add the TrackingMiddleware to the queue
            ->add(new \CakeTracking\Middleware\TrackingMiddleware());

        return $middlewareQueue;
    }
}
```

Finally, you should be able to add any custom configuration necessary to complete the environment.

If you want to use a custom Logger or blacklisting solution (perhaps to store data in a database) then you just need to create a class which implements either `TrackingLoggerInterface` or `BlacklistRepositoryInterface`. Then before adding the Middleware to the MiddlewareQueue, you can specify your custom classes using the built in setter calls.

```
class Application extends BaseApplication
{
    public function middleware($middlewareQueue)
    {
        //  supply the custom classes to the TrackingMiddleware object
        $trackingMiddleware = new \CakeTracking\Middleware\TrackingMiddleware();
        $trackingMiddleware->setBlacklistRepository(new BlacklistDatabaseRepository($configs));
        $trackingMiddleware->setLoggingOperation(new TrackingDatabaseLoggin($configs));

        $middlewareQueue
            ->add(ErrorHandlerMiddleware::class)
            ->add(AssetMiddleware::class)
            ->add(new RoutingMiddleware($this))

            //  supply the instantiated tracker to the queue
            ->add($trackingMiddleware);

        return $middlewareQueue;
    }
}
```

Configurations
--------------

[](#configurations)

The following configurations are optional but will be useful for system setup.

In `config/app.php` add the following:

```
'CakeTracking' => [
    'LogFile' => LOGS . 'bamboo.txt',
    'Blacklist' => LOGS . 'blacklist.txt',
],
```

The LogFile configuration will specify where all Requests should be logged.

Blacklist specifies the location of the blacklist on the system.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

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

Unknown

Total

1

Last Release

3163d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e2e17c26cd91563daf8cfe8e9910f2179aea067ccc7e814958a3b818a34433d3?d=identicon)[travy](/maintainers/travy)

---

Top Contributors

[![travy](https://avatars.githubusercontent.com/u/4945102?v=4)](https://github.com/travy "travy (17 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/travy-cake-tracking/health.svg)

```
[![Health](https://phpackages.com/badges/travy-cake-tracking/health.svg)](https://phpackages.com/packages/travy-cake-tracking)
```

###  Alternatives

[markstory/asset_compress

An asset compression plugin for CakePHP. Provides file concatenation and a flexible filter system for preprocessing and minification.

3761.0M11](/packages/markstory-asset-compress)[cakedc/cakephp-phpstan

CakePHP plugin extension for PHPStan.

40676.6k31](/packages/cakedc-cakephp-phpstan)[dereuromark/cakephp-dto

A CakePHP plugin for generating immutable Data Transfer Objects with full type safety

2988.9k3](/packages/dereuromark-cakephp-dto)[dereuromark/cakephp-geo

A CakePHP plugin around geocoding tools and helpers.

51174.9k4](/packages/dereuromark-cakephp-geo)[cakedc/enum

Enumeration list Plugin for CakePHP 5

30222.5k2](/packages/cakedc-enum)[josegonzalez/cakephp-environments

CakePHP plugin to handle environments-level configuration

4785.9k](/packages/josegonzalez-cakephp-environments)

PHPackages © 2026

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