opxcore/config-cache-files 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

opxcore/config-cache-files

Composer 安装命令:

composer require opxcore/config-cache-files

包简介

The OpxCore config cache file driver.

README 文档

README

Build Status Coverage Status Latest Stable Version Total Downloads License

Installing

composer require opxcore/config-cache-files

Standalone usage:

use OpxCore\Config\ConfigCacheFiles;

$configFiles = new ConfigCacheFiles($path);

Usage with container

use OpxCore\Config\Interfaces\ConfigCacheInterface;
use OpxCore\Config\ConfigCacheFiles;

$container->bind(
    ConfigCacheInterface::class, 
    ConfigCacheFiles::class, 
    ['path' => $path]
);

$configCache = $container->make(ConfigCacheInterface::class);

// or

$container->bind(ConfigCacheInterface::class, ConfigCacheFiles::class);

$configCache = $container->make(ConfigCacheInterface::class, ['path' => $path]);

Where $path is absolute path to folder with configuration cache files.

Loading config cache

$loaded = $configCache->load($config, $profile)

Loads array of configurations from path given in a constructor. If $profile is not set driver will search file with name config.cache, in other case name will be config.given_profile.cache. If file exists and not expired (this option stored inside file) array of configuration will be loaded to $config variable and true would be returned as function return value. In all other cases function returns false and $config variable would be not affected.

Saving config cache

$configCache->save($config, $profile, $ttl)

Saves $config array to file (see loading). $ttl is time to live for cached data in seconds.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-02-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固