Updates PHPSecLib. Fixed connection failure to remote server. Adds overriding of back-folder and git-folder on component level.

This commit is contained in:
2023-10-24 09:46:36 +02:00
parent ae9451292f
commit 3c91a5cdbb
66 changed files with 1941 additions and 1327 deletions

View File

@ -48,6 +48,22 @@ abstract class Api
*/
protected Response $response;
/**
* The Url string
*
* @var string|null
* @since 3.2.0
*/
protected ?string $url = null;
/**
* The token string
*
* @var string|null
* @since 3.2.0
*/
protected ?string $token = null;
/**
* Constructor.
*
@ -67,14 +83,31 @@ abstract class Api
/**
* Load/Reload API.
*
* @param string|null $url The url.
* @param token|null $token The token.
* @param string|null $url The url.
* @param token|null $token The token.
* @param bool $backup The backup swapping switch.
*
* @return void
* @since 3.2.0
**/
public function load_(?string $url = null, ?string $token = null)
public function load_(?string $url = null, ?string $token = null, bool $backup = true): void
{
// we keep the old values
// so we can reset after our call
// for the rest of the container
if ($backup)
{
if ($url !== null)
{
$this->url = $this->uri->getUrl();
}
if ($token !== null)
{
$this->token = $this->http->getToken();
}
}
if ($url !== null)
{
$this->uri->setUrl($url);
@ -86,6 +119,27 @@ abstract class Api
}
}
/**
* Reset to previous toke, url it set
*
* @return void
* @since 3.2.0
**/
public function reset_(): void
{
if ($this->url !== null)
{
$this->uri->setUrl($this->url);
$this->url = null;
}
if ($this->token !== null)
{
$this->http->setToken($this->token);
$this->token = null;
}
}
/**
* Get the API url
*

View File

@ -23,6 +23,14 @@ use Joomla\Registry\Registry;
*/
final class Http extends JoomlaHttp
{
/**
* The token
*
* @var string
* @since 3.2.0
*/
protected string $_token_; // to avoid collusions (but allow swapping)
/**
* Constructor.
*
@ -45,6 +53,7 @@ final class Http extends JoomlaHttp
if (is_string($token))
{
$config['headers']['Authorization'] = 'token ' . $token;
$this->_token_ = $token;
}
$options = new Registry($config);
@ -60,7 +69,7 @@ final class Http extends JoomlaHttp
*
* @since 3.2.0
**/
public function setToken(string $token)
public function setToken(string $token): void
{
// get the current headers
$headers = (array) $this->getOption('headers', [
@ -70,8 +79,20 @@ final class Http extends JoomlaHttp
// add the token
$headers['Authorization'] = 'token ' . $token;
$this->_token_ = $token;
$this->setOption('headers', $headers);
}
/**
* Get the Token.
*
* @return string|null
* @since 3.2.0
**/
public function getToken(): ?string
{
return $this->_token_ ?? null;
}
}

View File

@ -110,6 +110,17 @@ final class Uri
$this->url = $url;
}
/**
* Get the URL of the API
*
* @return string|null
* @since 3.2.0
**/
public function getUrl(): ?string
{
return $this->url ?? null;
}
/**
* Set the endpoint of the API
*

View File

@ -12,6 +12,9 @@
namespace VDM\Joomla\Componentbuilder\Server;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Application\CMSApplication;
use phpseclib3\Net\SFTP as SftpClient;
use VDM\Joomla\Componentbuilder\Crypt\KeyLoader;
use VDM\Joomla\Utilities\StringHelper;
@ -51,16 +54,26 @@ class Sftp implements Serverinterface
**/
protected ?object $details = null;
/**
* Application object.
*
* @var CMSApplication
* @since 3.2.0
**/
protected CMSApplication $app;
/**
* Constructor
*
* @param KeyLoader $key The key loader object.
* @param CMSApplication|null $app The app object.
*
* @since 3.2.0
*/
public function __construct(KeyLoader $key)
public function __construct(KeyLoader $key, ?CMSApplication $app = null)
{
$this->key = $key;
$this->app = $app ?: Factory::getApplication();
}
/**
@ -106,10 +119,21 @@ class Sftp implements Serverinterface
StringHelper::check($this->details->path) &&
$this->details->path !== '/')
{
$path = '/' . trim((string) $this->details->path, '/');
$path = trim((string) $this->details->path);
$path = '/' . trim($path, '/') . '/';
}
return $this->client->put($path . '/' . $fileName, $data);
try
{
return $this->client->put($path . trim($fileName), $data);
}
catch(\Exception $e)
{
$this->app->enqueueMessage(
Text::sprintf('COM_COMPONENTBUILDER_MOVING_OF_THE_S_FAILED', $fileName) . ': ' . $e->getMessage(),
'Error'
);
}
}
return false;
@ -147,24 +171,23 @@ class Sftp implements Serverinterface
isset($this->details->username) && StringHelper::check($this->details->username))
{
// insure the port is set
$port = (isset($this->details->port) && is_numeric($this->details->port) && $this->details->port > 0)
? (int) $this->details->port : 22;
$port = (int)($this->details->port ?? 22);
// open the connection
$sftp = new SftpClient($this->details->host, $port);
// set the passphrase if it exist
$passphrase = $this->details->secret ?? null;
$passphrase = (isset($this->details->secret) && StringHelper::check(trim($this->details->secret))) ? trim($this->details->secret) : false;
// set the password if it exist
$password = $this->details->password ?? null;
$password = (isset($this->details->password) && StringHelper::check(trim($this->details->password))) ? trim($this->details->password) : false;
// now login based on authentication type
$key = null;
switch($this->details->authentication)
{
case 1: // password
$key = $this->details->password ?? null;
$key = $password ?? null;
$password = null;
break;
case 2: // private key file
@ -172,28 +195,77 @@ class Sftp implements Serverinterface
if (isset($this->details->private) && StringHelper::check($this->details->private) &&
($private_key = FileHelper::getContent($this->details->private, null)) !== null)
{
$key = $this->key::load($private_key, $passphrase);
try
{
$key = $this->key::load(trim($private_key), $passphrase);
}
catch(\Exception $e)
{
$this->app->enqueueMessage(
Text::_('COM_COMPONENTBUILDER_LOADING_THE_PRIVATE_KEY_FILE_FAILED') . ': ' . $e->getMessage(),
'Error'
);
$key = null;
}
}
break;
case 4: // private key field
case 5: // both password and private key field
if (isset($this->details->private_key) && StringHelper::check($this->details->private_key))
{
$key = $this->key::load($this->details->private_key, $passphrase);
try
{
$key = $this->key::load(trim($this->details->private_key), $passphrase);
}
catch(\Exception $e)
{
$this->app->enqueueMessage(
Text::_('COM_COMPONENTBUILDER_LOADING_THE_PRIVATE_KEY_TEXT_FAILED') . ': ' . $e->getMessage(),
'Error'
);
$key = null;
}
}
break;
}
// remove any null bites from the username
$this->details->username = trim($this->details->username);
// login
if ((!empty($key) && !empty($password) && $sftp->login($this->details->username, $key, $password)) ||
(!empty($key) && $sftp->login($this->details->username, $key)))
if (!empty($key) && !empty($password))
{
return $sftp;
try
{
$sftp->login($this->details->username, $key, $password);
return $sftp;
}
catch(\Exception $e)
{
$this->app->enqueueMessage(
Text::_('COM_COMPONENTBUILDER_LOGIN_FAILED') . ': ' . $e->getMessage(),
'Error'
);
}
}
elseif (!empty($key))
{
try
{
$sftp->login($this->details->username, $key);
return $sftp;
}
catch(\Exception $e)
{
$this->app->enqueueMessage(
Text::_('COM_COMPONENTBUILDER_LOGIN_FAILED') . ': ' . $e->getMessage(),
'Error'
);
}
}
}
return null;
}
}
}

View File

@ -67,51 +67,6 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL,
'tab_name' => 'Details',
],
'php_helper_both' => [
'name' => 'php_helper_both',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_BOTH_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
'store' => 'base64',
'tab_name' => 'Libs & Helpers',
],
'created' => [
'name' => 'created',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CREATED_LABEL',
'type' => 'calendar',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'publishing',
],
'crowdin_project_identifier' => [
'name' => 'crowdin_project_identifier',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CROWDIN_PROJECT_IDENTIFIER_LABEL',
'type' => 'text',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Dynamic Integration',
],
'php_method_uninstall' => [
'name' => 'php_method_uninstall',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_METHOD_UNINSTALL_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
'store' => 'base64',
'tab_name' => 'Dash & Install',
],
'php_preflight_install' => [
'name' => 'php_preflight_install',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
'store' => 'base64',
'tab_name' => 'Dash & Install',
],
'css_admin' => [
'name' => 'css_admin',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CSS_ADMIN_LABEL',
@ -121,33 +76,6 @@ class Table extends BaseTable implements Tableinterface
'store' => 'base64',
'tab_name' => 'Libs & Helpers',
],
'mvc_versiondate' => [
'name' => 'mvc_versiondate',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MVC_VERSIONDATE_LABEL',
'type' => 'list',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
],
'remove_line_breaks' => [
'name' => 'remove_line_breaks',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_REMOVE_LINE_BREAKS_LABEL',
'type' => 'radio',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
],
'add_placeholders' => [
'name' => 'add_placeholders',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PLACEHOLDERS_LABEL',
'type' => 'radio',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
],
'php_admin_event' => [
'name' => 'php_admin_event',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_ADMIN_EVENT_LABEL',
@ -166,18 +94,18 @@ class Table extends BaseTable implements Tableinterface
'store' => 'base64',
'tab_name' => 'Libs & Helpers',
],
'description' => [
'name' => 'description',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DESCRIPTION_LABEL',
'type' => 'textarea',
'crowdin_username' => [
'name' => 'crowdin_username',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CROWDIN_USERNAME_LABEL',
'type' => 'text',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
'store' => 'basic_encryption',
'tab_name' => 'Dynamic Integration',
],
'author' => [
'name' => 'author',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL',
'component_version' => [
'name' => 'component_version',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPONENT_VERSION_LABEL',
'type' => 'text',
'title' => false,
'list' => 'joomla_components',
@ -193,10 +121,19 @@ class Table extends BaseTable implements Tableinterface
'store' => 'base64',
'tab_name' => 'Dash & Install',
],
'email' => [
'name' => 'email',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMAIL_LABEL',
'type' => 'text',
'remove_line_breaks' => [
'name' => 'remove_line_breaks',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_REMOVE_LINE_BREAKS_LABEL',
'type' => 'radio',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
],
'description' => [
'name' => 'description',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DESCRIPTION_LABEL',
'type' => 'textarea',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
@ -211,6 +148,96 @@ class Table extends BaseTable implements Tableinterface
'store' => 'base64',
'tab_name' => 'MySQL',
],
'debug_linenr' => [
'name' => 'debug_linenr',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DEBUG_LINENR_LABEL',
'type' => 'radio',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
],
'mvc_versiondate' => [
'name' => 'mvc_versiondate',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MVC_VERSIONDATE_LABEL',
'type' => 'list',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
],
'php_preflight_install' => [
'name' => 'php_preflight_install',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
'store' => 'base64',
'tab_name' => 'Dash & Install',
],
'backup_folder_path' => [
'name' => 'backup_folder_path',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACKUP_FOLDER_PATH_LABEL',
'type' => 'text',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Dynamic Integration',
],
'php_method_uninstall' => [
'name' => 'php_method_uninstall',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_METHOD_UNINSTALL_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
'store' => 'base64',
'tab_name' => 'Dash & Install',
],
'add_placeholders' => [
'name' => 'add_placeholders',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PLACEHOLDERS_LABEL',
'type' => 'radio',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
],
'author' => [
'name' => 'author',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL',
'type' => 'text',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
],
'add_sales_server' => [
'name' => 'add_sales_server',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SALES_SERVER_LABEL',
'type' => 'radio',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Dynamic Integration',
],
'email' => [
'name' => 'email',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMAIL_LABEL',
'type' => 'text',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
],
'translation_tool' => [
'name' => 'translation_tool',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TRANSLATION_TOOL_LABEL',
'type' => 'list',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Dynamic Integration',
],
'website' => [
'name' => 'website',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WEBSITE_LABEL',
@ -220,14 +247,14 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL,
'tab_name' => 'Details',
],
'debug_linenr' => [
'name' => 'debug_linenr',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DEBUG_LINENR_LABEL',
'type' => 'radio',
'buildcompsql' => [
'name' => 'buildcompsql',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_LABEL',
'type' => 'textarea',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
'store' => 'base64',
'tab_name' => 'Dynamic Build (beta)',
],
'add_license' => [
'name' => 'add_license',
@ -238,6 +265,15 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL,
'tab_name' => 'Details',
],
'php_helper_admin' => [
'name' => 'php_helper_admin',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_ADMIN_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
'store' => 'base64',
'tab_name' => 'Libs & Helpers',
],
'license_type' => [
'name' => 'license_type',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LICENSE_TYPE_LABEL',
@ -247,18 +283,18 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL,
'tab_name' => 'Details',
],
'add_email_helper' => [
'name' => 'add_email_helper',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_EMAIL_HELPER_LABEL',
'type' => 'radio',
'php_helper_site' => [
'name' => 'php_helper_site',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_SITE_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'store' => 'base64',
'tab_name' => 'Libs & Helpers',
],
'php_helper_admin' => [
'name' => 'php_helper_admin',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_ADMIN_LABEL',
'javascript' => [
'name' => 'javascript',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_JAVASCRIPT_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
@ -274,9 +310,9 @@ class Table extends BaseTable implements Tableinterface
'store' => 'basic_encryption',
'tab_name' => 'Details',
],
'php_helper_site' => [
'name' => 'php_helper_site',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_SITE_LABEL',
'css_site' => [
'name' => 'css_site',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CSS_SITE_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
@ -292,15 +328,6 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL,
'tab_name' => 'Details',
],
'javascript' => [
'name' => 'javascript',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_JAVASCRIPT_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
'store' => 'base64',
'tab_name' => 'Libs & Helpers',
],
'whmcs_buy_link' => [
'name' => 'whmcs_buy_link',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_BUY_LINK_LABEL',
@ -310,33 +337,6 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL,
'tab_name' => 'Details',
],
'css_site' => [
'name' => 'css_site',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CSS_SITE_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
'store' => 'base64',
'tab_name' => 'Libs & Helpers',
],
'license' => [
'name' => 'license',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LICENSE_LABEL',
'type' => 'textarea',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
],
'bom' => [
'name' => 'bom',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BOM_LABEL',
'type' => 'filelist',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
],
'php_preflight_update' => [
'name' => 'php_preflight_update',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_LABEL',
@ -346,10 +346,10 @@ class Table extends BaseTable implements Tableinterface
'store' => 'base64',
'tab_name' => 'Dash & Install',
],
'image' => [
'name' => 'image',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMAGE_LABEL',
'type' => 'media',
'license' => [
'name' => 'license',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LICENSE_LABEL',
'type' => 'textarea',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
@ -364,10 +364,10 @@ class Table extends BaseTable implements Tableinterface
'store' => 'base64',
'tab_name' => 'Dash & Install',
],
'copyright' => [
'name' => 'copyright',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COPYRIGHT_LABEL',
'type' => 'textarea',
'bom' => [
'name' => 'bom',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BOM_LABEL',
'type' => 'filelist',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
@ -382,6 +382,15 @@ class Table extends BaseTable implements Tableinterface
'store' => 'base64',
'tab_name' => 'MySQL',
],
'image' => [
'name' => 'image',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMAGE_LABEL',
'type' => 'media',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
],
'addreadme' => [
'name' => 'addreadme',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDREADME_LABEL',
@ -391,14 +400,14 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL,
'tab_name' => 'Readme',
],
'add_sales_server' => [
'name' => 'add_sales_server',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SALES_SERVER_LABEL',
'type' => 'radio',
'copyright' => [
'name' => 'copyright',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COPYRIGHT_LABEL',
'type' => 'textarea',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Dynamic Integration',
'tab_name' => 'Details',
],
'update_server_url' => [
'name' => 'update_server_url',
@ -409,15 +418,6 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL,
'tab_name' => 'Dynamic Integration',
],
'component_version' => [
'name' => 'component_version',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPONENT_VERSION_LABEL',
'type' => 'text',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
],
'add_powers' => [
'name' => 'add_powers',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_POWERS_LABEL',
@ -427,41 +427,32 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL,
'tab_name' => 'Details',
],
'translation_tool' => [
'name' => 'translation_tool',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TRANSLATION_TOOL_LABEL',
'type' => 'list',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Dynamic Integration',
],
'crowdin_username' => [
'name' => 'crowdin_username',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CROWDIN_USERNAME_LABEL',
'type' => 'text',
'title' => false,
'list' => 'joomla_components',
'store' => 'basic_encryption',
'tab_name' => 'Dynamic Integration',
],
'buildcompsql' => [
'name' => 'buildcompsql',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_LABEL',
'type' => 'textarea',
'title' => false,
'list' => 'joomla_components',
'store' => 'base64',
'tab_name' => 'Dynamic Build (beta)',
],
'add_php_helper_both' => [
'name' => 'add_php_helper_both',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_HELPER_BOTH_LABEL',
'add_backup_folder_path' => [
'name' => 'add_backup_folder_path',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_BACKUP_FOLDER_PATH_LABEL',
'type' => 'radio',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Libs & Helpers',
'tab_name' => 'Dynamic Integration',
],
'crowdin_project_identifier' => [
'name' => 'crowdin_project_identifier',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CROWDIN_PROJECT_IDENTIFIER_LABEL',
'type' => 'text',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Dynamic Integration',
],
'created' => [
'name' => 'created',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CREATED_LABEL',
'type' => 'calendar',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'publishing',
],
'add_php_helper_admin' => [
'name' => 'add_php_helper_admin',
@ -742,6 +733,42 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL,
'tab_name' => 'Dynamic Integration',
],
'add_git_folder_path' => [
'name' => 'add_git_folder_path',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_GIT_FOLDER_PATH_LABEL',
'type' => 'radio',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Dynamic Integration',
],
'git_folder_path' => [
'name' => 'git_folder_path',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_GIT_FOLDER_PATH_LABEL',
'type' => 'text',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Dynamic Integration',
],
'creatuserhelper' => [
'name' => 'creatuserhelper',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CREATUSERHELPER_LABEL',
'type' => 'radio',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Libs & Helpers',
],
'adduikit' => [
'name' => 'adduikit',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDUIKIT_LABEL',
'type' => 'list',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Libs & Helpers',
],
'crowdin_project_api_key' => [
'name' => 'crowdin_project_api_key',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CROWDIN_PROJECT_API_KEY_LABEL',
@ -751,6 +778,15 @@ class Table extends BaseTable implements Tableinterface
'store' => 'basic_encryption',
'tab_name' => 'Dynamic Integration',
],
'addfootable' => [
'name' => 'addfootable',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDFOOTABLE_LABEL',
'type' => 'list',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Libs & Helpers',
],
'crowdin_account_api_key' => [
'name' => 'crowdin_account_api_key',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CROWDIN_ACCOUNT_API_KEY_LABEL',
@ -760,9 +796,9 @@ class Table extends BaseTable implements Tableinterface
'store' => 'basic_encryption',
'tab_name' => 'Dynamic Integration',
],
'creatuserhelper' => [
'name' => 'creatuserhelper',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CREATUSERHELPER_LABEL',
'add_email_helper' => [
'name' => 'add_email_helper',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_EMAIL_HELPER_LABEL',
'type' => 'radio',
'title' => false,
'list' => 'joomla_components',
@ -778,10 +814,10 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL,
'tab_name' => 'Dynamic Build (beta)',
],
'adduikit' => [
'name' => 'adduikit',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDUIKIT_LABEL',
'type' => 'list',
'add_php_helper_both' => [
'name' => 'add_php_helper_both',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_HELPER_BOTH_LABEL',
'type' => 'radio',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
@ -796,13 +832,13 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL,
'tab_name' => 'publishing',
],
'addfootable' => [
'name' => 'addfootable',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDFOOTABLE_LABEL',
'type' => 'list',
'php_helper_both' => [
'name' => 'php_helper_both',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_BOTH_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'store' => 'base64',
'tab_name' => 'Libs & Helpers',
],
'modified' => [

View File

@ -65,7 +65,7 @@ abstract class TypeHelper
$string = StringHelper::transliterate($string);
// remove all and keep only characters and numbers and point (TODO just one point)
$string = trim(preg_replace("/[^A-Za-z0-9\.]/", '', (string) $string));
$string = trim(preg_replace("/[^A-Za-z0-9_\.]/", '', (string) $string));
// best is to return lower (for all string equality in compiler)
return strtolower($string);