Continued to add the namespacing for the file and folder classes across the system. gh-682
This commit is contained in:
parent
1279a5d2f9
commit
08d529aba9
@ -147,7 +147,7 @@ TODO
|
|||||||
+ *Version*: 2.12.8
|
+ *Version*: 2.12.8
|
||||||
+ *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*: **292190**
|
+ *Line count*: **292188**
|
||||||
+ *Field count*: **1629**
|
+ *Field count*: **1629**
|
||||||
+ *File count*: **1935**
|
+ *File count*: **1935**
|
||||||
+ *Folder count*: **322**
|
+ *Folder count*: **322**
|
||||||
|
@ -147,7 +147,7 @@ TODO
|
|||||||
+ *Version*: 2.12.8
|
+ *Version*: 2.12.8
|
||||||
+ *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*: **292190**
|
+ *Line count*: **292188**
|
||||||
+ *Field count*: **1629**
|
+ *Field count*: **1629**
|
||||||
+ *File count*: **1935**
|
+ *File count*: **1935**
|
||||||
+ *Folder count*: **322**
|
+ *Folder count*: **322**
|
||||||
|
@ -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###
|
||||||
|
|
||||||
|
@ -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###
|
||||||
|
@ -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###
|
||||||
*/
|
*/
|
||||||
|
@ -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
|
||||||
*/
|
*/
|
||||||
|
@ -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
|
||||||
*/
|
*/
|
||||||
|
@ -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###
|
||||||
*/
|
*/
|
||||||
|
@ -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###
|
||||||
*/
|
*/
|
||||||
|
@ -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###
|
||||||
*/
|
*/
|
||||||
|
@ -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###
|
||||||
*/
|
*/
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
@ -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.";
|
||||||
@ -6660,7 +6661,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 +6680,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 +6718,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 +6732,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 +6751,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 +7221,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 +7237,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 +8671,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 +8693,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');";
|
||||||
@ -22388,6 +22384,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;
|
||||||
@ -22735,7 +22751,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
|
||||||
);
|
);
|
||||||
@ -22984,7 +23000,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
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -28187,9 +28203,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++;
|
||||||
}
|
}
|
||||||
@ -28216,8 +28232,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',
|
||||||
@ -28545,9 +28561,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++;
|
||||||
}
|
}
|
||||||
@ -28577,8 +28593,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',
|
||||||
|
@ -648,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]
|
||||||
@ -677,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]
|
||||||
@ -1049,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]
|
||||||
@ -1510,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]
|
||||||
@ -1532,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]
|
||||||
@ -2026,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]
|
||||||
@ -2054,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]
|
||||||
|
@ -1184,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';
|
||||||
@ -1195,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
|
||||||
|
@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
|
18
script.php
18
script.php
@ -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;
|
||||||
}
|
}
|
||||||
@ -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');
|
||||||
}
|
}
|
||||||
|
@ -1181,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';
|
||||||
@ -1192,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
|
||||||
|
Loading…
Reference in New Issue
Block a user