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

Configuration file handling #13

Open
enygma opened this issue Dec 8, 2014 · 6 comments · May be fixed by #62
Open

Configuration file handling #13

enygma opened this issue Dec 8, 2014 · 6 comments · May be fixed by #62

Comments

@enygma
Copy link
Member

enygma commented Dec 8, 2014

It's been suggested in #10 that a configuration file should be added to allow for more customization than just the command line options allow.

Considerations:

  • Format (JSON, XML, YAML, INI)
  • What functionality needs to be configured in it
@hanneskod
Copy link
Contributor

I have some thoughts on this: As a first step I want to move some of the complexity of ScanCommand to a ConfigManager. The manager can be written to handle a ConfigFileInterface, preparing for the actual implementation in a format-agnostic way. I don't think doing this will add to the overall complexity of the project, quite the opposite I think it will make for a better division of concerns.

Any more thoughts on format and structure of the config file?

@hanneskod hanneskod self-assigned this Jan 20, 2015
@redbeardcreator
Copy link
Contributor

My only thought is it should mirror the error suppression annotations from #52.

@hanneskod hanneskod linked a pull request Jan 28, 2015 that will close this issue
@hanneskod
Copy link
Contributor

Here is a suggested configuration file structure. I like json because it is so simple to parse... We also need to decide on a default conf file name. I suggest .psecio-parse.json.

{
    "paths": ["pathOne", "pathTwo"],
    "ignore-paths": ["pathTwo/subpath"],
    "extensions": ["php"],
    "whitelist-rules": ["rulename"],
    "blacklist-rules": ["rulename"],
    "disable-annotations": true,
    "format": "dots",
    "verbose": true,
    "debug": true,
    "ansi": true
}

What do you think? @enygma @redbeardcreator

@redbeardcreator
Copy link
Contributor

It looks good to me. I also prefer JSON. But Any format is fine as long as it's consistent.

@enygma
Copy link
Member Author

enygma commented Jan 28, 2015

yeah, looks good to me too...is the "extensions" setting just to determine the file extensions to check? Would it ever really need to be anything other than .php?

@redbeardcreator
Copy link
Contributor

I have some older projects that used .inc. I believe at the time it was a fairly common practice. Of course, that was PHP 4 when I was able to crash PHP by using too many pass-by-reference calls. But I still have .inc files in the field.

@hanneskod hanneskod removed their assignment Jan 8, 2017
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

Successfully merging a pull request may close this issue.

3 participants