Respect / Config

A powerful, small, deadly simple configurator and dependency injection container DSL made to be easy
http://respect.github.io/Config
Other
98 stars 7 forks source link

Config writing gruidelines #21

Open augustohp opened 12 years ago

augustohp commented 12 years ago

We should keep a nice and small subset of guidelines on wrtting INI files, mainly to be used as a requirement to make a INI a Respected, thought something like this:

alganet commented 12 years ago

I also believe we need a mandatory comment for each INI file. Something like a #!/bin/bash that shell scripts use. Maybe a ; Container for Doctrine.ini on the first line should do. It's human readable and machine readable as well and if one day we need to filter out INIs for Config we could use it.

Another commenting and structuring guidelines would also help, like keeping primitive configurations on top and dependency arguments on bottom, both clearly identified as such.

augustohp commented 12 years ago
; Doctrine2.ini

; ... ini bla ble bli Foo bar

repo[] = Doctrine/phar ; Doctrine phar repository (Foundation-like)
alganet commented 12 years ago

Main rationale for repo[], as we discussed yesterday, is to point to a specific repository. We could use the new git 1.7 sparse checkout to point to a single library directory.

Use cases:

repo[Doctrine] = doctrine/doctrine2/lib/Doctrine ; Points to the folder lib/Doctrine inside http://github.com/doctrine/doctrine2
repo[Doctrino] = git://example.com/sample.git/lib/Doctrino ; Points to the folder lib/Doctrino inside the repo on custom domain

GitHub is the default, but any git could do the work. I've also added the key as a string that reflects the namespace we're importing.

Dependencies could be tracked like this:

repo[Zend\Dom] = framework/zf2/library/Zend/Dom ; This is a dependency
repo[Respect\Template] = Respect/Template/library
alganet commented 11 years ago

We should ignore this repo[] thing for this issue. That was about something else that we've abandoned in favor of Aeronautics\aero.

Anyway we should write some guidelines to keep INI files shiny.

nickl- commented 11 years ago

+0