Flow/Architecture/Internals

code resources

 * container.php provides resources.
 * container.php is configuration, includes/Container.php is implementation class
 * uses third-party Pimple to provide lazily-evaluated closures
 * uses third-party Pimple to provide lazily-evaluated closures

actions
Likewise, top-level FlowActions.php, then includes/Actions.php implementation

This configures how different actions work, e.g.


 * moderation actions get logged in Special:Log (log_type)
 * nearly everything gets written to RecentChanges (rc_insert)

permissions: if there's nothing there, it's blocked altogether
 * currently no support for moderation of header


 * button-method needs to die

Links (for queries) and actions (for writes), are outputs. The configuration says "If the change type of a revision is of this "hen the API output will include URLs for these actions. E.g. revision of create-header, outputs these links. Even though e.g. 'board-history' isn't used, the page chrome adds the ?action

Caching
All in includes/data/ ObjectManager drives it.ro

From a list of queries
 * determine cache keys
 * if it finds all the keys, then it returns
 * otherwise goes to "backing store", the database.

The posts that are output map to memcached keys according to index classes, e.g. includes/Data/Index/FeatureIndex.php

ObjectManager objects implement either Find or FindMulti

rowCompactor removes keys you don't need.

Tries to reduce the amount of joins so that we can eventually shard the data.

Example
A topic list query

In general, split into two parts, query and formatter. TopicList also has a paginator deciding what the list is.

Talk:Flow has a workflow identifier, each topic has a workflow identifier.
 * One memcached key for topics in the page
 * trim to a slice of 10 of these
 * Does a MultiGet to get those 10 topics

To debug what is cached
purge.php script does the query, but replaces from Hash bag of stuff to memcache bagOfStuff, forcing a repopulation, and then you can examine the keys.