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

Rewrite in PHP #2

Open
szepeviktor opened this issue Feb 23, 2019 · 3 comments
Open

Rewrite in PHP #2

szepeviktor opened this issue Feb 23, 2019 · 3 comments

Comments

@szepeviktor
Copy link
Owner

szepeviktor commented Feb 23, 2019

Anyone up to implement my shell script in proper OOP PHP?

@szepeviktor
Copy link
Owner Author

@ondrejmirtes You handle PHP code much more than me.
What do you suggest how to turn this regexp into nikic/PHP-Parser code?

\s*(require|include)(_once)?\(?\s*ABSPATH(\s*\.\s*WPINC)?\s*\.\s*'/?%'\s*\)?;.*

@ondrejmirtes
Copy link

@szepeviktor I don't know what the regexp does, but include, include_once, require, require_once are represented in nikic/PHP-Parser with the Include_ node: https://github.com/nikic/PHP-Parser/blob/master/lib/PhpParser/Node/Expr/Include_.php

You can change what it contains and then output the modified AST with a Printer.

@szepeviktor
Copy link
Owner Author

Thank you for the starter. I'd like to comment out these lines.

@szepeviktor szepeviktor pinned this issue Feb 25, 2019
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

2 participants