{"id":18885293,"url":"https://github.com/sandstorm/configloader","last_synced_at":"2025-07-15T11:08:58.823Z","repository":{"id":62540092,"uuid":"174157149","full_name":"sandstorm/ConfigLoader","owner":"sandstorm","description":"Configuration Loader for Neos Flow to load configuration from external sources like Files, XML, or JSON.","archived":false,"fork":false,"pushed_at":"2020-05-29T10:05:02.000Z","size":6,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-07-11T05:02:27.271Z","etag":null,"topics":["flowframework","neos-cms","neos-flow","neos-plugin","neoscms"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sandstorm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-06T14:08:00.000Z","updated_at":"2019-06-16T05:56:28.000Z","dependencies_parsed_at":"2022-11-02T16:00:24.420Z","dependency_job_id":null,"html_url":"https://github.com/sandstorm/ConfigLoader","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sandstorm/ConfigLoader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandstorm%2FConfigLoader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandstorm%2FConfigLoader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandstorm%2FConfigLoader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandstorm%2FConfigLoader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sandstorm","download_url":"https://codeload.github.com/sandstorm/ConfigLoader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandstorm%2FConfigLoader/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265430452,"owners_count":23764003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flowframework","neos-cms","neos-flow","neos-plugin","neoscms"],"created_at":"2024-11-08T07:17:38.969Z","updated_at":"2025-07-15T11:08:58.779Z","avatar_url":"https://github.com/sandstorm.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# External Configuration Loader for Neos Flow\n\nThis package is capable of loading configuration of type Settings from external sources, \nsuch as Files. It can also reformat credentials that are e.g. stored in an env\nvariable as JSON so that it can be used by Flow. It is 100% extensible so you can\ndefine your own Sources and Transformations.\n\n## Using this package\nThis package was developed for the following use case: A Flow application needs to be run\non a VM at a cloud provider. This cloud provider stores environment information,\nsuch as the database name and password, in a JSON-formatted environment variable.\nHere's a short example:\n```\n{\n  \"databases\": [\n    {\n      \"label\": \"mariadb\",\n      \"name\": \"cf-neos-db\",\n      \"instance_name\": \"cf-neos-db\",\n      \"credentials\": {\n        \"hostname\": \"foo.example.com\",\n        \"name\": \"DBNAME_ASDF1234\",\n        \"username\": \"username\",\n        \"password\": \"password\"\n      }\n    }\n  ]\n}\n```\nImagine this information is stored in an environment variable called `SERVICES`.\nThis package's task is to hook into the boot process of Flow very early, read\nthe env variable, transform the JSON into an associative array and inject it\ninto the regular configuration. Here is the configuration needed for this job:\n\n```\nSandstorm:\n  ConfigLoader:\n    externalConfig:\n      # This key can be chosen arbitrarily for each config source\n      'MyJson':\n        # The source's job is to read config from somewhere.\n        # The EnvSource is capable of reading an environment variable.\n        source: Sandstorm\\ConfigLoader\\Source\\EnvSource\n        sourceOptions:\n          name: 'SERVICES'\n        # A transformation transforms the value provided by source.\n        # The JsonTransformation parses a JSON string and returns an\n        # associative array that is stored by this package.\n        transformation: Sandstorm\\ConfigLoader\\Transformation\\JsonTransformation\n\n# Now, you can inject the loaded transformation into the place where you want\n# it to be. Use this format:\n# %EXT:ExternalConfigKey.some.path%\nNeos:\n  Flow:\n    persistence:\n      backendOptions:\n        host: '%EXT:MyJson.databases.0.credentials.hostname%'\n        dbname: '%EXT:MyJson.databases.0.credentials.name%'\n        user: '%EXT:MyJson.databases.0.credentials.username%'\n        password: '%EXT:MyJson.databases.0.credentials.password%'\n```\n\nIf you remove the caches and display the configuration, this is what\nyou would see. The credentials were parsed from the JSON and injected\ninto the config.\n```\n./flow configuration:show --path Neos.Flow.persistence.backendOptions\nConfiguration \"Settings: Neos.Flow.persistence.backendOptions\":\n\nhost: foo.example.com\ndbname: DBNAME_ASDF1234\nuser: username\npassword: password\n``` \n\n## Extensibility\nIt is extremely easy to create your own custom Sources and Transformations.\nJust have them implement the `SourceInterface` / `TransformationInterface`\nprovided with this package, and configure them to be used like in the example\nabove. This way, you can load any configuration format (XML, JSON, ...) from\nany source.\n\n## TODOs\nThis package ignores Application context and injects the same values no matter\nwhether you are in Development or Production (or any other) context. This\nis a missing feature.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandstorm%2Fconfigloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsandstorm%2Fconfigloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandstorm%2Fconfigloader/lists"}