wiki.techinc.nl/includes/filerepo
2008-12-23 17:35:05 +00:00
..
ArchivedFile.php Step 2 in NS_IMAGE -> NS_FILE transition (bug 44) (WARNING: huge commit). 2008-12-01 17:14:30 +00:00
File.php Add getGeneralShortDesc() and the like to avoid E_STRICT instead 2008-12-15 22:22:21 +00:00
FileCache.php Add a new FileCache class to wrap RepoGroup::findFile() and findFiles(), and make wfFindFile() use it by default. This should improve performance for pages that refer to the same image several times, but the real benefit is that it allows batch file existence checks, à la LinkBatch, by collecting a set of titles (or DB keys) and calling FileCache::findFiles() on them to prefill the cache. 2008-12-14 05:47:48 +00:00
FileRepo.php Remove it from the comments too. (Who reads those, anyway?) 2008-12-13 04:40:25 +00:00
FileRepoStatus.php
ForeignAPIFile.php Show icon instead of exploding for a remote API file we don't have a local handler class for... 2008-12-23 17:35:05 +00:00
ForeignAPIRepo.php Add some sanity checking. Return nicely if Http::get fails (in general) on fetchImageQuery(), and also if our query returns poorly in findBySha1(), similar to queryImage(). 2008-12-14 07:02:44 +00:00
ForeignDBFile.php Step 2 in NS_IMAGE -> NS_FILE transition (bug 44) (WARNING: huge commit). 2008-12-01 17:14:30 +00:00
ForeignDBRepo.php
ForeignDBViaLBRepo.php
FSRepo.php * Add a .htaccess to deleted images directory for additional protection 2008-11-17 19:01:07 +00:00
Image.php Step 2 in NS_IMAGE -> NS_FILE transition (bug 44) (WARNING: huge commit). 2008-12-01 17:14:30 +00:00
LocalFile.php Fix bug where new image uploads would be reviewed but had "changes needing review" tag 2008-12-15 23:51:28 +00:00
LocalRepo.php Remove parameter from FileRepo::findFiles(), it was fubar and nobody was using it anyway. (What we really need is some way to pass timestamps to that function, which probably requires further rethinking of the interface.) 2008-12-13 04:35:48 +00:00
NullRepo.php
OldLocalFile.php Step 2 in NS_IMAGE -> NS_FILE transition (bug 44) (WARNING: huge commit). 2008-12-01 17:14:30 +00:00
README
RepoGroup.php Followup to r44525: remove the broken $flags parameter from RepoGroup::findFiles() too. 2008-12-14 03:43:10 +00:00
UnregisteredLocalFile.php Step 2 in NS_IMAGE -> NS_FILE transition (bug 44) (WARNING: huge commit). 2008-12-01 17:14:30 +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 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