| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 30 | 2 | 6 | 0.968 | class_member |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 30 | 132 | administrator/components/com_templates/models/cssedit.php |
| 2 | 31 | 119 | administrator/components/com_templates/models/source.php |
| ||||
/**
* Method to store the Template
*
* @access public
* @return boolean True on success
* @since 1.6
*/
function store($filecontent) {
// Set FTP credentials, if given
jimport('joomla.client.helper');
JClientHelper::setCredentialsFromRequest('ftp');
$ftp= JClientHelper::getCredentials('ftp');
$file= $this->_client->path
. DS
. 'templates'
. DS
. $this->_template
. DS
. 'css'
. DS
. $this->_filename;
// Try to make the css file writeable
if (!$ftp['enabled']
&& JPath::isOwner($file)
&& !JPath::setPermissions($file, '0755')) {
$this->setError(JText::_('Could not make the css file writable'));
return FALSE;
}
jimport('joomla.filesystem.file');
$return= JFile::write($file, $filecontent);
// Try to make the css file unwriteable
if (!$ftp['enabled']
&& JPath::isOwner($file)
&& !JPath::setPermissions($file, '0555')) {
$this->setError(JText::_('Could not make the css file unwritable'));
return FALSE;
}
if (!$return)
{
$this->setError(JText::_('Operation Failed')
. ': '
. JText::sprintf('Failed to open file for writing.', $file));
return FALSE;
}
return TRUE;
}
|
| ||||
/**
* Method to store the Template
*
* @access public
* @return boolean True on success
* @since 1.6
*/
function store($filecontent) {
// Set FTP credentials, if given
jimport('joomla.client.helper');
JClientHelper::setCredentialsFromRequest('ftp');
$ftp= JClientHelper::getCredentials('ftp');
$file= $this->_client->path
. DS
. 'templates'
. DS
. $this->_template
. DS
. 'index.php';
// Try to make the template file writeable
if (!$ftp['enabled']
&& JPath::isOwner($file)
&& !JPath::setPermissions($file, '0755')) {
$this->setError(JText::_('Could not make the template file writable'));
return FALSE;
}
jimport('joomla.filesystem.file');
$return= JFile::write($file, $filecontent);
// Try to make the template file unwriteable
if (!$ftp['enabled']
&& JPath::isOwner($file)
&& !JPath::setPermissions($file, '0555')) {
$this->setError(JText::_('Could not make the template file unwritable'));
return FALSE;
}
if (!$return)
{
$this->setError(JText::_('Operation Failed')
. ': '
. JText::sprintf('Failed to open file for writing.', $file));
return FALSE;
}
return TRUE;
}
|
| |||
/**
* Method to store the Template
*
* @access public
* @return boolean True on success
* @since 1.6
*/
function store($filecontent) {
// Set FTP credentials, if given
jimport('joomla.client.helper');
JClientHelper::setCredentialsFromRequest('ftp');
$ftp=JClientHelper::getCredentials('ftp');
$file= [[#variable23393fe0]]
. DS
. [[#variable23393f60]]
. DS
. [[#variable23393ec0]]
. DS
. [[#variable23393e20]];
// Try to make the css file writeable
// Try to make the template file writeable
if (!$ftp['enabled']
&& JPath::isOwner($file)
&& !JPath::setPermissions($file,'0755')) {
$this->setError(JText::_( [[#variable23393d60]]));
return FALSE;
}
jimport('joomla.filesystem.file');
$return=JFile::write($file,$filecontent);
// Try to make the css file unwriteable
// Try to make the template file unwriteable
if (!$ftp['enabled']
&& JPath::isOwner($file)
&& !JPath::setPermissions($file,'0555')) {
$this->setError(JText::_( [[#variable23393ce0]]));
return FALSE;
}
if (!$return) {
$this->setError(JText::_('Operation Failed')
. ': '
. JText::sprintf('Failed to open file for writing.',$file));
return FALSE;
}
return TRUE;
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#23393fe0]] | $this->_client->path . DS . 'templates' |
| 1 | 2 | [[#23393fe0]] | $this->_client->path |
| 2 | 1 | [[#23393f60]] | $this->_template |
| 2 | 2 | [[#23393f60]] | 'templates' |
| 3 | 1 | [[#23393ec0]] | 'css' |
| 3 | 2 | [[#23393ec0]] | $this->_template |
| 4 | 1 | [[#23393e20]] | $this->_filename |
| 4 | 2 | [[#23393e20]] | 'index.php' |
| 5 | 1 | [[#23393d60]] | 'Could not make the css file writable' |
| 5 | 2 | [[#23393d60]] | 'Could not make the template file writable' |
| 6 | 1 | [[#23393ce0]] | 'Could not make the css file unwritable' |
| 6 | 2 | [[#23393ce0]] | 'Could not make the template file unwritable' |