44use dokuwiki \Extension \EventHandler ;
55use dokuwiki \Extension \Event ;
66use dokuwiki \Form \Form ;
7+ use dokuwiki \Logger ;
78
89/**
910 * Include Plugin: Display a wiki page within another wiki page
@@ -211,8 +212,6 @@ public function handleRedirect(Event $event, $param)
211212 */
212213 public function handleCachePrepare (Event $ event , $ param )
213214 {
214- global $ conf ;
215-
216215 /* @var cache_renderer $cache */
217216 $ cache =& $ event ->data ;
218217
@@ -221,10 +220,8 @@ public function handleCachePrepare(Event $event, $param)
221220
222221 $ depends = p_get_metadata ($ cache ->page , 'plugin_include ' );
223222
224- if ($ conf ['allowdebug ' ] && $ this ->getConf ('debugoutput ' )) {
225- dbglog ('---- PLUGIN INCLUDE CACHE DEPENDS START ---- ' );
226- dbglog ($ depends );
227- dbglog ('---- PLUGIN INCLUDE CACHE DEPENDS END ---- ' );
223+ if ($ this ->getConf ('debugoutput ' )) {
224+ Logger::debug ('include plugin: cache depends for ' . $ cache ->page , $ depends );
228225 }
229226
230227 if (!is_array ($ depends )) return ; // nothing to do for us
@@ -237,14 +234,11 @@ public function handleCachePrepare(Event $event, $param)
237234 $ depends ['include_content ' ] != isset ($ _REQUEST ['include_content ' ])
238235 ) {
239236 $ cache ->depends ['purge ' ] = true ; // included pages changed or old metadata - request purge.
240- if ($ conf ['allowdebug ' ] && $ this ->getConf ('debugoutput ' )) {
241- dbglog ('---- PLUGIN INCLUDE: REQUESTING CACHE PURGE ---- ' );
242- dbglog ('---- PLUGIN INCLUDE CACHE PAGES FROM META START ---- ' );
243- dbglog ($ depends ['pages ' ]);
244- dbglog ('---- PLUGIN INCLUDE CACHE PAGES FROM META END ---- ' );
245- dbglog ('---- PLUGIN INCLUDE CACHE PAGES FROM META_INSTRUCTIONS START ---- ' );
246- dbglog ($ this ->helper ->getIncludedPagesFromMetaInstructions ($ depends ['instructions ' ]));
247- dbglog ('---- PLUGIN INCLUDE CACHE PAGES FROM META_INSTRUCTIONS END ---- ' );
237+ if ($ this ->getConf ('debugoutput ' )) {
238+ Logger::debug ('include plugin: cache purge for ' . $ cache ->page , [
239+ 'meta-pages ' => $ depends ['pages ' ],
240+ 'inst-pages ' => $ this ->helper ->getIncludedPagesFromMetaInstructions ($ depends ['instructions ' ]),
241+ ]);
248242 }
249243 } else {
250244 // add plugin.info.txt to depends for nicer upgrades
@@ -286,7 +280,7 @@ public function handleSeceditButton(Event $event, $params)
286280 (page_exists ($ data ['name ' ])
287281 ? (is_writable ($ fn ) && $ perm >= AUTH_EDIT )
288282 : $ perm >= AUTH_CREATE ),
289- 'redirect ' => ($ data ['target ' ] == 'plugin_include_start ' )]
283+ 'redirect ' => ($ data ['target ' ] == 'plugin_include_start ' )]
290284 );
291285 } elseif ($ data ['target ' ] == 'plugin_include_end ' ) {
292286 array_shift ($ page_stack );
0 commit comments