Greetings. In config.php I have added a function to do perpage summary logging. It reads on disk if page config files exists, and reads from existing page config files if summary logging is already defined (in the $RecentChangesFmt array).
Now, the function potentially goes to disk three times. I would like to reduce the disk activity, if possible. Is there any way to check from config.php if a $RecentChangesFmt array element has been defined in a page config file? This is the code I have added to local/config.php: --- function PerPageSummaryLog($pagename, &$page, &$new) { // No summary logs for log pages. if (!strpos($pagename, "SummaryLog") && !strpos($pagename, "RecentChanges") && !strpos($pagename, "Site.AllEdits") && !strpos($pagename, "Last100Edits") && !strpos($pagename, "Last1000Edits")) { // If the page has no configuration file. if(!file_exists($LocalDir . $pagename . ".php")) { // Write configuration file. $file = fopen($LocalDir . $pagename . ".php", "w"); fwrite($file, $newfileconfig); fclose($file); } // If the page already has a configuration file. else { // Make sure we don't clobber an already existing log setting for the page. $file = fopen($LocalDir . $pagename . ".php", "r"); $configfile = fread($file, filesize($LocalDir . $pagename . ".php")); fclose($file); if(!strpos($configfile, "RecentChangesFmt['" . $pagename . "SummaryLog']")) { $file = fopen($LocalDir . $pagename . ".php", "a"); fwrite($file, $appendfileconfig); fclose($file); } } } } array_unshift($EditFunctions, 'PerPageSummaryLog'); Best regards :o) Johnny :o) _______________________________________________ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users