You are here

class Config in One Click Upload 7.2

Hierarchy

Expanded class hierarchy of Config

4 files declare their use of Config
ConfigTest.php in flowphp/test/Unit/ConfigTest.php
FileTest.php in flowphp/test/Unit/FileTest.php
FustyRequestTest.php in flowphp/test/Unit/FustyRequestTest.php
MongoConfig.php in flowphp/src/Flow/Mongo/MongoConfig.php

File

flowphp/src/Flow/Config.php, line 5

Namespace

Flow
View source
class Config implements ConfigInterface {

  /**
   * Config
   *
   * @var array
   */
  private $config;

  /**
   * Controller
   *
   * @param array $config
   */
  public function __construct($config = array()) {
    $this->config = $config;
  }

  /**
   * Set path to temporary directory for chunks storage
   *
   * @param $path
   */
  public function setTempDir($path) {
    $this->config['tempDir'] = $path;
  }

  /**
   * Get path to temporary directory for chunks storage
   *
   * @return string
   */
  public function getTempDir() {
    return isset($this->config['tempDir']) ? $this->config['tempDir'] : '';
  }

  /**
   * Set chunk identifier
   *
   * @param callable $callback
   */
  public function setHashNameCallback($callback) {
    $this->config['hashNameCallback'] = $callback;
  }

  /**
   * Generate chunk identifier
   *
   * @return callable
   */
  public function getHashNameCallback() {
    return isset($this->config['hashNameCallback']) ? $this->config['hashNameCallback'] : '\\Flow\\Config::hashNameCallback';
  }

  /**
   * Callback to pre-process chunk
   *
   * @param callable $callback
   */
  public function setPreprocessCallback($callback) {
    $this->config['preprocessCallback'] = $callback;
  }

  /**
   * Callback to pre-process chunk
   *
   * @return callable|null
   */
  public function getPreprocessCallback() {
    return isset($this->config['preprocessCallback']) ? $this->config['preprocessCallback'] : null;
  }

  /**
   * Delete chunks on save
   *
   * @param bool $delete
   */
  public function setDeleteChunksOnSave($delete) {
    $this->config['deleteChunksOnSave'] = $delete;
  }

  /**
   * Delete chunks on save
   *
   * @return bool
   */
  public function getDeleteChunksOnSave() {
    return isset($this->config['deleteChunksOnSave']) ? $this->config['deleteChunksOnSave'] : true;
  }

  /**
   * Generate chunk identifier
   *
   * @param RequestInterface $request
   *
   * @return string
   */
  public static function hashNameCallback(RequestInterface $request) {
    return sha1($request
      ->getIdentifier());
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Config::$config private property Config
Config::getDeleteChunksOnSave public function Delete chunks on save Overrides ConfigInterface::getDeleteChunksOnSave
Config::getHashNameCallback public function Generate chunk identifier Overrides ConfigInterface::getHashNameCallback
Config::getPreprocessCallback public function Callback to pre-process chunk Overrides ConfigInterface::getPreprocessCallback
Config::getTempDir public function Get path to temporary directory for chunks storage Overrides ConfigInterface::getTempDir
Config::hashNameCallback public static function Generate chunk identifier
Config::setDeleteChunksOnSave public function Delete chunks on save Overrides ConfigInterface::setDeleteChunksOnSave
Config::setHashNameCallback public function Set chunk identifier
Config::setPreprocessCallback public function Callback to pre-process chunk Overrides ConfigInterface::setPreprocessCallback
Config::setTempDir public function Set path to temporary directory for chunks storage
Config::__construct public function Controller 1