gc / app
基本微服务应用程序。
此包的规范存储库似乎已丢失,因此包已被冻结。
v1.0
2018-04-29 03:43 UTC
Requires
- doctrine/dbal: v2.7.1
- gc/jwt-middleware: ^1.0
- silex/silex: ^v2.3.0
- symfony/stopwatch: ^3.2
Requires (Dev)
- guzzlehttp/guzzle: ^6.0
- monolog/monolog: ^1.19.0
- phpunit/phpunit: ^6
This package is not auto-updated.
Last update: 2019-12-27 16:46:36 UTC
README
缓存服务
在测试中,cache
服务将变为 Doctrine\Common\Cache\ArrayCache
。
# Memcache backend
$options = ['backend' => 'memcache', 'host' => '127.0.0.1', 'port' => '11211'];
# Memcached
$options = ['backend' => 'memcached', 'host' => '127.0.0.1', 'port' => '11211'];
# File system backend
$options = ['backend' => 'filesystem', 'directory' => '/path/to/cache/'];
$app = new gc\App(['cacheOptions' => $options]);
// Acces `cache` service, instance of `Doctrine\Common\Cache\CacheProvider`
$cache = $app['cache'];
日志服务
$options = ['name' => 'go1'];
$app = new gc\App(['logOptions' => $options]);
// Access `logger` service, instance of `Psr\Log\LoggerInterface`
$logger = $app['logger'];
HTTP 客户端服务
$options = ['allow_redirects' => false];
$app = new gc\App(['clientOptions' => $options]);
// Access `client` service, instance of `GuzzleHttp\Client`
$client = $app['client'];