Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Hopefully this is the correct Stack Exchange site to be asking this question.

I've inherited a fairly large web app from the previous IT guy at my organisation. It's written in PHP and there's no documentation. My PHP is very rusty at best but I've been given the task of looking at the code for the web app, working out what it does, and preparing it so it can definitely be moved to another host with no problems.

The directories in which the relevant PHP, js and css files sit have a whole load of other PHP, js and css files in them - things like early revisions of files, backups, slight changes etc. All very messy.

I'd like to be able to just download locally all the files that are relevant to the app and not all the extra ones so that when I come to look at the code it'll be much easier to untangle. Is there such a piece of software which, when given relevant permissions on the server, goes off and fetches an initial PHP file, looks for any code from includes and downloads them, does the same for css and js files. Is there an IDE which does something similar for when people need to debug and untangle others' web apps?

share|improve this question

1 Answer 1

I am not aware of any software which would suit your requirements, though you should be able to handle this task without too much manual effort (and, if in doubt, copying everything - symlinks, web server config, database, and all - wholesale is all but guaranteed to work).

wget -r should be sufficient to download the CSS and JS assets.

As for the PHP, you might want to try adding this snippet at the end of the application's footer file(s) to see what's included:

<?php
    var_dump( get_included_files() );
?>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.