The class ScanDir provides a method to retrieve the list of all files and/or subdirectories from the specified path. The scan can: scan files and/or just the subdirectories; get only the filename or the full path+filename; give information on each file (size, dates, permissions, extension, and basename, or only filename and size); and filter the files list on some extensions files only. During a scan, all the unique extensions can be listed in an array. You can calculate the total size of files in the scan, and get a count of the number of files and directories. The class was developed because other similar classes seemed to be too complex for the author's requirements. Before running the scan, the class must be set up to enable/disable options. After the scan completes, you have an associative array with all the files and their information. This class can be use on the command line or in PHP Web pages.
PHP Debug is single API for tracing PHP applications. With a single file of only 200 lines, you can add, with minimal impact, diagnostics to be displayed upon program termination. Each diagnostic contains file, function, and caller function information. You just need to include the debug.php file and add debug() calls throughout your code in the same way as var_dump(). The diagnostic messages are stored and displayed in a list. Diagnostics can be disabled and controlled. It's small and simple yet very versatile.