https://github.com/ml-opensource/n-meta-php
https://github.com/ml-opensource/n-meta-php
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ml-opensource/n-meta-php
- Owner: ml-opensource
- License: mit
- Created: 2020-03-30T13:27:50.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T11:15:57.000Z (almost 3 years ago)
- Last Synced: 2025-08-08T15:49:08.424Z (6 months ago)
- Language: PHP
- Size: 35.2 KB
- Stars: 6
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# N-Meta PHP sdk
[](https://scrutinizer-ci.com/g/monstar-lab-oss/n-meta-php/?branch=master)
[](https://scrutinizer-ci.com/g/monstar-lab-oss/n-meta-php/?branch=master)
[](https://scrutinizer-ci.com/g/monstar-lab-oss/n-meta-php/build-status/master)
[](https://scrutinizer-ci.com/code-intelligence)
## 📝 Introduction
Core of N-Meta, parsing and DTO, A User-Agent header for android and ios apps.
Used to parse the N-Meta headers using following format:
`Meta: [PLATFORM];[ENVIRONMENT];[APP_VERSION];[DEVICE_OS];[DEVICE]`
#### PLATFORM:
Description of the requesting platform, expects values `android`, `ios` or `web`
#### ENVIRONMENT:
Description of the environment the request is targeted at, normally `staging` or `production`
#### APP_VERSION:
Semantic version sting of the requesting client `x.y.z`. Not required if platform is web.
#### DEVICE_OS:
Version of the operating system the request was made from, eg. `10.2`. Not required if platform is web.
#### DEVICE:
Description of the device making the request, eg. `iphone-x`. Not required if platform is web.
## 📦 Installation
To use this package you will need:
* PHP 8.0+
Run
`composer require monstar-lab/n-meta`
or setup in composer.json
`monstar-lab/n-meta: 2.0.x`
## ⚙ Usage
```php
$header = 'ios;production;1.0.0;10.2;iphone-x';
$meta = new NMeta($header);
$meta->getPlatform();
$meta->getVersion();
```
## 🏆 Credits
This package is developed and maintained by the PHP team at [Monstar Lab](http://monstar-lab.com)
## 📄 License
This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)