Removing large PHP snippets

I just inherited the project and said that due to licensing issues I need to delete the entire "includes /" folder. We do not have the right to distribute files in this folder, so we need to reduce our dependencies on them and fix any interruptions. They told me: "Less than 5% of the lines in this folder are even called by our program," but I can’t verify this.

The folder contains about 50 files, each of which contains a couple of hundred lines of code. There is currently no unit testing. There's one main file, include.php, which is require()sall 49 other files, so I can't just grep for any file doing import()on includes/.*.

This is about as detailed as I actually understood. I spent the whole last week browsing the files in the includes / folder, and it would not be difficult to rewrite all of this, but I had problems choosing where to start. I tried to delete the folder and slowly fix everything that breaks, but I am afraid that this route will make me skip some important functions in my rewriting.

Can someone point me in a direction to get started? Are there tools to simplify this process? I am looking at xdebug right now, but I'm not sure exactly how I will use it for this.

+3
source share
5 answers
+2

. , , :

  • , .
  • , .
  • : , , .
  • goto 2.

, , .

0

grepping , include.php. , , . grep /include/ * php . , , , .

PHP , , .

( , - , , ...)

0

. PHP PHP. , , , ( " ", , - ).

- .

0

, xdebug, , ( , ).

In my / etc / php 5 / apache2 / conf.d / xdebug.ini (on ubuntu 9.10), I installed xdebug.profiler_enable=1and xdebug.profiler_output_dir=/var/log/xdebug/then downloaded the resulting cachegrind files with KCacheGrind and just searched the file names for "includes /".

Now I have a mountain of work ahead to remove all this, but at least I have a good overview of what I will change!

0
source

Source: https://habr.com/ru/post/1734962/


All Articles