Added some more events to compiler. Added new helper method to make safeClassFunctionName.
This commit is contained in:
@ -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 safe 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.9.20) 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.9.21) 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)
|
||||
|
||||
@ -146,11 +146,11 @@ 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 July, 2019
|
||||
+ *Version*: 2.9.20
|
||||
+ *Last Build*: 6th July, 2019
|
||||
+ *Version*: 2.9.21
|
||||
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||
+ *Line count*: **211567**
|
||||
+ *Line count*: **211603**
|
||||
+ *Field count*: **1143**
|
||||
+ *File count*: **1346**
|
||||
+ *Folder count*: **209**
|
||||
|
@ -459,20 +459,28 @@ class Compiler extends Infusion
|
||||
{
|
||||
// set the repo path
|
||||
$repoFullPath = $this->repoPath . '/com_' . $this->componentData->sales_name . '__joomla_' . $this->joomlaVersion;
|
||||
// Trigger Event: jcb_ce_onBeforeUpdateRepo
|
||||
$this->triggerEvent('jcb_ce_onBeforeUpdateRepo', array(&$this->componentContext, &$this->componentPath, &$repoFullPath, &$this->componentData));
|
||||
// remove old data
|
||||
$this->removeFolder($repoFullPath, $this->componentData->toignore);
|
||||
// set the new data
|
||||
JFolder::copy($this->componentPath, $repoFullPath, '', true);
|
||||
// Trigger Event: jcb_ce_onAfterUpdateRepo
|
||||
$this->triggerEvent('jcb_ce_onAfterUpdateRepo', array(&$this->componentContext, &$this->componentPath, &$repoFullPath, &$this->componentData));
|
||||
}
|
||||
// the name of the zip file to create
|
||||
$this->filepath = $this->tempPath . '/' . $this->componentFolderName . '.zip';
|
||||
|
||||
// Trigger Event: jcb_ce_onBeforeZipComponent
|
||||
$this->triggerEvent('jcb_ce_onBeforeZipComponent', array(&$this->componentContext, &$this->componentPath, &$this->filepath, &$this->tempPath, &$this->componentFolderName, &$this->componentData));
|
||||
//create the zip file
|
||||
if (ComponentbuilderHelper::zip($this->componentPath, $this->filepath))
|
||||
{
|
||||
// now move to backup if zip was made and backup is requered
|
||||
// now move to backup if zip was made and backup is required
|
||||
if ($this->backupPath && $this->dynamicIntegration)
|
||||
{
|
||||
// Trigger Event: jcb_ce_onBeforeBackupZip
|
||||
$this->triggerEvent('jcb_ce_onBeforeBackupZip', array(&$this->componentContext, &$this->filepath, &$this->tempPath, &$this->backupPath, &$this->componentData));
|
||||
// copy the zip to backup path
|
||||
JFile::copy($this->filepath, $this->backupPath);
|
||||
}
|
||||
|
||||
@ -482,10 +490,14 @@ class Compiler extends Infusion
|
||||
// make sure we have the correct file
|
||||
if (isset($this->componentData->sales_server))
|
||||
{
|
||||
// Trigger Event: jcb_ce_onBeforeMoveToServer
|
||||
$this->triggerEvent('jcb_ce_onBeforeMoveToServer', array(&$this->componentContext, &$this->filepath, &$this->tempPath, &$this->componentSalesName, &$this->componentData));
|
||||
// move to server
|
||||
ComponentbuilderHelper::moveToServer($this->filepath, $this->componentSalesName . '.zip', (int) $this->componentData->sales_server, $this->componentData->sales_server_protocol);
|
||||
}
|
||||
}
|
||||
// Trigger Event: jcb_ce_onAfterZipComponent
|
||||
$this->triggerEvent('jcb_ce_onAfterZipComponent', array(&$this->componentContext, &$this->filepath, &$this->tempPath, &$this->componentFolderName, &$this->componentData));
|
||||
// remove the component folder since we are done
|
||||
if ($this->removeFolder($this->componentPath))
|
||||
{
|
||||
|
@ -124,6 +124,24 @@ abstract class ComponentbuilderHelper
|
||||
'JPATH_THEMES' => JPATH_THEMES
|
||||
);
|
||||
|
||||
/**
|
||||
* Making class or function name safe
|
||||
*
|
||||
* @input string The name you would like to make safe
|
||||
*
|
||||
* @returns string on success
|
||||
**/
|
||||
public static function safeClassFunctionName($name)
|
||||
{
|
||||
// remove numbers if the first character is a number
|
||||
if (is_numeric(substr($name, 0, 1)))
|
||||
{
|
||||
$name = self::replaceNumbers($name);
|
||||
}
|
||||
// remove all spaces and strange characters
|
||||
return trim(reg_replace("/[^A-Za-z0-9]/", '', $name));
|
||||
}
|
||||
|
||||
/**
|
||||
* The field builder switch
|
||||
**/
|
||||
|
@ -5257,7 +5257,7 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_COMPONENT_FILES_FOLDERS_DESCRIPTION="
|
||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_COMPONENT_FILES_FOLDERS_LABEL="Adding Custom Files & Folder"
|
||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_CROWDIN_DESCRIPTION="<div class='alert alert-warning'>
|
||||
<h4>Feature not ready?</h4>
|
||||
<p>We are still working on this integration, so it is not fully ready. Hopefully with the next update.</p>
|
||||
<p>We are still working on this integration, so it is not fully ready.</p>
|
||||
</div>
|
||||
<div id='crowdin_information_box'>
|
||||
<div class='alert alert-info'>
|
||||
|
Reference in New Issue
Block a user