wiki.techinc.nl/includes/filerepo
Sam Reed 8588e3e15e Partial revert to r87584
To fix bug bug 30355 importImages.php Internal Error
2011-08-15 18:35:19 +00:00
..
ArchivedFile.php Commit last of my w/c 2011-03-14 01:04:16 +00:00
File.php Followup r90722, seems the file comments were a bad merge... 2011-06-25 16:32:03 +00:00
FileRepo.php Swap else if for elseif 2011-06-17 16:03:52 +00:00
FileRepoStatus.php And more documentation. Yaaaay 2011-05-28 17:18:50 +00:00
ForeignAPIFile.php Followup r91609, helps to actually remove the @ 2011-07-06 22:07:05 +00:00
ForeignAPIRepo.php Fix r93820: PROT_ -> PROTO_ 2011-08-03 13:11:42 +00:00
ForeignDBFile.php And some more.... 2011-05-28 17:51:33 +00:00
ForeignDBRepo.php Revert the dbname -> dbName part of r90430. dbname actually dates back to r32578 and is referenced in the documentation for $wgDBservers, so it can't be easily changed. We can still kill tablename though, it's not too late. 2011-06-20 07:40:07 +00:00
ForeignDBViaLBRepo.php
FSRepo.php Adding __METHOD__ to parameters passed to wfMkdirParents() 2011-07-25 22:01:19 +00:00
LocalFile.php Partial revert to r87584 2011-08-15 18:35:19 +00:00
LocalRepo.php Bunch of error suppression operator fixes (bug 2011-07-06 21:57:44 +00:00
NullRepo.php Fill-in missing implementations of abstract function appendFinish() 2011-05-23 02:30:20 +00:00
OldLocalFile.php Fix r85635. Move LocalFile::publish() magic to LocalFile::publishTo() which has an explicit $destRel argument. 2011-06-17 17:12:20 +00:00
README mark a non-API function private; rename it to reflect what it does; call getPath() rather than accessing object variable directly 2011-07-19 03:44:28 +00:00
RepoGroup.php Change usages of $wgUser->getSkin() in special pages to use $this->getSkin() 2011-07-01 02:25:19 +00:00
UnregisteredLocalFile.php mark a non-API function private; rename it to reflect what it does; call getPath() rather than accessing object variable directly 2011-07-19 03:44:28 +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

Structure:

File.php defines an abstract class File.
    ForeignAPIFile.php extends File.
    LocalFile.php extends File.
        ForeignDBFile.php extends LocalFile
        Image.php extends LocalFile
    UnregisteredLocalFile.php extends File.
FileRepo.php defines an abstract class FileRepo.
    ForeignAPIRepo.php extends FileRepo
    FSRepo extends FileRepo
        LocalRepo.php extends FSRepo
            ForeignDBRepo.php extends LocalRepo
            ForeignDBViaLBRepo.php extends LocalRepo
    NullRepo extends FileRepo

Russ Nelson, March 2011