Install Yaconf on centos

Source: Internet
Author: User

Install Yaconf on centos
What is Yaconf? You can see:

  • Http://www.laruence.com/2015/06/12/3051.html
Installation:
git clone https://github.com/laruence/yaconf.gitcd yaconfphpize./configure --with-php-config=/usr/local/php/bin/php-config makemake install
Configure PHP. ini:
Vi/usr/local/php/etc/php. ini: [Yaconf] extension = yaconf. so # extension reference yaconf. directory =/home/web/conf # directory of the conf file yaconf. check_delay = 100 # Heartbeat check time. If it is 0, no check is performed. However, if it is modified, restart PHP.
Run:

-When PHP is loaded, it first searches for all INI files in/home/web/conf and parses them.-The parsed content is resident in the memory and calls PHP in php code. the ini value is called in the same format;

Set the INI File

/Home/web/conf/test. ini

foo="bar"phpversion=PHP_VERSION
Methods, only get and has methods:
# Read value: echo Yaconf: get ("test. foo "); // test is the name of the configuration file # determine whether this item has been set echo Yaconf: has (" test. foo "); // test is the name of the configuration file.
Special definition-array:

Definition:

arr[]=1arr.1=2

Read:

Yaconf: get ("test. arr.1"); # Read the specified Yaconf: get ("test. arr"); # Read the Array
Special definition-map type

Definition:

; You can use semicolons to write comments map2.foo. name = yaconfmap2.foo. year = 2015

Read:

Yaconf::get("test.map2.foo.name");
Special definition-group

Definition:

[parent]parent="base"children="NULL"[children:parent]children="children"

Read:

Yaconf: get ("test"); # An array in the KV format is returned. You can also use the. interval to access the array accurately.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.