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

Adding standalone scanner #25

Merged
merged 8 commits into from
Jan 11, 2019

Conversation

gudmdharalds
Copy link
Contributor

This Pull-Request introduces a standalone scanner for the library. It can scan multiple files, specified on the command-line, and output a JSON string just before exiting with the results.

For instance:

$ php svg-scanner.php ~/svgs/myfile.svg 
{
    "totals": {
        "errors": 3
    },
    "files": {
        "\/home\/user\/svgs\/myfile.svg": {
            "errors": 3,
            "messages": [
                {
                    "message": "Suspicious tag 'blabla'",
                    "line": 16
                },
                {
                    "message": "Suspicious tag 'script'",
                    "line": 15
                },
                {
                    "message": "Suspicious attribute 'version'",
                    "line": 2
                }
            ]
        }
    }
}

I realise that this code might go outside the scope of the original purpose of the library, and if it is deemed not to fit, that is just fine. I created this for internal purposes and thought it might be good to share it. :-)

Some of the changes here are duplicates from #24, as this PR depends on that code.

@darylldoyle darylldoyle merged commit fe658fd into darylldoyle:master Jan 11, 2019
@darylldoyle
Copy link
Owner

Thank you so much @gudmdharalds,

Another great addition that's been merged into the library 🙂

@gudmdharalds gudmdharalds deleted the feature-standalone-scanner branch January 27, 2022 16:52
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 this pull request may close these issues.

None yet

2 participants