File and folder path fix for Joomla 3.9.25 #692

Merged
Llewellyn merged 6 commits from staging into master 2021-03-11 03:04:50 +00:00
1649 changed files with 116040 additions and 115957 deletions

View File

@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.12.8) with **ALL** its features and **ALL** concepts totally open-source and free! You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.12.9) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -143,11 +143,11 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 5th March, 2021 + *Last Build*: 10th March, 2021
+ *Version*: 2.12.8 + *Version*: 2.12.9
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **292184** + *Line count*: **292188**
+ *Field count*: **1629** + *Field count*: **1629**
+ *File count*: **1935** + *File count*: **1935**
+ *Folder count*: **322** + *Folder count*: **322**

View File

@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.12.8) with **ALL** its features and **ALL** concepts totally open-source and free! You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.12.9) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -143,11 +143,11 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 5th March, 2021 + *Last Build*: 10th March, 2021
+ *Version*: 2.12.8 + *Version*: 2.12.9
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **292184** + *Line count*: **292188**
+ *Field count*: **1629** + *Field count*: **1629**
+ *File count*: **1935** + *File count*: **1935**
+ *Folder count*: **322** + *Folder count*: **322**

View File

@ -569,12 +569,12 @@ abstract class ###Component###Helper
$filePath = $path . '/' . $name . '.php'; $filePath = $path . '/' . $name . '.php';
$fullPathModel = $fullPathModels . '/' . $name . '.php'; $fullPathModel = $fullPathModels . '/' . $name . '.php';
// check if it exists // check if it exists
if (JFile::exists($filePath)) if (File::exists($filePath))
{ {
// get the file // get the file
require_once $filePath; require_once $filePath;
} }
elseif (JFile::exists($fullPathModel)) elseif (File::exists($fullPathModel))
{ {
// get the file // get the file
require_once $fullPathModel; require_once $fullPathModel;

View File

@ -201,12 +201,12 @@ abstract class ###Component###Helper
$filePath = $path . '/' . $name . '.php'; $filePath = $path . '/' . $name . '.php';
$fullPathModel = $fullPathModels . '/' . $name . '.php'; $fullPathModel = $fullPathModels . '/' . $name . '.php';
// check if it exists // check if it exists
if (JFile::exists($filePath)) if (File::exists($filePath))
{ {
// get the file // get the file
require_once $filePath; require_once $filePath;
} }
elseif (JFile::exists($fullPathModel)) elseif (File::exists($fullPathModel))
{ {
// get the file // get the file
require_once $fullPathModel; require_once $fullPathModel;

View File

@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet\IOFactory;
@ -227,7 +229,7 @@ class ###Component###ModelImport extends JModelLegacy
// Move uploaded file // Move uploaded file
jimport('joomla.filesystem.file'); jimport('joomla.filesystem.file');
$p_file = JFile::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions); $p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
// Was the package downloaded? // Was the package downloaded?
if (!$p_file) if (!$p_file)
@ -383,12 +385,12 @@ class ###Component###ModelImport extends JModelLegacy
// Is the package file a valid file? // Is the package file a valid file?
if (is_file($package)) if (is_file($package))
{ {
JFile::delete($package); File::delete($package);
} }
elseif (is_file(JPath::clean($package))) elseif (is_file(JPath::clean($package)))
{ {
// It might also be just a base filename // It might also be just a base filename
JFile::delete(JPath::clean($package)); File::delete(JPath::clean($package));
} }
}###IMPORT_SETDATA_METHOD######IMPORT_SAVE_METHOD### }###IMPORT_SETDATA_METHOD######IMPORT_SAVE_METHOD###

View File

@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet\IOFactory;
@ -116,8 +118,7 @@ class ###Component###Model###View### extends JModelLegacy
$tmp_src = $userfile['tmp_name']; $tmp_src = $userfile['tmp_name'];
// Move uploaded file // Move uploaded file
jimport('joomla.filesystem.file'); $p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
$p_file = JFile::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
// Was the package downloaded? // Was the package downloaded?
if (!$p_file) if (!$p_file)
@ -274,12 +275,12 @@ class ###Component###Model###View### extends JModelLegacy
// Is the package file a valid file? // Is the package file a valid file?
if (is_file($package)) if (is_file($package))
{ {
JFile::delete($package); File::delete($package);
} }
elseif (is_file(JPath::clean($package))) elseif (is_file(JPath::clean($package)))
{ {
// It might also be just a base filename // It might also be just a base filename
JFile::delete(JPath::clean($package)); File::delete(JPath::clean($package));
} }
} }
###IMPORT_SETDATA_METHOD### ###IMPORT_SETDATA_METHOD###

View File

@ -16,7 +16,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); ###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_GET_MODULE_JIMPORT### defined('_JEXEC') or die('Restricted access'); ###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_GET_MODULE_JIMPORT###
###CUSTOM_ADMIN_VIEW_HTML_HEADER###
/** /**
* ###Component### View class for the ###SView### * ###Component### View class for the ###SView###
*/ */

View File

@ -16,7 +16,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
###ADMIN_VIEW_HTML_HEADER###
/** /**
* ###View### View class * ###View### View class
*/ */

View File

@ -16,7 +16,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
###SITE_ADMIN_VIEW_HTML_HEADER###
/** /**
* ###View### View class * ###View### View class
*/ */

View File

@ -16,7 +16,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
###ADMIN_VIEWS_HTML_HEADER###
/** /**
* ###Component### View class for the ###Views### * ###Component### View class for the ###Views###
*/ */

View File

@ -16,7 +16,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_GET_MODULE_JIMPORT### defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_GET_MODULE_JIMPORT###
###CUSTOM_ADMIN_VIEWS_HTML_HEADER###
/** /**
* ###Component### View class for the ###SViews### * ###Component### View class for the ###SViews###
*/ */

View File

@ -16,7 +16,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_GET_MODULE_JIMPORT### defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_GET_MODULE_JIMPORT###
###SITE_VIEWS_HTML_HEADER###
/** /**
* ###Component### View class for the ###SViews### * ###Component### View class for the ###SViews###
*/ */

View File

@ -16,7 +16,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_GET_MODULE_JIMPORT### defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_GET_MODULE_JIMPORT###
###SITE_VIEW_HTML_HEADER###
/** /**
* ###Component### View class for the ###SView### * ###Component### View class for the ###SView###
*/ */

View File

@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
JHTML::_('behavior.modal'); JHTML::_('behavior.modal');
/** /**
@ -97,12 +99,12 @@ class com_###component###InstallerScript
{###PREINSTALLSCRIPT### {###PREINSTALLSCRIPT###
} }
// check if the PHPExcel stuff is still around // check if the PHPExcel stuff is still around
if (JFile::exists(JPATH_ADMINISTRATOR . '/components/com_###component###/helpers/PHPExcel.php')) if (File::exists(JPATH_ADMINISTRATOR . '/components/com_###component###/helpers/PHPExcel.php'))
{ {
// We need to remove this old PHPExcel folder // We need to remove this old PHPExcel folder
$this->removeFolder(JPATH_ADMINISTRATOR . '/components/com_###component###/helpers/PHPExcel'); $this->removeFolder(JPATH_ADMINISTRATOR . '/components/com_###component###/helpers/PHPExcel');
// We need to remove this old PHPExcel file // We need to remove this old PHPExcel file
JFile::delete(JPATH_ADMINISTRATOR . '/components/com_###component###/helpers/PHPExcel.php'); File::delete(JPATH_ADMINISTRATOR . '/components/com_###component###/helpers/PHPExcel.php');
} }
return true; return true;
} }
@ -141,7 +143,7 @@ class com_###component###InstallerScript
*/ */
protected function removeFolder($dir, $ignore = false) protected function removeFolder($dir, $ignore = false)
{ {
if (JFolder::exists($dir)) if (Folder::exists($dir))
{ {
$it = new RecursiveDirectoryIterator($dir); $it = new RecursiveDirectoryIterator($dir);
$it = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST); $it = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
@ -171,7 +173,7 @@ class com_###component###InstallerScript
{ {
continue; continue;
} }
JFolder::delete($file_dir); Folder::delete($file_dir);
} }
else else
{ {
@ -190,13 +192,13 @@ class com_###component###InstallerScript
{ {
continue; continue;
} }
JFile::delete($file_dir); File::delete($file_dir);
} }
} }
// delete the root folder if not ignore found // delete the root folder if not ignore found
if (!$this->checkArray($ignore)) if (!$this->checkArray($ignore))
{ {
return JFolder::delete($dir); return Folder::delete($dir);
} }
return true; return true;
} }

View File

