Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conceptual design (question) #45

Closed
yurii-github opened this issue Nov 5, 2019 · 0 comments
Closed

conceptual design (question) #45

yurii-github opened this issue Nov 5, 2019 · 0 comments

Comments

@yurii-github
Copy link

yurii-github commented Nov 5, 2019

| ---------------- | ---
| Version | 0.3/master

Question 1

I guess I'm missing the concept of this package even after reading its code.

I have created 3 projects
https://github.com/yurii-github/composer-config-plugin -- overrides your package for my tweaks purpose
https://github.com/yurii-github/test-config-plugin -- my demo plugin that uses extra data
https://github.com/yurii-github/test-config-plugin-project -- my demo project that uses test plugin

My expected behavior was

  1. I add extra options to test-config-plugin
  2. I include test-config-plugin in test-config-plugin-project
  3. I get cached config as
require_once 'vendor/autoload.php';
$config = require hiqdev\composer\config\Builder::path('aaa');
var_dump($config);

it returns config array instead of cache file. Is it correct?
How to get whole config? This does not work

require_once 'vendor/autoload.php';
$configAll = require hiqdev\composer\config\Builder::path('');
var_dump($configAll);

Question 2

Probably it comes from question 1.. why don't just use some sort of provider class instead of ton of ucommentable json lines in composer.json ? I mean, in Laravel you can use like

  "extra": {
    "laravel": {
      "providers": [
        "SomeProvider"
      ],
    }
  },

So, in your case it could be

  "extra": {
    "config-plugin": {
      "config": "My\\ConfigProviderClass",
      "order": -100
    }
  },

but instead you introduce things like "?" and "$"


what am I doing wrong?

regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant