wiki.techinc.nl/includes/filerepo
Aaron Schulz 1e9fd01037 [FileRepo] Changed "publishBatch" to handle failure better.
* Instead of moving the current file to the archive name,
  and then storing the new one, copy the current file to the
  archive name and overwrite the new one. When and object store
  backend is used, this reduces the number of operations from
  COPY, DELETE, PUT to just COPY and PUT. This reduces the RTTs,
  chances for failures, and avoids the period of time where the
  file has no current version.
* Also removed the "force" option to make file changes more likely
  to be all or nothing.

Change-Id: I46fc5c5c1fda5b386958b57557942f500de9dc2c
2012-10-31 04:24:19 +00:00
..
file [FileRepo] Fixed purging for "short style" thumbnail names. 2012-10-29 11:09:43 -07:00
FileRepo.php [FileRepo] Changed "publishBatch" to handle failure better. 2012-10-31 04:24:19 +00:00
FileRepoStatus.php Added missing GPLv2 headers in some places. 2012-05-07 09:11:33 +02:00
ForeignAPIRepo.php ForeignAPIRepo now overwrite files when creating them. 2012-06-25 12:27:34 -07:00
ForeignDBRepo.php Remove a bunch of trailing spaces and unneeded newlines 2012-10-19 22:03:05 +02:00
ForeignDBViaLBRepo.php Remove a bunch of trailing spaces and unneeded newlines 2012-10-19 22:03:05 +02:00
FSRepo.php Remove a bunch of trailing spaces and unneeded newlines 2012-10-19 22:03:05 +02:00
LocalRepo.php Remove a bunch of trailing spaces and unneeded newlines 2012-10-19 22:03:05 +02:00
NullRepo.php Improved/added parameter documentation 2012-05-18 03:58:15 +01:00
README Removed outdated FileRepo docs. 2012-10-18 12:54:42 -07:00
RepoGroup.php (bug 27567) Add file repo support to prop=duplicatefiles 2012-07-23 18:45:38 +02: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 behaviour 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 behaviour -- 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