wordpress-autoloaded
wordpress-autoloaded copied to clipboard
Rewrite in PHP
@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*\)?;.*
@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.
Thank you for the starter. I'd like to comment out these lines.