Hello! I was learning about studying a large php project to unify the architecture on which it is spinning. And before that, I didn't deal with php.

And the question arose, is it possible somehow to understand by the code which extensions it needs?

  • one
    In addition to direct analysis of the code - I'm afraid in any way. If the project has regression testing, then you can drive tests on raw PHP, gradually finishing it with extensions. - etki
  • one
    If there is composer.json, then all extensions should be listed in the dependencies of the mont. - etki

2 answers 2

You can deploy a copy of the project on the test site, which has only extensions by default. Increase the logging details and look at errors in the logs. By adding extensions, you achieve normal operation and get a list of necessary extensions (which should be documented immediately)

    Often the name of the extension and the name of the functions included in it have something in common. For example, the php_mysql extension defines a large set of mysql_xxxx () functions.

    The second option is to read the documentation of each extension used and analyze the code (search by text) for the occurrence of some identifiers (functions, constants) ...