Continued to add the namespacing for the file and folder classes across the system. gh-682

This commit is contained in:
2021-03-09 00:36:30 +02:00
parent 1279a5d2f9
commit 08d529aba9
23 changed files with 164 additions and 100 deletions

View File

@ -12,6 +12,8 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
JHTML::_('behavior.modal');
/**
@ -5988,12 +5990,12 @@ class com_componentbuilderInstallerScript
{
}
// check if the PHPExcel stuff is still around
if (JFile::exists(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/PHPExcel.php'))
if (File::exists(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/PHPExcel.php'))
{
// We need to remove this old PHPExcel folder
$this->removeFolder(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/PHPExcel');
// We need to remove this old PHPExcel file
JFile::delete(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/PHPExcel.php');
File::delete(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/PHPExcel.php');
}
return true;
}
@ -10887,7 +10889,7 @@ class com_componentbuilderInstallerScript
*/
protected function removeFolder($dir, $ignore = false)
{
if (JFolder::exists($dir))
if (Folder::exists($dir))
{
$it = new RecursiveDirectoryIterator($dir);
$it = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
@ -10917,7 +10919,7 @@ class com_componentbuilderInstallerScript
{
continue;
}
JFolder::delete($file_dir);
Folder::delete($file_dir);
}
else
{
@ -10936,13 +10938,13 @@ class com_componentbuilderInstallerScript
{
continue;
}
JFile::delete($file_dir);
File::delete($file_dir);
}
}
// delete the root folder if not ignore found
if (!$this->checkArray($ignore))
{
return JFolder::delete($dir);
return Folder::delete($dir);
}
return true;
}
@ -10988,7 +10990,7 @@ class com_componentbuilderInstallerScript
$installer = $parent->getParent();
$installPath = $installer->getPath('source');
// get all the folders
$folders = JFolder::folders($installPath);
$folders = Folder::folders($installPath);
// check if we have folders we may want to copy
$doNotCopy = array('media','admin','site'); // Joomla already deals with these
if (count((array) $folders) > 1)
@ -11003,7 +11005,7 @@ class com_componentbuilderInstallerScript
// set the destination path
$dest = JPATH_ROOT.'/'.$folder;
// now try to copy the folder
if (!JFolder::copy($src, $dest, '', true))
if (!Folder::copy($src, $dest, '', true))
{
$app->enqueueMessage('Could not copy '.$folder.' folder into place, please make sure destination is writable!', 'error');
}