edouardtack/loaderyaml

This package is abandoned and no longer maintained. No replacement package was suggested.

LoaderYaml plugin for CakePHP. You can load yaml config files.

dev-master 2016-01-12 13:49 UTC

This package is not auto-updated.

Last update: 2023-02-10 16:14:42 UTC


README

implements YAML specification using Symfony Yaml Component to CakePHP 3 for config files

Requirements

The 3.0 branch has the following requirements:

  • CakePHP 3.0.0 or greater.

Installation

Composer

  • Install the plugin with composer from your CakePHP Project's ROOT directory (where composer.json file is located)
php composer.phar require edouardtack/loaderyaml "dev-master"

OR add this lines to your composer.json

"require": {
  "edouardtack/loaderyaml": "dev-master"
}

And run php composer.phar update

CakePHP configuration

then add this lines to your config/bootstrap.php

Plugin::load('LoaderYaml', ['bootstrap' => false, 'routes' => false]);

And create a directory into config directory called yaml. You can insert your yaml's files.

Usage

Load it

use LoaderYaml\Controller\Component\LoaderComponent;

And use it

$config = LoaderComponent::load('FILENAME.yml');

OR

$this->loadComponent('LoaderYaml.Loader', ['file' => 'FILENAME.yml']);
$config = $this->Loader->get();

OR

$this->loadComponent('LoaderYaml.Loader');
$config = $this->Loader->get('FILENAME.yml');

LICENCE

The MIT License (MIT)

Copyright (c) 2016 Edouard

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.