wiki.techinc.nl/includes/filerepo
Aaron Schulz c518eaf0e0 Removed LocalFile::purgeHistory method
* This just purges an unused key as OldLocalFile::getCacheKey
  simply returns false (rather than a key with "oldfile" in it)

Change-Id: Ic7dda9bf192803a75eaa9bd3bb5a145ad1409dd2
2015-04-27 17:36:02 -07:00
..
file Removed LocalFile::purgeHistory method 2015-04-27 17:36:02 -07:00
FileRepo.php Made wfFindFile/wfLocalFile callers use explicit "latest" flags 2015-03-06 04:18:50 +00:00
FileRepoStatus.php Fix phpcs errors and warnings in includes/filerepo 2015-03-15 02:34:41 +00:00
ForeignAPIRepo.php Profile all external HTTP requests from MW 2015-03-03 20:54:30 -08:00
ForeignDBRepo.php
ForeignDBViaLBRepo.php
FSRepo.php
LocalRepo.php Fixed transaction error while undeleting revdeleted files 2015-04-26 18:29:24 +00:00
NullRepo.php
README
RepoGroup.php Made wfFindFile/wfLocalFile callers use explicit "latest" flags 2015-03-06 04:18:50 +00:00

Some quick notes on the file/repository architecture.

Functionality is, as always, driven by data model.

* The repository object stores configuration information about a file storage
  method.

* The file object is a process-local cache of information about a particular
  file.

Thus the file object is the primary public entry point for obtaining information
about files, since access via the file object can be cached, whereas access via
the repository should not be cached.

Functions which can act on any file specified in their parameters typically find
their place either in the repository object, where reference to
repository-specific configuration is needed, or in static members of File or
FileRepo, where no such configuration is needed.

File objects are generated by a factory function from the repository. The
repository thus has full control over the behavior of its subsidiary file
class, since it can subclass the file class and override functionality at its
whim. Thus there is no need for the File subclass to query its parent repository
for information about repository-class-dependent behavior -- the file subclass
is generally fully aware of the static preferences of its repository. Limited
exceptions can be made to this rule to permit sharing of functions, or perhaps
even entire classes, between repositories.

These rules alone still do lead to some ambiguity -- it may not be clear whether
to implement some functionality in a repository function with a filename
parameter, or in the file object itself.

So we introduce the following rule: the file subclass is smarter than the
repository subclass. The repository should in general provide a minimal API
needed to access the storage backend efficiently.

In particular, note that I have not implemented any database access in
LocalRepo.php. LocalRepo provides only file access, and LocalFile provides
database access and higher-level functions such as cache management.

Tim Starling, June 2007