CloneSet123


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
32240.993switch_statement_sequence[3]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
13251
libraries/joomla/filesystem/archive.php
23283
libraries/joomla/filesystem/archive.php
Clone Instance
1
Line Count
32
Source Line
51
Source File
libraries/joomla/filesystem/archive.php

                        case 'tgz'  :
                                $untar=  TRUE;  // This format is a tarball gzip'd
                        case 'gz'   :   // This may just be an individual file (e.g. sql script)
                        case 'gzip' :
                                $adapter=  &JArchive::getAdapter('gzip');
                                if ($adapter)
                                {
                                        $config=  &JFactory::getConfig();
                                        $tmpfname=  $config->getValue('config.tmp_path')
                                        .                                                DS
                                        .                                                   uniqid('gzip');
                                        $gzresult=  $adapter->extract($archivename, $tmpfname);
                                        if (JError::isError($gzresult))
                                        {
                                                @unlink($tmpfname);
                                                return FALSE;
                                              }
                                        if ($untar)
                                        {
                                                // Try to untar the file
                                                $tadapter=  &JArchive::getAdapter('tar');
                                                if ($tadapter) {
                                                        $result=  $tadapter->extract($tmpfname, $extractdir);
                                                      }
                                              }
                                        else
                                        {
                                                $path=  JPath::clean($extractdir);
                                                JFolder::create($path);
                                                $result=  JFile::copy($tmpfname,$path
                                                                                .     DS
                                                                                .        JFile::stripExt(JFile::getName(strtolower($archivename))),NULL,1);
                                              }
                                        @unlink($tmpfname);
                                      }
                                break;


Clone Instance
2
Line Count
32
Source Line
83
Source File
libraries/joomla/filesystem/archive.php

                        case 'tbz2' :
                                $untar=  TRUE; // This format is a tarball bzip2'd
                        case 'bz2'  :   // This may just be an individual file (e.g. sql script)
                        case 'bzip2':
                                $adapter=  &JArchive::getAdapter('bzip2');
                                if ($adapter)
                                {
                                        $config=  &JFactory::getConfig();
                                        $tmpfname=  $config->getValue('config.tmp_path')
                                        .                                                DS
                                        .                                                   uniqid('bzip2');
                                        $bzresult=  $adapter->extract($archivename, $tmpfname);
                                        if (JError::isError($bzresult))
                                        {
                                                @unlink($tmpfname);
                                                return FALSE;
                                              }
                                        if ($untar)
                                        {
                                                // Try to untar the file
                                                $tadapter=  &JArchive::getAdapter('tar');
                                                if ($tadapter) {
                                                        $result=  $tadapter->extract($tmpfname, $extractdir);
                                                      }
                                              }
                                        else
                                        {
                                                $path=  JPath::clean($extractdir);
                                                JFolder::create($path);
                                                $result=  JFile::copy($tmpfname,$path
                                                                                .     DS
                                                                                .        JFile::stripExt(JFile::getName(strtolower($archivename))),NULL,1);
                                              }
                                        @unlink($tmpfname);
                                      }
                                break;


Clone AbstractionParameter Count: 4Parameter Bindings

case [[#variable3f0b9c00]]:
  $untar=TRUE; // This format is a tarball gzip'd // This format is a tarball bzip2'd
case [[#variable3f0b9b40]]: // This may just be an individual file (e.g. sql script)
case [[#variable3f722a80]]:
  $adapter= &JArchive::getAdapter( [[#variable3f722a80]]);
  if ($adapter) {
    $config= &JFactory::getConfig();
    $tmpfname=$config->getValue('config.tmp_path')
    . DS
    . uniqid( [[#variable3f722a80]]);
     [[#variable3f0b9ae0]]=$adapter->extract($archivename,$tmpfname);
    if (JError::isError( [[#variable3f0b9ae0]])) {
      @unlink($tmpfname);
      return FALSE;
    }
    if ($untar) {
      // Try to untar the file
      $tadapter= &JArchive::getAdapter('tar');
      if ($tadapter) {
        $result=$tadapter->extract($tmpfname,$extractdir);
      }
    }
    else {
      $path=JPath::clean($extractdir);
      JFolder::create($path);
      $result=JFile::copy($tmpfname,$path
                                    . DS
                                    . JFile::stripExt(JFile::getName(strtolower($archivename))),NULL,1);
    }
    @unlink($tmpfname);
  }
  break;
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#3f0b9c00]]
'tgz' 
12[[#3f0b9c00]]
'tbz2' 
21[[#3f0b9b40]]
'gz' 
22[[#3f0b9b40]]
'bz2' 
31[[#3f722a80]]
'gzip' 
32[[#3f722a80]]
'bzip2' 
41[[#3f0b9ae0]]
$gzresult 
42[[#3f0b9ae0]]
$bzresult