wiki.techinc.nl/includes/filerepo
Aaron Schulz d9ba7cd005 Make LocalFile check early if the revision store is available
This reduces the odds of having files without corresponding
wiki pages, given that the later is done in a deferred update.

Also made some documentation cleanups.

Bug: T187942
Change-Id: Iff516669f535713d37e0011e2d7ed285c667f1c5
2018-02-22 22:07:30 +00:00
..
file Make LocalFile check early if the revision store is available 2018-02-22 22:07:30 +00:00
FileBackendDBRepoWrapper.php Improve some parameter docs 2017-09-10 20:32:31 +02:00
FileRepo.php Update suppressWarning()/restoreWarning() calls 2018-02-10 08:50:12 +00:00
FileRepoStatus.php Canonicalise '@deprecated since' doc comments 2016-08-02 22:21:57 +00:00
ForeignAPIRepo.php Use PHP's implode() with the suggested order of arguments 2018-02-22 20:24:00 +01:00
ForeignDBRepo.php Use ::class to resolve class names in includes files 2018-01-27 20:34:29 +01:00
ForeignDBViaLBRepo.php Use ::class to resolve class names in includes files 2018-01-27 20:34:29 +01:00
LocalRepo.php Use ::class to resolve class names in includes files 2018-01-27 20:34:29 +01:00
NullRepo.php Clean up get_class() in /includes/filerepo and /includes/resourceloader 2017-03-07 21:30:29 +00:00
README Use American English spelling for behavior 2013-03-04 10:24:57 +01:00
RepoGroup.php Fix RepoGroup caching bug 2018-01-02 18:26:46 -08:00
TempFileRepo.php Move TempFileRepo to a separate file 2016-12-18 05:52:49 +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