I just noticed that it seems that Phonos is not registering when it is transcluding a file with the file= syntax.
Take https://en.wikipedia.beta.wmflabs.org/wiki/Phonos_without_any_IPA
Note how the following file is in use:
https://en.wikipedia.beta.wmflabs.org/wiki/File:Voiceover-mathml-example-1.wav
Note how this usage was not registered in the file usage table and the article where it was used is not listed in the file usage section:
https://en.wikipedia.beta.wmflabs.org/wiki/File:Voiceover-mathml-example-1.wav#filelinks
This should be a requirement for launch, as without it, invalidation for such file usages will not work.
----
= Notes
The function for registering file dependencies is [[ https://doc.wikimedia.org/mediawiki-core/1.28.2/php/classParserOutput.html#a09e32508170667aadca398d9f0df4119 | ParserOutput::addImage() ]]
[[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Phonos/+/refs/heads/master/includes/Phonos.php#98 | renderPhonos() ]] in `includes/Phonos.php` already has [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Phonos/+/refs/heads/master/includes/Phonos.php#98 | conditional logic ]] for if a file is passed //and// already has a [[ https://doc.wikimedia.org/mediawiki-core/1.28.2/php/classParser.html | Parser object ]] available.
We can use [[ https://doc.wikimedia.org/mediawiki-core/1.28.2/php/classParser.html#ab960d1accbbae747f35cb66d7b675652 | Parser::getOutput() ]] to get a [[ https://doc.wikimedia.org/mediawiki-core/1.28.2/php/classParserOutput.html | ParserOutput object ]], and then call `addImage()` as shown below
```lang=php
$parser->getOutput()->addImage( $options['file'] );
```
= Acceptance criteria
- Instances of Phonos which use a file correctly register a file dependency
= QA
- Ensure a Phonos parser tag is using a file (e.g. https://en.wikipedia.beta.wmflabs.org/wiki/Phonos_without_any_IPA)
- Visit the file page (in this example, https://en.wikipedia.beta.wmflabs.org/wiki/File:Voiceover-mathml-example-1.wav)
- Ensure the page with the Phonos parser tag appears in the file's usage table (e.g. https://en.wikipedia.beta.wmflabs.org/wiki/File:Voiceover-mathml-example-1.wav#filelinks)