/**
  * Configure after successfull mount.
  *
  * @return void
  * @author Dmitry (dio) Levashov
  **/
 protected function configure()
 {
     $this->aroot = realpath($this->root);
     $root = $this->stat($this->root);
     if ($this->options['quarantine']) {
         $this->attributes[] = array('pattern' => '~^' . preg_quote(DIRECTORY_SEPARATOR . $this->options['quarantine']) . '$~', 'read' => false, 'write' => false, 'locked' => true, 'hidden' => true);
     }
     // chek thumbnails path
     if ($this->options['tmbPath']) {
         $this->options['tmbPath'] = strpos($this->options['tmbPath'], DIRECTORY_SEPARATOR) === false ? $this->root . DIRECTORY_SEPARATOR . $this->options['tmbPath'] : $this->_normpath($this->options['tmbPath']);
     }
     parent::configure();
     // if no thumbnails url - try detect it
     if ($root['read'] && !$this->tmbURL && $this->URL) {
         if (strpos($this->tmbPath, $this->root) === 0) {
             $this->tmbURL = $this->URL . str_replace(DIRECTORY_SEPARATOR, '/', substr($this->tmbPath, strlen($this->root) + 1));
             if (preg_match("|[^/?&=]\$|", $this->tmbURL)) {
                 $this->tmbURL .= '/';
             }
         }
     }
     // check quarantine dir
     if (!empty($this->options['quarantine'])) {
         $this->quarantine = $this->root . DIRECTORY_SEPARATOR . $this->options['quarantine'];
         if (!is_dir($this->quarantine) && !$this->_mkdir($this->root, $this->options['quarantine']) || !is_writable($this->quarantine)) {
             $this->archivers['extract'] = array();
             $this->disabled[] = 'extract';
         }
     } else {
         $this->archivers['extract'] = array();
         $this->disabled[] = 'extract';
     }
 }
Exemplo n.º 2
0
 /**
  * Configure after successfull mount.
  *
  * @return void
  * @author Dmitry (dio) Levashov
  **/
 protected function configure()
 {
     parent::configure();
     if (!$this->tmp) {
         $this->disabled[] = 'archive';
         $this->disabled[] = 'extract';
     }
 }
Exemplo n.º 3
0
 protected function configure()
 {
     parent::configure();
     $this->mimeDetect = 'internal';
 }
Exemplo n.º 4
0
 /**
  * Set tmp path
  *
  * @return void
  * @author Dmitry (dio) Levashov
  **/
 protected function configure()
 {
     parent::configure();
     if ($tmp = $this->options['tmpPath']) {
         if (!file_exists($tmp)) {
             if (@mkdir($tmp)) {
                 @chmod($tmp, $this->options['tmbPathMode']);
             }
         }
         $this->tmpPath = is_dir($tmp) && is_writable($tmp) ? $tmp : false;
     }
     if (!$this->tmpPath && $this->tmbPath && $this->tmbPathWritable) {
         $this->tmpPath = $this->tmbPath;
     }
     $this->mimeDetect = 'internal';
 }