承接 illchuk/zend-config-cacheproof 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

illchuk/zend-config-cacheproof

Composer 安装命令:

composer require illchuk/zend-config-cacheproof

包简介

Create *.cacheproof.php config files that skip the cache, with custom loading.

README 文档

README

Build Status

Purpose

Caching your config is nice (i.e. using 'module_listener_options' => ['config_cache_enabled' => true]), but this locks your config down tight. What if you need to tweak things a bit for, say, running tests? Enter ZendConfigCacheproof.

Install with composer require illchuk/zend-config-cacheproof.

Then reference in modules.config.php:

return [
    ..., 'ZendConfigCacheproof', ...
];

Easy Start

In your config/autoload, create *.cacheproof.php config files. (As opposed to the usual *.global.php and *.local.php files.) These will be loaded every time.

Useful Start

You may want your configuration to change based on environment variables; install a cacheproof_loaders factory -- see config/cacheproof.global.php.dist -- like the following:

namespace Application\Cacheproof;

use Interop\Container\ContainerInterface;
use Zend\ServiceManager\Factory\FactoryInterface;
use ZendConfigCacheproof\Loader\EnvironmentVariable as EnvLoader;

class LoaderFactory implements FactoryInterface {

    const GLOB_LIVE = './config/autoload/{{,*.}live}.php';
    const ENV_VAR_LIVE = 'INSTANCE_LIVE';

    public function __invoke(
    ContainerInterface $container, $requestedName, array $options = null
    ) {
        $loader = new EnvLoader(static::ENV_VAR_LIVE);
        $loader->setGlob(static::GLOB_LIVE);
        return $loader;
    }

}

Then, your ./config/autoload/{{,*.}live}.php config is live-loaded whenever environment variable INSTANCE_LIVE is true-ish.

Removing Conflicting Config

You may want to remove config too. This can be done as follows:

<?php // in ./config/autoload/cacheproof.php

return [
    'foobar' => new \Zend\Stdlib\ArrayUtils\MergeRemoveKey, // toast it
]

统计信息

  • 总下载量: 39
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固