| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 87 | 2 | 2 | 0.963 | statement_sequence[16] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 87 | 149 | installation/models/filesystem.php |
| 2 | 87 | 301 | installation/models/filesystem.php |
| ||||
// Verify PWD function
if ($ftp->pwd() === FALSE) {
$ftp->quit();
$this->setError(JText::_('NOPWD'));
return FALSE;
}
// Verify root path exists
if (!$ftp->chdir($root)) {
$ftp->quit();
$this->setError(JText::_('NOROOT'));
return FALSE;
}
// Verify NLST function
if (($rootList= $ftp->listNames()) === FALSE) {
$ftp->quit();
$this->setError(JText::_('NONLST'));
return FALSE;
}
// Verify LIST function
if ($ftp->listDetails() === FALSE) {
$ftp->quit();
$this->setError(JText::_('NOLIST'));
return FALSE;
}
// Verify SYST function
if ($ftp->syst() === FALSE) {
$ftp->quit();
$this->setError(JText::_('NOSYST'));
return FALSE;
}
// Verify valid root path, part one
$checkList= array( 'robots.txt', 'index.php'
);
if (count(array_diff($checkList, $rootList))) {
$ftp->quit();
$this->setError(JText::_('INVALIDROOT'));
return FALSE;
}
// Verify RETR function
$buffer= NULL;
if ($ftp->read($root
. '/libraries/joomla/version.php', $buffer) === FALSE) {
$ftp->quit();
$this->setError(JText::_('NORETR'));
return FALSE;
}
// Verify valid root path, part two
$checkValue= file_get_contents(JPATH_LIBRARIES
. DS
. 'joomla'
. DS
. 'version.php');
if ($buffer !== $checkValue) {
$ftp->quit();
$this->setError(JText::_('INVALIDROOT'));
return FALSE;
}
// Verify STOR function
if ($ftp->create($root
. '/ftp_testfile') === FALSE) {
$ftp->quit();
$this->setError(JText::_('NOSTOR'));
return FALSE;
}
// Verify DELE function
if ($ftp->delete($root
. '/ftp_testfile') === FALSE) {
$ftp->quit();
$this->setError(JText::_('NODELE'));
return FALSE;
}
// Verify MKD function
if ($ftp->mkdir($root
. '/ftp_testdir') === FALSE) {
$ftp->quit();
$this->setError(JText::_('NOMKD'));
return FALSE;
}
// Verify RMD function
if ($ftp->delete($root
. '/ftp_testdir') === FALSE) {
$ftp->quit();
$this->setError(JText::_('NORMD'));
return FALSE;
}
$ftp->quit();
|
| ||||
// Verify PWD function
if ($ftp->pwd() === FALSE) {
$ftp->quit();
$this->setError(JText::_('NOPWD'));
return FALSE;
}
// Verify root path exists
if (!$ftp->chdir($root)) {
$ftp->quit();
$this->setError(JText::_('NOROOT'));
return FALSE;
}
// Verify NLST function
if (($rootList= $ftp->listNames()) === FALSE) {
$ftp->quit();
$this->setError(JText::_('NONLST'));
return FALSE;
}
// Verify LIST function
if ($ftp->listDetails() === FALSE) {
$ftp->quit();
$this->setError(JText::_('NOLIST'));
return FALSE;
}
// Verify SYST function
if ($ftp->syst() === FALSE) {
$ftp->quit();
$this->setError(JText::_('NOSYST'));
return FALSE;
}
// Verify valid root path, part one
$checkList= array( 'CHANGELOG.php', 'COPYRIGHT.php', 'index.php', 'INSTALL.php', 'LICENSE.php'
);
if (count(array_diff($checkList, $rootList))) {
$ftp->quit();
$this->setError(JText::_('INVALIDROOT'));
return FALSE;
}
// Verify RETR function
$buffer= NULL;
if ($ftp->read($root
. '/libraries/joomla/version.php', $buffer) === FALSE) {
$ftp->quit();
$this->setError(JText::_('NORETR'));
return FALSE;
}
// Verify valid root path, part two
$checkValue= file_get_contents(JPATH_LIBRARIES
. DS
. 'joomla'
. DS
. 'version.php');
if ($buffer !== $checkValue) {
$ftp->quit();
$this->setError(JText::_('INVALIDROOT'));
return FALSE;
}
// Verify STOR function
if ($ftp->create($root
. '/ftp_testfile') === FALSE) {
$ftp->quit();
$this->setError(JText::_('NOSTOR'));
return FALSE;
}
// Verify DELE function
if ($ftp->delete($root
. '/ftp_testfile') === FALSE) {
$ftp->quit();
$this->setError(JText::_('NODELE'));
return FALSE;
}
// Verify MKD function
if ($ftp->mkdir($root
. '/ftp_testdir') === FALSE) {
$ftp->quit();
$this->setError(JText::_('NOMKD'));
return FALSE;
}
// Verify RMD function
if ($ftp->delete($root
. '/ftp_testdir') === FALSE) {
$ftp->quit();
$this->setError(JText::_('NORMD'));
return FALSE;
}
return TRUE;
|
| |||
// Verify PWD function
if ($ftp->pwd() === FALSE) {
$ftp->quit();
$this->setError(JText::_('NOPWD'));
return FALSE;
}
// Verify root path exists
if (!$ftp->chdir($root)) {
$ftp->quit();
$this->setError(JText::_('NOROOT'));
return FALSE;
}
// Verify NLST function
if (($rootList=$ftp->listNames()) === FALSE) {
$ftp->quit();
$this->setError(JText::_('NONLST'));
return FALSE;
}
// Verify LIST function
if ($ftp->listDetails() === FALSE) {
$ftp->quit();
$this->setError(JText::_('NOLIST'));
return FALSE;
}
// Verify SYST function
if ($ftp->syst() === FALSE) {
$ftp->quit();
$this->setError(JText::_('NOSYST'));
return FALSE;
}
// Verify valid root path, part one
$checkList=array( [[#variable50a34980]]
);
if (count(array_diff($checkList,$rootList))) {
$ftp->quit();
$this->setError(JText::_('INVALIDROOT'));
return FALSE;
}
// Verify RETR function
$buffer=NULL;
if ($ftp->read($root
. '/libraries/joomla/version.php',$buffer) === FALSE) {
$ftp->quit();
$this->setError(JText::_('NORETR'));
return FALSE;
}
// Verify valid root path, part two
$checkValue=file_get_contents(JPATH_LIBRARIES
. DS
. 'joomla'
. DS
. 'version.php');
if ($buffer !== $checkValue) {
$ftp->quit();
$this->setError(JText::_('INVALIDROOT'));
return FALSE;
}
// Verify STOR function
if ($ftp->create($root
. '/ftp_testfile') === FALSE) {
$ftp->quit();
$this->setError(JText::_('NOSTOR'));
return FALSE;
}
// Verify DELE function
if ($ftp->delete($root
. '/ftp_testfile') === FALSE) {
$ftp->quit();
$this->setError(JText::_('NODELE'));
return FALSE;
}
// Verify MKD function
if ($ftp->mkdir($root
. '/ftp_testdir') === FALSE) {
$ftp->quit();
$this->setError(JText::_('NOMKD'));
return FALSE;
}
// Verify RMD function
if ($ftp->delete($root
. '/ftp_testdir') === FALSE) {
$ftp->quit();
$this->setError(JText::_('NORMD'));
return FALSE;
}
[[#variable48c0c460]]
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#50a34980]] | 'robots.txt', 'index.php' |
| 1 | 2 | [[#50a34980]] | 'CHANGELOG.php', 'COPYRIGHT.php', 'index.php', 'INSTALL.php', 'LICENSE.php' |
| 2 | 1 | [[#48c0c460]] | $ftp->quit(); |
| 2 | 2 | [[#48c0c460]] | return TRUE; |