Hello,
I am interested in iterating over all pages in all namespaces.
The reason is to capitalize all page titles so I can successfully change $wgCapitalLinks from false to true. Currently my wiki has many pages with lower-case first letter and changing $wgCapitalLinks to true makes those inaccessible.
It appears that the AllPagesGenerator works on only one namespace at a time. The SearchPageGenerator allows multiple namespaces, but it requires a query to return a limited result set.
My only idea so far is to manually determine the list of namespaces and iterate over each one with AllPagesGenerator to check every page.
Any help is much appreciated.
On Tue, July 1, 2008 9:11 pm, Tom Hogarty wrote:
The reason is to capitalize all page titles so I can successfully change $wgCapitalLinks from false to true. Currently my wiki has many pages with lower-case first letter and changing $wgCapitalLinks to true makes those inaccessible.
If you have access to the SQL server then running a query to fix this is probably the best way to do it. You will need to run something like
UPDATE page SET page_title = concat( ucase( mid( page_title, 1, 1 ) ) , mid( page_title, 2 ) ) ;
** THIS WILL NOT WORK WHEN THE FIRST CHARACTER IS NON-ASCII ** (so please make a backup copy before trying, and confirm this is correct).
When using the generators, you will indeed have to use the AllpagesPageGenerator and iterate over all namespaces. Which is fairly easy: on most wikis it is just 0..15, and sometimes 100..115 as additional namespaces.
--valhallasw
pywikipedia-l@lists.wikimedia.org