Acquaintance with the new web system in which you must work / expand

I am going to start work on a site that has already been created by someone else.

The main script was purchased and then adjusted by the lead programmer. The host is gone, and I'm the only programmer.

I have never met with a host and there were no documents, documentation or comments in the code to help me, there are also many functions with single-letter names. There are also parts of the code, all compressed in one line (for example, where there should be 200 lines, there is one). There are several hundred files.

My questions: Does anyone have any tips on how to understand this system? Has anyone had such experiences? Does anyone have a quick way to decompress strings?

Please help me here. This is my first big break, and I really want it to work out well.

thanks

EDIT: Regarding the question: - Does anyone have a quick way to decompress strings?

I just used notepad ++ (extended replace) and netbeans (format option) to change the file from 1696 lines to 5584.

It will be a loooonnngggg project

+4
source share
4 answers

To reformat the source, try this online printer: http://www.prettyprinter.de/

For understanding HTML and CSS use Firebug .

To understand the PHP code, go through it in the debugger. (I cannot personally recommend the PHP debugger, but I heard well about Komodo .)

Start by checking the entire element in the original control, if you haven’t done so already, and then when you determine what the various functions and variables are doing, rename them to something reasonable and check your changes.

If you can collect some rough regression tests (like Selenium ) before you start, you can be reasonably sure that you don't break anything when you go.

+8
source

Oh! I feel your pain!

A few things to get started:

  • If you are not using the original control, do nothing until you get this setting. When you crack files, you should be able to revert to previous, presumably working versions. Which source control system is not so important, how to use it. Subversion is simple and widely used.

  • Get an editor with good PHP syntax syntax and a code folder. Which one is heavily dependent on the platform and personal taste; I like JEdit and Notepad ++ . This will help you navigate the code inside the page. JEdit folder is the best. Notepad ++ has a great feature that, when you select a word, highlights other occurrences in a single file, so you can easily see it, for example. where the tag begins or where the variable is used.

  • Separate these long lines with search and replace ' ; 'on' ;\n '- at least you get each statement on a separate line. The cute printer described above will do the same plus. But I believe that manually entering and indenting code is a good way to get started with it.

  • Analyze the main uses of the website and trace them. If you are a third-party guy, it can be easier if you start from the front-end and return to the database; if you are a minor guy, start with the database and see what it says, and then how it is used to render pages - anyway. Use FireBug in Firefox to check for example. forms to see which names occupy the fields and on which page they are published. Take a look at the PHP page to see what happens next. Use some echo () statements to print the values ​​of variables in different places. Finally, crack the database and get familiar with your schema.

  • Wet, rinse, repeat.

Good luck

+6
source

Can you get a copy of the original version of the script that was purchased? Perhaps this is documented. You can then use a comparison tool, such as Beyond Compare, to extract any changes made.

+1
source

If the function names are just one letter, maybe the code is encoded by some tool (I think Zend had such a tool - Zend Encoder?) So that people could not copy it. You should try to find an unencrypted version, if any, because it will save a lot of time.

0
source

All Articles