wiki.techinc.nl/includes/filerepo
2019-06-17 17:59:44 +00:00
..
file Merge "FileRepo: Use Late Static Binding in File static constructors" 2019-06-17 17:59:44 +00:00
FileBackendDBRepoWrapper.php Avoid use of deprecated "wikiId" parameter for FileBackend 2019-03-29 15:24:09 -07:00
FileRepo.php Fix type to callable on FileRepo::getErrorCleanupFunction 2019-06-04 21:28:25 +02:00
ForeignAPIRepo.php Deprecate the Http class 2019-05-06 12:07:26 +03:00
ForeignDBRepo.php Replace call_user_func_array(), part 1 2018-06-04 23:39:04 -07:00
ForeignDBViaLBRepo.php Remove unused fields in ForeignDBViaLBRepo 2018-10-21 00:44:45 -07:00
LocalRepo.php Safe replacement of a lot of !count() with === [] 2019-01-15 17:28:49 +01:00
NullRepo.php Clean up get_class() in /includes/filerepo and /includes/resourceloader 2017-03-07 21:30:29 +00:00
README
RepoGroup.php Fix type hint for properties holding MapCacheLRU 2019-06-05 20:32:16 +02:00
TempFileRepo.php

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