本文整理匯總了PHP中JInstaller::copyFiles方法的典型用法代碼示例。如果您正苦於以下問題:PHP JInstaller::copyFiles方法的具體用法?PHP JInstaller::copyFiles怎麽用?PHP JInstaller::copyFiles使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JInstaller
的用法示例。
在下文中一共展示了JInstaller::copyFiles方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: copyFiles
function copyFiles($files, $overwrite = null)
{
$ftp = JClientHelper::getCredentials('ftp');
// try to make writeable
if ($overwrite || $this->getOverwrite()) {
foreach ($files as $file) {
$type = array_key_exists('type', $file) ? $file['type'] : 'file';
switch ($type) {
case 'file':
if (!$ftp['enabled'] && JFile::exists($file['dest']) && JPath::isOwner($file['dest'])) {
JPath::setPermissions($file['dest']);
}
break;
case 'folder':
if (!$ftp['enabled'] && JFolder::exists($file['dest']) && JPath::isOwner($file['dest'])) {
JPath::setPermissions($file['dest']);
}
break;
}
}
}
return parent::copyFiles($files, $overwrite);
}
示例2: copyFiles
public function copyFiles($files, $overwrite = null)
{
// To allow for manual override on the overwriting flag, we check to see if
// the $overwrite flag was set and is a boolean value. If not, use the object
// allowOverwrite flag.
if (is_null($overwrite) || !is_bool($overwrite)) {
if (version_compare(JVERSION, '3.0', '<')) {
// Joomla 2.5 compatibility.
$overwrite = $this->_overwrite;
} else {
$overwrite = $this->overwrite;
}
}
$ftp = JClientHelper::getCredentials('ftp');
if (!$ftp['enabled'] && $overwrite && is_array($files)) {
foreach ($files as $file) {
$filedest = JPath::clean($file['dest']);
$filetype = array_key_exists('type', $file) ? $file['type'] : 'file';
switch ($filetype) {
case 'file':
if (JFile::exists($filedest) && JPath::isOwner($filedest)) {
JPath::setPermissions($filedest);
}
break;
case 'folder':
if (JFolder::exists($filedest) && JPath::isOwner($filedest)) {
JPath::setPermissions($filedest);
}
break;
}
}
}
return parent::copyFiles($files, $overwrite);
}