Skip to content

Support for NEON #56

Description

@feamsr00

Hi There,

May I suggest adding support for config.neon files?

https://ne-on.org/

For miscellaneous reasons, I am unable to use the pull feature here. However in light of its brevity I have simply included the driver below:

<?php
namespace Igorw\Silex;

use Nette\Neon;

class NeonConfigDriver implements ConfigDriver
{
    public function load($filename)
    {
        if (!class_exists('Neon\\Neon')) {
            throw new \RuntimeException('Unable to read neon as the Neon Parser is not installed.');
        }
        $config = Neon\Neon::decode(file_get_contents($filename));
        return $config ?: array();
    }
    public function supports($filename)
    {
        return (bool) preg_match('#\.neon(\.dist)?$#', $filename);
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions