PHPackages                             kaz29/phai - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. kaz29/phai

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

kaz29/phai
==========

Phai is PSR-15 compliant middleware for Application Insights.

1.0.11(2y ago)19.0k↓16.7%1[3 PRs](https://github.com/kaz29/phai/pulls)MITPHP

Since Jan 22Pushed 2y ago1 watchersCompare

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

READMEChangelogDependencies (5)Versions (17)Used By (0)

Phai - Application Insights PHP middleware
==========================================

[](#phai---application-insights-php-middleware)

Phai is PSR-15 compliant middleware for [Application Insights](https://docs.microsoft.com/ja-jp/azure/azure-monitor/app/app-insights-overview).

[![Build Status](https://camo.githubusercontent.com/f802e64c0bfe20f2f2a91f44cba396a7760019535e75da64acc12efb453aa8bc/68747470733a2f2f6465762e617a7572652e636f6d2f6b617a32392f706861692f5f617069732f6275696c642f7374617475732f6b617a32392e706861693f6272616e63684e616d653d6d6173746572)](https://dev.azure.com/kaz29/phai/_build/latest?definitionId=2&branchName=master)

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

[](#installation)

Install the latest version with

```
$ composer require kaz29/phai:dev-master

```

Basic Usage
-----------

[](#basic-usage)

Framework Integrations
----------------------

[](#framework-integrations)

Frameworks or libraries using PSR-15 can be used very easily with this middleware.

### Slim3

[](#slim3)

- [Slim3 example](https://github.com/kaz29/phai/tree/master/examples/slim3)

#### How to setup

[](#how-to-setup)

```
$ cd examples/slim3
$ composer install
$ env APPLICATION_INSIGHTS_KEY='Your application insights "Instrumentation Key"' php -S localhost:8080 -t public public/index.php

```

### CakePHP-3.x

[](#cakephp-3x)

- [CakePHP example](https://github.com/kaz29/phai/tree/master/examples/cakephp)

#### Hot to setup

[](#hot-to-setup)

```
$ cd examples/cakephp
$ composer install
$ env APPLICATION_INSIGHTS_KEY='Your application insights "Instrumentation Key"' ./bin/cake server

```

### Laravel

[](#laravel)

TBD

Author
------

[](#author)

Kazuhiro Watanabe - cyo \[at\] mac.com - [https://twitter.com/kaz\_29](https://twitter.com/kaz_29)

License
-------

[](#license)

Phai is licensed under the MIT License - see the LICENSE file for details

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity65

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

Recently: every ~138 days

Total

12

Last Release

984d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/44de8529c667030c187b91e31c795189fa17a4918de89c497053057973a56704?d=identicon)[kaz29](/maintainers/kaz29)

---

Top Contributors

[![kaz29](https://avatars.githubusercontent.com/u/63869?v=4)](https://github.com/kaz29 "kaz29 (25 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kaz29-phai/health.svg)

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

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.8k18.5M1.6k](/packages/cakephp-cakephp)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2222.9M248](/packages/open-telemetry-sdk)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)[pagemachine/typo3-formlog

Form log for TYPO3

23225.3k6](/packages/pagemachine-typo3-formlog)[rareloop/lumberjack-core

A powerful MVC framework for the modern WordPress developer. Write better, more expressive and easier to maintain code

42155.0k19](/packages/rareloop-lumberjack-core)

PHPackages © 2026

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