Download the PHP package corneltek/configkit without Composer
On this page you can find all versions of the php package corneltek/configkit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package configkit
ConfigKit
ConfigKit compiles your readable YAML config file to PHP files automatically.
YAML format is clean, smart, easy. but in PHP, you have to parse yaml config file in every request. Parsing YAML costs too much CPU time. How to improve it ?
php-ConfigKit is a library for config files and which is designed for performance, it parses yaml config files for the first time, then compiles the config files into php files, so these config files can be cached in PHP, and it can also be in APC or any other cache backend system.
ConfigKit is simple and fast, all you have to do is defining your config file in YAML format, then use ConfigKit to load the config file.
ConfigKit uses static methods because static methods are faster than object methods.
It checks if a {config file}.php
exists, if so, then checks the file
modification time to decide whether to recompile yaml files.
When APC extension is enabled, PHP source code can be cached in APC, so when you require the pure php source file, it will be faster then reparsing it from yaml.
A generated config PHP file is like:
Requirement
YAML extension
Installation
Composer:
Usage
ConfigCompiler
To compile a yaml config file and get the config stash:
To disable stats check (mtime checking):
If you want to compile the config file manually, you may call the compile
static function to do that:
You may also specify the compiled filename in the arguments:
You can also override some config values during the compilation, by using the override_compile
function:
To test if a compiled file needs to be updated (re-compile):
ConfigLoader
You can manage multiple config files with ConfigLoader
To get config stash
To write all config stash into one cache file:
To load all config stash back:
Generate AppConfigLoader class
All versions of configkit with dependencies
symfony/yaml Version ^2.8|^3.0|^3.2
corneltek/fileutil Version ^1
corneltek/codegen Version >=3.0