elFinder\elFinder::extract PHP Method

extract() protected method

Extract files from archive
Author: Dmitry (dio) Levashov,
Author: Alexey Sukhotin
protected extract ( array $args ) : array
$args array command arguments
return array
    protected function extract($args)
    {
        $target = $args['target'];
        $mimes = !empty($args['mimes']) && is_array($args['mimes']) ? $args['mimes'] : array();
        $error = array(self::ERROR_EXTRACT, '#' . $target);
        if (($volume = $this->volume($target)) == false || ($file = $volume->file($target)) == false) {
            return array('error' => $this->error(self::ERROR_EXTRACT, '#' . $target, self::ERROR_FILE_NOT_FOUND));
        }
        return ($file = $volume->extract($target)) ? array('added' => array($file)) : array('error' => $this->error(self::ERROR_EXTRACT, $volume->path($target), $volume->error()));
    }