In my current company we don't use MVC so it's pretty chaotic and I often struggle on where to find the PHP files which are responsible for specific things that I see on frontend. I was thinking on how to solve this chaos, I want to effectively know where to find those files immediately when I see the page in my browser. (We edit code directly on production server via FTP, without any testing or development environment so we are basically unable to search the code)
My idea is to achieve this:
Every include(), include_once(), require(), require_once() will echo an HTML comment of the PHP file which is being included, and after the file ends, it will do another "closing" HTML comment.
Example:
another_file.php
<?php echo "<p>Hey everyone!</p>"; ?>
Index.php:
<?php
echo "<p>Hello World</p>";
include('another_file.php');
?>
What the browser renders:
<p>Hello World</p>
<!-- 'another_file.php' -->
<p>Hey everyone!</p>
<!-- END 'another_file.php' -->
Is there a way I can implement this? Maybe some PHP extension, or settings? This would be real time and nerve saver. Thank you.