bear / app-meta
BEAR.Sunday application meta information
Installs: 408 899
Dependents: 10
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 3
Open Issues: 0
Requires
- php: ^8.0
- bear/resource: ^1.0
- koriym/psr4list: ^1.0.2
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.4
- phpunit/phpunit: ^9.5.10
README
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.
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 }