Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bearsunday/bear.appmeta
BEAR.Sunday application meta data
https://github.com/bearsunday/bear.appmeta
bearsunday bearsunday-module
Last synced: 30 days ago
JSON representation
BEAR.Sunday application meta data
- Host: GitHub
- URL: https://github.com/bearsunday/bear.appmeta
- Owner: bearsunday
- License: mit
- Created: 2015-02-17T11:01:08.000Z (almost 10 years ago)
- Default Branch: 1.x
- Last Pushed: 2024-01-11T01:35:31.000Z (12 months ago)
- Last Synced: 2024-11-09T08:06:33.429Z (about 2 months ago)
- Topics: bearsunday, bearsunday-module
- Language: PHP
- Homepage:
- Size: 162 KB
- Stars: 1
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# BEAR.AppMeta
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/bearsunday/BEAR.AppMeta/badges/quality-score.png?b=1.x)](https://scrutinizer-ci.com/g/bearsunday/BEAR.AppMeta/?branch=1.x)
[![Code Coverage](https://scrutinizer-ci.com/g/bearsunday/BEAR.AppMeta/badges/coverage.png?b=1.x)](https://scrutinizer-ci.com/g/bearsunday/BEAR.AppMeta/?branch=1.x)
[![Build Status](https://travis-ci.org/bearsunday/BEAR.AppMeta.svg?branch=1.x)](https://travis-ci.org/bearsunday/BEAR.AppMeta)Application meta data value object
* AppMeta object keep the application path such as `$tmpDir`, `$logDir` and `$appDir` in public property by given app name and context.
* `getGenerator()` return `\Generator` to get resource meta data.
```php
use BEAR\AppMeta\Meta;$appMeta = new Meta('MyVendor\HelloWorld');
// provids directory path
// $appMeta->name; // MyVendor\HelloWorld
// $appMeta->appDir; // MyVendor\HelloWorld/src
// $appMeta->logDir; // MyVendor\HelloWorld/var/log
// $appMeta->tmpDir; // MyVendor\HelloWorld/var/tmp// resource meta generator
foreach ($appMeta->getGenerator('*') as $resourceMeta) {
var_dump($resourceMeta->uriPath); // app://self/one
var_dump($resourceMeta->class); // FakeVendor\HelloWorld\Resource\App\One
var_dump($resourceMeta->file); // /path/to/src/Resource/App/One.php
}foreach ($appMeta->getGenerator('app') as $resourceMeta) {
var_dump($resourceMeta->uriPath); // /one
var_dump($resourceMeta->class); // FakeVendor\HelloWorld\Resource\App\One
var_dump($resourceMeta->file); // /path/to/src/Resource/App/One.php
}
```