@ -12,6 +12,8 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
// Use the component builder autoloader // Use the component builder autoloader
ComponentbuilderHelper::autoLoader(); ComponentbuilderHelper::autoLoader();
@ -391,7 +393,7 @@ class Compiler extends Infusion
// first we do the static files // first we do the static files
foreach ($this->newFiles['static'] as $static) foreach ($this->newFiles['static'] as $static)
{ {
if (JFile::exists($static['path'])) if (File::exists($static['path']))
{ {
$this->setFileContent( $this->setFileContent(
$static['name'], $static['path'], $bom $static['name'], $static['path'], $bom
@ -410,7 +412,7 @@ class Compiler extends Infusion
{ {
if ($file['view'] == $view) if ($file['view'] == $view)
{ {
if (JFile::exists($file['path'])) if (File::exists($file['path']))
{ {
$this->setFileContent( $this->setFileContent(
$file['name'], $file['path'], $bom, $file['name'], $file['path'], $bom,
@ -492,7 +494,7 @@ class Compiler extends Infusion
// update the module files // update the module files
foreach ($this->newFiles[$module->key] as $module_file) foreach ($this->newFiles[$module->key] as $module_file)
{ {
if (JFile::exists($module_file['path'])) if (File::exists($module_file['path']))
{ {
$this->setFileContent( $this->setFileContent(
$module_file['name'], $module_file['path'], $module_file['name'], $module_file['path'],
@ -573,7 +575,7 @@ class Compiler extends Infusion
// update the plugin files // update the plugin files
foreach ($this->newFiles[$plugin->key] as $plugin_file) foreach ($this->newFiles[$plugin->key] as $plugin_file)
{ {
if (JFile::exists($plugin_file['path'])) if (File::exists($plugin_file['path']))
{ {
$this->setFileContent( $this->setFileContent(
$plugin_file['name'], $plugin_file['path'], $plugin_file['name'], $plugin_file['path'],
@ -674,7 +676,7 @@ class Compiler extends Infusion
$update_server_xml_path = $this->componentPath . '/' $update_server_xml_path = $this->componentPath . '/'
. $this->updateServerFileName . '.xml'; . $this->updateServerFileName . '.xml';
// make sure we have the correct file // make sure we have the correct file
if (JFile::exists($update_server_xml_path) if (File::exists($update_server_xml_path)
&& isset($this->componentData->update_server)) && isset($this->componentData->update_server))
{ {
// move to server // move to server
@ -685,7 +687,7 @@ class Compiler extends Infusion
$this->componentData->update_server_protocol $this->componentData->update_server_protocol
); );
// remove the local file // remove the local file
JFile::delete($update_server_xml_path); File::delete($update_server_xml_path);
} }
} }
// move the plugins update server to host // move the plugins update server to host
@ -702,7 +704,7 @@ class Compiler extends Infusion
&& is_numeric($plugin->update_server) && is_numeric($plugin->update_server)
&& $plugin->update_server > 0 && $plugin->update_server > 0
&& isset($plugin->update_server_xml_path) && isset($plugin->update_server_xml_path)
&& JFile::exists($plugin->update_server_xml_path) && File::exists($plugin->update_server_xml_path)
&& isset($plugin->update_server_xml_file_name) && isset($plugin->update_server_xml_file_name)
&& ComponentbuilderHelper::checkString( && ComponentbuilderHelper::checkString(
$plugin->update_server_xml_file_name $plugin->update_server_xml_file_name
@ -716,7 +718,7 @@ class Compiler extends Infusion
$plugin->update_server_protocol $plugin->update_server_protocol
); );
// remove the local file // remove the local file
JFile::delete($plugin->update_server_xml_path); File::delete($plugin->update_server_xml_path);
} }
} }
} }
@ -810,7 +812,7 @@ class Compiler extends Infusion
if (('README.md' === $static['name'] if (('README.md' === $static['name']
|| 'README.txt' === $static['name']) || 'README.txt' === $static['name'])
&& $this->componentData->addreadme && $this->componentData->addreadme
&& JFile::exists($static['path'])) && File::exists($static['path']))
{ {
$this->setReadMe($static['path']); $this->setReadMe($static['path']);
$two++; $two++;
@ -934,7 +936,7 @@ class Compiler extends Infusion
// remove old data // remove old data
$this->removeFolder($repoFullPath, $this->componentData->toignore); $this->removeFolder($repoFullPath, $this->componentData->toignore);
// set the new data // set the new data
JFolder::copy($this->componentPath, $repoFullPath, '', true); Folder::copy($this->componentPath, $repoFullPath, '', true);
// Trigger Event: jcb_ce_onAfterUpdateRepo // Trigger Event: jcb_ce_onAfterUpdateRepo
$this->triggerEvent( $this->triggerEvent(
'jcb_ce_onAfterUpdateRepo', 'jcb_ce_onAfterUpdateRepo',
@ -967,7 +969,7 @@ class Compiler extends Infusion
$repoFullPath, $this->componentData->toignore $repoFullPath, $this->componentData->toignore
); );
// set the new data // set the new data
JFolder::copy( Folder::copy(
$module->folder_path, $repoFullPath, '', true $module->folder_path, $repoFullPath, '', true
); );
// Trigger Event: jcb_ce_onAfterUpdateRepo // Trigger Event: jcb_ce_onAfterUpdateRepo
@ -1004,7 +1006,7 @@ class Compiler extends Infusion
$repoFullPath, $this->componentData->toignore $repoFullPath, $this->componentData->toignore
); );
// set the new data // set the new data
JFolder::copy( Folder::copy(
$plugin->folder_path, $repoFullPath, '', true $plugin->folder_path, $repoFullPath, '', true
); );
// Trigger Event: jcb_ce_onAfterUpdateRepo // Trigger Event: jcb_ce_onAfterUpdateRepo
@ -1050,7 +1052,7 @@ class Compiler extends Infusion
&$this->componentData) &$this->componentData)
); );
// copy the zip to backup path // copy the zip to backup path
JFile::copy( File::copy(
$this->filepath['component'], $this->filepath['component'],
$this->backupPath . '/' . $this->componentBackupName $this->backupPath . '/' . $this->componentBackupName
. '.zip' . '.zip'
@ -1144,7 +1146,7 @@ class Compiler extends Infusion
&$module) &$module)
); );
// copy the zip to backup path // copy the zip to backup path
JFile::copy( File::copy(
$this->filepath['modules'][$module->id], $this->filepath['modules'][$module->id],
$this->backupPath . '/' . $module->zip_name $this->backupPath . '/' . $module->zip_name
. '.zip' . '.zip'
@ -1238,7 +1240,7 @@ class Compiler extends Infusion
&$plugin) &$plugin)
); );
// copy the zip to backup path // copy the zip to backup path
JFile::copy( File::copy(
$this->filepath['plugins'][$plugin->id], $this->filepath['plugins'][$plugin->id],
$this->backupPath . '/' . $plugin->zip_name $this->backupPath . '/' . $plugin->zip_name
. '.zip' . '.zip'
@ -1324,7 +1326,7 @@ class Compiler extends Infusion
} }
$counter = 0; $counter = 0;
// check if file exist // check if file exist
if (JFile::exists($file)) if (File::exists($file))
{ {
foreach ( foreach (
new SplFileObject($file) as $lineNumber => $lineContent new SplFileObject($file) as $lineNumber => $lineContent

View File

@ -12,6 +12,9 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
/** /**
* Get class as the main compilers class * Get class as the main compilers class
*/ */
@ -7248,7 +7251,7 @@ class Get
if ((!filter_var($target, FILTER_VALIDATE_URL) === false if ((!filter_var($target, FILTER_VALIDATE_URL) === false
&& ComponentbuilderHelper::urlExists($target)) && ComponentbuilderHelper::urlExists($target))
|| (JPath::clean($target) === $target || (JPath::clean($target) === $target
&& JFile::exists($target))) && File::exists($target)))
{ {
$this->getExternalCodeString($target, $bucket); $this->getExternalCodeString($target, $bucket);
} }
@ -10344,7 +10347,7 @@ class Get
foreach ($fileTypes as $type) foreach ($fileTypes as $type)
{ {
// get a list of files in the current directory tree (only PHP, JS and XML for now) // get a list of files in the current directory tree (only PHP, JS and XML for now)
$files = JFolder::files('.', $type, true, true); $files = Folder::files('.', $type, true, true);
// check if files found // check if files found
if (ComponentbuilderHelper::checkArray($files)) if (ComponentbuilderHelper::checkArray($files))
{ {
@ -11540,7 +11543,7 @@ class Get
// check if the local install is found // check if the local install is found
foreach ($localPaths as $key => $localPath) foreach ($localPaths as $key => $localPath)
{ {
if (!JFolder::exists($localPath)) if (!Folder::exists($localPath))
{ {
unset($localPaths[$key]); unset($localPaths[$key]);
} }

View File

@ -12,6 +12,9 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
/** /**
* Structure class * Structure class
*/ */
@ -1403,12 +1406,12 @@ class Structure extends Get
private function createFolder($path) private function createFolder($path)
{ {
// check if the path exist // check if the path exist
if (!JFolder::exists( if (!Folder::exists(
$path $path
)) ))
{ {
// create the path // create the path
JFolder::create( Folder::create(
$path $path
); );
// count the folder created // count the folder created
@ -1436,9 +1439,9 @@ class Structure extends Get
array(&$this->componentContext, &$this->libraries) array(&$this->componentContext, &$this->libraries)
); );
// creat the main component folder // creat the main component folder
if (!JFolder::exists($this->componentPath)) if (!Folder::exists($this->componentPath))
{ {
JFolder::create($this->componentPath); Folder::create($this->componentPath);
// count the folder created // count the folder created
$this->folderCount++; $this->folderCount++;
$this->indexHTML(''); $this->indexHTML('');
@ -1736,9 +1739,9 @@ class Structure extends Get
)) ))
{ {
// creat the main component folder // creat the main component folder
if (!JFolder::exists($this->componentPath)) if (!Folder::exists($this->componentPath))
{ {
JFolder::create($this->componentPath); Folder::create($this->componentPath);
// count the folder created // count the folder created
$this->folderCount++; $this->folderCount++;
$this->indexHTML(''); $this->indexHTML('');
@ -1995,7 +1998,7 @@ class Structure extends Get
// now move the file // now move the file
if ($details->type === 'file') if ($details->type === 'file')
{ {
if (!JFile::exists($currentFullPath)) if (!File::exists($currentFullPath))
{ {
$this->app->enqueueMessage( $this->app->enqueueMessage(
JText::_('<hr /><h3>File Path Error</h3>'), 'Error' JText::_('<hr /><h3>File Path Error</h3>'), 'Error'
@ -2014,12 +2017,12 @@ class Structure extends Get
basename($packageFullPath), '', $packageFullPath basename($packageFullPath), '', $packageFullPath
); );
// check if path exist, if not creat it // check if path exist, if not creat it
if (!JFolder::exists($packageFullPath0nly)) if (!Folder::exists($packageFullPath0nly))
{ {
JFolder::create($packageFullPath0nly); Folder::create($packageFullPath0nly);
} }
// move the file to its place // move the file to its place
JFile::copy($currentFullPath, $packageFullPath); File::copy($currentFullPath, $packageFullPath);
// count the file created // count the file created
$this->fileCount++; $this->fileCount++;
// store the new files // store the new files
@ -2054,7 +2057,7 @@ class Structure extends Get
} }
elseif ($details->type === 'folder') elseif ($details->type === 'folder')
{ {
if (!JFolder::exists($currentFullPath)) if (!Folder::exists($currentFullPath))
{ {
$this->app->enqueueMessage( $this->app->enqueueMessage(
JText::_('<hr /><h3>Folder Path Error</h3>'), JText::_('<hr /><h3>Folder Path Error</h3>'),
@ -2070,7 +2073,7 @@ class Structure extends Get
else else
{ {
// move the folder to its place // move the folder to its place
JFolder::copy( Folder::copy(
$currentFullPath, $packageFullPath, '', true $currentFullPath, $packageFullPath, '', true
); );
// count the folder created // count the folder created
@ -2359,13 +2362,13 @@ class Structure extends Get
if (!isset($this->extentionTrackingFilesMoved[$check])) if (!isset($this->extentionTrackingFilesMoved[$check]))
{ {
// check files exist // check files exist
if (JFile::exists( if (File::exists(
$this->componentPath . '/admin/models/fields/' $this->componentPath . '/admin/models/fields/'
. $field['type_name'] . '.php' . $field['type_name'] . '.php'
)) ))
{ {
// copy the custom field // copy the custom field
JFile::copy( File::copy(
$this->componentPath . '/admin/models/fields/' $this->componentPath . '/admin/models/fields/'
. $field['type_name'] . '.php', . $field['type_name'] . '.php',
$path . '/fields/' . $field['type_name'] . '.php' $path . '/fields/' . $field['type_name'] . '.php'
@ -2386,14 +2389,14 @@ class Structure extends Get
if (!isset($this->extentionTrackingFilesMoved[$check])) if (!isset($this->extentionTrackingFilesMoved[$check]))
{ {
// check files exist // check files exist
if (JFile::exists( if (File::exists(
$this->componentPath . '/admin/models/rules/' $this->componentPath . '/admin/models/rules/'
. $this->validationLinkedFields[$field['field']] . $this->validationLinkedFields[$field['field']]
. '.php' . '.php'
)) ))
{ {
// copy the custom field // copy the custom field
JFile::copy( File::copy(
$this->componentPath . '/admin/models/rules/' $this->componentPath . '/admin/models/rules/'
. $this->validationLinkedFields[$field['field']] . $this->validationLinkedFields[$field['field']]
. '.php', $path . '/rules/' . '.php', $path . '/rules/'
@ -2651,9 +2654,9 @@ class Structure extends Get
} }
// setup the folder // setup the folder
if (!JFolder::exists($path)) if (!Folder::exists($path))
{ {
JFolder::create($path); Folder::create($path);
$this->indexHTML($zipPath); $this->indexHTML($zipPath);
// count the folder created // count the folder created
$this->folderCount++; $this->folderCount++;
@ -2683,10 +2686,10 @@ class Structure extends Get
{ {
$new = $item; $new = $item;
} }
if (!JFile::exists($path . '/' . $new)) if (!File::exists($path . '/' . $new))
{ {
// move the file to its place // move the file to its place
JFile::copy( File::copy(
$this->templatePath . '/' . $item, $this->templatePath . '/' . $item,
$path . '/' . $new $path . '/' . $new
); );
@ -3043,7 +3046,7 @@ class Structure extends Get
// use path if exist // use path if exist
if (strlen($path) > 0) if (strlen($path) > 0)
{ {
JFile::copy( File::copy(
$this->templatePath . '/index.html', $this->templatePath . '/index.html',
$root . $path . '/index.html' $root . $path . '/index.html'
); );
@ -3052,7 +3055,7 @@ class Structure extends Get
} }
else else
{ {
JFile::copy( File::copy(
$this->templatePath . '/index.html', $root . '/index.html' $this->templatePath . '/index.html', $root . '/index.html'
); );
// count the file created // count the file created

View File

@ -12,6 +12,9 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
/** /**
* Compiler class * Compiler class
*/ */
@ -1010,11 +1013,9 @@ class Interpretation extends Fields
. " Prep the path a little"; . " Prep the path a little";
$function[] = $this->_t(2) $function[] = $this->_t(2)
. "\$path = '/'. trim(str_replace('//', '/', \$path), '/');"; . "\$path = '/'. trim(str_replace('//', '/', \$path), '/');";
$function[] = $this->_t(2) $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. "jimport('joomla.filesystem.folder');";
$function[] = $this->_t(2) . "///" . $this->setLine(__LINE__)
. " Check if folder exist"; . " Check if folder exist";
$function[] = $this->_t(2) . "if (!JFolder::exists(\$path))"; $function[] = $this->_t(2) . "if (!Folder::exists(\$path))";
$function[] = $this->_t(2) . "{"; $function[] = $this->_t(2) . "{";
$function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Lock key."; . " Lock key.";
@ -1565,12 +1566,15 @@ class Interpretation extends Fields
{ {
if ($this->addEximport) if ($this->addEximport)
{ {
// we use the company name set in the GUI
$company_name = $this->fileContentStatic[$this->hhh . 'COMPANYNAME' . $this->hhh];
// start building the xml function
$exel = array(); $exel = array();
$exel[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; $exel[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
$exel[] = $this->_t(1) . "* Prepares the xml document"; $exel[] = $this->_t(1) . "* Prepares the xml document";
$exel[] = $this->_t(1) . "*/"; $exel[] = $this->_t(1) . "*/";
$exel[] = $this->_t(1) $exel[] = $this->_t(1)
. "public static function xls(\$rows, \$fileName = null, \$title = null, \$subjectTab = null, \$creator = 'Joomla Component Builder', \$description = null, \$category = null,\$keywords = null, \$modified = null)"; . "public static function xls(\$rows, \$fileName = null, \$title = null, \$subjectTab = null, \$creator = '$company_name', \$description = null, \$category = null,\$keywords = null, \$modified = null)";
$exel[] = $this->_t(1) . "{"; $exel[] = $this->_t(1) . "{";
$exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " set the user"; . " set the user";
@ -1611,7 +1615,7 @@ class Interpretation extends Fields
. " Set document properties"; . " Set document properties";
$exel[] = $this->_t(2) . "\$spreadsheet->getProperties()"; $exel[] = $this->_t(2) . "\$spreadsheet->getProperties()";
$exel[] = $this->_t(3) . "->setCreator(\$creator)"; $exel[] = $this->_t(3) . "->setCreator(\$creator)";
$exel[] = $this->_t(3) . "->setCompany('Joomla Component Builder')"; $exel[] = $this->_t(3) . "->setCompany('$company_name')";
$exel[] = $this->_t(3) . "->setLastModifiedBy(\$modified)"; $exel[] = $this->_t(3) . "->setLastModifiedBy(\$modified)";
$exel[] = $this->_t(3) . "->setTitle(\$title)"; $exel[] = $this->_t(3) . "->setTitle(\$title)";
$exel[] = $this->_t(3) . "->setSubject(\$subjectTab);"; $exel[] = $this->_t(3) . "->setSubject(\$subjectTab);";
@ -6660,7 +6664,7 @@ class Interpretation extends Fields
__LINE__ __LINE__
) . " check if the CSS file exists."; ) . " check if the CSS file exists.";
$setter .= PHP_EOL . $tabV . $this->_t(5) $setter .= PHP_EOL . $tabV . $this->_t(5)
. "if (JFile::exists(JPATH_ROOT.'/media/com_" . "if (File::exists(JPATH_ROOT.'/media/com_"
. $this->componentCodeName . $this->componentCodeName
. "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))"; . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))";
$setter .= PHP_EOL . $tabV . $this->_t(5) . "{"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "{";
@ -6679,7 +6683,7 @@ class Interpretation extends Fields
__LINE__ __LINE__
) . " check if the JavaScript file exists."; ) . " check if the JavaScript file exists.";
$setter .= PHP_EOL . $tabV . $this->_t(5) $setter .= PHP_EOL . $tabV . $this->_t(5)
. "if (JFile::exists(JPATH_ROOT.'/media/com_" . "if (File::exists(JPATH_ROOT.'/media/com_"
. $this->componentCodeName . $this->componentCodeName
. "/uikit-v2/js/components/'.\$name.\$size.'.js'))"; . "/uikit-v2/js/components/'.\$name.\$size.'.js'))";
$setter .= PHP_EOL . $tabV . $this->_t(5) . "{"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "{";
@ -6717,11 +6721,6 @@ class Interpretation extends Fields
. $this->fileContentStatic[$this->hhh . 'Component' . $this->fileContentStatic[$this->hhh . 'Component'
. $this->hhh] . "Helper::checkArray(\$uikitComp))"; . $this->hhh] . "Helper::checkArray(\$uikitComp))";
$setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "{";
$setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine(
__LINE__
) . " load just in case.";
$setter .= PHP_EOL . $tabV . $this->_t(3)
. "jimport('joomla.filesystem.file');";
$setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine( $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine(
__LINE__ __LINE__
) . " loading..."; ) . " loading...";
@ -6736,7 +6735,7 @@ class Interpretation extends Fields
__LINE__ __LINE__
) . " check if the CSS file exists."; ) . " check if the CSS file exists.";
$setter .= PHP_EOL . $tabV . $this->_t(5) $setter .= PHP_EOL . $tabV . $this->_t(5)
. "if (JFile::exists(JPATH_ROOT.'/media/com_" . "if (File::exists(JPATH_ROOT.'/media/com_"
. $this->componentCodeName . $this->componentCodeName
. "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))"; . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))";
$setter .= PHP_EOL . $tabV . $this->_t(5) . "{"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "{";
@ -6755,7 +6754,7 @@ class Interpretation extends Fields
__LINE__ __LINE__
) . " check if the JavaScript file exists."; ) . " check if the JavaScript file exists.";
$setter .= PHP_EOL . $tabV . $this->_t(5) $setter .= PHP_EOL . $tabV . $this->_t(5)
. "if (JFile::exists(JPATH_ROOT.'/media/com_" . "if (File::exists(JPATH_ROOT.'/media/com_"
. $this->componentCodeName . $this->componentCodeName
. "/uikit-v2/js/components/'.\$name.\$size.'.js'))"; . "/uikit-v2/js/components/'.\$name.\$size.'.js'))";
$setter .= PHP_EOL . $tabV . $this->_t(5) . "{"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "{";
@ -7225,7 +7224,7 @@ class Interpretation extends Fields
$file $file
)) ))
{ {
if (JFile::exists($file['path'])) if (File::exists($file['path']))
{ {
$string = ComponentbuilderHelper::getFileContents( $string = ComponentbuilderHelper::getFileContents(
$file['path'] $file['path']
@ -7241,7 +7240,7 @@ class Interpretation extends Fields
{ {
if (ComponentbuilderHelper::checkArray($doc)) if (ComponentbuilderHelper::checkArray($doc))
{ {
if (JFile::exists($doc['path'])) if (File::exists($doc['path']))
{ {
$string $string
= ComponentbuilderHelper::getFileContents( = ComponentbuilderHelper::getFileContents(
@ -8675,7 +8674,7 @@ class Interpretation extends Fields
$script[] = $this->_t(2) . "//" . $this->setLine(__LINE__) $script[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " get all the folders"; . " get all the folders";
$script[] = $this->_t(2) $script[] = $this->_t(2)
. "\$folders = JFolder::folders(\$installPath);"; . "\$folders = Folder::folders(\$installPath);";
$script[] = $this->_t(2) . "//" . $this->setLine(__LINE__) $script[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " check if we have folders we may want to copy"; . " check if we have folders we may want to copy";
$script[] = $this->_t(2) $script[] = $this->_t(2)
@ -8697,7 +8696,7 @@ class Interpretation extends Fields
$script[] = $this->_t(5) . "//" . $this->setLine(__LINE__) $script[] = $this->_t(5) . "//" . $this->setLine(__LINE__)
. " now try to copy the folder"; . " now try to copy the folder";
$script[] = $this->_t(5) $script[] = $this->_t(5)
. "if (!JFolder::copy(\$src, \$dest, '', true))"; . "if (!Folder::copy(\$src, \$dest, '', true))";
$script[] = $this->_t(5) . "{"; $script[] = $this->_t(5) . "{";
$script[] = $this->_t(6) $script[] = $this->_t(6)
. "\$app->enqueueMessage('Could not copy '.\$folder.' folder into place, please make sure destination is writable!', 'error');"; . "\$app->enqueueMessage('Could not copy '.\$folder.' folder into place, please make sure destination is writable!', 'error');";
@ -22346,6 +22345,7 @@ class Interpretation extends Fields
break; break;
case 'admin.helper': case 'admin.helper':
case 'site.helper': case 'site.helper':
$headers[] = 'use Joomla\CMS\Filesystem\File;';
$headers[] = 'use Joomla\CMS\Language\Language;'; $headers[] = 'use Joomla\CMS\Language\Language;';
$headers[] = 'use Joomla\Registry\Registry;'; $headers[] = 'use Joomla\Registry\Registry;';
$headers[] = 'use Joomla\String\StringHelper;'; $headers[] = 'use Joomla\String\StringHelper;';
@ -22387,6 +22387,26 @@ class Interpretation extends Fields
case 'site.views': case 'site.views':
$headers = array(); $headers = array();
break; break;
case 'admin.view.html':
case 'admin.views.html':
case 'site.admin.view.html':
case 'site.view.html':
case 'site.views.html':
case 'custom.admin.view.html':
case 'custom.admin.views.html':
// add a space
$headers = array('');
// load the file class if uikit is being loaded
if ((2 == $this->uikit || 1 == $this->uikit)
&& isset($this->uikitComp[$viewsCodeName])
&& ComponentbuilderHelper::checkArray(
$this->uikitComp[$viewsCodeName]
))
{
$headers[] = 'use Joomla\CMS\Filesystem\File;';
$headers[] = '';
}
break;
default: default:
$headers[] = 'use Joomla\Utilities\ArrayHelper;'; $headers[] = 'use Joomla\Utilities\ArrayHelper;';
break; break;
@ -22734,7 +22754,7 @@ class Interpretation extends Fields
{ {
$imagePath = $this->componentPath . '/admin/assets/images'; $imagePath = $this->componentPath . '/admin/assets/images';
// move the image to its place // move the image to its place
JFile::copy( File::copy(
JPATH_SITE . '/' . $path, JPATH_SITE . '/' . $path,
$imagePath . '/vdm-component.' . $type $imagePath . '/vdm-component.' . $type
); );
@ -22983,7 +23003,7 @@ class Interpretation extends Fields
$imageName = $name . '.' . $type; $imageName = $name . '.' . $type;
} }
// move the image to its place // move the image to its place
JFile::copy( File::copy(
JPATH_SITE . '/' . $path, $imagePath . '/' . $imageName JPATH_SITE . '/' . $path, $imagePath . '/' . $imageName
); );
} }
@ -28186,9 +28206,9 @@ function vdm_dkim() {
$path = $module->folder_path . '/language/' . $tag $path = $module->folder_path . '/language/' . $tag
. '/'; . '/';
// create path if not exist // create path if not exist
if (!JFolder::exists($path)) if (!Folder::exists($path))
{ {
JFolder::create($path); Folder::create($path);
// count the folder created // count the folder created
$this->folderCount++; $this->folderCount++;
} }
@ -28215,8 +28235,8 @@ function vdm_dkim() {
} }
} }
// get all files and folders in module folder // get all files and folders in module folder
$files = JFolder::files($module->folder_path); $files = Folder::files($module->folder_path);
$folders = JFolder::folders($module->folder_path); $folders = Folder::folders($module->folder_path);
// the files/folders to ignore // the files/folders to ignore
$ignore = array('sql', 'language', 'script.php', $ignore = array('sql', 'language', 'script.php',
$module->file_name . '.xml', $module->file_name . '.xml',
@ -28544,9 +28564,9 @@ function vdm_dkim() {
$path = $plugin->folder_path . '/language/' . $tag $path = $plugin->folder_path . '/language/' . $tag
. '/'; . '/';
// create path if not exist // create path if not exist
if (!JFolder::exists($path)) if (!Folder::exists($path))
{ {
JFolder::create($path); Folder::create($path);
// count the folder created // count the folder created
$this->folderCount++; $this->folderCount++;
} }
@ -28576,8 +28596,8 @@ function vdm_dkim() {
} }
} }
// get all files and folders in plugin folder // get all files and folders in plugin folder
$files = JFolder::files($plugin->folder_path); $files = Folder::files($plugin->folder_path);
$folders = JFolder::folders($plugin->folder_path); $folders = Folder::folders($plugin->folder_path);
// the files/folders to ignore // the files/folders to ignore
$ignore = array('sql', 'language', 'script.php', $ignore = array('sql', 'language', 'script.php',
$plugin->file_name . '.xml', $plugin->file_name . '.xml',

View File

@ -12,6 +12,9 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
/** /**
* Infusion class * Infusion class
*/ */
@ -645,6 +648,13 @@ class Infusion extends Interpretation
'site.admin.view.model', 'site.admin.view.model',
$nameSingleCode $nameSingleCode
); );
// SITE_ADMIN_VIEW_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$nameSingleCode][$this->hhh
. 'SITE_ADMIN_VIEW_HTML_HEADER' . $this->hhh]
= $this->setFileHeader(
'site.admin.view.html',
$nameSingleCode
);
// SITE_ADMIN_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view // SITE_ADMIN_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$nameSingleCode][$this->hhh $this->fileContentDynamic[$nameSingleCode][$this->hhh
. 'SITE_ADMIN_VIEW_HEADER' . $this->hhh] . 'SITE_ADMIN_VIEW_HEADER' . $this->hhh]
@ -674,6 +684,12 @@ class Infusion extends Interpretation
= $this->setFileHeader( = $this->setFileHeader(
'admin.view.model', $nameSingleCode 'admin.view.model', $nameSingleCode
); );
// ADMIN_VIEW_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$nameSingleCode][$this->hhh
. 'ADMIN_VIEW_HTML_HEADER' . $this->hhh]
= $this->setFileHeader(
'admin.view.html', $nameSingleCode
);
// ADMIN_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view // ADMIN_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$nameSingleCode][$this->hhh $this->fileContentDynamic[$nameSingleCode][$this->hhh
. 'ADMIN_VIEW_HEADER' . $this->hhh] . 'ADMIN_VIEW_HEADER' . $this->hhh]
@ -1046,6 +1062,12 @@ class Infusion extends Interpretation
= $this->setFileHeader( = $this->setFileHeader(
'admin.views.model', $nameListCode 'admin.views.model', $nameListCode
); );
// ADMIN_VIEWS_HTML_HEADER <<<DYNAMIC>>> add the header details for the views
$this->fileContentDynamic[$nameListCode][$this->hhh
. 'ADMIN_VIEWS_HTML_HEADER' . $this->hhh]
= $this->setFileHeader(
'admin.views.html', $nameListCode
);
// ADMIN_VIEWS_HEADER <<<DYNAMIC>>> add the header details for the views // ADMIN_VIEWS_HEADER <<<DYNAMIC>>> add the header details for the views
$this->fileContentDynamic[$nameListCode][$this->hhh $this->fileContentDynamic[$nameListCode][$this->hhh
. 'ADMIN_VIEWS_HEADER' . $this->hhh] . 'ADMIN_VIEWS_HEADER' . $this->hhh]
@ -1507,6 +1529,12 @@ class Infusion extends Interpretation
= $this->setFileHeader( = $this->setFileHeader(
'custom.admin.view.model', $view['settings']->code 'custom.admin.view.model', $view['settings']->code
); );
// CUSTOM_ADMIN_VIEW_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$view['settings']->code][$this->hhh
. 'CUSTOM_ADMIN_VIEW_HTML_HEADER' . $this->hhh]
= $this->setFileHeader(
'custom.admin.view.html', $view['settings']->code
);
// CUSTOM_ADMIN_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view // CUSTOM_ADMIN_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$view['settings']->code][$this->hhh $this->fileContentDynamic[$view['settings']->code][$this->hhh
. 'CUSTOM_ADMIN_VIEW_HEADER' . $this->hhh] . 'CUSTOM_ADMIN_VIEW_HEADER' . $this->hhh]
@ -1529,6 +1557,12 @@ class Infusion extends Interpretation
= $this->setFileHeader( = $this->setFileHeader(
'custom.admin.views.model', $view['settings']->code 'custom.admin.views.model', $view['settings']->code
); );
// CUSTOM_ADMIN_VIEWS_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$view['settings']->code][$this->hhh
. 'CUSTOM_ADMIN_VIEWS_HTML_HEADER' . $this->hhh]
= $this->setFileHeader(
'custom.admin.views.html', $view['settings']->code
);
// CUSTOM_ADMIN_VIEWS_HEADER <<<DYNAMIC>>> add the header details for the view // CUSTOM_ADMIN_VIEWS_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$view['settings']->code][$this->hhh $this->fileContentDynamic[$view['settings']->code][$this->hhh
. 'CUSTOM_ADMIN_VIEWS_HEADER' . $this->hhh] . 'CUSTOM_ADMIN_VIEWS_HEADER' . $this->hhh]
@ -2023,6 +2057,12 @@ class Infusion extends Interpretation
= $this->setFileHeader( = $this->setFileHeader(
'site.view.model', $view['settings']->code 'site.view.model', $view['settings']->code
); );
// SITE_VIEW_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$view['settings']->code][$this->hhh
. 'SITE_VIEW_HTML_HEADER' . $this->hhh]
= $this->setFileHeader(
'site.view.html', $view['settings']->code
);
// SITE_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view // SITE_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$view['settings']->code][$this->hhh $this->fileContentDynamic[$view['settings']->code][$this->hhh
. 'SITE_VIEW_HEADER' . $this->hhh] . 'SITE_VIEW_HEADER' . $this->hhh]
@ -2051,6 +2091,12 @@ class Infusion extends Interpretation
= $this->setFileHeader( = $this->setFileHeader(
'site.views.model', $view['settings']->code 'site.views.model', $view['settings']->code
); );
// SITE_VIEWS_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$view['settings']->code][$this->hhh
. 'SITE_VIEWS_HTML_HEADER' . $this->hhh]
= $this->setFileHeader(
'site.views.html', $view['settings']->code
);
// SITE_VIEWS_HEADER <<<DYNAMIC>>> add the header details for the view // SITE_VIEWS_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$view['settings']->code][$this->hhh $this->fileContentDynamic[$view['settings']->code][$this->hhh
. 'SITE_VIEWS_HEADER' . $this->hhh] . 'SITE_VIEWS_HEADER' . $this->hhh]
@ -2620,14 +2666,14 @@ class Infusion extends Interpretation
// build the path to place the lang file // build the path to place the lang file
$path = $this->componentPath . '/' . $p . '/language/' $path = $this->componentPath . '/' . $p . '/language/'
. $tag . '/'; . $tag . '/';
if (!JFolder::exists($path)) if (!Folder::exists($path))
{ {
JFolder::create($path); Folder::create($path);
// count the folder created // count the folder created
$this->folderCount++; $this->folderCount++;
} }
// move the file to its place // move the file to its place
JFile::copy($getPAth, $path . $file_name); File::copy($getPAth, $path . $file_name);
// count the file created // count the file created
$this->fileCount++; $this->fileCount++;
// add content to it // add content to it

View File

@ -19,6 +19,10 @@ use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx; use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
use Joomla\Archive\Archive;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\CMS\Filesystem\Path;
/** /**
* Componentbuilder component helper. * Componentbuilder component helper.
@ -796,7 +800,7 @@ abstract class ComponentbuilderHelper
// set the path to the form validation rules // set the path to the form validation rules
$path = JPATH_LIBRARIES . '/src/Form/Rule'; $path = JPATH_LIBRARIES . '/src/Form/Rule';
// check if the path exist // check if the path exist
if (!JFolder::exists($path)) if (!Folder::exists($path))
{ {
return false; return false;
} }
@ -805,7 +809,7 @@ abstract class ComponentbuilderHelper
// go to that folder // go to that folder
chdir($path); chdir($path);
// load all the files in this path // load all the files in this path
$items = JFolder::files('.', '\.php', true, true); $items = Folder::files('.', '\.php', true, true);
// change back to Joomla working directory // change back to Joomla working directory
chdir($joomla); chdir($joomla);
// make sure we have an array // make sure we have an array
@ -1108,7 +1112,7 @@ abstract class ComponentbuilderHelper
*/ */
public static function getAllFilePaths($folder, $fileTypes = array('\.php', '\.js', '\.css', '\.less'), $recurse = true, $full = true) public static function getAllFilePaths($folder, $fileTypes = array('\.php', '\.js', '\.css', '\.less'), $recurse = true, $full = true)
{ {
if (JFolder::exists($folder)) if (Folder::exists($folder))
{ {
// we must first store the current woking directory // we must first store the current woking directory
$joomla = getcwd(); $joomla = getcwd();
@ -1121,18 +1125,18 @@ abstract class ComponentbuilderHelper
foreach ($fileTypes as $type) foreach ($fileTypes as $type)
{ {
// get a list of files in the current directory tree // get a list of files in the current directory tree
$files[] = JFolder::files('.', $type, $recurse, $full); $files[] = Folder::files('.', $type, $recurse, $full);
} }
} }
elseif (self::checkString($fileTypes)) elseif (self::checkString($fileTypes))
{ {
// get a list of files in the current directory tree // get a list of files in the current directory tree
$files[] = JFolder::files('.', $fileTypes, $recurse, $full); $files[] = Folder::files('.', $fileTypes, $recurse, $full);
} }
else else
{ {
// get a list of files in the current directory tree // get a list of files in the current directory tree
$files[] = JFolder::files('.', '.', $recurse, $full); $files[] = Folder::files('.', '.', $recurse, $full);
} }
// change back to Joomla working directory // change back to Joomla working directory
chdir($joomla); chdir($joomla);
@ -1180,9 +1184,6 @@ abstract class ComponentbuilderHelper
if ('compiler' === $type) if ('compiler' === $type)
{ {
// import the Joomla librarys // import the Joomla librarys
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.archive');
jimport('joomla.application.component.modellist'); jimport('joomla.application.component.modellist');
// include class to minify js // include class to minify js
require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/js.php'; require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/js.php';
@ -1191,9 +1192,6 @@ abstract class ComponentbuilderHelper
if ('smart' === $type) if ('smart' === $type)
{ {
// import the Joomla libraries // import the Joomla libraries
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.archive');
jimport('joomla.application.component.modellist'); jimport('joomla.application.component.modellist');
} }
// load this for all // load this for all
@ -2191,9 +2189,9 @@ abstract class ComponentbuilderHelper
md5($image_data) === $target['hash']) md5($image_data) === $target['hash'])
{ {
// create the JCB type path if it does not exist // create the JCB type path if it does not exist
if (!JFolder::exists(JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/$type")) if (!Folder::exists(JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/$type"))
{ {
JFolder::create(JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/$type"); Folder::create(JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/$type");
} }
// only set the image if the data match the hash // only set the image if the data match the hash
self::writeFile($path, $image_data); self::writeFile($path, $image_data);
@ -2697,20 +2695,20 @@ abstract class ComponentbuilderHelper
chdir($workingDIR); chdir($workingDIR);
// the full file path of the zip file // the full file path of the zip file
$filepath = JPath::clean($filepath); $filepath = Path::clean($filepath);
// delete an existing zip file (or use an exclusion parameter in JFolder::files() // delete an existing zip file (or use an exclusion parameter in Folder::files()
JFile::delete($filepath); File::delete($filepath);
// get a list of files in the current directory tree // get a list of files in the current directory tree
$files = JFolder::files('.', '', true, true); $files = Folder::files('.', '', true, true);
$zipArray = array(); $zipArray = array();
// setup the zip array // setup the zip array
foreach ($files as $file) foreach ($files as $file)
{ {
$tmp = array(); $tmp = array();
$tmp['name'] = str_replace('./', '', $file); $tmp['name'] = str_replace('./', '', $file);
$tmp['data'] = JFile::read($file); $tmp['data'] = self::getFileContents($file);
$tmp['time'] = filemtime($file); $tmp['time'] = filemtime($file);
$zipArray[] = $tmp; $zipArray[] = $tmp;
} }
@ -2719,7 +2717,8 @@ abstract class ComponentbuilderHelper
chdir($joomla); chdir($joomla);
// get the zip adapter // get the zip adapter
$zip = JArchive::getAdapter('zip'); $adapter = new Archive();
$zip = $adapter->getAdapter('zip');
//create the zip file //create the zip file
if ($zip->create($filepath, $zipArray)) if ($zip->create($filepath, $zipArray))
@ -2774,7 +2773,7 @@ abstract class ComponentbuilderHelper
*/ */
public static function removeFolder($dir, $ignore = false) public static function removeFolder($dir, $ignore = false)
{ {
if (JFolder::exists($dir)) if (Folder::exists($dir))
{ {
$it = new RecursiveDirectoryIterator($dir); $it = new RecursiveDirectoryIterator($dir);
$it = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST); $it = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
@ -2804,7 +2803,7 @@ abstract class ComponentbuilderHelper
{ {
continue; continue;
} }
JFolder::delete($file_dir); Folder::delete($file_dir);
} }
else else
{ {
@ -2823,13 +2822,13 @@ abstract class ComponentbuilderHelper
{ {
continue; continue;
} }
JFile::delete($file_dir); File::delete($file_dir);
} }
} }
// delete the root folder if not ignore found // delete the root folder if not ignore found
if (!self::checkArray($ignore)) if (!self::checkArray($ignore))
{ {
return JFolder::delete($dir); return Folder::delete($dir);
} }
return true; return true;
} }
@ -4118,11 +4117,10 @@ abstract class ComponentbuilderHelper
{ {
$filePath = $default; $filePath = $default;
} }
jimport('joomla.filesystem.folder');
// create the folder if it does not exist // create the folder if it does not exist
if ($createIfNotSet && !JFolder::exists($filePath)) if ($createIfNotSet && !Folder::exists($filePath))
{ {
JFolder::create($filePath); Folder::create($filePath);
} }
// setup the file name // setup the file name
$fileName = ''; $fileName = '';
@ -4187,11 +4185,10 @@ abstract class ComponentbuilderHelper
self::$params = JComponentHelper::getParams('com_componentbuilder'); self::$params = JComponentHelper::getParams('com_componentbuilder');
} }
$folderPath = self::$params->get($target, $default); $folderPath = self::$params->get($target, $default);
jimport('joomla.filesystem.folder');
// create the folder if it does not exist // create the folder if it does not exist
if ($createIfNotSet && !JFolder::exists($folderPath)) if ($createIfNotSet && !Folder::exists($folderPath))
{ {
JFolder::create($folderPath); Folder::create($folderPath);
} }
// return the url // return the url
if ('url' === $type) if ('url' === $type)
@ -7680,12 +7677,12 @@ abstract class ComponentbuilderHelper
$filePath = $path . '/' . $name . '.php'; $filePath = $path . '/' . $name . '.php';
$fullPathModel = $fullPathModels . '/' . $name . '.php'; $fullPathModel = $fullPathModels . '/' . $name . '.php';
// check if it exists // check if it exists
if (JFile::exists($filePath)) if (File::exists($filePath))
{ {
// get the file // get the file
require_once $filePath; require_once $filePath;
} }
elseif (JFile::exists($fullPathModel)) elseif (File::exists($fullPathModel))
{ {
// get the file // get the file
require_once $fullPathModel; require_once $fullPathModel;

View File

@ -12,6 +12,8 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet\IOFactory;
@ -222,7 +224,7 @@ class ComponentbuilderModelImport extends JModelLegacy
// Move uploaded file // Move uploaded file
jimport('joomla.filesystem.file'); jimport('joomla.filesystem.file');
$p_file = JFile::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions); $p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
// Was the package downloaded? // Was the package downloaded?
if (!$p_file) if (!$p_file)
@ -400,12 +402,12 @@ class ComponentbuilderModelImport extends JModelLegacy
// Is the package file a valid file? // Is the package file a valid file?
if (is_file($package)) if (is_file($package))
{ {
JFile::delete($package); File::delete($package);
} }
elseif (is_file(JPath::clean($package))) elseif (is_file(JPath::clean($package)))
{ {
// It might also be just a base filename // It might also be just a base filename
JFile::delete(JPath::clean($package)); File::delete(JPath::clean($package));
} }
} }

View File

@ -12,6 +12,8 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet\IOFactory;
@ -390,8 +392,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
$tmp_src = $userfile['tmp_name']; $tmp_src = $userfile['tmp_name'];
// Move uploaded file // Move uploaded file
jimport('joomla.filesystem.file'); $p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
$p_file = JFile::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
// Was the package downloaded? // Was the package downloaded?
if (!$p_file) if (!$p_file)
@ -570,12 +571,12 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
// Is the package file a valid file? // Is the package file a valid file?
if (is_file($package)) if (is_file($package))
{ {
JFile::delete($package); File::delete($package);
} }
elseif (is_file(JPath::clean($package))) elseif (is_file(JPath::clean($package)))
{ {
// It might also be just a base filename // It might also be just a base filename
JFile::delete(JPath::clean($package)); File::delete(JPath::clean($package));
} }
} }

View File

@ -12,6 +12,8 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet\IOFactory;
@ -219,8 +221,7 @@ class ComponentbuilderModelImport_language_translations extends JModelLegacy
$tmp_src = $userfile['tmp_name']; $tmp_src = $userfile['tmp_name'];
// Move uploaded file // Move uploaded file
jimport('joomla.filesystem.file'); $p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
$p_file = JFile::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
// Was the package downloaded? // Was the package downloaded?
if (!$p_file) if (!$p_file)
@ -398,12 +399,12 @@ class ComponentbuilderModelImport_language_translations extends JModelLegacy
// Is the package file a valid file? // Is the package file a valid file?
if (is_file($package)) if (is_file($package))
{ {
JFile::delete($package); File::delete($package);
} }
elseif (is_file(JPath::clean($package))) elseif (is_file(JPath::clean($package)))
{ {
// It might also be just a base filename // It might also be just a base filename
JFile::delete(JPath::clean($package)); File::delete(JPath::clean($package));
} }
} }

View File

@ -12,6 +12,8 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
/** /**
* Componentbuilder View class for the Compiler * Componentbuilder View class for the Compiler
*/ */
@ -260,13 +262,13 @@ class ComponentbuilderViewCompiler extends JViewLegacy
foreach (ComponentbuilderHelper::$uk_components[$class] as $name) foreach (ComponentbuilderHelper::$uk_components[$class] as $name)
{ {
// check if the CSS file exists. // check if the CSS file exists.
if (JFile::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css')) if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css'))
{ {
// load the css. // load the css.
$this->document->addStyleSheet(JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); $this->document->addStyleSheet(JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
} }
// check if the JavaScript file exists. // check if the JavaScript file exists.
if (JFile::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js')) if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js'))
{ {
// load the js. // load the js.
$this->document->addScript(JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); $this->document->addScript(JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);

View File

@ -12,6 +12,8 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
/** /**
* Componentbuilder View class for the Get_snippets * Componentbuilder View class for the Get_snippets
*/ */
@ -104,13 +106,13 @@ class ComponentbuilderViewGet_snippets extends JViewLegacy
foreach (ComponentbuilderHelper::$uk_components[$class] as $name) foreach (ComponentbuilderHelper::$uk_components[$class] as $name)
{ {
// check if the CSS file exists. // check if the CSS file exists.
if (JFile::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css')) if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css'))
{ {
// load the css. // load the css.
$this->document->addStyleSheet(JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); $this->document->addStyleSheet(JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
} }
// check if the JavaScript file exists. // check if the JavaScript file exists.
if (JFile::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js')) if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js'))
{ {
// load the js. // load the js.
$this->document->addScript(JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); $this->document->addScript(JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade"> <extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name> <name>COM_COMPONENTBUILDER</name>
<creationDate>5th March, 2021</creationDate> <creationDate>10th March, 2021</creationDate>
<author>Llewellyn van der Merwe</author> <author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail> <authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl> <authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>
<copyright>Copyright (C) 2015 Vast Development Method. All rights reserved.</copyright> <copyright>Copyright (C) 2015 Vast Development Method. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license> <license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>2.12.8</version> <version>2.12.9</version>
<description><![CDATA[ <description><![CDATA[
<h1>Component Builder (v.2.12.8)</h1> <h1>Component Builder (v.2.12.9)</h1>
<div style="clear: both;"></div> <div style="clear: both;"></div>
<p>The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time. <p>The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.

View File

@ -1024,10 +1024,10 @@
<description>Builds Complex Joomla Components</description> <description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element> <element>com_componentbuilder</element>
<type>component</type> <type>component</type>
<version>2.12.8</version> <version>2.12.9</version>
<infourl title="Component Builder!">http://www.joomlacomponentbuilder.com</infourl> <infourl title="Component Builder!">http://www.joomlacomponentbuilder.com</infourl>
<downloads> <downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.12.8/JCB_v2.12.8.zip</downloadurl> <downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.12.9/JCB_v2.12.9.zip</downloadurl>
</downloads> </downloads>
<tags> <tags>
<tag>stable</tag> <tag>stable</tag>

View File

@ -12,6 +12,8 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
JHTML::_('behavior.modal'); JHTML::_('behavior.modal');
/** /**
@ -5988,12 +5990,12 @@ class com_componentbuilderInstallerScript
{ {
} }
// check if the PHPExcel stuff is still around // 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 // We need to remove this old PHPExcel folder
$this->removeFolder(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/PHPExcel'); $this->removeFolder(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/PHPExcel');
// We need to remove this old PHPExcel file // 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; return true;
} }
@ -9250,7 +9252,7 @@ class com_componentbuilderInstallerScript
echo '<a target="_blank" href="http://www.joomlacomponentbuilder.com" title="Component Builder"> echo '<a target="_blank" href="http://www.joomlacomponentbuilder.com" title="Component Builder">
<img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/> <img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/>
</a> </a>
<h3>Upgrade to Version 2.12.8 Was Successful! Let us know if anything is not working as expected.</h3>'; <h3>Upgrade to Version 2.12.9 Was Successful! Let us know if anything is not working as expected.</h3>';
// Set db if not set already. // Set db if not set already.
if (!isset($db)) if (!isset($db))
@ -10887,7 +10889,7 @@ class com_componentbuilderInstallerScript
*/ */
protected function removeFolder($dir, $ignore = false) protected function removeFolder($dir, $ignore = false)
{ {
if (JFolder::exists($dir)) if (Folder::exists($dir))
{ {
$it = new RecursiveDirectoryIterator($dir); $it = new RecursiveDirectoryIterator($dir);
$it = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST); $it = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
@ -10917,7 +10919,7 @@ class com_componentbuilderInstallerScript
{ {
continue; continue;
} }
JFolder::delete($file_dir); Folder::delete($file_dir);
} }
else else
{ {
@ -10936,13 +10938,13 @@ class com_componentbuilderInstallerScript
{ {
continue; continue;
} }
JFile::delete($file_dir); File::delete($file_dir);
} }
} }
// delete the root folder if not ignore found // delete the root folder if not ignore found
if (!$this->checkArray($ignore)) if (!$this->checkArray($ignore))
{ {
return JFolder::delete($dir); return Folder::delete($dir);
} }
return true; return true;
} }
@ -10988,7 +10990,7 @@ class com_componentbuilderInstallerScript
$installer = $parent->getParent(); $installer = $parent->getParent();
$installPath = $installer->getPath('source'); $installPath = $installer->getPath('source');
// get all the folders // get all the folders
$folders = JFolder::folders($installPath); $folders = Folder::folders($installPath);
// check if we have folders we may want to copy // check if we have folders we may want to copy
$doNotCopy = array('media','admin','site'); // Joomla already deals with these $doNotCopy = array('media','admin','site'); // Joomla already deals with these
if (count((array) $folders) > 1) if (count((array) $folders) > 1)
@ -11003,7 +11005,7 @@ class com_componentbuilderInstallerScript
// set the destination path // set the destination path
$dest = JPATH_ROOT.'/'.$folder; $dest = JPATH_ROOT.'/'.$folder;
// now try to copy the 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'); $app->enqueueMessage('Could not copy '.$folder.' folder into place, please make sure destination is writable!', 'error');
} }

View File

@ -16,6 +16,10 @@ use Joomla\CMS\Language\Language;
use Joomla\Registry\Registry; use Joomla\Registry\Registry;
use Joomla\String\StringHelper; use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use Joomla\Archive\Archive;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\CMS\Filesystem\Path;
/** /**
* Componentbuilder component helper * Componentbuilder component helper
@ -793,7 +797,7 @@ abstract class ComponentbuilderHelper
// set the path to the form validation rules // set the path to the form validation rules
$path = JPATH_LIBRARIES . '/src/Form/Rule'; $path = JPATH_LIBRARIES . '/src/Form/Rule';
// check if the path exist // check if the path exist
if (!JFolder::exists($path)) if (!Folder::exists($path))
{ {
return false; return false;
} }
@ -802,7 +806,7 @@ abstract class ComponentbuilderHelper
// go to that folder // go to that folder
chdir($path); chdir($path);
// load all the files in this path // load all the files in this path
$items = JFolder::files('.', '\.php', true, true); $items = Folder::files('.', '\.php', true, true);
// change back to Joomla working directory // change back to Joomla working directory
chdir($joomla); chdir($joomla);
// make sure we have an array // make sure we have an array
@ -1105,7 +1109,7 @@ abstract class ComponentbuilderHelper
*/ */
public static function getAllFilePaths($folder, $fileTypes = array('\.php', '\.js', '\.css', '\.less'), $recurse = true, $full = true) public static function getAllFilePaths($folder, $fileTypes = array('\.php', '\.js', '\.css', '\.less'), $recurse = true, $full = true)
{ {
if (JFolder::exists($folder)) if (Folder::exists($folder))
{ {
// we must first store the current woking directory // we must first store the current woking directory
$joomla = getcwd(); $joomla = getcwd();
@ -1118,18 +1122,18 @@ abstract class ComponentbuilderHelper
foreach ($fileTypes as $type) foreach ($fileTypes as $type)
{ {
// get a list of files in the current directory tree // get a list of files in the current directory tree
$files[] = JFolder::files('.', $type, $recurse, $full); $files[] = Folder::files('.', $type, $recurse, $full);
} }
} }
elseif (self::checkString($fileTypes)) elseif (self::checkString($fileTypes))
{ {
// get a list of files in the current directory tree // get a list of files in the current directory tree
$files[] = JFolder::files('.', $fileTypes, $recurse, $full); $files[] = Folder::files('.', $fileTypes, $recurse, $full);
} }
else else
{ {
// get a list of files in the current directory tree // get a list of files in the current directory tree
$files[] = JFolder::files('.', '.', $recurse, $full); $files[] = Folder::files('.', '.', $recurse, $full);
} }
// change back to Joomla working directory // change back to Joomla working directory
chdir($joomla); chdir($joomla);
@ -1177,9 +1181,6 @@ abstract class ComponentbuilderHelper
if ('compiler' === $type) if ('compiler' === $type)
{ {
// import the Joomla librarys // import the Joomla librarys
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.archive');
jimport('joomla.application.component.modellist'); jimport('joomla.application.component.modellist');
// include class to minify js // include class to minify js
require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/js.php'; require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/js.php';
@ -1188,9 +1189,6 @@ abstract class ComponentbuilderHelper
if ('smart' === $type) if ('smart' === $type)
{ {
// import the Joomla libraries // import the Joomla libraries
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.archive');
jimport('joomla.application.component.modellist'); jimport('joomla.application.component.modellist');
} }
// load this for all // load this for all
@ -2188,9 +2186,9 @@ abstract class ComponentbuilderHelper
md5($image_data) === $target['hash']) md5($image_data) === $target['hash'])
{ {
// create the JCB type path if it does not exist // create the JCB type path if it does not exist
if (!JFolder::exists(JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/$type")) if (!Folder::exists(JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/$type"))
{ {
JFolder::create(JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/$type"); Folder::create(JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/$type");
} }
// only set the image if the data match the hash // only set the image if the data match the hash
self::writeFile($path, $image_data); self::writeFile($path, $image_data);
@ -2694,20 +2692,20 @@ abstract class ComponentbuilderHelper
chdir($workingDIR); chdir($workingDIR);
// the full file path of the zip file // the full file path of the zip file
$filepath = JPath::clean($filepath); $filepath = Path::clean($filepath);
// delete an existing zip file (or use an exclusion parameter in JFolder::files() // delete an existing zip file (or use an exclusion parameter in Folder::files()
JFile::delete($filepath); File::delete($filepath);
// get a list of files in the current directory tree // get a list of files in the current directory tree
$files = JFolder::files('.', '', true, true); $files = Folder::files('.', '', true, true);
$zipArray = array(); $zipArray = array();
// setup the zip array // setup the zip array
foreach ($files as $file) foreach ($files as $file)
{ {
$tmp = array(); $tmp = array();
$tmp['name'] = str_replace('./', '', $file); $tmp['name'] = str_replace('./', '', $file);
$tmp['data'] = JFile::read($file); $tmp['data'] = self::getFileContents($file);
$tmp['time'] = filemtime($file); $tmp['time'] = filemtime($file);
$zipArray[] = $tmp; $zipArray[] = $tmp;
} }
@ -2716,7 +2714,8 @@ abstract class ComponentbuilderHelper
chdir($joomla); chdir($joomla);
// get the zip adapter // get the zip adapter
$zip = JArchive::getAdapter('zip'); $adapter = new Archive();
$zip = $adapter->getAdapter('zip');
//create the zip file //create the zip file
if ($zip->create($filepath, $zipArray)) if ($zip->create($filepath, $zipArray))
@ -2771,7 +2770,7 @@ abstract class ComponentbuilderHelper
*/ */
public static function removeFolder($dir, $ignore = false) public static function removeFolder($dir, $ignore = false)
{ {
if (JFolder::exists($dir)) if (Folder::exists($dir))
{ {
$it = new RecursiveDirectoryIterator($dir); $it = new RecursiveDirectoryIterator($dir);
$it = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST); $it = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
@ -2801,7 +2800,7 @@ abstract class ComponentbuilderHelper
{ {
continue; continue;
} }
JFolder::delete($file_dir); Folder::delete($file_dir);
} }
else else
{ {
@ -2820,13 +2819,13 @@ abstract class ComponentbuilderHelper
{ {
continue; continue;
} }
JFile::delete($file_dir); File::delete($file_dir);
} }
} }
// delete the root folder if not ignore found // delete the root folder if not ignore found
if (!self::checkArray($ignore)) if (!self::checkArray($ignore))
{ {
return JFolder::delete($dir); return Folder::delete($dir);
} }
return true; return true;
} }
@ -4115,11 +4114,10 @@ abstract class ComponentbuilderHelper
{ {
$filePath = $default; $filePath = $default;
} }
jimport('joomla.filesystem.folder');
// create the folder if it does not exist // create the folder if it does not exist
if ($createIfNotSet && !JFolder::exists($filePath)) if ($createIfNotSet && !Folder::exists($filePath))
{ {
JFolder::create($filePath); Folder::create($filePath);
} }
// setup the file name // setup the file name
$fileName = ''; $fileName = '';
@ -4184,11 +4182,10 @@ abstract class ComponentbuilderHelper
self::$params = JComponentHelper::getParams('com_componentbuilder'); self::$params = JComponentHelper::getParams('com_componentbuilder');
} }
$folderPath = self::$params->get($target, $default); $folderPath = self::$params->get($target, $default);
jimport('joomla.filesystem.folder');
// create the folder if it does not exist // create the folder if it does not exist
if ($createIfNotSet && !JFolder::exists($folderPath)) if ($createIfNotSet && !Folder::exists($folderPath))
{ {
JFolder::create($folderPath); Folder::create($folderPath);
} }
// return the url // return the url
if ('url' === $type) if ('url' === $type)
@ -6896,12 +6893,12 @@ abstract class ComponentbuilderHelper
$filePath = $path . '/' . $name . '.php'; $filePath = $path . '/' . $name . '.php';
$fullPathModel = $fullPathModels . '/' . $name . '.php'; $fullPathModel = $fullPathModels . '/' . $name . '.php';
// check if it exists // check if it exists
if (JFile::exists($filePath)) if (File::exists($filePath))
{ {
// get the file // get the file
require_once $filePath; require_once $filePath;
} }
elseif (JFile::exists($fullPathModel)) elseif (File::exists($fullPathModel))
{ {
// get the file // get the file
require_once $fullPathModel; require_once $fullPathModel;