Improved the compiler, added the option to add the update server file to the zipped package, fixed a few bugs.
This commit is contained in:
@ -43,7 +43,7 @@ class Compiler extends Infusion
|
||||
|
||||
public $filepath = '';
|
||||
// fixed pathes
|
||||
protected $add2SalesServer = false;
|
||||
protected $dynamicIntegration = false;
|
||||
protected $backupPath = false;
|
||||
protected $gitPath = false;
|
||||
|
||||
@ -61,8 +61,8 @@ class Compiler extends Infusion
|
||||
// set some folder paths in relation to distribution
|
||||
if ($config['addBackup'])
|
||||
{
|
||||
$this->backupPath = $this->params->get('backup_folder_path', $this->tempPath).'/'.$this->componentBackupName.'.zip';
|
||||
$this->add2SalesServer = true;
|
||||
$this->backupPath = $this->params->get('backup_folder_path', $this->tempPath).'/'.$this->componentBackupName.'.zip';
|
||||
$this->dynamicIntegration = true;
|
||||
}
|
||||
if ($config['addGit'])
|
||||
{
|
||||
@ -187,7 +187,7 @@ class Compiler extends Infusion
|
||||
}
|
||||
}
|
||||
// move the update server to host
|
||||
if ($this->componentData->add_update_server && isset($this->updateServerFileName) && $this->add2SalesServer)
|
||||
if ($this->componentData->add_update_server && $this->componentData->update_server_target == 1 && isset($this->updateServerFileName) && $this->dynamicIntegration)
|
||||
{
|
||||
$xml_update_server_path = $this->componentPath.'/'.$this->updateServerFileName.'.xml';
|
||||
// make sure we have the correct file
|
||||
@ -329,12 +329,12 @@ class Compiler extends Infusion
|
||||
if ($zip->create($this->filepath, $zipArray))
|
||||
{
|
||||
// now move to backup if zip was made and backup is requered
|
||||
if ($this->backupPath)
|
||||
if ($this->backupPath && $this->dynamicIntegration)
|
||||
{
|
||||
JFile::copy($this->filepath, $this->backupPath);
|
||||
}
|
||||
// move to sales server host
|
||||
if ($this->componentData->add_sales_server)
|
||||
if ($this->componentData->add_sales_server && $this->dynamicIntegration)
|
||||
{
|
||||
// make sure we have the correct file
|
||||
if (isset($this->componentData->sales_server_ftp))
|
||||
|
@ -445,13 +445,13 @@ class Interpretation extends Fields
|
||||
$function = array();
|
||||
if (isset($this->basicEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->basicEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->advancedEncryptionBuilder))
|
||||
{
|
||||
$function[] = "\n\n\tpublic static function getCryptKey(\$type)";
|
||||
$function[] = "\n\n\tpublic static function getCryptKey(\$type, \$default = null)";
|
||||
$function[] = "\t{";
|
||||
$function[] = "\t\t//".$this->setLine(__LINE__)." Get the global params";
|
||||
$function[] = "\t\t\$params = JComponentHelper::getParams('com_".$component."', true);";
|
||||
$function[] = "\t\tif ('advanced' == \$type)";
|
||||
$function[] = "\t\t{";
|
||||
$function[] = "\t\t\t\$advanced_key = \$params->get('advanced_key', null);";
|
||||
$function[] = "\t\t\t\$advanced_key = \$params->get('advanced_key', \$default);";
|
||||
$function[] = "\t\t\tif (\$advanced_key)";
|
||||
$function[] = "\t\t\t{";
|
||||
$function[] = "\t\t\t\t//".$this->setLine(__LINE__)." load the file";
|
||||
@ -462,7 +462,7 @@ class Interpretation extends Fields
|
||||
$function[] = "\t\t}";
|
||||
$function[] = "\t\telseif ('basic' == \$type)";
|
||||
$function[] = "\t\t{";
|
||||
$function[] = "\t\t\t\$basic_key = \$params->get('basic_key', null);";
|
||||
$function[] = "\t\t\t\$basic_key = \$params->get('basic_key', \$default);";
|
||||
$function[] = "\t\t\tif (\$basic_key)";
|
||||
$function[] = "\t\t\t{";
|
||||
$function[] = "\t\t\t\treturn \$basic_key;";
|
||||
@ -473,13 +473,13 @@ class Interpretation extends Fields
|
||||
}
|
||||
elseif (isset($this->advancedEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->advancedEncryptionBuilder))
|
||||
{
|
||||
$function[] = "\n\n\tpublic static function getCryptKey(\$type)";
|
||||
$function[] = "\n\n\tpublic static function getCryptKey(\$type, \$default = null)";
|
||||
$function[] = "\t{";
|
||||
$function[] = "\t\tif ('advanced' == \$type)";
|
||||
$function[] = "\t\t{";
|
||||
$function[] = "\t\t\t//".$this->setLine(__LINE__)." Get the global params";
|
||||
$function[] = "\t\t\t\$params = JComponentHelper::getParams('com_".$component."', true);";
|
||||
$function[] = "\t\t\t\$advanced_key = \$params->get('advanced_key', null);";
|
||||
$function[] = "\t\t\t\$advanced_key = \$params->get('advanced_key', \$default);";
|
||||
$function[] = "\t\t\tif (\$advanced_key)";
|
||||
$function[] = "\t\t\t{";
|
||||
$function[] = "\t\t\t\t//".$this->setLine(__LINE__)." load the file";
|
||||
@ -493,13 +493,13 @@ class Interpretation extends Fields
|
||||
}
|
||||
elseif (isset($this->basicEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->basicEncryptionBuilder))
|
||||
{
|
||||
$function[] = "\n\n\tpublic static function getCryptKey(\$type)";
|
||||
$function[] = "\n\n\tpublic static function getCryptKey(\$type, \$default = null)";
|
||||
$function[] = "\t{";
|
||||
$function[] = "\t\tif ('basic' == \$type)";
|
||||
$function[] = "\t\t{";
|
||||
$function[] = "\t\t\t//".$this->setLine(__LINE__)." Get the global params";
|
||||
$function[] = "\t\t\t\$params = JComponentHelper::getParams('com_".$component."', true);";
|
||||
$function[] = "\t\t\t\$basic_key = \$params->get('basic_key', null);";
|
||||
$function[] = "\t\t\t\$basic_key = \$params->get('basic_key', \$default);";
|
||||
$function[] = "\t\t\tif (\$basic_key)";
|
||||
$function[] = "\t\t\t{";
|
||||
$function[] = "\t\t\t\treturn \$basic_key;";
|
||||
@ -521,7 +521,7 @@ class Interpretation extends Fields
|
||||
{
|
||||
$updateXML = array();
|
||||
// add the update server
|
||||
if ($this->componentData->add_update_server)
|
||||
if ($this->componentData->add_update_server && $this->componentData->update_server_target != 3)
|
||||
{
|
||||
$updateXML[] = '<updates>';
|
||||
}
|
||||
@ -545,7 +545,7 @@ class Interpretation extends Fields
|
||||
$this->fileContentDynamic[$name.'_'.$update['version']]['###UPDATE_VERSION_MYSQL###'] = $update['mysql'];
|
||||
}
|
||||
// add the update server
|
||||
if ($this->componentData->add_update_server)
|
||||
if ($this->componentData->add_update_server && $this->componentData->update_server_target != 3)
|
||||
{
|
||||
// build update xml
|
||||
$updateXML[] = "\t<update>";
|
||||
@ -571,8 +571,8 @@ class Interpretation extends Fields
|
||||
$updateXML[] = "\t</update>";
|
||||
}
|
||||
}
|
||||
// add the update server
|
||||
if ($this->componentData->add_update_server)
|
||||
// add the update server file
|
||||
if ($this->componentData->add_update_server && $this->componentData->update_server_target != 3)
|
||||
{
|
||||
$updateXML[] = '</updates>';
|
||||
// ###UPDATE_SERVER_XML###
|
||||
@ -583,16 +583,19 @@ class Interpretation extends Fields
|
||||
|
||||
// set the Update server file name
|
||||
$this->updateServerFileName = $name;
|
||||
|
||||
// ###UPDATESERVER###
|
||||
$updateServer = array();
|
||||
$updateServer[] = "\n\t<updateservers>";
|
||||
$updateServer[] = "\t\t".'<server type="extension" enabled="1" element="com_'.$this->fileContentStatic['###component###'].'" name="'.$this->fileContentStatic['###Component_name###'].'">'.$this->componentData->update_server.'</server>';
|
||||
$updateServer[] = "\t</updateservers>";
|
||||
// return the array to string
|
||||
$updateServer = implode("\n", $updateServer);
|
||||
}
|
||||
}
|
||||
// add the update server link to component XML
|
||||
if ($this->componentData->add_update_server && isset($this->componentData->update_server) && ComponentbuilderHelper::checkString($this->componentData->update_server))
|
||||
{
|
||||
// ###UPDATESERVER###
|
||||
$updateServer = array();
|
||||
$updateServer[] = "\n\t<updateservers>";
|
||||
$updateServer[] = "\t\t".'<server type="extension" enabled="1" element="com_'.$this->fileContentStatic['###component###'].'" name="'.$this->fileContentStatic['###Component_name###'].'">'.$this->componentData->update_server.'</server>';
|
||||
$updateServer[] = "\t</updateservers>";
|
||||
// return the array to string
|
||||
$updateServer = implode("\n", $updateServer);
|
||||
}
|
||||
// add update server details to component XML file
|
||||
$this->fileContentStatic['###UPDATESERVER###'] = $updateServer;
|
||||
}
|
||||
@ -2711,6 +2714,27 @@ class Interpretation extends Fields
|
||||
// check if custom button should be added
|
||||
if (isset($view['settings']->add_custom_button) && $view['settings']->add_custom_button == 1)
|
||||
{
|
||||
// insure the controller and model strings are added
|
||||
if (ComponentbuilderHelper::checkString($view['settings']->php_controller) && $view['settings']->php_controller != '//')
|
||||
{
|
||||
// set the custom buttons ###CUSTOM_BUTTONS_CONTROLLER###
|
||||
$this->fileContentDynamic[$viewName]['###'.$TARGET.'_CUSTOM_BUTTONS_CONTROLLER###'] =
|
||||
"\n\n".str_replace(array_keys($this->placeholders),array_values($this->placeholders),$view['settings']->php_controller);
|
||||
if ('site' == $this->target)
|
||||
{
|
||||
// add the controller for this view
|
||||
// build the file
|
||||
$target = array($this->target => $viewName);
|
||||
$this->buildDynamique($target,'custom_form');
|
||||
###GET_FORM_CUSTOM###
|
||||
}
|
||||
}
|
||||
if (ComponentbuilderHelper::checkString($view['settings']->php_model) && $view['settings']->php_model != '//')
|
||||
{
|
||||
// set the custom buttons ###CUSTOM_BUTTONS_METHOD###
|
||||
$this->fileContentDynamic[$viewName]['###'.$TARGET.'_CUSTOM_BUTTONS_METHOD###'] =
|
||||
"\n\n".str_replace(array_keys($this->placeholders),array_values($this->placeholders),$view['settings']->php_model);
|
||||
}
|
||||
if (ComponentbuilderHelper::checkArray($view['settings']->custom_buttons))
|
||||
{
|
||||
$buttons = array();
|
||||
@ -2732,27 +2756,6 @@ class Interpretation extends Fields
|
||||
}
|
||||
if (ComponentbuilderHelper::checkArray($buttons))
|
||||
{
|
||||
if (ComponentbuilderHelper::checkString($view['settings']->php_controller))
|
||||
{
|
||||
// set the custom buttons ###CUSTOM_BUTTONS_CONTROLLER###
|
||||
$this->fileContentDynamic[$viewName]['###'.$TARGET.'_CUSTOM_BUTTONS_CONTROLLER###'] =
|
||||
"\n\n".str_replace(array_keys($this->placeholders),array_values($this->placeholders),$view['settings']->php_controller);
|
||||
if ('site' == $this->target)
|
||||
{
|
||||
// add the controller for this view
|
||||
// build the file
|
||||
$target = array($this->target => $viewName);
|
||||
$this->buildDynamique($target,'custom_form');
|
||||
###GET_FORM_CUSTOM###
|
||||
}
|
||||
}
|
||||
if (ComponentbuilderHelper::checkString($view['settings']->php_model))
|
||||
{
|
||||
// set the custom buttons ###CUSTOM_BUTTONS_METHOD###
|
||||
$this->fileContentDynamic[$viewName]['###'.$TARGET.'_CUSTOM_BUTTONS_METHOD###'] =
|
||||
"\n\n".str_replace(array_keys($this->placeholders),array_values($this->placeholders),$view['settings']->php_model);
|
||||
}
|
||||
|
||||
return "\n".implode("\n",$buttons);
|
||||
}
|
||||
}
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.0
|
||||
@build 31st October, 2016
|
||||
@version 2.2.2
|
||||
@build 22nd November, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage componentbuilder.php
|
||||
@ -1465,13 +1465,13 @@ abstract class ComponentbuilderHelper
|
||||
return implode($key);
|
||||
}
|
||||
|
||||
public static function getCryptKey($type)
|
||||
public static function getCryptKey($type, $default = null)
|
||||
{
|
||||
if ('basic' == $type)
|
||||
{
|
||||
// Get the global params
|
||||
$params = JComponentHelper::getParams('com_componentbuilder', true);
|
||||
$basic_key = $params->get('basic_key', null);
|
||||
$basic_key = $params->get('basic_key', $default);
|
||||
if ($basic_key)
|
||||
{
|
||||
return $basic_key;
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.0
|
||||
@build 31st October, 2016
|
||||
@version 2.2.2
|
||||
@build 22nd November, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage batch_.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.0
|
||||
@build 31st October, 2016
|
||||
@version 2.2.2
|
||||
@build 22nd November, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage indenter.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.0
|
||||
@build 31st October, 2016
|
||||
@version 2.2.2
|
||||
@build 22nd November, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage js.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.0
|
||||
@build 31st October, 2016
|
||||
@version 2.2.2
|
||||
@build 22nd November, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage minify.php
|
||||
|
Reference in New Issue
Block a user