devitek/yaml-configuration

Add YAML file support to Laravel Configuration

Installs: 1 739

Dependents: 0

Stars: 5

Watchers: 1

Forks: 3

Open Issues: 1

Language: PHP

1.0.1 2015-03-19 14:11 UTC

README

This package uses Symfony/Yaml parser.

Installing

Add "devitek/yaml-configuration": "1.*" to your composer.json by running :

php composer.phar require devitek/yaml-configuration

And select version : 1.*

Add support in Laravel

You have to replace

$app = new Illuminate\Foundation\Application(

with

$app = new Devitek\Core\Foundation\Application(

in bootstrap/start.php.

How to use

Just use regular php files or use yml or yaml files instead.

PHP :

<?php

return [
    'debug' => false,
    'key' => 'foobar',
];

Will be equivalent to :

YAML

debug: false
key: foobar

Paths Helpers

You can use paths helpers provided by Laravel like that :

routes_file: %app_path%/routes.php
unit_test: %base_path%/behat.yml
main_style: %public_path%/css/style.css
manifest: %storage_path%/meta
  • %app_path% refers to app_path()
  • %base_path% refers to base_path()
  • %public_path% refers to public_path()
  • %storage_path% refers to storage_path()

Enjoy it ! Feel free to fork :) !