Lines Matching defs:page
18 const PLUGIN_SQL2WIKI_EDIT_SUMMARY_INFINITE_LOOP = 'plugin sql2wiki: syntax commented out: query results may depend on page revision';
59 // if we have updated the page we are currently viewing, redirect to updated version
69 if ($ACT != 'show') return; // update the page content only when we viewing it
94 foreach ($pages as $page) {
95 if (in_array($page, $filter_ids)) continue;
96 $sql2wiki_data = p_get_metadata($page, 'plugin_sql2wiki');
100 // but when $ACT != 'show' the current page might be not updated yet
101 $sleep = $page == $ID ? 1 : 0;
102 $this->update_query_results($page, $sql2wiki_filtered, $sleep);
134 protected function get_updated_page_content($page_content, $page, $sql2wiki_data) {
137 'page' => $page,
153 $page,
154 getNS($page),
155 noNS($page)
190 protected function update_query_results($page, $sql2wiki_data, $sleep=0) {
191 $page_content = file_get_contents(wikiFN($page));
192 $updated_content = $this->get_updated_page_content($page_content, $page, $sql2wiki_data);
194 sleep($sleep); // wait if we are processing currently viewed page
195 saveWikiText($page, $updated_content, self::PLUGIN_SQL2WIKI_EDIT_SUMMARY);
196 $next_update = $this->get_updated_page_content($page_content, $page, $sql2wiki_data);
197 // this may mean that the query results depend on page revisions which leads to infinite loop
201 sleep(1); // wait for all types of updates since we have just updated the page
202 saveWikiText($page, $wrapped_content, self::PLUGIN_SQL2WIKI_EDIT_SUMMARY_INFINITE_LOOP);