triniti / sys
Php library that provides implementations for triniti:sys schemas.
Installs: 6 532
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 16
Forks: 0
Open Issues: 2
Requires
- php: >=7.1
- ext-openssl: *
- gdbots/ncr: ^1.0
- gdbots/uri-template: ^1.0
- triniti/schemas: ^1.0
Requires (Dev)
- guzzlehttp/guzzle: ^6.2
- phpunit/phpunit: ^6.4
- triniti/acme-schemas: ^1.0
- twig/twig: ^2.7
This package is auto-updated.
Last update: 2021-06-16 23:18:10 UTC
README
Php library that provides implementations for triniti:sys schemas. Using this library assumes that you've already created and compiled your own pbj classes using the Pbjc and are making use of the "triniti:sys:mixin:*" mixins from triniti/schemas.
Symfony Integration
Enabling these services in a Symfony app is done by importing classes and letting Symfony autoconfigure and autowire them.
config/packages/sys.yml:
services: _defaults: autowire: true autoconfigure: true public: false Triniti\Sys\: resource: '%kernel.project_dir%/vendor/triniti/sys/src/**/*' bind: $flagset: '%app_vendor%:flagset:%kernel.environment%-%app_name%'
Twig Extension
This library provides an extension with access to flagset values. A flagset is assumed to be one per application, e.g. acme:flagset:prod-web
.
Available functions:
flags_get_all()
- Returns the flagset itself which can be json encoded or used like any other pbj instance.flags_get_boolean(flag, default = false)
flags_get_float(flag, default = 0.0)
flags_get_int(flag, default = 0)
flags_get_string(flag, default = '')
flags_get_trinary(flag, default = 0)
The Twig extension is automatically available if using Symfony autowiring.