| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 32 | 2 | 4 | 0.993 | switch_statement_sequence[3] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 32 | 51 | libraries/joomla/filesystem/archive.php |
| 2 | 32 | 83 | 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;
|
| ||||
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;
|
| |||
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 Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#3f0b9c00]] | 'tgz' |
| 1 | 2 | [[#3f0b9c00]] | 'tbz2' |
| 2 | 1 | [[#3f0b9b40]] | 'gz' |
| 2 | 2 | [[#3f0b9b40]] | 'bz2' |
| 3 | 1 | [[#3f722a80]] | 'gzip' |
| 3 | 2 | [[#3f722a80]] | 'bzip2' |
| 4 | 1 | [[#3f0b9ae0]] | $gzresult |
| 4 | 2 | [[#3f0b9ae0]] | $bzresult |