PHPackages                             flavioheleno/pastry - 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. flavioheleno/pastry

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

flavioheleno/pastry
===================

A Raspberry Pi Information Library

311[3 PRs](https://github.com/flavioheleno/pastry/pulls)PHPCI failing

Since Nov 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/flavioheleno/pastry)[ Packagist](https://packagist.org/packages/flavioheleno/pastry)[ RSS](/packages/flavioheleno-pastry/feed)WikiDiscussions main Synced 5d ago

READMEChangelogDependenciesVersions (4)Used By (0)

Pastry [![Maintainability](https://camo.githubusercontent.com/6c90e8d1002145cea44ecdeda7b5bf0e8f815bffbf7607a4ed67a571a4c3d189/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f32613666636366383033323839346633303530372f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/flavioheleno/pastry/maintainability) [![Total Downloads](https://camo.githubusercontent.com/6ead956413aae773850678e2c4084606668874a080f70b9ab8fbf307ae6b7fb1/68747470733a2f2f706f7365722e707567782e6f72672f666c6176696f68656c656e6f2f7061737472792f646f776e6c6f616473)](//packagist.org/packages/flavioheleno/pastry)
==========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#pastry--)

Pastry is a handy tool to extract information from your [Raspberry Pi](https://www.raspberrypi.org/).

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

[](#installation)

To use Pastry, simple run:

```
composer require flavioheleno/pastry
```

Usage
-----

[](#usage)

The Pastry library is super straightforward to use.

```
/* Probe the system for information */
$pi = Pastry\Pi::probe();

/* Board details */
$board = $pi->getBoard();

$board->getHardware();
// string(7) "BCM2711"
$board->getRevision();
// string(6) "d03114"
$board->getSerial();
// string(16) "xxxxxxxxxxxxxxxx"
$board->getModel();
// string(30) "Raspberry Pi 4 Model B Rev 1.4"

/* CPU details */
$cpu = $pi->getCpu();

$cpu->getCount();
// int(4)
$cpu->getModelName();
// string(27) "ARMv7 Processor rev 3 (v7l)"
$cpu->getBogoMips();
// float(108)
$cpu->getFeatures();
// array(15) {
//   [0]  => string(4) "half"
//   [1]  => string(5) "thumb"
//   [2]  => string(8) "fastmult"
//   [3]  => string(3) "vfp"
//   [4]  => string(4) "edsp"
//   [5]  => string(4) "neon"
//   [6]  => string(5) "vfpv3"
//   [7]  => string(3) "tls"
//   [8]  => string(5) "vfpv4"
//   [9]  => string(5) "idiva"
//   [10] => string(5) "idivt"
//   [11] => string(6) "vfpd32"
//   [12] => string(4) "lpae"
//   [13] => string(7) "evtstrm"
//   [14] => string(5) "crc32"
// }
$cpu->getImplementer();
// int(65)
$cpu->getArchitecture();
// int(7)
$cpu->getVariant();
// int(0)
$cpu->getPart();
// int(3336)
$cpu->getRevision();
// int(3)

/* Revision details */
$revision = $pi->getRevision();

$revision->getReleaseDate();
// string(7) "Q2 2020"
$revision->getOvervoltage();
// int(0) - Overvoltage allowed
$revision->getOtpProgram();
// int(0) - OTP programming allowed
$revision->getOtpRead();
// int(0) - OTP reading allowed
$revision->getWarranty();
// int(0) - Warranty is intact
$revision->getNewFlag();
// int(1) - new-style revision
$revision->getMemorySize();
// int(5) - 8GB
$revision->getManufacturer();
// int(0) - Sony UK
$revision->getProcessor();
// int(3) - BCM2711
$revision->getType();
// int(17) - 4B
$revision->getPcbRevision();
// float(1.4)
```

Supported Hardware
------------------

[](#supported-hardware)

The table below lists the tested chips.

RevisionModelContributor[000e](tests/Fixtures/000e.txt)Raspberry Pi Model B Rev 2[flavioheleno](https://github.com/flavioheleno)[9000c1](tests/Fixtures/9000c1.txt)Raspberry Pi Zero W Rev 1.1[flavioheleno](https://github.com/flavioheleno)[902120](tests/Fixtures/902120.txt)Raspberry Pi Zero 2 W Rev 1.0[okiedork](https://github.com/okiedork)[a02082](tests/Fixtures/a02082.txt)Raspberry Pi 3 Model B Rev 1.2[flavioheleno](https://github.com/flavioheleno)[a020d3](tests/Fixtures/a020d3.txt)Raspberry Pi 3 Model B Plus Rev 1.3[okiedork](https://github.com/okiedork)[a21041](tests/Fixtures/a21041.txt)Raspberry Pi 2 Model B Rev 1.1[okiedork](https://github.com/okiedork)[c03115](tests/Fixtures/c03115.txt)Raspberry Pi 4 Model B Rev 1.5[flavioheleno](https://github.com/flavioheleno)[d03114](tests/Fixtures/d03114.txt)Raspberry Pi 4 Model B Rev 1.4[flavioheleno](https://github.com/flavioheleno)[d04170](tests/Fixtures/d04170.txt)Raspberry Pi 5 Model B Rev 1.0[flavioheleno](https://github.com/flavioheleno)If you have a Raspberry Pi and you don't see its model revision listed here, please consider contributing the contents of your `/proc/cpuinfo`.

License
-------

[](#license)

This library is licensed under the [MIT License](LICENSE).

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 71.6% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/42b9c9cbc06973a61587667fc811b853f4d71843f35ba2535f3900083e69ab3f?d=identicon)[flavioheleno](/maintainers/flavioheleno)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (63 commits)")[![flavioheleno](https://avatars.githubusercontent.com/u/471860?v=4)](https://github.com/flavioheleno "flavioheleno (25 commits)")

---

Tags

bcm2711bcm2835bcm2836bcm2837hacktoberfestraspberry-piraspberrypirpi

### Embed Badge

![Health badge](/badges/flavioheleno-pastry/health.svg)

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

###  Alternatives

[afbora/kirby-minify-html

Enable minify HTML output for Kirby

3816.0k1](/packages/afbora-kirby-minify-html)[pwm/s-flow

A lightweight library for defining state machines

742.5k](/packages/pwm-s-flow)

PHPackages © 2026

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