, , get_included_files(). , include.php, - auto_append_file. . , , , include.php, , .
<?php
function writeIncludes( array $includes ) {
$filename = __DIR__ . '/included.php';
$output = "<?php\nreturn ";
if( file_exists( $filename ) ) {
$files = include( $filename );
}
else {
$files = array( );
}
$files = array_merge( $files, $includes );
$output .= var_export( $files, true );
file_put_contents( $filename, $output );
}
writeIncludes( get_included_files( ) );
Of course, this script is not useful for debugging other than your current setup, but it should be fast and fast enough. It may be ugly, but he will do his job.
source
share