[wp-hackers] concatinating PHP code files
gaarai at gaarai.com
Mon Mar 22 18:37:33 UTC 2010
I don't know of anything that does this. I'm really curious to know why
you would want to.
If you only needed to do it once, just manually merge them (though I
still don't know why you'd want to). If it needed to handle random code
in an automated fashion, what application would require this?
If you really needed this, it sounds like you would want to build a
custom script that uses regex (http://www.regular-expressions.info/) to
parse the files in order to find the include, include_once, require,
require_once instances and replace them with the content of the files.
Of course, if include_once or require_once is used, log the file so it
is only included once.
Chris Jean (AKA gaarai & chrisbliss18)
Coder for http://ithemes.com/
Arlen Beiler wrote:
> Is there a way to specify a start file and have php build a new file out of
> the inludes and requires it finds? Say I have 5 files, #1 includes the other
> 4 at runtime. Can I have it take the code in those other files and insert it
> where the include is the way PHP does when it runs?
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers