wiki.techinc.nl/includes/filerepo
2008-02-03 19:03:01 +00:00
..
ArchivedFile.php (bug 12608) (in continuation of r29719) Unifying the spelling of getDBkey() in the code. 2008-01-14 09:26:36 +00:00
File.php * (bug 11593, 12719) Fixes for overzealous invocation of thumb.php. 2008-01-22 03:31:10 +00:00
FileRepo.php Image redirects: 2008-01-20 07:05:59 +00:00
FileRepoStatus.php
ForeignDBFile.php
ForeignDBRepo.php
FSRepo.php put a @ on a chmod, since all other file ops in there are so marked. 2008-01-30 01:06:28 +00:00
ICRepo.php
LocalFile.php (bug 12875) Adding query-continue to prop=imageinfo. Patch by Bryan Tongh Minh. 2008-02-03 19:03:01 +00:00
LocalRepo.php Gotta die today... 2008-01-20 12:13:34 +00:00
NullRepo.php A file repository without files. Gets rid of useless DB queries during parser testing. 2007-11-20 10:58:12 +00:00
OldLocalFile.php Revert r26281 for the moment. Big patch, changes several existing practices. Will want some public testing and more review before taking it to trunk. 2007-10-01 19:50:25 +00:00
README
RepoGroup.php * Support redirects in image namespace 2008-01-16 18:27:43 +00:00
UnregisteredLocalFile.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 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