PHPackages                             corneltek/configkit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. corneltek/configkit

ActiveLibrary[Caching](/categories/caching)

corneltek/configkit
===================

Fast config toolkit, which provides super lightweight config accessor and loader.

1.6.6(8y ago)1314.1k1[2 issues](https://github.com/c9s/ConfigKit/issues)8MITPHPPHP &gt;=5.3.0

Since Mar 21Pushed 8y ago3 watchersCompare

[ Source](https://github.com/c9s/ConfigKit)[ Packagist](https://packagist.org/packages/corneltek/configkit)[ RSS](/packages/corneltek-configkit/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (22)Used By (8)

ConfigKit
=========

[](#configkit)

[![Build Status](https://camo.githubusercontent.com/27abfbc562f39d4859d21abf1560f2a67e7c73dfcb61c1fec79b7ae8dfe562a3/68747470733a2f2f7472617669732d63692e6f72672f6339732f436f6e6669674b69742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/c9s/ConfigKit)[![Latest Stable Version](https://camo.githubusercontent.com/d34c40b8d4038ef9763abcd6d51640c20ca98a47b18f3078c11b5d836880401c/68747470733a2f2f706f7365722e707567782e6f72672f636f726e656c74656b2f636f6e6669676b69742f762f737461626c65)](https://packagist.org/packages/corneltek/configkit)[![Total Downloads](https://camo.githubusercontent.com/5e59962f3bcbdb85ac8a2c908b7f7785911a2512714e07321092c8e10707559c/68747470733a2f2f706f7365722e707567782e6f72672f636f726e656c74656b2f636f6e6669676b69742f646f776e6c6f616473)](https://packagist.org/packages/corneltek/configkit)[![Latest Unstable Version](https://camo.githubusercontent.com/efc8f37136f89e369470e700c6cd2d5232b855f0fa1984993d18e0d3728a7f03/68747470733a2f2f706f7365722e707567782e6f72672f636f726e656c74656b2f636f6e6669676b69742f762f756e737461626c65)](https://packagist.org/packages/corneltek/configkit)[![License](https://camo.githubusercontent.com/e81d2d871c9c8dcca952185e7b138e30e121058cb2e1feb3c39498068cfd450c/68747470733a2f2f706f7365722e707567782e6f72672f636f726e656c74656b2f636f6e6669676b69742f6c6963656e7365)](https://packagist.org/packages/corneltek/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:

```
