As a follow-up to T324233: Create maintenance script to count/delete orphaned Phonos files, it would be more scalable to leverage the page_props table to store which Phonos files are used on a page. These properties are regenerated on every reparse, which is exactly when Phonos files are created/changed.
This still wouldn't allow us to easily find unused Phonos files, but the countOrphanFiles.php maintenance script could be dramatically faster if we go off of page properties rather than looping through the tracking category and scraping the HTML.
Acceptance criteria
- Have Phonos store a single page property that records all Phonos files that are used on the page
- Update the countOrphanFiles.php script to go off of page props rather than the tracking category.
QA notes
- If you're testing on your local that already has Phonos pages, make sure to run maintenance/run refreshLinks --category='Pages that use Phonos' after pulling in the new code.
- Changes to page props require an actual page edit, or null edit (essentially what the refreshLinks maintenance script does)
- Your testing is probably more easily done using the newly updated countOrphanFiles.php script (T324233)
- You can query which Phonos page props exist against the database with SELECT * FROM page_props WHERE pp_propname = 'phonos-files'