Pop\Archive\Archive::setAdapter PHP Method

setAdapter() protected method

Method to set the adapter based on the file name
protected setAdapter ( string $password = null, string $prefix ) : void
$password string
$prefix string
return void
    protected function setAdapter($password = null, $prefix)
    {
        $ext = strtolower($this->ext);
        if ($ext == 'tar' || stripos($ext, 'bz') !== false || stripos($ext, 'gz') !== false) {
            $class = $prefix . 'Tar';
        } else {
            $class = $prefix . ucfirst($ext);
        }
        $this->adapter = null !== $password ? new $class($this, $password) : new $class($this);
    }