Вход Регистрация
Файл: adultscript-2.0.3-pro/files/libraries/framework/archive.php
Строк: 21
<?php
defined
('_VALID') or die('Restricted Access!');
class 
VArchive
{
    protected 
$paths;
    protected 
$driver;
    protected 
$archives = array(
        
'zip'        => 'zip',
        
'tar'        => 'tar',
        
'gz'        => 'gzip',
        
'bzip'        => 'bzip',
        
'bz'        => 'bzip',
        
'bzip2'        => 'bzip',
        
'bz2'        => 'bzip',
        
'tgz'        => 'gzip',
        
'tgzip'        => 'gzip',
        
'tbzip'        => 'bzip',
        
'tbz'        => 'bzip',
        
'tbzip2'    => 'bzip',
        
'tbz2'        => 'bzip',
        
'rar'        => 'rar'
    
);

    public function 
__construct()
    {
    }
    
    protected function 
load($src)
    {
        
$ext    VFile::ext($src);
        if (isset(
$this->archives[$ext])) {
            
$driver $this->archive[$ext];
            
$class     'VArchive_Driver_'.$driver;
            
VF::load('framework.archive.'.$driver);
            
$this->driver     = new $class($src);
        } else {
            throw new 
VException('Invalid archive type!');
        }
    }
    
    protected function 
info()
    {
        
$this->driver->info();
    }
    
    protected function 
extract($dst)
    {
        
$this->driver->extract($dst);
    }
    
    protected function 
create($src$dst$type='zip')
    {
        
$this->driver->create($src$dst);
    }
    
    protected function 
add($dir)
    {
    }
}
Онлайн: 1
Реклама