[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/files/engineselector/ -> PhabricatorFileStorageEngineSelector.php (source)

   1  <?php
   2  
   3  /**
   4   * Chooses appropriate storage engine(s) for files. When Phabricator needs
   5   * to write a blob of file data, it uses the configured selector to get a list
   6   * of suitable @{class:PhabricatorFileStorageEngine}s. For more information,
   7   * see @{article:File Storage Technical Documentation}.
   8   *
   9   * @task  select  Selecting Storage Engines
  10   */
  11  abstract class PhabricatorFileStorageEngineSelector {
  12  
  13    final public function __construct() {
  14      // <empty>
  15    }
  16  
  17  
  18  /* -(  Selecting Storage Engines  )------------------------------------------ */
  19  
  20  
  21    /**
  22     * Select valid storage engines for a file. This method will be called by
  23     * Phabricator when it needs to store a file permanently. It must return a
  24     * list of valid @{class:PhabricatorFileStorageEngine}s.
  25     *
  26     * If you are extending this class to provide a custom selector, you
  27     * probably just want it to look like this:
  28     *
  29     *   return array(new MyCustomFileStorageEngine());
  30     *
  31     * ...that is, store every file in whatever storage engine you're using.
  32     * However, you can also provide multiple storage engines, or store some files
  33     * in one engine and some files in a different engine by implementing a more
  34     * complex selector.
  35     *
  36     * @param string  File data.
  37     * @param dict    Dictionary of optional file metadata. This may be empty, or
  38     *                have some additional keys like 'file' and 'author' which
  39     *                provide metadata.
  40     * @return list   List of @{class:PhabricatorFileStorageEngine}s, ordered by
  41     *                preference.
  42     * @task select
  43     */
  44    abstract public function selectStorageEngines($data, array $params);
  45  
  46  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1