Cache API

From FollowTheScore
Jump to: navigation, search

This is a development page for the Cache API that we are currently implementing. Talk to EmuWikiAdmin- for more information.

Manual


We have a somewhat working version here : http://www.emuwiki.com/testinstall/extensions/CacheAPI_current.txt


Updated : EmuWikiAdmin- 04:43, 1 July 2009 (UTC)


For now this SQL command needs to be executed manually before installing :

 CREATE TABLE IF NOT EXISTS `cacheapi` (
`page_ids` INT(10) NOT NULL ,
`dependencies` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`first` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`type` INT(10) NOT NULL ,
INDEX ( `page_ids` , `dependencies`(40) , `first`(40) , `type` )
) ENGINE = MYISAM 

Removing dependencies


To remove all dependencies of a page, use CacheAPI::remDependencies ( idOfThePage ).


Adding dependencies


To add a dependency, use CacheAPI::addDependencies ( pageid , type, condition, );

type 1 = category, 2 = template, 3 = linksto

condition is an array of category names (to be switched to an array of category numbers, see discussion below).


TODO :

  • Implement other types of dependencies (Namespace, linksfrom, etc...)
  • Implement the NOTs (notcategory, notlinksto, etc...)
  • Make a better system for deleation of dependencies (right now, the only thing you can do is delete ALL dependencies related to a page at once)
  • Implement cache outdating when special events other than edit/create are performed (deletion, rename, etc...)
  • If you need anything else, add it here.