mario-deluna/hip 问题修复 & 功能扩展

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

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

mario-deluna/hip

最新稳定版本:1.0.0

Composer 安装命令:

composer require mario-deluna/hip

包简介

Ultra F***ing simple human readable data serialization.

README 文档

README

Hip logo

Human Input / Simple human readable data markup.

Build Status License

name: "Hip"
type: "Markup language"
version: 1.0
tags: "markup", "serialization", "language"

Hip does not try to replace any data markups or create a new standard. The target of hip is to be readable and writable by non-technicals folks without out having to explain the syntax.

FAQ

  • Why should I use this? Sorry dude I don't know.. This data parser is an experiment and will maybe be implemented into the ClanCatsFramework 2.1. If you are looking for an approved and stable data serialization format use YAML. If you believe Hip could be useful, feel free, every user makes me happy :)

Installation

This Hip parser is written in PHP using PSR-4 autoloading you can install it using composer.

"require": 
{
    "mario-deluna/hip": "dev-master"
}

Usage

Encoding / Decoding

Decode a hip data string to an array:

Hip\Hip::decode( $hipString );

Encode an array to a hip data string:

Hip\Hip::decode( $myArray );

Reading / Writing files

Read hip file:

Hip\Hip::read( 'my/path/to/file.hip' );

Write hip file:

Hip\Hip::write( 'my/path/to/file.hip', $myArray );

Hip syntax

Simple key values

name: "Zaphod beeblebrox"
job: "President of the Galaxy"

wich equals

{
    "name": "Zaphod beeblebrox",
    "job": "President of the Galaxy"
}

Multi layer

recipe:
    duration: 60
    ingredients: "eggs", "bacon", "cream", "leek"

wich equals

{
    "recipe": 
    {
        "duration": 60,
        "ingredients": [ "eggs", "bacon", "cream", "leek" ]
    } 
}

Array lists

instruments:
    -
    name: "Guitar"
    strings: 6
    --
    name: "Bass"
    strings: 4
    -

wich equals

{
    "instruments": 
    [
        {
            "name": "Guitar",
            "strings": 6
        },
        {
            "name": "Bass",
            "strings": 4
        }
    ] 
}

data types

string: "Hello World"
integer: 42
float: 3.14
yepBool: yes
nopeBool: no
nothing: nil

wich equals

{
    "string": "Hello World",
    "integer": 42,
    "float": 3.14,
    "yepBool": true,
    "nopeBool": false,
    "nothing": null
}

TODO

  • Hip config object / utility
  • Automatic detect the level indicator ( space, tab etc. )
  • more tests...

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固