2017 © Pedro PelĂĄez
 

library lib-tml

Library for parsing and creating our Tabbed Meta Lanuage (TML)

image

openlss/lib-tml

Library for parsing and creating our Tabbed Meta Lanuage (TML)

  • Tuesday, March 26, 2013
  • by nullivex
  • Repository
  • 1 Watchers
  • 0 Stars
  • 79 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

openlss/lib-tml

Library for parsing and creating our Tabbed Meta Lanuage (TML), (*1)

TML is a simple storage language that LSS can use. TML stands for “Tabbed Meta Language” while tabs arent required as a delimiter they are suggested., (*2)

Syntax

  • Each level must be indented by one delimiter (TAB is the default)
  • Name value pairs must be separated by one delimiter (TAB again)
  • Empty arrays must be defined as: name []
  • Anonymous array entries can be added to lists but when converted back to TML they will show with the indexes
  • All TML files require a root element that defines the document

Example

app
        source  /opt/myapp
        mirror  /data/mirror
        blankarray    []
        packages
                usr/lib/news
                        version         0.0.1
                        description     The news library
                        depends
                                main/util/func  0.0.1
                        manifest
                                lib/news.php
                usr/app-web/news
                        version         0.0.1
                        description     News front end
                        depends
                                main/sys/db     0.0.1
                                usr/lib/news    0.0.1
                        manifest
                                ctl/news.php
                                tpl/news.tpl.php
                                news.txt

Usage

use \LSS\TML

//setup our test array
$array = array('test'=>'test1','test2'=>'test3');

//conert array to TML
$tml = TML::fromArray($array);

//convert TML to array
$array = TML::toArray($tml);

Reference

(string) TML::fromArray($arr,$level=0,$newline=true)

  • $arr The array to be parsed into TML
  • $level This is an internal pointer for nested parsing
  • $newline This is an internal flag for nested parsing Returns TML that can be transported as texted and is excellent for compression

(array) TML::toArray($buf)

  • $buf The TML to be parsed Returns an array matching the original input array

The Versions

26/03 2013

dev-master

9999999-dev http://openlss.org

Library for parsing and creating our Tabbed Meta Lanuage (TML)

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3.2

 

function skeleton

26/03 2013

dev-0.0.x-dev

dev-0.0.x-dev http://openlss.org

Library for parsing and creating our Tabbed Meta Lanuage (TML)

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3.2

 

function skeleton

26/03 2013

0.0.2

0.0.2.0 http://openlss.org

Library for parsing and creating our Tabbed Meta Lanuage (TML)

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3.2

 

function skeleton

26/03 2013

0.0.3

0.0.3.0 http://openlss.org

Library for parsing and creating our Tabbed Meta Lanuage (TML)

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3.2

 

function skeleton

26/03 2013

0.0.4

0.0.4.0 http://openlss.org

Library for parsing and creating our Tabbed Meta Lanuage (TML)

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3.2

 

function skeleton

26/03 2013

0.0.5

0.0.5.0 http://openlss.org

Library for parsing and creating our Tabbed Meta Lanuage (TML)

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3.2

 

function skeleton

24/03 2013

0.0.1

0.0.1.0 http://openlss.org

Library for parsing and creating our Tabbed Meta Lanuage (TML)

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3.2

 

function skeleton