PHPackages                             rikstone/php-cpe - 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. rikstone/php-cpe

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rikstone/php-cpe
================

A package that enables working with Common Platform Enumeration (CPE)

v0.5.0(7mo ago)00MITPHPPHP &gt;=8.1

Since Oct 13Pushed 5mo agoCompare

[ Source](https://github.com/Rikstone/php-cpe)[ Packagist](https://packagist.org/packages/rikstone/php-cpe)[ RSS](/packages/rikstone-php-cpe/feed)WikiDiscussions main Synced 1mo ago

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

PHP CPE Library
===============

[](#php-cpe-library)

PHP library for working with CPE (Common Platform Enumeration)

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

[](#installation)

```
composer require rikstone/php-cpe
```

Features
--------

[](#features)

- Parse and build CPE URIs (2.2 and 2.3)
- Convert between versions (2.2 ↔ 2.3)
- Typed classes for each CPE version
- Field normalization according to MITRE rules

Example
-------

[](#example)

**Creating a CPE 2.2**

```
use Rikstone\Cpe\Cpe22;
use Rikstone\Cpe\Part;

$cpe = (new Cpe22())
    ->setPart(Part::H)
    ->setVendor('dell')
    ->setProduct('inspiron')
    ->setVersion('8500');

echo $cpe;
```

**Creating a CPE 2.3**

```
use Rikstone\Cpe\Cpe23;
use Rikstone\Cpe\Part;

$cpe = (new Cpe23())
    ->setPart(Part::A)
    ->setVendor('f5')
    ->setProduct('nginx')
    ->setVersion('0.3.31');
//    ->setUpdate()
//    ->setEdition()
//    ->setLanguage()
//    ->setSwEdition()
//    ->setTargetSw()
//    ->setTargetHw()
//    ->setOther();

echo $cpe;
// cpe:2.3:a:f5:nginx:0.3.31:*:*:*:*:*:*:*
```

**Parsing a CPE 2.2 string**

```
$cpe = Cpe22::fromString('cpe:/a:zoom:zoom_client_for_vdi:5.7.1');

echo $cpe->getVersion(); // 5.7.1
```

**Converting between CPE versions**

**Convert 2.2 → 2.3**

```
use Rikstone\Cpe\CpeConverter;
use Rikstone\Cpe\Cpe23;
use Rikstone\Cpe\Cpe22;

$source = Cpe22::fromString('cpe:/o:microsoft:windows_2000');

$cpe23 = (new Converter())->convert($source, Cpe23::class);

echo $cpe23; // cpe:2.3:o:microsoft:windows_2000:*:*:*:*:*:*:*:*
```

**Convert 2.3 → 2.2**

```
use Rikstone\Cpe\CpeConverter;
use Rikstone\Cpe\Cpe23;
use Rikstone\Cpe\Cpe22;

$source = Cpe23::fromString('cpe:2.3:a:zoom:zoom_client_for_vdi:5.7.1:*:*:*:*:*:*:*');

$cpe22 = (new Converter())->convert($source, Cpe22::class);

echo $cpe22; // cpe:/a:zoom:zoom_client_for_vdi:5.7.1
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance68

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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

218d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/956ac458fb6cf960273f6cebde4f55b0d833b1ffe1d27123afd4534d127f6ceb?d=identicon)[Rikstone](/maintainers/Rikstone)

---

Top Contributors

[![Rikstone](https://avatars.githubusercontent.com/u/46562501?v=4)](https://github.com/Rikstone "Rikstone (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rikstone-php-cpe/health.svg)

```
[![Health](https://phpackages.com/badges/rikstone-php-cpe/health.svg)](https://phpackages.com/packages/rikstone-php-cpe)
```

###  Alternatives

[lbaey/chromedriver

Utility for installing Chromedriver, whatever platform you are on, for use with Behat

1459.5k1](/packages/lbaey-chromedriver)

PHPackages © 2026

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