Adds phpseclib version 3.

This commit is contained in:
2022-12-29 08:12:03 +02:00
parent d28e4c74af
commit e614f2ec23
412 changed files with 66550 additions and 477 deletions

View File

@@ -12,8 +12,11 @@
namespace VDM\Joomla\Componentbuilder\Search\Model;
use VDM\Joomla\Componentbuilder\Search\Interfaces\ModelInterface;
use VDM\Joomla\Componentbuilder\Search\Abstraction\Model;
use VDM\Joomla\Componentbuilder\Search\Factory;
use VDM\Joomla\Componentbuilder\Table;
use VDM\Joomla\Componentbuilder\Search\Config;
use VDM\Joomla\Componentbuilder\Interfaces\ModelInterface;
use VDM\Joomla\Componentbuilder\Abstraction\Model;
/**
@@ -23,6 +26,29 @@ use VDM\Joomla\Componentbuilder\Search\Abstraction\Model;
*/
class Insert extends Model implements ModelInterface
{
/**
* Search Config
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* Constructor
*
* @param Config|null $config The search config object.
* @param Table|null $table The search table object.
*
* @since 3.2.0
*/
public function __construct(?Config $config = null, ?Table $table = null)
{
parent::__construct($table ?? Factory::_('Table'));
$this->config = $config ?: Factory::_('Config');
}
/**
* Model the value
* Example: $this->value(value, 'field_key', 'table_name');
@@ -39,7 +65,7 @@ class Insert extends Model implements ModelInterface
// set the table name
if (empty($table))
{
$table = $this->config->table_name;
$table = $this->getTable();
}
// check if this is a valid table
@@ -49,15 +75,27 @@ class Insert extends Model implements ModelInterface
switch($store)
{
case 'base64':
$value = \base64_encode($value);
$value = base64_encode($value);
break;
case 'json':
$value = \json_encode($value, JSON_FORCE_OBJECT);
$value = json_encode($value, JSON_FORCE_OBJECT);
break;
}
}
return $value;
}
/**
* Get the current active table
*
* @return string
* @since 3.2.0
*/
protected function getTable(): string
{
return $this->config->table_name;
}
}

View File

@@ -12,10 +12,13 @@
namespace VDM\Joomla\Componentbuilder\Search\Model;
use VDM\Joomla\Componentbuilder\Search\Factory;
use VDM\Joomla\Componentbuilder\Table;
use VDM\Joomla\Componentbuilder\Search\Config;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Componentbuilder\Search\Interfaces\ModelInterface;
use VDM\Joomla\Componentbuilder\Search\Abstraction\Model;
use VDM\Joomla\Componentbuilder\Interfaces\ModelInterface;
use VDM\Joomla\Componentbuilder\Abstraction\Model;
/**
@@ -25,6 +28,29 @@ use VDM\Joomla\Componentbuilder\Search\Abstraction\Model;
*/
class Load extends Model implements ModelInterface
{
/**
* Search Config
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* Constructor
*
* @param Config|null $config The search config object.
* @param Table|null $table The search table object.
*
* @since 3.2.0
*/
public function __construct(?Config $config = null, ?Table $table = null)
{
parent::__construct($table ?? Factory::_('Table'));
$this->config = $config ?: Factory::_('Config');
}
/**
* Model the value
* Example: $this->value(value, 'value_key', 'table_name');
@@ -41,7 +67,7 @@ class Load extends Model implements ModelInterface
// load the table
if (empty($table))
{
$table = $this->config->table_name;
$table = $this->getTable();
}
// check if this is a valid table
@@ -51,19 +77,30 @@ class Load extends Model implements ModelInterface
switch($store)
{
case 'base64':
$value = \base64_decode($value);
$value = base64_decode($value);
break;
case 'json':
// check if there is a json string
if (JsonHelper::check($value))
{
$value = \json_decode($value, true);
$value = json_decode($value, true);
}
break;
}
}
return $value;
}
/**
* Get the current active table
*
* @return string
* @since 3.2.0
*/
protected function getTable(): string
{
return $this->config->table_name;
}
}