forked from joomla/Component-Builder
Adds the namespacing to the compiler classes for the File, and Folder classes of Joomla.
This commit is contained in:
parent
3c3951ae83
commit
552a2664ba
@ -143,7 +143,7 @@ TODO
|
||||
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
||||
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
|
||||
+ *First Build*: 30th April, 2015
|
||||
+ *Last Build*: 5th March, 2021
|
||||
+ *Last Build*: 7th March, 2021
|
||||
+ *Version*: 2.12.8
|
||||
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||
|
@ -143,7 +143,7 @@ TODO
|
||||
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
||||
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
|
||||
+ *First Build*: 30th April, 2015
|
||||
+ *Last Build*: 5th March, 2021
|
||||
+ *Last Build*: 7th March, 2021
|
||||
+ *Version*: 2.12.8
|
||||
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||
|
@ -12,6 +12,9 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\Filesystem\File;
|
||||
use Joomla\CMS\Filesystem\Folder;
|
||||
|
||||
/**
|
||||
* Get class as the main compilers class
|
||||
*/
|
||||
@ -7248,7 +7251,7 @@ class Get
|
||||
if ((!filter_var($target, FILTER_VALIDATE_URL) === false
|
||||
&& ComponentbuilderHelper::urlExists($target))
|
||||
|| (JPath::clean($target) === $target
|
||||
&& JFile::exists($target)))
|
||||
&& File::exists($target)))
|
||||
{
|
||||
$this->getExternalCodeString($target, $bucket);
|
||||
}
|
||||
@ -10344,7 +10347,7 @@ class Get
|
||||
foreach ($fileTypes as $type)
|
||||
{
|
||||
// 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
|
||||
if (ComponentbuilderHelper::checkArray($files))
|
||||
{
|
||||
@ -11540,7 +11543,7 @@ class Get
|
||||
// check if the local install is found
|
||||
foreach ($localPaths as $key => $localPath)
|
||||
{
|
||||
if (!JFolder::exists($localPath))
|
||||
if (!Folder::exists($localPath))
|
||||
{
|
||||
unset($localPaths[$key]);
|
||||
}
|
||||
|
@ -12,6 +12,9 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\Filesystem\File;
|
||||
use Joomla\CMS\Filesystem\Folder;
|
||||
|
||||
/**
|
||||
* Structure class
|
||||
*/
|
||||
@ -1403,12 +1406,12 @@ class Structure extends Get
|
||||
private function createFolder($path)
|
||||
{
|
||||
// check if the path exist
|
||||
if (!JFolder::exists(
|
||||
if (!Folder::exists(
|
||||
$path
|
||||
))
|
||||
{
|
||||
// create the path
|
||||
JFolder::create(
|
||||
Folder::create(
|
||||
$path
|
||||
);
|
||||
// count the folder created
|
||||
@ -1436,9 +1439,9 @@ class Structure extends Get
|
||||
array(&$this->componentContext, &$this->libraries)
|
||||
);
|
||||
// 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
|
||||
$this->folderCount++;
|
||||
$this->indexHTML('');
|
||||
@ -1736,9 +1739,9 @@ class Structure extends Get
|
||||
))
|
||||
{
|
||||
// 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
|
||||
$this->folderCount++;
|
||||
$this->indexHTML('');
|
||||
@ -1995,7 +1998,7 @@ class Structure extends Get
|
||||
// now move the file
|
||||
if ($details->type === 'file')
|
||||
{
|
||||
if (!JFile::exists($currentFullPath))
|
||||
if (!File::exists($currentFullPath))
|
||||
{
|
||||
$this->app->enqueueMessage(
|
||||
JText::_('<hr /><h3>File Path Error</h3>'), 'Error'
|
||||
@ -2014,12 +2017,12 @@ class Structure extends Get
|
||||
basename($packageFullPath), '', $packageFullPath
|
||||
);
|
||||
// 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
|
||||
JFile::copy($currentFullPath, $packageFullPath);
|
||||
File::copy($currentFullPath, $packageFullPath);
|
||||
// count the file created
|
||||
$this->fileCount++;
|
||||
// store the new files
|
||||
@ -2054,7 +2057,7 @@ class Structure extends Get
|
||||
}
|
||||
elseif ($details->type === 'folder')
|
||||
{
|
||||
if (!JFolder::exists($currentFullPath))
|
||||
if (!Folder::exists($currentFullPath))
|
||||
{
|
||||
$this->app->enqueueMessage(
|
||||
JText::_('<hr /><h3>Folder Path Error</h3>'),
|
||||
@ -2070,7 +2073,7 @@ class Structure extends Get
|
||||
else
|
||||
{
|
||||
// move the folder to its place
|
||||
JFolder::copy(
|
||||
Folder::copy(
|
||||
$currentFullPath, $packageFullPath, '', true
|
||||
);
|
||||
// count the folder created
|
||||
@ -2359,13 +2362,13 @@ class Structure extends Get
|
||||
if (!isset($this->extentionTrackingFilesMoved[$check]))
|
||||
{
|
||||
// check files exist
|
||||
if (JFile::exists(
|
||||
if (File::exists(
|
||||
$this->componentPath . '/admin/models/fields/'
|
||||
. $field['type_name'] . '.php'
|
||||
))
|
||||
{
|
||||
// copy the custom field
|
||||
JFile::copy(
|
||||
File::copy(
|
||||
$this->componentPath . '/admin/models/fields/'
|
||||
. $field['type_name'] . '.php',
|
||||
$path . '/fields/' . $field['type_name'] . '.php'
|
||||
@ -2386,14 +2389,14 @@ class Structure extends Get
|
||||
if (!isset($this->extentionTrackingFilesMoved[$check]))
|
||||
{
|
||||
// check files exist
|
||||
if (JFile::exists(
|
||||
if (File::exists(
|
||||
$this->componentPath . '/admin/models/rules/'
|
||||
. $this->validationLinkedFields[$field['field']]
|
||||
. '.php'
|
||||
))
|
||||
{
|
||||
// copy the custom field
|
||||
JFile::copy(
|
||||
File::copy(
|
||||
$this->componentPath . '/admin/models/rules/'
|
||||
. $this->validationLinkedFields[$field['field']]
|
||||
. '.php', $path . '/rules/'
|
||||
@ -2651,9 +2654,9 @@ class Structure extends Get
|
||||
}
|
||||
|
||||
// setup the folder
|
||||
if (!JFolder::exists($path))
|
||||
if (!Folder::exists($path))
|
||||
{
|
||||
JFolder::create($path);
|
||||
Folder::create($path);
|
||||
$this->indexHTML($zipPath);
|
||||
// count the folder created
|
||||
$this->folderCount++;
|
||||
@ -2683,10 +2686,10 @@ class Structure extends Get
|
||||
{
|
||||
$new = $item;
|
||||
}
|
||||
if (!JFile::exists($path . '/' . $new))
|
||||
if (!File::exists($path . '/' . $new))
|
||||
{
|
||||
// move the file to its place
|
||||
JFile::copy(
|
||||
File::copy(
|
||||
$this->templatePath . '/' . $item,
|
||||
$path . '/' . $new
|
||||
);
|
||||
@ -3043,7 +3046,7 @@ class Structure extends Get
|
||||
// use path if exist
|
||||
if (strlen($path) > 0)
|
||||
{
|
||||
JFile::copy(
|
||||
File::copy(
|
||||
$this->templatePath . '/index.html',
|
||||
$root . $path . '/index.html'
|
||||
);
|
||||
@ -3052,7 +3055,7 @@ class Structure extends Get
|
||||
}
|
||||
else
|
||||
{
|
||||
JFile::copy(
|
||||
File::copy(
|
||||
$this->templatePath . '/index.html', $root . '/index.html'
|
||||
);
|
||||
// count the file created
|
||||
|
@ -12,6 +12,9 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\Filesystem\File;
|
||||
use Joomla\CMS\Filesystem\Folder;
|
||||
|
||||
/**
|
||||
* Infusion class
|
||||
*/
|
||||
@ -2620,14 +2623,14 @@ class Infusion extends Interpretation
|
||||
// build the path to place the lang file
|
||||
$path = $this->componentPath . '/' . $p . '/language/'
|
||||
. $tag . '/';
|
||||
if (!JFolder::exists($path))
|
||||
if (!Folder::exists($path))
|
||||
{
|
||||
JFolder::create($path);
|
||||
Folder::create($path);
|
||||
// count the folder created
|
||||
$this->folderCount++;
|
||||
}
|
||||
// move the file to its place
|
||||
JFile::copy($getPAth, $path . $file_name);
|
||||
File::copy($getPAth, $path . $file_name);
|
||||
// count the file created
|
||||
$this->fileCount++;
|
||||
// add content to it
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="component" version="3.2" method="upgrade">
|
||||
<name>COM_COMPONENTBUILDER</name>
|
||||
<creationDate>5th March, 2021</creationDate>
|
||||
<creationDate>7th March, 2021</creationDate>
|
||||
<author>Llewellyn van der Merwe</author>
|
||||
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
|
||||
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>
|
||||
|
Loading…
Reference in New Issue
Block a user