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

site:add allows duplicates #9

Closed
chriscroome opened this issue Jun 13, 2019 · 3 comments
Closed

site:add allows duplicates #9

chriscroome opened this issue Jun 13, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@chriscroome
Copy link
Contributor

chriscroome commented Jun 13, 2019

You can add the same site multiple times, would it be within the scope of this plugin to check for duplicates?

I have looked at doing a duplicate check prior to adding sites to work around this but have found that the php console site:list command doesn't appear to return anything?

Would I best best off reverting to running MySQL queries against the Matomo database or using the API for now?

@mikkeschiren
Copy link
Contributor

I will look into this.

@mikkeschiren mikkeschiren added the bug Something isn't working label Jun 25, 2019
@chriscroome
Copy link
Contributor Author

Thanks for fixing site:list, I wonder if you would consider if it would be useful if it had the option to return more than just the values from the idsite and name columns in the site table?

If you are interested in adding more fields I don't know if this would be best with arguments, for example:

php console site:list --main_url --urls

Or it would be best to simply send the additional data, one thing I'd be interested in is the nature of the YAML output as I'm working with Ansible, perhaps a YAML dictionary output would be a possibility from php console --no-ansi -n --format=yaml site:list?

---
sites:
  1:
    name: foo
    main_url: http://foo.example.com
    urls:
      - http://www.foo.example.com
      - http://foo.example.org
      - http://www.foo.example.org
  2:
    name: bar
    main_url: http://bar.example.com
    urls:
      - http://www.bar.example.com
      - http://bar.example.org
      - http://www.bar.example.org

@mikkeschiren
Copy link
Contributor

Yeah, the output needs work, and think that your suggested output for yaml is the how it should be - I possible work on that later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants