File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636 - Add deployed_at column and an index on it.
3737- Batch queries to the deployed_files table for better
3838 performance.
39+ - Add "extra_detected_files" filter that allows plugins to
40+ add additional files when the "detect" step is run.
3941
4042## 9.3.2 (2025-07-29)
4143
Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ public static function detectURLsIter(): \Iterator {
2929
3030 $ iterators_to_merge = [];
3131
32+ $ iterators_to_merge [] = apply_filters (
33+ Controller::getHookName ( 'extra_detected_files ' ),
34+ new \ArrayIterator ( [] ),
35+ );
36+
3237 $ iterators_to_merge [] = new \ArrayIterator (
3338 [
3439 new PathInfo ( '/ ' ),
Original file line number Diff line number Diff line change @@ -66,4 +66,32 @@ public function testSitemapDoubleSlashes(): void
6666
6767 exec ( 'rm -f ' . escapeshellarg ( $ robotstxt ) );
6868 }
69+
70+ public function testExtraDetectedFiles (): void
71+ {
72+ $ plugin = <<<'PHP'
73+ <?php
74+
75+ /**
76+ * Plugin Name: Extra Detected Files Test
77+ */
78+
79+ if ( ! defined( 'WPINC' ) ) {
80+ die;
81+ }
82+
83+ use StaticDeploy\PathInfo;
84+
85+ function extra_detected_files_filter ( $iter ) {
86+ yield from $iter;
87+ yield new PathInfo( '/extra-detected-file.html' );
88+ }
89+ add_filter( 'static_deploy_extra_detected_files', 'extra_detected_files_filter' );
90+ PHP;
91+ $ this ->installStringPlugin ( 'extra-detected-files-test ' , $ plugin );
92+
93+ $ this ->pluginCli ( [ 'detect ' ] );
94+ $ lines = $ this ->pluginCli ( [ 'detected-files ' , 'list ' ] )['output ' ];
95+ $ this ->assertContains ( '/extra-detected-file.html ' , $ lines );
96+ }
6997}
You can’t perform that action at this time.
0 commit comments