Resolved gh-436 so that the new Joomla plugin builder/feature is fully active, and part of the import and export of JCB packages.

This commit is contained in:
2019-08-12 23:30:31 +02:00
parent ed43b00862
commit 7fed9d7a1c
16 changed files with 519 additions and 127 deletions

View File

@ -35,7 +35,21 @@ class Compiler extends Infusion
private $time_start;
private $time_end;
public $secondsCompiled;
public $filepath = array('component' => '', 'package' => '', 'plugins' => array(), 'modules' => array());
/*
* The file path array
*
* @var string
*/
public $filepath = array(
'component' => '',
'component-folder' => '',
'package' => '',
'plugins' => array(),
'plugins-folders' => array(),
'modules' => array()
);
// fixed pathes
protected $dynamicIntegration = false;
protected $backupPath = false;
@ -58,7 +72,7 @@ class Compiler extends Infusion
// set some folder paths in relation to distribution
if ($config['backup'])
{
$this->backupPath = $this->params->get('backup_folder_path', $this->tempPath) . '/' . $this->componentBackupName . '.zip';
$this->backupPath = $this->params->get('backup_folder_path', $this->tempPath);
$this->dynamicIntegration = true;
}
// set local repos switch
@ -539,8 +553,10 @@ class Compiler extends Infusion
private function zipComponent()
{
// Component Folder Name
$this->filepath['component-folder'] = $this->componentFolderName;
// the name of the zip file to create
$this->filepath['component'] = $this->tempPath . '/' . $this->componentFolderName . '.zip';
$this->filepath['component'] = $this->tempPath . '/' . $this->filepath['component-folder'] . '.zip';
// Trigger Event: jcb_ce_onBeforeZipComponent
$this->triggerEvent('jcb_ce_onBeforeZipComponent', array(&$this->componentContext, &$this->componentPath, &$this->filepath['component'], &$this->tempPath, &$this->componentFolderName, &$this->componentData));
//create the zip file
@ -552,7 +568,7 @@ class Compiler extends Infusion
// Trigger Event: jcb_ce_onBeforeBackupZip
$this->triggerEvent('jcb_ce_onBeforeBackupZip', array(&$this->componentContext, &$this->filepath['component'], &$this->tempPath, &$this->backupPath, &$this->componentData));
// copy the zip to backup path
JFile::copy($this->filepath['component'], $this->backupPath);
JFile::copy($this->filepath['component'], $this->backupPath . '/' . $this->componentBackupName . '.zip');
}
// move to sales server host
@ -591,6 +607,8 @@ class Compiler extends Infusion
{
// set plugin context
$plugin_context = $plugin->file_name . '.' . $plugin->id;
// Component Folder Name
$this->filepath['plugins-folder'][$plugin->id] = $plugin->zip_name;
// the name of the zip file to create
$this->filepath['plugins'][$plugin->id] = $this->tempPath . '/' . $plugin->zip_name . '.zip';
// Trigger Event: jcb_ce_onBeforeZipPlugin
@ -605,7 +623,7 @@ class Compiler extends Infusion
// Trigger Event: jcb_ce_onBeforeBackupZip
$this->triggerEvent('jcb_ce_onBeforeBackupZip', array(&$__plugin_context, &$this->filepath['plugins'][$plugin->id], &$this->tempPath, &$this->backupPath, &$plugin));
// copy the zip to backup path
JFile::copy($this->filepath['plugins'][$plugin->id], $this->backupPath);
JFile::copy($this->filepath['plugins'][$plugin->id], $this->backupPath . '/' . $plugin->zip_name . '.zip');
}
// move to sales server host

View File

@ -6199,7 +6199,6 @@ class Get
'addurls',
'version_update',
'version_update_id'
)
)
);
@ -6237,7 +6236,7 @@ class Get
// update the name if it has dynamic values
$plugin->name = $this->setPlaceholders($this->setDynamicValues($plugin->name), $this->placeholders);
// set official name
$plugin->official_name = $plugin->name . ' ' . $plugin->group;
$plugin->official_name = ucwords($plugin->group . ' - ' . $plugin->name);
// set langPrefix
$this->langPrefix = 'PLG_' . strtoupper($plugin->group) . '_' . strtoupper($plugin->name);
// set lang prefix
@ -6261,6 +6260,7 @@ class Get
}
else
{
$plugin->description = $this->setPlaceholders($this->setDynamicValues($plugin->description), $this->placeholders);
$this->setLangContent($plugin->key, $plugin->lang_prefix . '_DESCRIPTION', $plugin->description);
$plugin->description = '<p>' . $plugin->description . '</p>';
}
@ -7410,6 +7410,8 @@ class Get
$localPaths['site'] = JPATH_ROOT . '/components/com_' . $this->componentCodeName;
// TODO later to include the JS and CSS
$localPaths['media'] = JPATH_ROOT . '/media/com_' . $this->componentCodeName;
// TODO plugin paths (just those linked to this component)
// $localPaths['plugin'] = JPATH_ROOT . '/plugins';
// check if the local install is found
foreach ($localPaths as $key => $localPath)
{

View File

@ -1140,12 +1140,9 @@ class Structure extends Get
if ($details->type === 'folder')
{
// only folders outside the standard folder are added
if (!in_array($checker[0], $this->stdFolders))
{
$eNAME = 'FOLDERS';
$ename = 'folder';
$add_to_extra = true;
}
$eNAME = 'FOLDERS';
$ename = 'folder';
$add_to_extra = true;
}
// if this is a file, it can only be added to the admin/site/media folders
// all other folders are moved as a whole so their files do not need to be declared