Initial commit

This commit is contained in:
Oh
2024-06-27 09:47:26 +02:00
commit a89d8c8719
557 changed files with 137129 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
# Apache 2.4+
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
# Apache 2.0-2.2
<IfModule !mod_authz_core.c>
Deny from all
</IfModule>

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,502 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Abstraction;
use JCB\Joomla\Interfaces\Tableinterface;
/**
* Base Table
*
* @since 3.2.0
*/
abstract class BaseTable implements Tableinterface
{
/**
* All areas/views/tables with their field details
*
* @var array
* @since 3.2.0
**/
protected array $tables;
/**
* All default fields
*
* @var array
* @since 3.2.1
**/
protected array $defaults = [
'id' => [
'order' => -1,
'name' => 'id',
'label' => 'ID',
'type' => 'text',
'title' => false,
'list' => NULL,
'store' => NULL,
'tab_name' => NULL,
'db' => [
'type' => 'INT(11)',
'default' => 'EMPTY',
'auto_increment' => true,
'primary_key' => true,
'null_switch' => 'NOT NULL'
]
],
'asset_id' => [
'name' => 'asset_id',
'label' => NULL,
'type' => NULL,
'title' => false,
'list' => NULL,
'store' => NULL,
'tab_name' => NULL,
'db' => [
'type' => 'INT(10) unsigned',
'default' => '0',
'null_switch' => 'NOT NULL',
'comment' => 'FK to the #__assets table.'
]
],
'ordering' => [
'name' => 'ordering',
'label' => 'Ordering',
'type' => 'number',
'title' => false,
'list' => NULL,
'store' => NULL,
'tab_name' => NULL,
'db' => [
'type' => 'INT(11)',
'default' => '0',
'null_switch' => 'NOT NULL'
]
],
'published' => [
'name' => 'published',
'label' => 'Status',
'type' => 'list',
'title' => false,
'list' => NULL,
'store' => NULL,
'tab_name' => NULL,
'db' => [
'type' => 'TINYINT(3)',
'default' => '1',
'null_switch' => 'NOT NULL',
'key' => true,
'key_name' => 'state'
]
],
'modified_by' => [
'name' => 'modified_by',
'label' => 'Modified by',
'type' => 'user',
'title' => false,
'list' => NULL,
'store' => NULL,
'tab_name' => NULL,
'db' => [
'type' => 'INT(10) unsigned',
'default' => '0',
'null_switch' => 'NOT NULL',
'key' => true,
'key_name' => 'modifiedby'
]
],
'modified' => [
'name' => 'modified',
'label' => 'Modified',
'type' => 'calendar',
'title' => false,
'list' => NULL,
'store' => NULL,
'tab_name' => NULL,
'db' => [
'type' => 'DATETIME',
'default' => '0000-00-00 00:00:00',
'null_switch' => 'NOT NULL'
]
],
'created_by' => [
'name' => 'created_by',
'label' => 'Created by',
'type' => 'user',
'title' => false,
'list' => NULL,
'store' => NULL,
'tab_name' => NULL,
'db' => [
'type' => 'INT(10) unsigned',
'default' => '0',
'null_switch' => 'NOT NULL',
'key' => true,
'key_name' => 'createdby'
]
],
'created' => [
'name' => 'created',
'label' => 'Created',
'type' => 'calendar',
'title' => false,
'list' => NULL,
'store' => NULL,
'tab_name' => NULL,
'db' => [
'type' => 'DATETIME',
'default' => '0000-00-00 00:00:00',
'null_switch' => 'NOT NULL'
]
],
'checked_out' => [
'name' => 'checked_out',
'label' => NULL,
'type' => NULL,
'title' => false,
'list' => NULL,
'store' => NULL,
'tab_name' => NULL,
'db' => [
'type' => 'INT(10) unsigned',
'default' => '0',
'null_switch' => 'NOT NULL',
'key' => true,
'key_name' => 'checkout'
]
],
'checked_out_time' => [
'name' => 'checked_out_time',
'label' => NULL,
'type' => NULL,
'title' => false,
'list' => NULL,
'store' => NULL,
'tab_name' => NULL,
'db' => [
'type' => 'DATETIME',
'default' => '0000-00-00 00:00:00',
'null_switch' => 'NOT NULL'
]
],
'hits' => [
'name' => 'hits',
'label' => 'Hits',
'type' => 'number',
'title' => false,
'list' => NULL,
'store' => NULL,
'tab_name' => NULL,
'db' => [
'type' => 'INT(10) unsigned',
'default' => '0',
'null_switch' => 'NOT NULL'
]
],
'version' => [
'name' => 'version',
'label' => 'Version',
'type' => 'text',
'title' => false,
'list' => NULL,
'store' => NULL,
'tab_name' => NULL,
'db' => [
'type' => 'INT(10) unsigned',
'default' => '1',
'null_switch' => 'NOT NULL'
]
],
'params' => [
'name' => 'params',
'label' => NULL,
'type' => NULL,
'title' => false,
'list' => NULL,
'store' => 'json',
'tab_name' => NULL,
'db' => [
'type' => 'TEXT',
'default' => 'EMPTY',
'null_switch' => 'NULL'
]
]
];
/**
* Get any value from a item/field/column of an area/view/table
* Example: $this->get('table_name', 'field_name', 'value_key');
* Get an item/field/column of an area/view/table
* Example: $this->get('table_name', 'field_name');
* Get all items/fields/columns of an area/view/table
* Example: $this->get('table_name');
* Get all areas/views/tables with all their item/field/column details
* Example: $this->get('All');
* Example: $this->get();
*
* @param string|null $table The table
* @param string|null $field The field
* @param string|null $key The value key
*
* @return mixed
* @since 3.2.1
*/
public function get(?string $table = null, ?string $field = null, ?string $key = null)
{
// Return specific value
if ($table && $field && $key)
{
return $this->tables[$table][$field][$key] ?? $this->getDefaultKey($field, $key);
}
// Return field within table
if ($table && $field)
{
return $this->tables[$table][$field] ?? $this->getDefault($field);
}
// Return all fields in a table or all tables if 'All' is passed
if ($table)
{
if (strtoupper($table) === 'ALL')
{
return $this->tables;
}
return $this->tables[$table] ?? null;
}
// Return all tables
return $this->tables;
}
/**
* Get title field from an area/view/table
*
* @param string $table The area
*
* @return ?array
* @since 3.2.0
*/
public function title(string $table): ?array
{
// return the title item/field/column of an area/view/table
if (($table = $this->get($table)) !== null)
{
foreach ($table as $item)
{
if ($item['title'])
{
return $item;
}
}
}
// none found
return null;
}
/**
* Get title field name
*
* @param string $table The area
*
* @return string
* @since 3.2.0
*/
public function titleName(string $table): string
{
// return the title name of an area/view/table
if (($field = $this->title($table)) !== null)
{
return $field['name'];
}
// none found default to ID
return 'id';
}
/**
* Get all tables
*
* @return array
* @since 3.2.0
*/
public function tables(): array
{
// return all areas/views/tables
return array_keys($this->tables);
}
/**
* Check if a table (and field) exist
*
* @param string $table The area
* @param string|null $field The area
*
* @return bool
* @since 3.2.0
*/
public function exist(string $table, ?string $field = null): bool
{
if (isset($this->tables[$table]))
{
// if we have a field
if (is_string($field))
{
if (isset($this->tables[$table][$field]))
{
return true;
}
}
else
{
return true;
}
}
return $this->isDefault($field);
}
/**
* Get all fields of an area/view/table
*
* @param string $table The area
* @param bool $default Add the default fields
* @param bool $details Add/Leave fields the details
*
* @return array|null On success an array of fields
* @since 3.2.0
*/
public function fields(string $table, bool $default = false, bool $details = false): ?array
{
// Retrieve fields from the specified table
$fields = $this->get($table);
if ($fields === null)
{
return null;
}
// Determine the fields output based on the $default and $details flags
if ($details)
{
return $default ? $this->addDefaultDetails($fields) : $fields;
}
$fieldKeys = array_keys($fields);
return $default ? $this->addDefault($fieldKeys) : $fieldKeys;
}
/**
* Add the default fields
*
* @param array $fields The table dynamic fields
*
* @return array Fields (with defaults added)
* @since 3.2.0
*/
protected function addDefault(array $fields): array
{
// add default fields
foreach ($this->defaults as $default)
{
if (in_array($default['name'], $fields))
{
continue;
}
// used just for loading the fields
$order = $default['order'] ?? 1;
unset($default['order']);
if ($order < 0)
{
array_unshift($fields, $default['name']);
}
else
{
$fields[] = $default['name'];
}
}
return $fields;
}
/**
* Add the default fields
*
* @param array $fields The table dynamic fields
*
* @return array Fields (with defaults details added)
* @since 3.2.0
*/
protected function addDefaultDetails(array $fields): array
{
// add default fields
foreach ($this->defaults as $default)
{
// remove ordering for now
unset($default['order']);
if (!isset($fields[$default['name']]))
{
$fields[$default['name']] = $default;
}
}
return $fields;
}
/**
* Check if the field is a default field
*
* @param string $field The field to check
*
* @return bool True if a default field
* @since 3.2.0
*/
protected function isDefault(string $field): bool
{
return isset($this->defaults[$field]);
}
/**
* Get a default field
*
* @param string $field The field to check
*
* @return array|null True if a default field
* @since 3.2.0
*/
protected function getDefault(string $field): ?array
{
return $this->defaults[$field] ?? null;
}
/**
* Get a default field property
*
* @param string $field The field to check
* @param string $key The field key/property to check
*
* @return mixed String value if a default field property exist
* @since 3.2.0
*/
protected function getDefaultKey(string $field, string $key)
{
return $this->defaults[$field][$key] ?? null;
}
}

View File

@@ -0,0 +1,115 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Abstraction;
use Joomla\CMS\Factory as JoomlaFactory;
use JCB\Joomla\Utilities\Component\Helper;
/**
* Database
*
* @since 3.2.0
*/
abstract class Database
{
/**
* Database object to query local DB
*
* @since 3.2.0
*/
protected $db;
/**
* Core Component Table Name
*
* @var string
* @since 3.2.0
*/
protected string $table;
/**
* Constructor
*
* @throws \Exception
* @since 3.2.0
*/
public function __construct()
{
$this->db = JoomlaFactory::getDbo();
// set the component table
$this->table = '#__' . Helper::getCode();
}
/**
* Set a value based on data type
*
* @param mixed $value The value to set
*
* @return mixed
* @since 3.2.0
**/
protected function quote($value)
{
if ($value === null) // hmm the null does pose an issue (will keep an eye on this)
{
return 'NULL';
}
if (is_numeric($value))
{
if (filter_var($value, FILTER_VALIDATE_INT))
{
return (int) $value;
}
elseif (filter_var($value, FILTER_VALIDATE_FLOAT))
{
return (float) $value;
}
}
elseif (is_bool($value)) // not sure if this will work well (but its correct)
{
return $value ? 'TRUE' : 'FALSE';
}
// For date and datetime values
if ($value instanceof \DateTime)
{
return $this->db->quote($value->format('Y-m-d H:i:s'));
}
// For other data types, just escape it
return $this->db->quote($value);
}
/**
* Set a table name, adding the
* core component as needed
*
* @param string $table The table string
*
* @return string
* @since 3.2.0
**/
protected function getTable(string $table): string
{
if (strpos($table, '#__') === false)
{
return $this->table . '_' . $table;
}
return $table;
}
}

View File

@@ -0,0 +1,83 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Abstraction;
use Joomla\DI\Container;
use JCB\Joomla\Interfaces\FactoryInterface;
/** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
**
** In realms of code where purists frown, the anti-pattern wears a crown,
** A paradox of chaos bright, where complex paths lose all its slight.
** For in its tangled, wild embrace, lies raw creativity's face,
** No rigid forms, no strict decree, just boundless, daring artistry.
** In flaws, we find the freedom's key, where messy code and brilliance spree,
** A dance of thought, unchained, unbound, in anti-pattern, beauty's found.
**
** Perfect Paradox and True Nature of the Anti-Pattern by ChatGPT
**
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
**
** @since 0.0.0
**/
abstract class Factory implements FactoryInterface
{
/**
* Global Package Container
*
* @var Container|null
* @since 0.0.0
**/
protected static ?Container $container = null;
/**
* Get any class from the package container
*
* @param string $key The container class key
*
* @return Mixed
* @since 0.0.0
*/
public static function _($key)
{
return static::getContainer()->get($key);
}
/**
* Get the global package container
*
* @return Container
* @since 0.0.0
*/
public static function getContainer(): Container
{
if (!static::$container)
{
static::$container = static::createContainer();
}
return static::$container;
}
/**
* Create a container object
*
* @return Container
* @since 0.0.0
*/
abstract protected static function createContainer(): Container;
}

View File

@@ -0,0 +1,503 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Abstraction;
use JCB\Joomla\Utilities\StringHelper;
use JCB\Joomla\Utilities\ArrayHelper;
use JCB\Joomla\Interfaces\Tableinterface as Table;
use JCB\Joomla\Interfaces\ModelInterface;
/**
* Base Model
*
* @since 3.2.0
*/
abstract class Model implements ModelInterface
{
/**
* Last ID
*
* @var array
* @since 3.2.0
*/
protected array $last;
/**
* Search Table
*
* @var Table
* @since 3.2.0
*/
protected Table $table;
/**
* Table Name
*
* @var string
* @since 3.2.0
*/
protected string $tableName;
/**
* The switch to control the behaviour of empty values
*
* @var bool
* @since 3.2.2
*/
protected bool $allowEmpty = true;
/**
* Constructor
*
* @param Table $table The search table object.
* @param string|null $tableName The table
* @param bool|null $allowEmpty The switch to control the behaviour of empty values (default true)
*
* @since 3.2.0
*/
public function __construct(Table $table, ?string $tableName = null, bool $allowEmpty = null)
{
$this->table = $table;
if ($tableName !== null)
{
$this->setTable($tableName);
}
if ($allowEmpty !== null)
{
$this->setAllowEmpty($allowEmpty);
}
}
/**
* Set the current active table
*
* @param string $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(string $table): self
{
$this->setTable($table);
return $this;
}
/**
* Model the value
* Example: $this->value(value, 'value_key', 'table_name');
*
* @param mixed $value The value to model
* @param string $field The field key
* @param string|null $table The table
*
* @return mixed
* @since 3.2.0
*/
abstract public function value($value, string $field, ?string $table = null);
/**
* Model a value of multiple items
* Example: $this->items(Array, 'value_key', 'table_name');
*
* @param array|null $items The array of values
* @param string $field The field key
* @param string|null $table The table
*
* @return array|null
* @since 3.2.2
*/
public function values(?array $items = null, string $field, ?string $table = null): ?array
{
// check if this is a valid table
if (ArrayHelper::check($items))
{
// set the table name
if (empty($table))
{
$table = $this->getTable();
}
// validate if field exist in table
if (!$this->table->exist($table, $field))
{
return null;
}
// value counter
$value_number = 0;
// check if this is a valid table
$item_bucket = [];
foreach ($items as $value)
{
if (!$this->validateBefore($value, $field, $table))
{
continue;
}
$value = $this->value($value, $field, $table);
if (!$this->validateAfter($value, $field, $table))
{
continue;
}
$item_bucket[] = $value;
$value_number++;
}
// do we have any values left
if ($value_number > 0)
{
return $item_bucket;
}
}
return null;
}
/**
* Model the values of an item
* Example: $this->item(Object, 'table_name');
*
* @param object|null $item The item object
* @param string|null $table The table
*
* @return object|null
* @since 3.2.0
*/
public function item(?object $item, ?string $table = null): ?object
{
// we must have an object
if (empty($item))
{
return null;
}
// set the table name
if (empty($table))
{
$table = $this->getTable();
}
if (($fields = $this->getTableFields($table, true)) !== null)
{
// field counter
$field_number = 0;
// check if this is a valid table
$item_bucket = new \stdClass();
foreach ($fields as $field)
{
// model a value if it exists
if(isset($item->{$field}))
{
if (!$this->validateBefore($item->{$field}, $field, $table))
{
continue;
}
$item->{$field} = $this->value($item->{$field}, $field, $table);
if (!$this->validateAfter($item->{$field}, $field, $table))
{
continue;
}
$item_bucket->{$field} = $item->{$field};
$field_number++;
}
}
// all items must have more than one field or its empty (1 = key)
if ($field_number > 1)
{
return $item_bucket;
}
}
return null;
}
/**
* Model the values of multiple items
* Example: $this->items(Array, 'table_name');
*
* @param array|null $items The array of item objects
* @param string|null $table The table
*
* @return array|null
* @since 3.2.0
*/
public function items(?array $items = null, ?string $table = null): ?array
{
// check if this is a valid table
if (ArrayHelper::check($items))
{
// set the table name
if (empty($table))
{
$table = $this->getTable();
}
foreach ($items as $id => &$item)
{
// model the item
if (($item = $this->item($item, $table)) !== null)
{
// add the last ID
$this->last[$table] = $item->id ?? $this->last[$table] ?? null;
}
else
{
unset($items[$id]);
}
}
if (ArrayHelper::check($items))
{
return $items;
}
}
return null;
}
/**
* Model the values of an row
* Example: $this->item(Array, 'table_name');
*
* @param array|null $item The item array
* @param string|null $table The table
*
* @return array|null
* @since 3.2.0
*/
public function row(?array $item, ?string $table = null): ?array
{
// we must have an array
if (empty($item))
{
return null;
}
// set the table name
if (empty($table))
{
$table = $this->getTable();
}
if (($fields = $this->getTableFields($table, true)) !== null)
{
// field counter
$field_number = 0;
// check if this is a valid table
$item_bucket = [];
foreach ($fields as $field)
{
// model a value if it exists
if(isset($item[$field]))
{
if (!$this->validateBefore($item[$field], $field, $table))
{
continue;
}
$item[$field] = $this->value($item[$field], $field, $table);
if (!$this->validateAfter($item[$field], $field, $table))
{
continue;
}
$item_bucket[$field] = $item[$field];
$field_number++;
}
}
// all items must have more than one field or its empty (1 = id or guid)
if ($field_number > 1)
{
return $item_bucket;
}
}
return null;
}
/**
* Model the values of multiple rows
* Example: $this->items(Array, 'table_name');
*
* @param array|null $items The array of item array
* @param string|null $table The table
*
* @return array|null
* @since 3.2.0
*/
public function rows(?array $items = null, ?string $table = null): ?array
{
// check if this is a valid table
if (ArrayHelper::check($items))
{
// set the table name
if (empty($table))
{
$table = $this->getTable();
}
foreach ($items as $id => &$item)
{
// model the item
if (($item = $this->row($item, $table)) !== null)
{
// add the last ID
$this->last[$table] = $item['id'] ?? $this->last[$table] ?? null;
}
else
{
unset($items[$id]);
}
}
if (ArrayHelper::check($items))
{
return $items;
}
}
return null;
}
/**
* Get last modeled ID
* Example: $this->last('table_name');
*
* @param string|null $table The table
*
* @return int|null
* @since 3.2.0
*/
public function last(?string $table = null): ?int
{
// set the table name
if (empty($table))
{
$table = $this->getTable();
}
// check if this is a valid table
if ($table && isset($this->last[$table]))
{
return $this->last[$table];
}
return null;
}
/**
* Set the current active table
*
* @param string $tableName The table name
*
* @return void
* @since 3.2.2
*/
public function setTable(string $tableName): void
{
$this->tableName = $tableName;
}
/**
* Set the switch to control the behaviour of empty values
*
* @param bool $allowEmpty The switch
*
* @return void
* @since 3.2.2
*/
public function setAllowEmpty(bool $allowEmpty): void
{
$this->allowEmpty = $allowEmpty;
}
/**
* Get the current active table
*
* @return string
* @since 3.2.0
*/
protected function getTable(): string
{
return $this->tableName;
}
/**
* Get the switch to control the behaviour of empty values
*
* @return bool
* @since 3.2.2
*/
protected function getAllowEmpty(): bool
{
return $this->allowEmpty;
}
/**
* Get the current active table's fields (including defaults)
*
* @param string $table The area
* @param bool $default Add the default fields
*
* @return array
* @since 3.2.0
*/
protected function getTableFields(string $table, bool $default = false): ?array
{
return $this->table->fields($table, $default);
}
/**
* Validate before the value is modelled (basic, override in child class)
*
* @param mixed $value The field value
* @param string|null $field The field key
* @param string|null $table The table
*
* @return bool
* @since 3.2.0
*/
abstract protected function validateBefore(&$value, ?string $field = null, ?string $table = null): bool;
/**
* Validate after the value is modelled (basic, override in child class)
*
* @param mixed $value The field value
* @param string|null $field The field key
* @param string|null $table The table
*
* @return bool
* @since 3.2.0
*/
abstract protected function validateAfter(&$value, ?string $field = null, ?string $table = null): bool;
}

View File

@@ -0,0 +1,821 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Abstraction;
use Joomla\CMS\Factory;
use Joomla\CMS\Version;
use JCB\Joomla\Interfaces\Tableinterface as Table;
use JCB\Joomla\Interfaces\SchemaInterface;
/**
* Schema Checking
*
* @since 3.2.1
*/
abstract class Schema implements SchemaInterface
{
/**
* The Table Class.
*
* @var Table
* @since 3.2.1
*/
protected Table $table;
/**
* The Database Class
*
* @since 3.2.1
*/
protected $db;
/**
* The local tables
*
* @var array
* @since 3.2.1
*/
private array $tables;
/**
* The component table prefix
*
* @var string
* @since 3.2.1
*/
private string $prefix;
/**
* The field unique keys
*
* @var array
* @since 3.2.1
*/
private array $uniqueKeys;
/**
* The field keys
*
* @var array
* @since 3.2.1
*/
private array $keys;
/**
* The current table columns
*
* @var array
* @since 3.2.1
*/
private array $columns;
/**
* The success messages of the action
*
* @var array
* @since 3.2.1
*/
private array $success;
/**
* Current Joomla Version We are IN
*
* @var int
* @since 3.2.1
**/
protected $currentVersion;
/**
* Constructor.
*
* @param Table $table The Table Class.
*
* @since 3.2.1
* @throws \Exception If the database fails
*/
public function __construct(Table $table)
{
$this->table = $table;
try {
// set the database object
$this->db = Factory::getDbo();
// get current component tables
$this->tables = $this->db->getTableList();
// set the component table
$this->prefix = $this->db->getPrefix() . $this->getCode();
// set the current version
$this->currentVersion = Version::MAJOR_VERSION;
} catch (\Exception $e) {
throw new \Exception("Error: failed to initialize schema class due to a database error.");
}
}
/**
* Check and update database schema for missing fields or tables.
*
* @return array The array of successful updates/actions, if empty no update/action was taken.
* @since 3.2.1
* @throws \Exception If there is an error during the update process.
*/
public function update(): array
{
try {
$this->success = [
"Success: scan of the component tables started."
];
foreach ($this->table->tables() as $table)
{
$this->uniqueKeys = [];
$this->keys = [];
if ($this->tableExists($table))
{
$this->updateSchema($table);
}
else
{
$this->createTable($table);
}
}
} catch (\Exception $e) {
throw new \Exception("Error: updating database schema. " . $e->getMessage());
}
if (count($this->success) == 1)
{
$this->success[] = "Success: scan of the component tables completed with no update needed.";
}
else
{
$this->success[] = "Success: scan of the component tables completed.";
}
return $this->success;
}
/**
* Get the targeted component code
*
* @return string
* @since 3.2.1
*/
abstract protected function getCode(): string;
/**
* Check if a table exists in the database.
*
* @param string $table The name of the table to check.
*
* @return bool True if table exists, False otherwise.
* @since 3.2.1
*/
protected function tableExists(string $table): bool
{
return in_array($this->getTable($table), $this->tables);
}
/**
* Update the schema of an existing table.
*
* @param string $table The table to update.
*
* @return void
* @since 3.2.1
* @throws \Exception If there is an error while updating the schema.
*/
public function updateSchema(string $table): void
{
try {
$existingColumns = $this->getExistingColumns($table);
$expectedColumns = $this->table->fields($table, true);
$missingColumns = array_diff($expectedColumns, $existingColumns);
if (!empty($missingColumns))
{
$this->addMissingColumns($table, $missingColumns);
}
$this->checkColumnsDataType($table, $expectedColumns);
} catch (\Exception $e) {
throw new \Exception("Error: updating schema for $table table. " . $e->getMessage());
}
if (!empty($missingColumns))
{
$column_s = (count($missingColumns) == 1) ? 'column' : 'columns';
$missingColumns = implode(', ', $missingColumns);
$this->success[] = "Success: added missing ($missingColumns) $column_s to $table table.";
}
}
/**
* Create a table with all necessary fields.
*
* @param string $table The name of the table to create.
*
* @return void
* @since 3.2.1
* @throws \Exception If there is an error creating the table.
*/
public function createTable(string $table): void
{
try {
$columns = [];
$fields = $this->table->fields($table, true);
$createTable = 'CREATE TABLE IF NOT EXISTS ' . $this->db->quoteName($this->getTable($table));
foreach ($fields as $field)
{
if (($def = $this->getColumnDefinition($table, $field)) !== null)
{
$columns[] = $def;
}
}
$columnDefinitions = implode(', ', $columns);
$keys = $this->getTableKeys();
$createTableSql = "$createTable ($columnDefinitions, $keys)";
$this->db->setQuery($createTableSql);
$this->db->execute();
} catch (\Exception $e) {
throw new \Exception("Error: failed to create missing $table table. " . $e->getMessage());
}
$this->success[] = "Success: created missing $table table.";
}
/**
* Fetch existing columns from a database table.
*
* @param string $table The name of the table.
*
* @return array An array of column names.
* @since 3.2.1
*/
protected function getExistingColumns(string $table): array
{
$this->columns = $this->db->getTableColumns($this->getTable($table), false);
return array_keys($this->columns);
}
/**
* Add missing columns to a table.
*
* @param string $table The table to update.
* @param array $columns List of missing columns/fields.
*
* @return void
* @since 3.2.1
* @throws \Exception If there is an error adding columns.
*/
protected function addMissingColumns(string $table, array $columns): void
{
try {
$query = $this->db->getQuery(true);
$alterTable = 'ALTER TABLE ' . $this->db->quoteName($this->getTable($table)) . ' ';
// Start an ALTER TABLE query
$alterQueries = [];
foreach ($columns as $column)
{
if (($def = $this->getColumnDefinition($table, $column)) !== null)
{
$alterQueries[] = " ADD " . $def;
}
}
$this->db->setQuery($alterTable . implode(', ', $alterQueries));
$this->db->execute();
} catch (\Exception $e) {
$column_s = (count($columns) == 1) ? 'column' : 'columns';
$columns = implode(', ', $columns);
throw new \Exception("Error: failed to add ($columns) $column_s to $table table. " . $e->getMessage());
}
}
/**
* Validate and update the data type of existing fields/columns
*
* @param string $table The table to update.
* @param array $columns List of columns/fields to check.
*
* @return void
* @since 3.2.1
*/
protected function checkColumnsDataType(string $table, array $columns): void
{
$requireUpdate = [];
foreach ($columns as $column)
{
$current = $this->columns[$column] ?? null;
if ($current === null || ($expected = $this->table->get($table, $column, 'db')) === null)
{
continue;
}
// check if the data type and size match
if ($this->isDataTypeChangeSignificant($current->Type, $expected['type']))
{
$requireUpdate[$column] = [
'column' => $column,
'current' => $current->Type,
'expected' => $expected['type']
];
}
// check if update of default values is needed
elseif ($this->checkDefault($table, $column))
{
$requireUpdate[$column] = [
'column' => $column,
'current' => $current->Type,
'expected' => $expected['type']
];
}
// check if update of null is needed
elseif ($this->checkNull($table, $column))
{
$requireUpdate[$column] = [
'column' => $column,
'current' => $current->Type,
'expected' => $expected['type']
];
}
}
if (!empty($requireUpdate))
{
$this->updateColumnsDataType($table, $requireUpdate);
}
}
/**
* Generates a SQL snippet for defining a table column, incorporating column type,
* default value, nullability, and auto-increment properties.
*
* @param string $table The table name to be used.
* @param string $field The field name in the table to generate SQL for.
*
* @return string|null The SQL snippet for the column definition.
* @since 3.2.1
* @throws \Exception If the schema details cannot be retrieved or the SQL statement cannot be constructed properly.
*/
protected function getColumnDefinition(string $table, string $field): ?string
{
try {
// Retrieve the database schema details for the specified table and field
if (($db = $this->table->get($table, $field, 'db')) === null)
{
return null;
}
// Prepare the column name
$column_name = $this->db->quoteName($field);
$db['name'] = $field;
// Prepare the type and default value SQL statement
$type = $db['type'] ?? 'TEXT';
$db_default = isset($db['default']) ? $db['default'] : null;
$default = $this->getDefaultValue($type, $db_default);
// Prepare the null switch, and auto increment statement
$null_switch = !empty($db['null_switch']) ? ' ' . $db['null_switch'] : '';
// Prepare the auto increment statement
$auto_increment = !empty($db['auto_increment']) ? " AUTO_INCREMENT" : '';
// If there's a default value, the column should not be nullable
if ($default !== '')
{
$null_switch = '';
}
$this->setKeys($db);
// Assemble the SQL snippet for the column definition
return "{$column_name} {$type}{$null_switch}{$auto_increment}{$default}";
} catch (\Exception $e) {
throw new \Exception("Error: failed to generate column definition for ($table.$field). " . $e->getMessage());
}
}
/**
* Check and Update the default values if needed, including existing data adjustments
*
* @param string $table The table to update.
* @param string $column The column/field to check.
*
* @return bool
* @since 3.2.1
*/
protected function checkDefault(string $table, string $column): bool
{
// Retrieve the expected column configuration
$expected = $this->table->get($table, $column, 'db');
// Skip updates if the column is auto_increment
if (isset($expected['auto_increment']) && $expected['auto_increment'] === true)
{
return false;
}
// Retrieve the current column configuration
$current = $this->columns[$column];
// Determine the new default value based on the expected settings
$type = $expected['type'] ?? 'TEXT';
$db_default = isset($expected['default']) ? $expected['default'] : null;
$newDefault = $this->getDefaultValue($type, $db_default, true);
// First, adjust existing rows to conform to the new default if necessary
if (is_numeric($newDefault) && $this->adjustExistingDefaults($table, $column, $current->Default, $newDefault))
{
$this->success[] = "Success: updated the ($column) defaults in $table table.";
return true;
}
if (is_string($expected['default']) && strtoupper($expected['default']) === 'EMPTY' &&
is_string($current->Default) && strpos($current->Default, 'EMPTY') !== false)
{
return true; // little fix
}
return false;
}
/**
* Check and Update the null value if needed, including existing data adjustments
*
* @param string $table The table to update.
* @param string $column The column/field to check.
*
* @return bool
* @since 3.2.2
*/
protected function checkNull(string $table, string $column): bool
{
// Retrieve the expected column configuration
$expected = $this->table->get($table, $column, 'db');
// Skip updates if the null_switch is not set
if (!isset($expected['null_switch']))
{
return false;
}
// Retrieve the current column configuration
$current = $this->columns[$column];
// Skip updates if the Null is not set
if (!isset($current->Null))
{
return false;
}
// set the expected NULL
$expected_null = 'NO';
if ($expected['null_switch'] === "NULL")
{
$expected_null = 'YES';
}
// set the current NULL
$current_null = $current->Null;
// Prepare the type and default value SQL statement
$type = $expected['type'] ?? 'TEXT';
$db_default = isset($expected['default']) ? $expected['default'] : null;
$default = $this->getDefaultValue($type, $db_default, true);
// check the null values if they match
if ($current_null !== $expected_null && $current_null === 'NO' && empty($default))
{
$this->success[] = "Success: updated the ($column) null state in $table table.";
return true;
}
return false;
}
/**
* Update the data type of the given fields.
*
* @param string $table The table to update.
* @param array $columns List of columns/fields that must be updated.
*
* @return void
* @since 3.2.1
*/
protected function updateColumnsDataType(string $table, array $columns): void
{
$alterTable = 'ALTER TABLE ' . $this->db->quoteName($this->getTable($table));
foreach ($columns as $column => $types)
{
if (($def = $this->getColumnDefinition($table, $column)) === null)
{
continue;
}
$dbField = $this->db->quoteName($column);
$alterQuery = "$alterTable CHANGE $dbField ". $def;
if ($this->updateColumnDataType($alterQuery, $table, $column))
{
$current = $types['current'] ?? 'error';
$expected = $types['expected'] ?? 'error';
$this->success[] = "Success: updated ($column) column datatype $current to $expected in $table table.";
}
}
}
/**
* Add the component name to get the full table name.
*
* @param string $table The table name.
*
* @return void
* @since 3.2.1
*/
protected function getTable(string $table): string
{
return $this->prefix . '_' . $table;
}
/**
* Determines if the change in data type between two definitions is significant.
*
* This function checks if there's a significant difference between the current
* data type and the expected data type that would require updating the database schema.
* It ignores display width for numeric types where MySQL considers these attributes
* irrelevant for storage but considers size and other modifiers for types like VARCHAR.
*
* @param string $currentType The current data type from the database schema.
* @param string $expectedType The expected data type to validate against.
*
* @return bool Returns true if the data type change is significant, otherwise false.
* @since 3.2.1
*/
protected function isDataTypeChangeSignificant(string $currentType, string $expectedType): bool
{
// Normalize both input types to lowercase for case-insensitive comparison
$currentType = strtolower($currentType);
$expectedType = strtolower($expectedType);
// Regex to extract the base data type and numeric parameters with named groups
$typePattern = '/^(?<datatype>\w+)(\((?<params>\d+(,\d+)?)\))?/';
// Match types and parameters
preg_match($typePattern, $currentType, $currentMatches);
preg_match($typePattern, $expectedType, $expectedMatches);
// Compare base types
if ($currentMatches['datatype'] !== $expectedMatches['datatype'])
{
return true; // Base types differ
}
// Define types where size and other modifiers are irrelevant
$sizeIrrelevantTypes = [
'int', 'tinyint', 'smallint', 'mediumint', 'bigint',
'float', 'double', 'decimal', 'numeric' // Numeric types where display width is irrelevant
];
// If the type is not in the size irrelevant list, compare full definitions
if (!in_array($currentMatches['datatype'], $sizeIrrelevantTypes))
{
return $currentType !== $expectedType; // Use full definition for types where size matters
}
// For size irrelevant types, only compare base type, ignoring size and unsigned
$currentBaseType = preg_replace('/\(\d+(,\d+)?\)|unsigned/', '', $currentType);
$expectedBaseType = preg_replace('/\(\d+(,\d+)?\)|unsigned/', '', $expectedType);
// Perform a final comparison for numeric types ignoring size
return $currentBaseType !== $expectedBaseType;
}
/**
* Updates existing rows in a column to a new default value
*
* @param string $table The table to update.
* @param string $column The column to update.
* @param mixed $currentDefault Current default value.
* @param mixed $newDefault The new default value to be set.
*
* @return void
* @since 3.2.1
* @throws \Exception If there is an error updating column defaults.
*/
protected function adjustExistingDefaults(string $table, string $column, $currentDefault, $newDefault): bool
{
// Determine if adjustment is needed based on new and current defaults
if ($newDefault !== $currentDefault)
{
try {
// Format the new default for SQL use
$sqlDefault = $this->db->quote($newDefault);
$updateTable = 'UPDATE ' . $this->db->quoteName($this->getTable($table));
$dbField = $this->db->quoteName($column);
// Update SQL to set new default on existing rows where the default is currently the old default
$sql = $updateTable . " SET $dbField = $sqlDefault WHERE $dbField IS NULL OR $dbField = ''";
// Execute the update
$this->db->setQuery($sql);
return $this->db->execute();
} catch (\Exception $e) {
throw new \Exception("Error: failed to update ($column) column defaults in $table table. " . $e->getMessage());
}
}
return false;
}
/**
* Update the data type of the given field.
*
* @param string $updateString The SQL command to update the column data type
* @param string $table The table to update.
* @param string $field Column/field that must be updated.
*
* @return bool true on succes
* @since 3.2.1
* @throws \Exception If there is an error adding columns.
*/
protected function updateColumnDataType(string $updateString, string $table, string $field): bool
{
try {
$this->db->setQuery($updateString);
return $this->db->execute();
} catch (\Exception $e) {
throw new \Exception("Error: failed to update the datatype of ($field) column in $table table. " . $e->getMessage());
}
}
/**
* Key all needed keys for this table
*
* @return string of keys
* @since 3.2.1
*/
protected function getTableKeys(): string
{
$keys = [];
$keys[] = 'PRIMARY KEY (`id`)'; // TODO (we may want this to be dynamicly set)
if (!empty($this->uniqueKeys))
{
$keys[] = implode(', ', $this->uniqueKeys);
}
if (!empty($this->keys))
{
$keys[] = implode(', ', $this->keys);
}
return implode(', ', $keys);
}
/**
* Function to set the view keys
*
* @param string $column The field column database array values
*
* @return void
* @since 3.2.1
*/
protected function setKeys(array $column): void
{
$this->setUniqueKey($column);
$this->setKey($column);
}
/**
* Function to set the unique key
*
* @param string $column The field column database array values
*
* @return void
* @since 3.2.1
*/
protected function setUniqueKey(array $column): void
{
if (isset($column['unique_key']) && $column['unique_key'])
{
$key = $column['unique_key_name'] ?? $column['name'];
$this->uniqueKeys[] = "UNIQUE KEY `idx_" . $key . "` (`" . $column['name'] . "`)";
}
}
/**
* Function to set the key
*
* @param string $column The field column database array values
*
* @return void
* @since 3.2.1
*/
protected function setKey(array $column): void
{
if (isset($column['key']) && $column['key'])
{
$key = $column['key_name'] ?? $column['name'];
$this->keys[] = "KEY `idx_" . $key . "` (`" . $column['name'] . "`)";
}
}
/**
* Adjusts the default value SQL fragment for a database field based on its type and specific rules.
*
* If the field is of type DATETIME and the Joomla version is not 3, it sets the default to CURRENT_TIMESTAMP
* if not explicitly specified otherwise. For all other types it handles defaults by either leaving them unset or applying
* the provided default, properly quoted for SQL safety. When a 'EMPTY' default is specified, it returns no default at all. (:)
*
* @param string $type The type of the database field (e.g., 'DATETIME').
* @param string|null $defaultValue Optional default value for the field, null if not provided.
* @param bool $pure Optional to add the 'DEFAULT' string or not.
*
* @return string The SQL fragment to set the default value for a field.
* @since 3.2.1
*/
protected function getDefaultValue(string $type, ?string $defaultValue, bool $pure = false): string
{
if ($defaultValue === null || strtoupper($defaultValue) === 'EMPTY')
{
return '';
}
// Set default for DATETIME fields in Joomla versions above 3
if (strtoupper($type) === 'DATETIME' && $this->currentVersion != 3)
{
return $pure ? "CURRENT_TIMESTAMP" : " DEFAULT CURRENT_TIMESTAMP";
}
// Apply and quote the default value
$sql_default = $this->quote($defaultValue);
return $pure ? $defaultValue : " DEFAULT $sql_default";
}
/**
* Set a value based on data type
*
* @param mixed $value The value to set
*
* @return mixed
* @since 3.2.0
**/
protected function quote($value)
{
if ($value === null) // hmm the null does pose an issue (will keep an eye on this)
{
return 'NULL';
}
if (is_numeric($value))
{
if (filter_var($value, FILTER_VALIDATE_INT))
{
return (int) $value;
}
elseif (filter_var($value, FILTER_VALIDATE_FLOAT))
{
return (float) $value;
}
}
elseif (is_bool($value)) // not sure if this will work well (but its correct)
{
return $value ? 'TRUE' : 'FALSE';
}
// For date and datetime values
elseif ($value instanceof \DateTime)
{
return $this->db->quote($value->format('Y-m-d H:i:s'));
}
// For other data types, just escape it
return $this->db->quote($value);
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,112 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Data\Action;
use JCB\Joomla\Interfaces\DeleteInterface as Database;
use JCB\Joomla\Interfaces\Data\DeleteInterface;
/**
* Data Delete
*
* @since 3.2.2
*/
class Delete implements DeleteInterface
{
/**
* The Delete Class.
*
* @var Database
* @since 3.2.2
*/
protected Database $database;
/**
* Table Name
*
* @var string
* @since 3.2.2
*/
protected string $table;
/**
* Constructor.
*
* @param Database $database The Delete Class.
* @param string|null $table The table name.
*
* @since 3.2.2
*/
public function __construct(Database $database, ?string $table = null)
{
$this->database = $database;
if ($table !== null)
{
$this->table = $table;
}
}
/**
* Set the current active table
*
* @param string|null $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(?string $table): self
{
if ($table !== null)
{
$this->table = $table;
}
return $this;
}
/**
* Delete all items in the database that match these conditions
*
* @param array $conditions Conditions by which to delete the data in database [array of arrays (key => value)]
*
* @return bool
* @since 3.2.2
**/
public function items(array $conditions): bool
{
return $this->database->items($conditions, $this->getTable());
}
/**
* Truncate a table
*
* @return void
* @since 3.2.2
**/
public function truncate(): void
{
$this->database->truncate($this->getTable());
}
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string
{
return $this->table;
}
}

View File

@@ -0,0 +1,202 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Data\Action;
use JCB\Joomla\Interfaces\ModelInterface as Model;
use JCB\Joomla\Interfaces\InsertInterface as Database;
use JCB\Joomla\Interfaces\Data\InsertInterface;
/**
* Data Insert (GUID)
*
* @since 3.2.2
*/
class Insert implements InsertInterface
{
/**
* Model
*
* @var Model
* @since 3.2.0
*/
protected Model $model;
/**
* Database
*
* @var Database
* @since 3.2.0
*/
protected Database $database;
/**
* Table Name
*
* @var string
* @since 3.2.1
*/
protected string $table;
/**
* Constructor
*
* @param Model $model The set model object.
* @param Database $database The insert database object.
* @param string|null $table The table name.
*
* @since 3.2.2
*/
public function __construct(Model $model, Database $database, ?string $table = null)
{
$this->model = $model;
$this->database = $database;
if ($table !== null)
{
$this->table = $table;
}
}
/**
* Set the current active table
*
* @param string|null $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(?string $table): self
{
if ($table !== null)
{
$this->table = $table;
}
return $this;
}
/**
* Insert a value to a given table
* Example: $this->value(Value, 'value_key', 'GUID');
*
* @param mixed $value The field value
* @param string $field The field key
* @param string $keyValue The key value
* @param string $key The key name
*
* @return bool
* @since 3.2.0
*/
public function value($value, string $field, string $keyValue, string $key = 'guid'): bool
{
// build the array
$item = [];
$item[$key] = $keyValue;
$item[$field] = $value;
// Insert the column of this table
return $this->row($item);
}
/**
* Insert single row with multiple values to a given table
* Example: $this->item(Array);
*
* @param array $item The item to save
*
* @return bool
* @since 3.2.0
*/
public function row(array $item): bool
{
// check if object could be modelled
if (($item = $this->model->row($item, $this->getTable())) !== null)
{
// Insert the column of this table
return $this->database->row($item, $this->getTable());
}
return false;
}
/**
* Insert multiple rows to a given table
* Example: $this->items(Array);
*
* @param array|null $items The items updated in database (array of arrays)
*
* @return bool
* @since 3.2.0
*/
public function rows(?array $items): bool
{
// check if object could be modelled
if (($items = $this->model->rows($items, $this->getTable())) !== null)
{
// Insert the column of this table
return $this->database->rows($items, $this->getTable());
}
return false;
}
/**
* Insert single item with multiple values to a given table
* Example: $this->item(Object);
*
* @param object $item The item to save
*
* @return bool
* @since 3.2.0
*/
public function item(object $item): bool
{
// check if object could be modelled
if (($item = $this->model->item($item, $this->getTable())) !== null)
{
// Insert the column of this table
return $this->database->item($item, $this->getTable());
}
return false;
}
/**
* Insert multiple items to a given table
* Example: $this->items(Array);
*
* @param array|null $items The items updated in database (array of objects)
*
* @return bool
* @since 3.2.0
*/
public function items(?array $items): bool
{
// check if object could be modelled
if (($items = $this->model->items($items, $this->getTable())) !== null)
{
// Update the column of this table using guid as the primary key.
return $this->database->items($items, $this->getTable());
}
return false;
}
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string
{
return $this->table;
}
}

View File

@@ -0,0 +1,224 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Data\Action;
use JCB\Joomla\Interfaces\ModelInterface as Model;
use JCB\Joomla\Interfaces\LoadInterface as Database;
use JCB\Joomla\Interfaces\Data\LoadInterface;
/**
* Data Load (GUID)
*
* @since 3.2.2
*/
class Load implements LoadInterface
{
/**
* Model Load
*
* @var Model
* @since 2.0.1
*/
protected Model $model;
/**
* Database Load
*
* @var Database
* @since 2.0.1
*/
protected Database $load;
/**
* Table Name
*
* @var string
* @since 3.2.1
*/
protected string $table;
/**
* Constructor
*
* @param Model $model The model object.
* @param Database $load The database object.
* @param string|null $table The table name.
*
* @since 2.0.1
*/
public function __construct(Model $model, Database $load, ?string $table = null)
{
$this->model = $model;
$this->load = $load;
if ($table !== null)
{
$this->table = $table;
}
}
/**
* Set the current active table
*
* @param string|null $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(?string $table): self
{
if ($table !== null)
{
$this->table = $table;
}
return $this;
}
/**
* Get a value from a given table
* Example: $this->value(
* [
* 'guid' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
* ], 'value_key'
* );
*
* @param array $keys The item keys
* @param string $field The field key
*
* @return mixed
* @since 2.0.1
*/
public function value(array $keys, string $field)
{
return $this->model->value(
$this->load->value(
["a.{$field}" => $field],
['a' => $this->getTable()],
$this->prefix($keys)
),
$field,
$this->getTable()
);
}
/**
* Get a value from multiple rows from a given table
* Example: $this->values(
* [
* 'guid' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
* ], 'value_key'
* );
*
* @param array $keys The item keys
* @param string $field The field key
*
* @return array|null
* @since 3.2.2
*/
public function values(array $keys, string $field): ?array
{
return $this->model->values(
$this->load->values(
["a.{$field}" => $field],
['a' => $this->getTable()],
$this->prefix($keys)
),
$field,
$this->getTable()
);
}
/**
* Get values from a given table
* Example: $this->item(
* [
* 'guid' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
* ]
* );
*
* @param array $keys The item keys
*
* @return object|null
* @since 2.0.1
*/
public function item(array $keys): ?object
{
return $this->model->item(
$this->load->item(
['all' => 'a.*'],
['a' => $this->getTable()],
$this->prefix($keys)
),
$this->getTable()
);
}
/**
* Get values from a given table
* Example: $this->items(
* [
* 'guid' => [
* 'operator' => 'IN',
* 'value' => [''xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'', ''xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'']
* ]
* ]
* );
* Example: $this->items($ids);
*
* @param array $keys The item keys
*
* @return array|null
* @since 2.0.1
*/
public function items(array $keys): ?array
{
return $this->model->items(
$this->load->items(
['all' => 'a.*'], ['a' => $this->getTable()], $this->prefix($keys)
),
$this->getTable()
);
}
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string
{
return $this->table;
}
/**
* Add prefix to the keys
*
* @param array $keys The query keys
*
* @return array
* @since 2.0.1
*/
private function prefix(array &$keys): array
{
// update the key values
$bucket = [];
foreach ($keys as $k => $v)
{
$bucket['a.' . $k] = $v;
}
return $bucket;
}
}

View File

@@ -0,0 +1,206 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Data\Action;
use JCB\Joomla\Interfaces\ModelInterface as Model;
use JCB\Joomla\Interfaces\UpdateInterface as Database;
use JCB\Joomla\Interfaces\Data\UpdateInterface;
/**
* Data Update
*
* @since 3.2.2
*/
class Update implements UpdateInterface
{
/**
* Model
*
* @var Model
* @since 3.2.0
*/
protected Model $model;
/**
* Database
*
* @var Database
* @since 3.2.0
*/
protected Database $database;
/**
* Table Name
*
* @var string
* @since 3.2.1
*/
protected string $table;
/**
* Constructor
*
* @param Model $model The set model object.
* @param Database $database The update database object.
* @param string|null $table The table name.
*
* @since 3.2.0
*/
public function __construct(Model $model, Database $database, ?string $table = null)
{
$this->model = $model;
$this->database = $database;
if ($table !== null)
{
$this->table = $table;
}
}
/**
* Set the current active table
*
* @param string|null $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(?string $table): self
{
if ($table !== null)
{
$this->table = $table;
}
return $this;
}
/**
* Update a value to a given table
* Example: $this->value(Value, 'value_key', 'GUID');
*
* @param mixed $value The field value
* @param string $field The field key
* @param string $keyValue The key value
* @param string $key The key name
*
* @return bool
* @since 3.2.0
*/
public function value($value, string $field, string $keyValue, string $key = 'guid'): bool
{
// build the array
$item = [];
$item[$key] = $keyValue;
$item[$field] = $value;
// Update the column of this table using $key as the primary key.
return $this->row($item, $key);
}
/**
* Update single row with multiple values to a given table
* Example: $this->item(Array);
*
* @param array $item The item to save
* @param string $key The key name
*
* @return bool
* @since 3.2.0
*/
public function row(array $item, string $key = 'guid'): bool
{
// check if object could be modelled
if (($item = $this->model->row($item, $this->getTable())) !== null)
{
// Update the column of this table using $key as the primary key.
return $this->database->row($item, $key, $this->getTable());
}
return false;
}
/**
* Update multiple rows to a given table
* Example: $this->items(Array);
*
* @param array|null $items The items updated in database (array of arrays)
* @param string $key The key name
*
* @return bool
* @since 3.2.0
*/
public function rows(?array $items, string $key = 'guid'): bool
{
// check if object could be modelled
if (($items = $this->model->rows($items, $this->getTable())) !== null)
{
// Update the column of this table using $key as the primary key.
return $this->database->rows($items, $key, $this->getTable());
}
return false;
}
/**
* Update single item with multiple values to a given table
* Example: $this->item(Object);
*
* @param object $item The item to save
* @param string $key The key name
*
* @return bool
* @since 3.2.0
*/
public function item(object $item, string $key = 'guid'): bool
{
// check if object could be modelled
if (($item = $this->model->item($item, $this->getTable())) !== null)
{
// Update the column of this table using $key as the primary key.
return $this->database->item($item, $key, $this->getTable());
}
return false;
}
/**
* Update multiple items to a given table
* Example: $this->items(Array);
*
* @param array|null $items The items updated in database (array of objects)
* @param string $key The key name
*
* @return bool
* @since 3.2.0
*/
public function items(?array $items, string $key = 'guid'): bool
{
// check if object could be modelled
if (($items = $this->model->items($items, $this->getTable())) !== null)
{
// Update the column of this table using $key as the primary key.
return $this->database->items($items, $key, $this->getTable());
}
return false;
}
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string
{
return $this->table;
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,46 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Data;
use Joomla\DI\Container;
use JCB\Joomla\Service\Table;
use JCB\Joomla\Service\Database;
use JCB\Joomla\Service\Model;
use JCB\Joomla\Service\Data;
use JCB\Joomla\Interfaces\FactoryInterface;
use JCB\Joomla\Abstraction\Factory as ExtendingFactory;
/**
* Data Factory
*
* @since 3.2.2
*/
abstract class Factory extends ExtendingFactory implements FactoryInterface
{
/**
* Create a container object
*
* @return Container
* @since 3.2.2
*/
protected static function createContainer(): Container
{
return (new Container())
->registerServiceProvider(new Table())
->registerServiceProvider(new Database())
->registerServiceProvider(new Model())
->registerServiceProvider(new Data());
}
}

View File

@@ -0,0 +1,245 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Data;
use JCB\Joomla\Interfaces\Data\LoadInterface as Load;
use JCB\Joomla\Interfaces\Data\InsertInterface as Insert;
use JCB\Joomla\Interfaces\Data\UpdateInterface as Update;
use JCB\Joomla\Interfaces\Data\DeleteInterface as Delete;
use JCB\Joomla\Interfaces\LoadInterface as Database;
use JCB\Joomla\Interfaces\Data\ItemInterface;
/**
* Data Item
*
* @since 3.2.2
*/
final class Item implements ItemInterface
{
/**
* The Load Class.
*
* @var Load
* @since 3.2.2
*/
protected Load $load;
/**
* The Insert Class.
*
* @var Insert
* @since 3.2.2
*/
protected Insert $insert;
/**
* The Update Class.
*
* @var Update
* @since 3.2.2
*/
protected Update $update;
/**
* The Delete Class.
*
* @var Delete
* @since 3.2.2
*/
protected Delete $delete;
/**
* The Load Class.
*
* @var Database
* @since 3.2.2
*/
protected Database $database;
/**
* Table Name
*
* @var string
* @since 3.2.1
*/
protected string $table;
/**
* Constructor.
*
* @param Load $load The LoadInterface Class.
* @param Insert $insert The InsertInterface Class.
* @param Update $update The UpdateInterface Class.
* @param Delete $delete The UpdateInterface Class.
* @param Database $database The Database Load Class.
* @param string|null $table The table name.
*
* @since 3.2.2
*/
public function __construct(Load $load, Insert $insert, Update $update,
Delete $delete, Database $database, ?string $table = null)
{
$this->load = $load;
$this->insert = $insert;
$this->update = $update;
$this->delete = $delete;
$this->database = $database;
if ($table !== null)
{
$this->table = $table;
}
}
/**
* Set the current active table
*
* @param string $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(string $table): self
{
$this->table = $table;
return $this;
}
/**
* Get an item
*
* @param string $value The item key value
* @param string $key The item key
*
* @return object|null The item object or null
* @since 3.2.2
*/
public function get(string $value, string $key = 'guid'): ?object
{
return $this->load->table($this->getTable())->item([$key => $value]);
}
/**
* Get the value
*
* @param string $value The item key value
* @param string $key The item key
* @param string $get The key of the values we want back
*
* @return mixed
* @since 3.2.2
*/
public function value(string $value, string $key = 'guid', string $get = 'id')
{
return $this->load->table($this->getTable())->value([$key => $value], $get);
}
/**
* Set an item
*
* @param object $item The item
* @param string $key The item key
* @param string|null $action The action to load power
*
* @return bool
* @since 3.2.2
*/
public function set(object $item, string $key = 'guid', ?string $action = null): bool
{
if ($action !== null || (isset($item->{$key}) && ($action = $this->action($item->{$key}, $key)) !== null))
{
return method_exists($this, $action) ? $this->{$action}($item, $key) : false;
}
return false;
}
/**
* Delete an item
*
* @param string $value The item key value
* @param string $key The item key
*
* @return bool
* @since 3.2.2
*/
public function delete(string $value, string $key = 'guid'): bool
{
return $this->delete->table($this->getTable())->items([$key => $value]);
}
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string
{
return $this->table;
}
/**
* Insert a item
*
* @param object $item The item
*
* @return bool
* @since 3.2.2
*/
private function insert(object $item): bool
{
return $this->insert->table($this->getTable())->item($item);
}
/**
* Update a item
*
* @param object $item The item
* @param string $key The item key
*
* @return bool
* @since 3.2.2
*/
private function update(object $item, string $key): bool
{
return $this->update->table($this->getTable())->item($item, $key);
}
/**
* Get loading action
*
* @param string $value The key value the item
* @param string $key The item key
*
* @return string
* @since 3.2.2
*/
private function action(string $value, string $key): string
{
$id = $this->database->value(
["a.id" => 'id'],
["a" => $this->getTable()],
["a.$key" => $value]
);
if ($id !== null && $id > 0)
{
return 'update';
}
return 'insert';
}
}

View File

@@ -0,0 +1,342 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Data;
use JCB\Joomla\Interfaces\Data\LoadInterface as Load;
use JCB\Joomla\Interfaces\Data\InsertInterface as Insert;
use JCB\Joomla\Interfaces\Data\UpdateInterface as Update;
use JCB\Joomla\Interfaces\Data\DeleteInterface as Delete;
use JCB\Joomla\Interfaces\LoadInterface as Database;
use JCB\Joomla\Interfaces\Data\ItemsInterface;
/**
* Data Items
*
* @since 3.2.2
*/
final class Items implements ItemsInterface
{
/**
* The LoadInterface Class.
*
* @var Load
* @since 3.2.2
*/
protected Load $load;
/**
* The InsertInterface Class.
*
* @var Insert
* @since 3.2.2
*/
protected Insert $insert;
/**
* The UpdateInterface Class.
*
* @var Update
* @since 3.2.2
*/
protected Update $update;
/**
* The DeleteInterface Class.
*
* @var Delete
* @since 3.2.2
*/
protected Delete $delete;
/**
* The Load Class.
*
* @var Database
* @since 3.2.2
*/
protected Database $database;
/**
* Table Name
*
* @var string
* @since 3.2.1
*/
protected string $table;
/**
* Constructor.
*
* @param Load $load The LoadInterface Class.
* @param Insert $insert The InsertInterface Class.
* @param Update $update The UpdateInterface Class.
* @param Delete $delete The DeleteInterface Class.
* @param Database $database The Database Load Class.
* @param string|null $table The table name.
*
* @since 3.2.2
*/
public function __construct(Load $load, Insert $insert, Update $update, Delete $delete,
Database $database, ?string $table = null)
{
$this->load = $load;
$this->insert = $insert;
$this->update = $update;
$this->delete = $delete;
$this->database = $database;
if ($table !== null)
{
$this->table = $table;
}
}
/**
* Set the current active table
*
* @param string $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(string $table): self
{
$this->table = $table;
return $this;
}
/**
* Get list of items
*
* @param array $values The ids of the items
* @param string $key The key of the values
*
* @return array|null The item object or null
* @since 3.2.2
*/
public function get(array $values, string $key = 'guid'): ?array
{
return $this->load->table($this->getTable())->items([
$key => [
'operator' => 'IN',
'value' => array_values($values)
]
]);
}
/**
* Get the values
*
* @param array $values The list of values (to search by).
* @param string $key The key on which the values being searched.
* @param string $get The key of the values we want back
*
* @return array|null The array of found values.
* @since 3.2.2
*/
public function values(array $values, string $key = 'guid', string $get = 'id'): ?array
{
// Perform the database query
return $this->load->table($this->getTable())->values([
$key => [
'operator' => 'IN',
'value' => array_values($values)
]
], $get);
}
/**
* Set items
*
* @param array $items The list of items
* @param string $key The key on which the items should be set
*
* @return bool
* @since 3.2.2
*/
public function set(array $items, string $key = 'guid'): bool
{
if (($sets = $this->sort($items, $key)) !== null)
{
foreach ($sets as $action => $items)
{
$this->{$action}($items, $key);
}
return true;
}
return false;
}
/**
* Delete items
*
* @param array $values The item key value
* @param string $key The item key
*
* @return bool
* @since 3.2.2
*/
public function delete(array $values, string $key = 'guid'): bool
{
return $this->delete->table($this->getTable())->items([$key => ['operator' => 'IN', 'value' => $values]]);
}
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string
{
return $this->table;
}
/**
* Insert a item
*
* @param array $items The item
*
* @return bool
* @since 3.2.2
*/
private function insert(array $items): bool
{
return $this->insert->table($this->getTable())->rows($items);
}
/**
* Update a item
*
* @param object $item The item
* @param string $key The item key
*
* @return bool
* @since 3.2.2
*/
private function update(array $items, string $key): bool
{
return $this->update->table($this->getTable())->rows($items, $key);
}
/**
* Sort items between insert and update.
*
* @param array $items The list of items.
* @param string $key The key on which the items should be sorted.
*
* @return array|null The sorted sets.
* @since 3.2.2
*/
private function sort(array $items, string $key): ?array
{
// Extract relevant items based on the key.
$values = $this->extractValues($items, $key);
if ($values === null)
{
return null;
}
$sets = [
'insert' => [],
'update' => []
];
// Check for existing items.
$existingItems = $this->database->values(
["a.$key" => $key],
["a" => $this->getTable()],
["a.$key" => ['operator' => 'IN', 'value' => $values]]
);
if ($existingItems !== null)
{
$sets['update'] = $this->extractSet($items, $existingItems, $key) ?? [];
$sets['insert'] = $this->extractSet($items, $existingItems, $key, true) ?? [];
}
else
{
$sets['insert'] = $items;
}
// If either set is empty, remove it from the result.
$sets = array_filter($sets);
return !empty($sets) ? $sets : null;
}
/**
* Extracts values for a given key from an array of items.
* Items can be either arrays or objects.
*
* @param array $items Array of items (arrays or objects)
* @param string $key The key to extract values for
*
* @return array|null Extracted values
* @since 3.2.2
*/
private function extractValues(array $items, string $key): ?array
{
$result = [];
foreach ($items as $item)
{
if (is_array($item) && !empty($item[$key]))
{
$result[] = $item[$key];
}
elseif (is_object($item) && !empty($item->{$key}))
{
$result[] = $item->{$key};
}
}
return ($result === []) ? null : $result;
}
/**
* Extracts items from an array of items based on a set.
* Items can be either arrays or objects.
*
* @param array $items Array of items (arrays or objects)
* @param array $set The set to match values against
* @param string $key The key of the set values
* @param bool $inverse Whether to extract items not in the set
*
* @return array|null Extracted values
* @since 3.2.2
*/
private function extractSet(array $items, array $set, string $key, bool $inverse = false): ?array
{
$result = [];
foreach ($items as $item)
{
$value = is_array($item) ? ($item[$key] ?? null) : ($item->{$key} ?? null);
if ($value !== null)
{
$inSet = in_array($value, $set);
if (($inSet && !$inverse) || (!$inSet && $inverse))
{
$result[] = is_array($item) ? $item : (array) $item; // convert all to arrays
}
}
}
return empty($result) ? null : $result;
}
}

View File

@@ -0,0 +1,511 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2020
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Data;
use JCB\Joomla\Interfaces\Data\SubformInterface as Subform;
use JCB\Joomla\Interfaces\Data\MultiSubformInterface;
/**
* CRUD the data of multi subform to another views (tables)
*
* @since 3.2.2
*/
final class MultiSubform implements MultiSubformInterface
{
/**
* The Subform Class.
*
* @var Subform
* @since 3.2.2
*/
protected Subform $subform;
/**
* Constructor.
*
* @param Subform $subform The Subform Class.
*
* @since 3.2.2
*/
public function __construct(Subform $subform)
{
$this->subform = $subform;
}
/**
* Get a subform items
*
* @param array $getMap The the map to get the subfrom data
*
* Example:
* $getMap = [
* '_core' => [
* 'table' =>'data',
* 'linkValue' => $item->guid ?? '',
* 'linkKey' => 'look',
* 'field' => 'data',
* 'get' => ['guid','email','image','mobile_phone','website','dateofbirth']
* ],
* 'countries' => [
* 'table' =>'data_country',
* 'linkValue' => 'data:guid', // coretable:fieldname
* 'linkKey' => 'data',
* 'get' => ['guid','country','currency']
* ]
* ];
*
* @return array|null The subform
* @since 3.2.2
*/
public function get(array $getMap): ?array
{
// Validate the core map presence and structure
if (!isset($getMap['_core']) || !is_array($getMap['_core']) || !$this->validGetMap($getMap['_core']))
{
return null;
}
// Initialize the core data
$coreData = $this->getSubformData($getMap['_core']);
// Return null if fetching core data fails
if (null === $coreData)
{
return null;
}
$table = $getMap['_core']['table'];
unset($getMap['_core']);
// Recursively get data for all nested subforms
return $this->getNestedSubforms($getMap, $coreData, $table);
}
/**
* Set a subform items
*
* @param array $items The list of items from the subform to set
* @param array $setMap The the map to set the subfrom data
*
* Example:
* $items,
* $setMap = [
* '_core' => [
* 'table' =>'data',
* 'indexKey' => 'guid',
* 'linkKey' => 'look',
* 'linkValue' => $data['guid'] ?? ''
* ],
* 'countries' => [
* 'table' =>'data_country',
* 'indexKey' => 'guid',
* 'linkKey' => 'data',
* 'linkValue' => 'data:guid' // coretable:fieldname
* ]
* ];
*
* @return bool
* @since 3.2.2
*/
public function set(array $items, array $setMap): bool
{
// Validate the core map presence and structure
if (!isset($setMap['_core']) || !is_array($getMap['_core']) || !$this->validSetMap($setMap['_core']))
{
return false;
}
// Save the core data
if (!$this->setSubformData($items, $setMap['_core']))
{
return false;
}
$table = $setMap['_core']['table'];
unset($setMap['_core']);
// Recursively set data for all nested subforms
return $this->setNestedSubforms($setMap, $items, $table);
}
/**
* Fetch data based on provided map configuration.
*
* @param array $map Map configuration
* @param array|null $coreData The core data to be appended with subform data
*
* @return array|null Fetched data or null on failure
* @since 3.2.2
*/
private function getSubformData(array $map, ?array $coreData = null): ?array
{
$map['linkValue'] = $this->setLinkValue($map['linkValue'], $coreData);
if (empty($map['linkValue']) || strpos($map['linkValue'], ':') !== false)
{
return null;
}
return $this->subform->table($map['table'])->get(
$map['linkValue'],
$map['linkKey'],
$map['field'],
$map['get']
);
}
/**
* Set data based on provided map configuration.
*
* @param array $items The list of items from the subform to set
* @param array $map The the map to set the subfrom data
* @param array|null $coreData The core data to be appended with subform data
*
* @return bool
* @since 3.2.2
*/
private function setSubformData(array $items, array $map, ?array $coreData = null): bool
{
$map['linkValue'] = $this->setLinkValue($map['linkValue'], $coreData);
if (empty($map['linkValue']) || strpos($map['linkValue'], ':') !== false)
{
return false;
}
return $this->subform->table($map['table'])->set(
$items,
$map['indexKey'],
$map['linkKey'],
$map['linkValue']
);
}
/**
* Set the linked value if needed, and posible.
*
* @param string $linkValue The current linkValue
* @param array|null $data The already found data as table => dataSet[field] => value
*
* @return string|null The actual linkValue
* @since 3.2.2
*/
private function setLinkValue(string $linkValue, ?array $data = null): ?string
{
if ($data !== null && strpos($linkValue, ':') !== false)
{
[$table, $field] = explode(':', $linkValue);
$linkValue = $data[$table][$field] ?? null;
}
return $linkValue;
}
/**
* Recursively process additional subform data.
*
* @param array $getMap The nested map of data to process
* @param array $subformData The core subform data
* @param string $table The core table
*
* @return array The core data with nested subforms included
* @since 3.2.2
*/
private function getNestedSubforms(array $getMap, array $subformData, string $table): array
{
foreach ($subformData as &$subform)
{
$subform = $this->processGetSubform($getMap, $subform, $table);
}
return $subformData;
}
/**
* Recursively process additional subform data.
*
* @param array $setMap The nested map of data to process
* @param array $subformData The core subform data
* @param string $table The core table
*
* @return bool
* @since 3.2.2
*/
private function setNestedSubforms(array $setMap, array $subformData, string $table): bool
{
$status = true;
foreach ($subformData as $subform)
{
if (!$this->processSetSubform($setMap, $subform, $table))
{
$status = false;
}
}
return $status;
}
/**
* Process each subform entry based on the map.
*
* @param array $getMap Mapping data for processing subforms
* @param array $subform A single subform entry
* @param string $table The table name used for linking values
*
* @return array Updated subform
* @since 3.2.2
*/
private function processGetSubform(array $getMap, array $subform, string $table): array
{
foreach ($getMap as $key => $map)
{
if (!is_array($map) || isset($subform[$key]))
{
continue;
}
$this->processGetMap($subform, $map, $key, $table);
}
return $subform;
}
/**
* Process each subform entry based on the map.
*
* @param array $setMap Mapping data for processing subforms
* @param array $subform A single subform entry
* @param string $table The table name used for linking values
*
* @return bool
* @since 3.2.2
*/
private function processSetSubform(array $setMap, array $subform, string $table): bool
{
$status = true;
foreach ($setMap as $key => $map)
{
if (!is_array($map) || !isset($subform[$key]))
{
continue;
}
if (!$this->processSetMap($subform, $map, $key, $table))
{
$status = false;
}
}
return $status;
}
/**
* Process a given map by either fetching nested subforms or handling them directly.
*
* @param array &$subform Reference to subform data
* @param array $map Map configuration for subform processing
* @param string $key Key associated with the map
* @param string $table Core table name for linking values
*
* @return void
* @since 3.2.2
*/
private function processGetMap(array &$subform, array $map, string $key, string $table): void
{
if (isset($map['_core']))
{
$this->handleCoreGetMap($subform, $map, $key, $table);
}
else
{
$this->handleRegularGetMap($subform, $map, $key, $table);
}
}
/**
* Process a given map by either setting nested subforms or handling them directly.
*
* @param array $subform Subform data
* @param array $map Map configuration for subform processing
* @param string $key Key associated with the map
* @param string $table Core table name for linking values
*
* @return bool
* @since 3.2.2
*/
private function processSetMap(array $subform, array $map, string $key, string $table): bool
{
if (isset($map['_core']))
{
return $this->handleCoreSetMap($subform, $map, $key, $table);
}
return $this->handleRegularSetMap($subform, $map, $key, $table);
}
/**
* Handle the processing of '_core' maps in a subform.
*
* @param array &$subform Reference to subform data
* @param array $map Map configuration for core subform processing
* @param string $key Key associated with the map
* @param string $table Core table name for linking values
*
* @return void
* @since 3.2.2
*/
private function handleCoreGetMap(array &$subform, array $map, string $key, string $table): void
{
if (is_array($map['_core']) && $this->validGetMap($map['_core']))
{
$map['_core']['linkValue'] = $this->setLinkValue($map['_core']['linkValue'], [$table => $subform]);
$subCoreData = $this->get($map);
if ($subCoreData !== null)
{
$subform[$key] = $subCoreData;
}
}
}
/**
* Handle the processing of '_core' maps in a subform.
*
* @param array $subform Subform data
* @param array $map Map configuration for core subform processing
* @param string $key Key associated with the map
* @param string $table Core table name for linking values
*
* @return bool
* @since 3.2.2
*/
private function handleCoreSetMap(array $subform, array $map, string $key, string $table): bool
{
if (is_array($map['_core']) && $this->validGetMap($map['_core']))
{
$map['_core']['linkValue'] = $this->setLinkValue($map['_core']['linkValue'], [$table => $subform]);
return $this->set($subform[$key], $map);
}
return false;
}
/**
* Handle the processing of regular maps in a subform.
*
* @param array &$subform Reference to subform data
* @param array $map Map configuration for regular subform processing
* @param string $key Key associated with the map
* @param string $table Core table name for linking values
*
* @return void
* @since 3.2.2
*/
private function handleRegularGetMap(array &$subform, array $map, string $key, string $table): void
{
$map['field'] = $key;
if ($this->validGetMap($map))
{
$subformData = $this->getSubformData($map, [$table => $subform]);
if ($subformData !== null)
{
$subform[$key] = $subformData;
}
}
}
/**
* Handle the processing of regular maps in a subform.
*
* @param array $subform Subform data
* @param array $map Map configuration for regular subform processing
* @param string $key Key associated with the map
* @param string $table Core table name for linking values
*
* @return bool
* @since 3.2.2
*/
private function handleRegularSetMap(array $subform, array $map, string $key, string $table): bool
{
if ($this->validSetMap($map))
{
return $this->setSubformData($subform[$key], $map, [$table => $subform]);
}
return false;
}
/**
* Validate the get map configuration for fetching subform data.
* Ensures all required keys are present and have valid values.
*
* @param array $map The map configuration to validate.
*
* @return bool Returns true if the map is valid, false otherwise.
* @since 3.2.2
*/
private function validGetMap(array $map): bool
{
// List of required keys with their expected types or validation functions
$requiredKeys = [
'table' => 'is_string',
'linkValue' => 'is_string',
'linkKey' => 'is_string',
'field' => 'is_string',
'get' => 'is_array'
];
// Iterate through each required key and validate
foreach ($requiredKeys as $key => $validator)
{
if (empty($map[$key]) || !$validator($map[$key]))
{
return false; // Key missing or validation failed
}
}
return true; // All checks passed
}
/**
* Validate the set map configuration for fetching subform data.
* Ensures all required keys are present and have valid values.
*
* @param array $map The map configuration to validate.
*
* @return bool Returns true if the map is valid, false otherwise.
* @since 3.2.2
*/
private function validSetMap(array $map): bool
{
// List of required keys with their expected types or validation functions
$requiredKeys = [
'table' => 'is_string',
'indexKey' => 'is_string',
'linkKey' => 'is_string',
'linkValue' => 'is_string'
];
// Iterate through each required key and validate
foreach ($requiredKeys as $key => $validator)
{
if (empty($map[$key]) || !$validator($map[$key]))
{
return false; // Key missing or validation failed
}
}
return true; // All checks passed
}
}

View File

@@ -0,0 +1,310 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2020
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Data;
use JCB\Joomla\Interfaces\Data\ItemsInterface as Items;
use JCB\Joomla\Interfaces\Data\SubformInterface;
/**
* CRUD the data of any sub-form to another view (table)
*
* @since 3.2.2
*/
final class Subform implements SubformInterface
{
/**
* The ItemsInterface Class.
*
* @var Items
* @since 3.2.2
*/
protected Items $items;
/**
* Table Name
*
* @var string
* @since 3.2.1
*/
protected string $table;
/**
* Constructor.
*
* @param Items $items The ItemsInterface Class.
* @param string|null $table The table name.
*
* @since 3.2.2
*/
public function __construct(Items $items, ?string $table = null)
{
$this->items = $items;
if ($table !== null)
{
$this->table = $table;
}
}
/**
* Set the current active table
*
* @param string $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(string $table): self
{
$this->table = $table;
return $this;
}
/**
* Get a subform items
*
* @param string $linkValue The value of the link key in child table.
* @param string $linkKey The link key on which the items where linked in the child table.
* @param string $field The parent field name of the subform in the parent view.
* @param array $get The array get:set of the keys of each row in the subform.
*
* @return array|null The subform
* @since 3.2.2
*/
public function get(string $linkValue, string $linkKey, string $field, array $get): ?array
{
if (($items = $this->items->table($this->getTable())->get([$linkValue], $linkKey)) !== null)
{
return $this->converter($items, $get, $field);
}
return null;
}
/**
* Set a subform items
*
* @param array $items The list of items from the subform to set
* @param string $indexKey The index key on which the items should be observed as it relates to insert/update/delete.
* @param string $linkKey The link key on which the items where linked in the child table.
* @param string $linkValue The value of the link key in child table.
*
* @return bool
* @since 3.2.2
*/
public function set(array $items, string $indexKey, string $linkKey, string $linkValue): bool
{
$items = $this->process($items, $indexKey, $linkKey, $linkValue);
$this->purge($items, $indexKey, $linkKey, $linkValue);
return $this->items->table($this->getTable())->set(
$items, $indexKey
);
}
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string
{
return $this->table;
}
/**
* Purge all items no longer in subform
*
* @param array $items The list of items to set.
* @param string $indexKey The index key on which the items should be observed as it relates to insert/update/delete
* @param string $linkKey The link key on which the items where linked in the child table.
* @param string $linkValue The value of the link key in child table.
*
* @return void
* @since 3.2.2
*/
private function purge(array $items, string $indexKey, string $linkKey, string $linkValue): void
{
// Get the current index values from the database
$currentIndexValues = $this->items->table($this->getTable())->values([$linkValue], $linkKey, $indexKey);
if ($currentIndexValues !== null)
{
// Extract the index values from the items array
$activeIndexValues = array_values(array_map(function($item) use ($indexKey) {
return $item[$indexKey] ?? null;
}, $items));
// Find the index values that are no longer in the items array
$inactiveIndexValues = array_diff($currentIndexValues, $activeIndexValues);
// Delete the inactive index values
if (!empty($inactiveIndexValues))
{
$this->items->table($this->getTable())->delete($inactiveIndexValues, $indexKey);
}
}
}
/**
* Filters the specified keys from an array of objects or arrays, converts them to arrays,
* and sets them by association with a specified key and an incrementing integer.
*
* @param array $items Array of objects or arrays to be filtered.
* @param array $keySet Array of keys to retain in each item.
* @param string $field The field prefix for the resulting associative array.
*
* @return array Array of filtered arrays set by association.
* @since 3.2.2
*/
private function converter(array $items, array $keySet, string $field): array
{
/**
* Filters keys for a single item and converts it to an array.
*
* @param object|array $item The item to filter.
* @param array $keySet The keys to retain.
*
* @return array The filtered array.
* @since 3.2.2
*/
$filterKeys = function ($item, array $keySet) {
$filteredArray = [];
foreach ($keySet as $key) {
if (is_object($item) && property_exists($item, $key)) {
$filteredArray[$key] = $item->{$key};
} elseif (is_array($item) && array_key_exists($key, $item)) {
$filteredArray[$key] = $item[$key];
}
}
return $filteredArray;
};
$result = [];
foreach ($items as $index => $item)
{
$filteredArray = $filterKeys($item, $keySet);
$result[$field . $index] = $filteredArray;
}
return $result;
}
/**
* Processes an array of arrays based on the specified key.
*
* @param array $items Array of arrays to be processed.
* @param string $indexKey The index key on which the items should be observed as it relates to insert/update/delete
* @param string $linkKey The link key on which the items where linked in the child table.
* @param string $linkValue The value of the link key in child table.
*
* @return array The processed array of arrays.
* @since 3.2.2
*/
private function process(array $items, string $indexKey, string $linkKey, string $linkValue): array
{
foreach ($items as &$item)
{
$value = $item[$indexKey] ?? '';
switch ($indexKey) {
case 'guid':
if (empty($value))
{
// set INDEX
$item[$indexKey] = $this->setGuid($indexKey);
}
break;
case 'id':
if (empty($value))
{
$item[$indexKey] = 0;
}
break;
default:
// No action for other keys if empty
break;
}
// set LINK
$item[$linkKey] = $linkValue;
}
return array_values($items);
}
/**
* Returns a GUIDv4 string
*
* Thanks to Dave Pearson (and other)
* https://www.php.net/manual/en/function.com-create-guid.php#119168
*
* Uses the best cryptographically secure method
* for all supported platforms with fallback to an older,
* less secure version.
*
* @param string $key The key to check and modify values.
* @param bool $trim
*
* @return string
*
* @since 3.0.9
*/
private function setGuid(string $key, bool $trim = true): string
{
// Windows
if (function_exists('com_create_guid'))
{
if ($trim)
{
return trim(\com_create_guid(), '{}');
}
return \com_create_guid();
}
// set the braces if needed
$lbrace = $trim ? "" : chr(123); // "{"
$rbrace = $trim ? "" : chr(125); // "}"
// OSX/Linux
if (function_exists('openssl_random_pseudo_bytes'))
{
$data = \openssl_random_pseudo_bytes(16);
$data[6] = chr( ord($data[6]) & 0x0f | 0x40); // set version to 0100
$data[8] = chr( ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10
return $lbrace . vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)) . $lbrace;
}
// Fallback (PHP 4.2+)
mt_srand((double) microtime() * 10000);
$charid = strtolower( md5( uniqid( rand(), true)));
$hyphen = chr(45); // "-"
$guidv4 = $lbrace.
substr($charid, 0, 8). $hyphen.
substr($charid, 8, 4). $hyphen.
substr($charid, 12, 4). $hyphen.
substr($charid, 16, 4). $hyphen.
substr($charid, 20, 12).
$rbrace;
// check that it does not already exist (one in a billion chance ;)
// but we do it any way...
if ($this->items->table($this->getTable())->values([$guidv4], $key))
{
return $this->setGuid($key);
}
return $guidv4;
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,132 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Database;
use JCB\Joomla\Utilities\ArrayHelper;
use JCB\Joomla\Interfaces\DeleteInterface;
use JCB\Joomla\Abstraction\Database;
/**
* Database Delete Class
*
* @since 3.2.0
*/
final class Delete extends Database implements DeleteInterface
{
/**
* Delete all items in the database that match these conditions
*
* @param array $conditions Conditions by which to delete the data in database [array of arrays (key => value)]
* @param string $table The table where the data is being deleted
*
* @return bool
* @since 3.2.2
**/
public function items(array $conditions, string $table): bool
{
// set the update columns
if ($conditions === [])
{
return false;
}
// get a query object
$query = $this->db->getQuery(true);
// start the conditions bucket
$_conditions = [];
foreach ($conditions as $key => $value)
{
if (ArrayHelper::check($value))
{
if (isset($value['value']) && isset($value['operator']))
{
// check if value needs to be quoted
$quote = $value['quote'] ?? true;
if (!$quote)
{
if (ArrayHelper::check($value['value']))
{
// add the where by array
$_conditions[] = $this->db->quoteName($key)
. ' ' . $value['operator']
. ' ' . ' (' .
implode(',', $value['value'])
. ')';
}
else
{
// add the conditions
$_conditions[] = $this->db->quoteName($key)
. ' ' . $value['operator']
. ' ' . $value['value'];
}
}
else
{
if (ArrayHelper::check($value['value']))
{
// add the where by array
$_conditions[] = $this->db->quoteName($key)
. ' ' . $value['operator']
. ' ' . ' (' .
implode(',', array_map(fn($val) => $this->quote($val), $value['value']))
. ')';
}
else
{
// add the conditions
$_conditions[] = $this->db->quoteName($key)
. ' ' . $value['operator']
. ' ' . $this->quote($value['value']);
}
}
}
else
{
// we should through an exception
// for security we just return false for now
return false;
}
}
else
{
// add default condition
$_conditions[] = $this->db->quoteName($key) . ' = ' . $this->quote($value);
}
}
// set the query targets
$query->delete($this->db->quoteName($this->getTable($table)));
$query->where($_conditions);
$this->db->setQuery($query);
return $this->db->execute();
}
/**
* Truncate a table
*
* @param string $table The table that should be truncated
*
* @return void
* @since 3.2.2
**/
public function truncate(string $table): void
{
$this->db->truncateTable($this->getTable($table));
}
}

View File

@@ -0,0 +1,290 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Database;
use Joomla\CMS\Date\Date;
use JCB\Joomla\Utilities\ArrayHelper;
use JCB\Joomla\Interfaces\InsertInterface;
use JCB\Joomla\Abstraction\Database;
/**
* Database Insert Class
*
* @since 3.2.0
*/
final class Insert extends Database implements InsertInterface
{
/**
* Switch to set the defaults
*
* @var bool
* @since 1.2.0
**/
protected bool $defaults = true;
/**
* Switch to prevent/allow defaults from being added.
*
* @param bool $trigger toggle the defaults
*
* @return void
* @since 3.2.0
**/
public function defaults(bool $trigger = true)
{
$this->defaults = $trigger;
}
/**
* Insert rows to the database (with remapping and filtering columns option)
*
* @param array $data Dataset to store in database [array of arrays (key => value)]
* @param string $table The table where the data is being added
* @param array $columns Data columns for remapping and filtering
*
* @return bool
* @since 3.2.0
**/
public function rows(array $data, string $table, array $columns = []): bool
{
if (!ArrayHelper::check($data))
{
return false;
}
if ($columns === [])
{
$columns = $this->getArrayColumns($data);
}
return ($columns === []) ? false : $this->insert($data, $table, $columns, true);
}
/**
* Insert items to the database (with remapping and filtering columns option)
*
* @param array $data Data to store in database (array of objects)
* @param string $table The table where the data is being added
* @param array $columns Data columns for remapping and filtering
*
* @return bool
* @since 3.2.0
**/
public function items(array $data, string $table, array $columns = []): bool
{
if (!ArrayHelper::check($data))
{
return false;
}
if ($columns === [])
{
$columns = $this->getObjectsColumns($data);
}
return ($columns === []) ? false : $this->insert($data, $table, $columns, false);
}
/**
* Insert row to the database
*
* @param array $data Dataset to store in database (key => value)
* @param string $table The table where the data is being added
*
* @return bool
* @since 3.2.0
**/
public function row(array $data, string $table): bool
{
return $this->rows([$data], $table);
}
/**
* Insert item to the database
*
* @param object $data Dataset to store in database (key => value)
* @param string $table The table where the data is being added
*
* @return bool
* @since 3.2.0
**/
public function item(object $data, string $table): bool
{
return $this->items([$data], $table);
}
/**
* Get columns from data array
*
* @param array $data Data array
*
* @return array
* @since 3.2.0
**/
protected function getArrayColumns(array &$data): array
{
$row = array_values($data)[0];
if (!ArrayHelper::check($row))
{
return [];
}
$columns = array_keys($row);
return array_combine($columns, $columns);
}
/**
* Get columns from data objects
*
* @param array $data Data objects
*
* @return array
* @since 3.2.0
**/
protected function getObjectsColumns(array &$data): array
{
$row = array_values($data)[0];
if (!is_object($row))
{
return [];
}
$columns = get_object_vars($row);
return array_combine(array_keys($columns), array_keys($columns));
}
/**
* Insert data into the database
*
* @param array $data Data to store in database
* @param string $table The table where the data is being added
* @param array $columns Data columns for remapping and filtering
* @param bool $isArray Whether the data is an array of arrays or an array of objects
*
* @return bool
* @since 3.2.0
**/
protected function insert(array &$data, string $table, array $columns, bool $isArray): bool
{
// set joomla default columns
$add_created = false;
$add_version = false;
$add_published = false;
// check if we should load the defaults
if ($this->defaults)
{
// get the date
$date = (new Date())->toSql();
if (!isset($columns['created']))
{
$columns['created'] = ' (o_O) ';
$add_created = true;
}
if (!isset($columns['version']))
{
$columns['version'] = ' (o_O) ';
$add_version = true;
}
if (!isset($columns['published']))
{
$columns['published'] = ' (o_O) ';
$add_published = true;
}
// the (o_O) prevents an empty value from being loaded
}
// get a query object
$query = $this->db->getQuery(true);
// set the query targets
$query->insert($this->db->quoteName($this->getTable($table)))->columns($this->db->quoteName(array_keys($columns)));
// limiting factor on the amount of rows to insert before we reset the query
$limit = 300;
// set the insert values
foreach ($data as $nr => $value)
{
// check the limit
if ($limit <= 1)
{
// execute and reset the query
$this->db->setQuery($query);
$this->db->execute();
// reset limit
$limit = 300;
// get a query object
$query = $this->db->getQuery(true);
// set the query targets
$query->insert($this->db->quoteName($this->getTable($table)))->columns($this->db->quoteName(array_keys($columns)));
}
$row = [];
foreach ($columns as $column => $key)
{
if (' (o_O) ' !== $key)
{
$row[] = ($isArray && isset($value[$key])) ? $this->quote($value[$key])
: ((!$isArray && isset($value->{$key})) ? $this->quote($value->{$key}) : '');
}
}
// set joomla default columns
if ($add_created)
{
$row[] = $this->db->quote($date);
}
if ($add_version)
{
$row[] = 1;
}
if ($add_published)
{
$row[] = 1;
}
// add to query
$query->values(implode(',', $row));
// decrement the limiter
$limit--;
// clear the data from memory
unset($data[$nr]);
}
// execute the final query
$this->db->setQuery($query);
$this->db->execute();
// always reset the default switch
$this->defaults();
return true;
}
}

View File

@@ -0,0 +1,502 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Database;
use JCB\Joomla\Utilities\ArrayHelper;
use JCB\Joomla\Interfaces\LoadInterface;
use JCB\Joomla\Abstraction\Database;
/**
* Database Load
*
* @since 3.2.0
*/
final class Load extends Database implements LoadInterface
{
/**
* Load data rows as an array of associated arrays
*
* @param array $select Array of selection keys
* @param array $tables Array of tables to search
* @param array|null $where Array of where key=>value match exist
* @param array|null $order Array of how to order the data
* @param int|null $limit Limit the number of values returned
*
* @return array|null
* @since 3.2.0
**/
public function rows(array $select, array $tables, ?array $where = null,
?array $order = null, ?int $limit = null): ?array
{
// set key if found
$key = $this->getKey($select);
// check if we can get many rows
if ($this->many($select, $tables, $where, $order, $limit))
{
// return associated arrays from the table records
return $this->db->loadAssocList($key);
}
// data does not exist
return null;
}
/**
* Load data rows as an array of objects
*
* @param array $select Array of selection keys
* @param array $tables Array of tables to search
* @param array|null $where Array of where key=>value match exist
* @param array|null $order Array of how to order the data
* @param int|null $limit Limit the number of values returned
*
* @return array|null
* @since 3.2.0
**/
public function items(array $select, array $tables, ?array $where = null,
?array $order = null, ?int $limit = null): ?array
{
// set key if found
$key = $this->getKey($select);
// check if we can get many rows
if ($this->many($select, $tables, $where, $order, $limit))
{
// return associated arrays from the table records
return $this->db->loadObjectList($key);
}
// data does not exist
return null;
}
/**
* Load data row as an associated array
*
* @param array $select Array of selection keys
* @param array $tables Array of tables to search
* @param array|null $where Array of where key=>value match exist
* @param array|null $order Array of how to order the data
*
* @return array|null
* @since 3.2.0
**/
public function row(array $select, array $tables, ?array $where = null, ?array $order = null): ?array
{
// check if we can get one row
if ($this->one($select, $tables, $where, $order))
{
return $this->db->loadAssoc();
}
// data does not exist
return null;
}
/**
* Load data row as an object
*
* @param array $select Array of selection keys
* @param array $tables Array of tables to search
* @param array|null $where Array of where key=>value match exist
* @param array|null $order Array of how to order the data
*
* @return object|null
* @since 3.2.0
**/
public function item(array $select, array $tables, ?array $where = null, ?array $order = null): ?object
{
// check if we can get one row
if ($this->one($select, $tables, $where, $order))
{
return $this->db->loadObject();
}
// data does not exist
return null;
}
/**
* Get the max value based on a filtered result from a given table
*
* @param string $field The field key
* @param string $tables The tables
* @param array $filter The filter keys
*
* @return int|null
* @since 3.2.0
**/
public function max($field, array $tables, array $filter): ?int
{
// only do check if we have the table set
if (isset($tables['a']))
{
// get the query
$query = $this->query(["all" => "MAX(`$field`)"], $tables, $filter);
// Load the max number
$this->db->setQuery($query);
$this->db->execute();
// check if we have values
if ($this->db->getNumRows())
{
return (int) $this->db->loadResult();
}
}
// data does not exist
return null;
}
/**
* Count the number of items based on filter result from a given table
*
* @param string $tables The table
* @param array $filter The filter keys
*
* @return int|null
* @since 3.2.0
**/
public function count(array $tables, array $filter): ?int
{
// only do check if we have the table set
if (isset($tables['a']))
{
// get the query
$query = $this->query(["all" => 'COUNT(*)'], $tables, $filter);
// Load the max number
$this->db->setQuery($query);
$this->db->execute();
// check if we have values
if ($this->db->getNumRows())
{
return (int) $this->db->loadResult();
}
}
// data does not exist
return null;
}
/**
* Load one value from a row
*
* @param array $select Array of selection keys
* @param array $tables Array of tables to search
* @param array|null $where Array of where key=>value match exist
* @param array|null $order Array of how to order the data
*
* @return mixed
* @since 3.2.0
**/
public function value(array $select, array $tables, ?array $where = null, ?array $order = null)
{
// check if we can get one value
if ($this->one($select, $tables, $where, $order))
{
return $this->db->loadResult();
}
// data does not exist
return null;
}
/**
* Load values from multiple rows
*
* @param array $select Array of selection keys
* @param array $tables Array of tables to search
* @param array|null $where Array of where key=>value match exist
* @param array|null $order Array of how to order the data
* @param int|null $limit Limit the number of values returned
*
* @return array|null
* @since 3.2.2
**/
public function values(array $select, array $tables, ?array $where = null,
?array $order = null, ?int $limit = null): ?array
{
// check if we can get many rows
if ($this->many($select, $tables, $where, $order, $limit))
{
return $this->db->loadColumn();
}
// data does not exist
return null;
}
/**
* Load many
*
* @param array $select Array of selection keys
* @param array $tables Array of tables to search
* @param array|null $where Array of where key=>value match exist
* @param array|null $order Array of how to order the data
* @param int|null $limit Limit the number of values returned
*
* @return bool
* @since 3.2.0
**/
protected function many(array $select, array $tables, ?array $where = null,
?array $order = null, ?int $limit = null): bool
{
// only do check if we have the table set
if (isset($tables['a']))
{
// get the query
$query = $this->query($select, $tables, $where, $order, $limit);
// Load the items
$this->db->setQuery($query);
$this->db->execute();
// check if we have values
if ($this->db->getNumRows())
{
return true;
}
}
// data does not exist
return false;
}
/**
* Load one
*
* @param array $select Array of selection keys
* @param array $tables Array of tables to search
* @param array|null $where Array of where key=>value match exist
* @param array|null $order Array of how to order the data
*
* @return bool
* @since 3.2.0
**/
protected function one(array $select, array $tables, ?array $where = null, ?array $order = null): bool
{
// only do check if we have the table set
if (isset($tables['a']))
{
// get the query
$query = $this->query($select, $tables, $where, $order);
// Load the item
$this->db->setQuery($query, 0, 1);
$this->db->execute();
// check if we have values
if ($this->db->getNumRows())
{
return true;
}
}
// data does not exist
return false;
}
/**
* Get the query object
*
* @param array $select Array of selection keys
* @param array $tables Array of tables to search
* @param array|null $where Array of where key=>value match exist
* @param array|null $order Array of how to order the data
* @param int|null $limit Limit the number of values returned
*
* @return object|null The query object (DatabaseQuery)
* @since 3.2.0
**/
protected function query(array $select, array $tables, ?array $where = null,
?array $order = null, ?int $limit = null): ?object
{
$query = $this->db->getQuery(true);
// check if we have an all selection set
if (isset($select['all']))
{
// all selection example array: ['all' => ['a.*', 'b.*']]
if (ArrayHelper::check($select['all']))
{
foreach ($select['all'] as $select_all)
{
// set target selection
$query->select(
$select_all
);
}
}
// all selection example string: ['all' =>'a.*']
elseif (is_string($select['all']))
{
// set target selection
$query->select(
$select['all']
);
}
unset($select['all']);
}
// load the table where join
if (ArrayHelper::check($select))
{
// set target selection
$query->select(
$this->db->quoteName(
array_keys($select),
array_values($select)
)
);
}
// set main table
$query->from($this->db->quoteName($this->getTable($tables['a']), 'a'));
// remove main table
unset($tables['a']);
// load the table where join
if (ArrayHelper::check($tables))
{
foreach ($tables as $as => $table)
{
$query->join(
'LEFT', $this->db->quoteName(
$this->getTable($table['name']), $as
) . ' ON (' . $this->db->quoteName($table['join_on'])
. ' = ' . $this->db->quoteName($table['as_on']) . ')'
);
}
}
// load the table where getters
if (ArrayHelper::check($where))
{
foreach ($where as $key => $value)
{
if (ArrayHelper::check($value))
{
if (isset($value['value']) && isset($value['operator']))
{
// check if value needs to be quoted
$quote = $value['quote'] ?? true;
if (!$quote)
{
if (ArrayHelper::check($value['value']))
{
// add the where by array
$query->where($this->db->quoteName($key) . ' ' .
$value['operator'] . ' (' .
implode(',', $value['value'])
. ')'
);
}
else
{
// add the where
$query->where($this->db->quoteName($key) . ' ' .
$value['operator'] . ' ' . $value['value']);
}
}
else
{
if (ArrayHelper::check($value['value']))
{
// add the where by array
$query->where($this->db->quoteName($key) . ' ' .
$value['operator'] . ' (' .
implode(',',
array_map(
fn($val) => $this->quote($val),
$value['value']
)
)
. ')'
);
}
else
{
// add the where
$query->where($this->db->quoteName($key) . ' ' .
$value['operator'] . ' ' . $this->quote($value['value']));
}
}
}
else
{
// we should through an exception
// for security we just return nothing for now
return null;
}
}
else
{
// add the where
$query->where($this->db->quoteName($key) .
' = ' . $this->quote($value));
}
}
}
// load the row ordering
if (ArrayHelper::check($order))
{
foreach ($order as $key => $direction)
{
// add the ordering
$query->order($this->db->quoteName($key) .
' ' . $direction);
}
}
// only return a limited number
if (is_numeric($limit))
{
$query->setLimit($limit);
}
return $query;
}
/**
* Get the key from the selection array.
*
* This function retrieves a key from the provided selection array.
* The key is removed from the array after being retrieved.
*
* @param array $select Array of selection keys.
*
* @return string|null The key, or null if no key is found.
* @since 3.2.2
**/
protected function getKey(array &$select): ?string
{
$key = null;
// Check for 'key' first and ensure it's a string.
if (isset($select['key']) && is_string($select['key']))
{
$key = $select['key'];
unset($select['key']); // Remove 'key' from the array.
}
return $key;
}
}

View File

@@ -0,0 +1,188 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Database;
use JCB\Joomla\Interfaces\UpdateInterface;
use JCB\Joomla\Abstraction\Database;
/**
* Database Update Class
*
* @since 3.2.0
*/
final class Update extends Database implements UpdateInterface
{
/**
* Update rows in the database (with remapping and filtering columns option)
*
* @param array $data Dataset to update in database [array of arrays (key => value)]
* @param string $key Dataset key column to use in updating the values in the Database
* @param string $table The table where the data is being updated
* @param array $columns Data columns for remapping and filtering
*
* @return bool
* @since 3.2.0
**/
public function rows(array $data, string $key, string $table, array $columns = []): bool
{
// set the update columns
if ($data === [] || strlen($key) == 0)
{
return false;
}
// set the update values
foreach ($data as $values)
{
if ($columns !== [])
{
// load only what is part of the columns set
$row = [];
foreach ($columns as $column => $key_)
{
if (isset($values[$key_]))
{
$row[$column] = $values[$key_];
}
}
// update the row
$this->row($row, $key, $table);
}
else
{
// update the row
$this->row((array) $values, $key, $table);
}
}
return true;
}
/**
* Update items in the database (with remapping and filtering columns option)
*
* @param array $data Data to updated in database (array of objects)
* @param string $key Dataset key column to use in updating the values in the Database
* @param string $table The table where the data is being update
* @param array $columns Data columns for remapping and filtering
*
* @return bool
* @since 3.2.0
**/
public function items(array $data, string $key, string $table, array $columns = []): bool
{
// set the update columns
if ($data === [] || strlen($key) == 0)
{
return false;
}
// set the update values
foreach ($data as $nr => $values)
{
if ($columns !== [])
{
// load only what is part of the columns set
$row = [];
foreach ($columns as $column => $key_)
{
if (isset($values->{$key_}))
{
$row[$column] = $values->{$key_};
}
}
// update the row
$this->row($row, $key, $table);
}
else
{
// update the row
$this->row((array) $values, $key, $table);
}
}
return true;
}
/**
* Update row in the database
*
* @param array $data Dataset to update in database (key => value)
* @param string $key Dataset key column to use in updating the values in the Database
* @param string $table The table where the data is being updated
*
* @return bool
* @since 3.2.0
**/
public function row(array $data, string $key, string $table): bool
{
// set the update columns
if ($data === [] || strlen($key) == 0)
{
return false;
}
// get a query object
$query = $this->db->getQuery(true);
// set the query targets
$query->update($this->db->quoteName($this->getTable($table)));
// set the update values
$key_ = null;
foreach ($data as $column => $value)
{
if ($column === $key)
{
$key_ = $value;
}
else
{
$query->set($this->db->quoteName($column) . ' = ' . $this->quote($value));
}
}
// add the key condition
if ($key_ !== null)
{
$query->where($this->db->quoteName($key) . ' = ' . $this->quote($key_));
// execute the final query
$this->db->setQuery($query);
return $this->db->execute();
}
return false;
}
/**
* Update item in the database
*
* @param object $data Dataset to update in database (key => value)
* @param string $key Dataset key column to use in updating the values in the Database
* @param string $table The table where the data is being updated
*
* @return bool
* @since 3.2.0
**/
public function item(object $data, string $key, string $table): bool
{
// convert to an array
return $this->row((array) get_object_vars($data), $key, $table);
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,60 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Interfaces\Data;
/**
* Data Delete
*
* @since 3.2.2
*/
interface DeleteInterface
{
/**
* Set the current active table
*
* @param string|null $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(?string $table): self;
/**
* Delete all items in the database that match these conditions
*
* @param array $conditions Conditions by which to delete the data in database [array of arrays (key => value)]
*
* @return bool
* @since 3.2.2
**/
public function items(array $conditions): bool;
/**
* Truncate a table
*
* @param string|null $table The table that should be truncated
*
* @return void
* @since 3.2.2
**/
public function truncate(): void;
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string;
}

View File

@@ -0,0 +1,98 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Interfaces\Data;
/**
* Data Insert
*
* @since 3.2.2
*/
interface InsertInterface
{
/**
* Set the current active table
*
* @param string|null $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(?string $table): self;
/**
* Insert a value to a given table
* Example: $this->value(Value, 'value_key', 'GUID');
*
* @param mixed $value The field value
* @param string $field The field key
* @param string $keyValue The key value
* @param string $key The key name
*
* @return bool
* @since 3.2.0
*/
public function value($value, string $field, string $keyValue, string $key = 'guid'): bool;
/**
* Insert single row with multiple values to a given table
* Example: $this->item(Array);
*
* @param array $item The item to save
*
* @return bool
* @since 3.2.0
*/
public function row(array $item): bool;
/**
* Insert multiple rows to a given table
* Example: $this->items(Array);
*
* @param array|null $items The items updated in database (array of arrays)
*
* @return bool
* @since 3.2.0
*/
public function rows(?array $items): bool;
/**
* Insert single item with multiple values to a given table
* Example: $this->item(Object);
*
* @param object $item The item to save
*
* @return bool
* @since 3.2.0
*/
public function item(object $item): bool;
/**
* Insert multiple items to a given table
* Example: $this->items(Array);
*
* @param array|null $items The items updated in database (array of objects)
*
* @return bool
* @since 3.2.0
*/
public function items(?array $items): bool;
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string;
}

View File

@@ -0,0 +1,86 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Interfaces\Data;
/**
* Data Item Interface
*
* @since 3.2.2
*/
interface ItemInterface
{
/**
* Set the current active table
*
* @param string $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(string $table): self;
/**
* Get an item
*
* @param string $value The item key value
* @param string $key The item key
*
* @return object|null The item object or null
* @since 3.2.2
*/
public function get(string $value, string $key = 'guid'): ?object;
/**
* Get the value
*
* @param string $value The item key value
* @param string $key The item key
* @param string $get The key of the values we want back
*
* @return mixed
* @since 3.2.2
*/
public function value(string $value, string $key = 'guid', string $get = 'id');
/**
* Set an item
*
* @param object $item The item
* @param string $key The item key
* @param string|null $action The action to load power
*
* @return bool
* @since 3.2.2
*/
public function set(object $item, string $key = 'guid', ?string $action = null): bool;
/**
* Delete an item
*
* @param string $value The item key value
* @param string $key The item key
*
* @return bool
* @since 3.2.2
*/
public function delete(string $value, string $key = 'guid'): bool;
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string;
}

View File

@@ -0,0 +1,85 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Interfaces\Data;
/**
* Data Items Interface
*
* @since 3.2.2
*/
interface ItemsInterface
{
/**
* Set the current active table
*
* @param string $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(string $table): self;
/**
* Get list of items
*
* @param array $values The ids of the items
* @param string $key The key of the values
*
* @return array|null The item object or null
* @since 3.2.2
*/
public function get(array $values, string $key = 'guid'): ?array;
/**
* Get the values
*
* @param array $values The list of values (to search by).
* @param string $key The key on which the values being searched.
* @param string $get The key of the values we want back
*
* @return array|null The array of found values.
* @since 3.2.2
*/
public function values(array $values, string $key = 'guid', string $get = 'id'): ?array;
/**
* Set items
*
* @param array $items The list of items
* @param string $key The key on which the items should be set
*
* @return bool
* @since 3.2.2
*/
public function set(array $items, string $key = 'guid'): bool;
/**
* Delete items
*
* @param array $values The item key value
* @param string $key The item key
*
* @return bool
* @since 3.2.2
*/
public function delete(array $values, string $key = 'guid'): bool;
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string;
}

View File

@@ -0,0 +1,106 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Interfaces\Data;
/**
* Data Load Interface
*
* @since 3.2.2
*/
interface LoadInterface
{
/**
* Set the current active table
*
* @param string|null $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(?string $table): self;
/**
* Get a value from a given table
* Example: $this->value(
* [
* 'guid' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
* ], 'value_key'
* );
*
* @param array $keys The item keys
* @param string $field The field key
*
* @return mixed
* @since 2.0.1
*/
public function value(array $keys, string $field);
/**
* Get a value from multiple rows from a given table
* Example: $this->values(
* [
* 'guid' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
* ], 'value_key'
* );
*
* @param array $keys The item keys
* @param string $field The field key
*
* @return array|null
* @since 3.2.2
*/
public function values(array $keys, string $field): ?array;
/**
* Get values from a given table
* Example: $this->item(
* [
* 'guid' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
* ]
* );
*
* @param array $keys The item keys
*
* @return object|null
* @since 2.0.1
*/
public function item(array $keys): ?object;
/**
* Get values from a given table
* Example: $this->items(
* [
* 'guid' => [
* 'operator' => 'IN',
* 'value' => [''xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'', ''xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'']
* ]
* ]
* );
* Example: $this->items($keys);
*
* @param array $keys The item keys
*
* @return array|null
* @since 2.0.1
*/
public function items(array $keys): ?array;
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string;
}

View File

@@ -0,0 +1,77 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Interfaces\Data;
/**
* Data Multi Subform Interface
*
* @since 3.2.2
*/
interface MultiSubformInterface
{
/**
* Get a subform items
*
* @param array $getMap The the map to get the subfrom data
*
* Example:
* $getMap = [
* '_core' => [
* 'table' =>'data',
* 'linkValue' => $item->guid ?? '',
* 'linkKey' => 'look',
* 'field' => 'data',
* 'get' => ['guid','email','image','mobile_phone','website','dateofbirth']
* ],
* 'countries' => [
* 'table' =>'data_country',
* 'linkValue' => 'data:guid', // coretable:fieldname
* 'linkKey' => 'data',
* 'get' => ['guid','country','currency']
* ]
* ];
*
* @return array|null The subform
* @since 3.2.2
*/
public function get(array $getMap): ?array;
/**
* Set a subform items
*
* @param array $items The list of items from the subform to set
* @param array $setMap The the map to set the subfrom data
*
* Example:
* $items,
* $setMap = [
* '_core' => [
* 'table' =>'data',
* 'indexKey' => 'guid',
* 'linkKey' => 'look',
* 'linkValue' => $data['guid'] ?? ''
* ],
* 'countries' => [
* 'table' =>'data_country',
* 'indexKey' => 'guid',
* 'linkKey' => 'data',
* 'linkValue' => 'data:guid' // coretable:fieldname
* ]
* ];
*
* @return bool
* @since 3.2.2
*/
public function set(array $items, array $setMap): bool;
}

View File

@@ -0,0 +1,66 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Interfaces\Data;
/**
* Data Subform Interface
*
* @since 3.2.2
*/
interface SubformInterface
{
/**
* Set the current active table
*
* @param string $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(string $table): self;
/**
* Get a subform items
*
* @param string $linkValue The value of the link key in child table.
* @param string $linkKey The link key on which the items where linked in the child table.
* @param string $field The parent field name of the subform in the parent view.
* @param array $set The array SET of the keys of each row in the subform.
*
* @return array|null The subform
* @since 3.2.2
*/
public function get(string $linkValue, string $linkKey, string $field, array $set): ?array;
/**
* Set a subform items
*
* @param array $items The list of items from the subform to set
* @param string $indexKey The index key on which the items should be observed as it relates to insert/update/delete.
* @param string $linkKey The link key on which the items where linked in the child table.
* @param string $linkValue The value of the link key in child table.
*
* @return bool
* @since 3.2.2
*/
public function set(array $items, string $indexKey, string $linkKey, string $linkValue): bool;
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string;
}

View File

@@ -0,0 +1,102 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Interfaces\Data;
/**
* Data Update
*
* @since 3.2.2
*/
interface UpdateInterface
{
/**
* Set the current active table
*
* @param string|null $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(?string $table): self;
/**
* Update a value to a given table
* Example: $this->value(Value, 'value_key', 'GUID');
*
* @param mixed $value The field value
* @param string $field The field key
* @param string $keyValue The key value
* @param string $key The key name
*
* @return bool
* @since 3.2.0
*/
public function value($value, string $field, string $keyValue, string $key = 'guid'): bool;
/**
* Update single row with multiple values to a given table
* Example: $this->item(Array);
*
* @param array $item The item to save
* @param string $key The key name
*
* @return bool
* @since 3.2.0
*/
public function row(array $item, string $key = 'guid'): bool;
/**
* Update multiple rows to a given table
* Example: $this->items(Array);
*
* @param array|null $items The items updated in database (array of arrays)
* @param string $key The key name
*
* @return bool
* @since 3.2.0
*/
public function rows(?array $items, string $key = 'guid'): bool;
/**
* Update single item with multiple values to a given table
* Example: $this->item(Object);
*
* @param object $item The item to save
* @param string $key The key name
*
* @return bool
* @since 3.2.0
*/
public function item(object $item, string $key = 'guid'): bool;
/**
* Update multiple items to a given table
* Example: $this->items(Array);
*
* @param array|null $items The items updated in database (array of objects)
* @param string $key The key name
*
* @return bool
* @since 3.2.0
*/
public function items(?array $items, string $key = 'guid'): bool;
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string;
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,43 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Interfaces;
/**
* Database Delete Interface
*
* @since 3.2.0
*/
interface DeleteInterface
{
/**
* Delete all rows in the database that match these conditions
*
* @param array $conditions Conditions by which to delete the data in database [array of arrays (key => value)]
* @param string $table The table where the data is being deleted
*
* @return bool
* @since 3.2.0
**/
public function items(array $conditions, string $table): bool;
/**
* Truncate a table
*
* @param string $table The table that should be truncated
*
* @return void
* @since 3.2.2
**/
public function truncate(string $table): void;
}

View File

@@ -0,0 +1,43 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Interfaces;
use Joomla\DI\Container;
/**
* The Container Factory Interface
*
* @since 0.0.0
*/
interface FactoryInterface
{
/**
* Get any class from the container
*
* @param string $key The container class key
*
* @return Mixed
* @since 0.0.0
*/
public static function _(string $key);
/**
* Get the global container
*
* @return Container
* @since 0.0.0
*/
public static function getContainer(): Container;
}

View File

@@ -0,0 +1,78 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Interfaces;
/**
* Database Insert Interface
*
* @since 3.2.0
*/
interface InsertInterface
{
/**
* Switch to prevent/allow defaults from being added.
*
* @param bool $trigger toggle the defaults
*
* @return void
* @since 3.2.0
**/
public function defaults(bool $trigger = true);
/**
* Insert rows to the database (with remapping and filtering columns option)
*
* @param array $data Dataset to store in database [array of arrays (key => value)]
* @param string $table The table where the data is being added
* @param array $columns Data columns for remapping and filtering
*
* @return bool
* @since 3.2.0
**/
public function rows(array $data, string $table, array $columns = []): bool;
/**
* Insert items to the database (with remapping and filtering columns option)
*
* @param array $data Data to store in database (array of objects)
* @param string $table The table where the data is being added
* @param array $columns Data columns for remapping and filtering
*
* @return bool
* @since 3.2.0
**/
public function items(array $data, string $table, array $columns = []): bool;
/**
* Insert row to the database
*
* @param array $data Dataset to store in database (key => value)
* @param string $table The table where the data is being added
*
* @return bool
* @since 3.2.0
**/
public function row(array $data, string $table): bool;
/**
* Insert item to the database
*
* @param object $data Dataset to store in database (key => value)
* @param string $table The table where the data is being added
*
* @return bool
* @since 3.2.0
**/
public function item(object $data, string $table): bool;
}

View File

@@ -0,0 +1,129 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Interfaces;
/**
* Database Load Interface
*
* @since 3.2.0
*/
interface LoadInterface
{
/**
* Load data rows as an array of associated arrays
*
* @param array $select Array of selection keys
* @param array $tables Array of tables to search
* @param array|null $where Array of where key=>value match exist
* @param array|null $order Array of how to order the data
* @param int|null $limit Limit the number of values returned
*
* @return array|null
* @since 3.2.0
**/
public function rows(array $select, array $tables, ?array $where = null,
?array $order = null, ?int $limit = null): ?array;
/**
* Load data rows as an array of objects
*
* @param array $select Array of selection keys
* @param array $tables Array of tables to search
* @param array|null $where Array of where key=>value match exist
* @param array|null $order Array of how to order the data
* @param int|null $limit Limit the number of values returned
*
* @return array|null
* @since 3.2.0
**/
public function items(array $select, array $tables, ?array $where = null,
?array $order = null, ?int $limit = null): ?array;
/**
* Load data row as an associated array
*
* @param array $select Array of selection keys
* @param array $tables Array of tables to search
* @param array|null $where Array of where key=>value match exist
* @param array|null $order Array of how to order the data
*
* @return array|null
* @since 3.2.0
**/
public function row(array $select, array $tables, ?array $where = null, ?array $order = null): ?array;
/**
* Load data row as an object
*
* @param array $select Array of selection keys
* @param array $tables Array of tables to search
* @param array|null $where Array of where key=>value match exist
* @param array|null $order Array of how to order the data
*
* @return object|null
* @since 3.2.0
**/
public function item(array $select, array $tables, ?array $where = null, ?array $order = null): ?object;
/**
* Get the max value based on a filtered result from a given table
*
* @param string $field The field key
* @param string $tables The table
* @param array $filter The filter keys
*
* @return int|null
* @since 3.2.0
**/
public function max($field, array $tables, array $filter): ?int;
/**
* Count the number of items based on filter result from a given table
*
* @param string $tables The table
* @param array $filter The filter keys
*
* @return int|null
* @since 3.2.0
**/
public function count(array $tables, array $filter): ?int;
/**
* Load one value from a row
*
* @param array $select Array of selection keys
* @param array $tables Array of tables to search
* @param array|null $where Array of where key=>value match exist
* @param array|null $order Array of how to order the data
*
* @return mixed
* @since 3.2.0
**/
public function value(array $select, array $tables, ?array $where = null, ?array $order = null);
/**
* Load values from multiple rows
*
* @param array $select Array of selection keys
* @param array $tables Array of tables to search
* @param array|null $where Array of where key=>value match exist
* @param array|null $order Array of how to order the data
* @param int|null $limit Limit the number of values returned
*
* @return array|null
* @since 3.2.2
**/
public function values(array $select, array $tables, ?array $where = null,
?array $order = null, ?int $limit = null): ?array;
}

View File

@@ -0,0 +1,137 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Interfaces;
/**
* Model Interface
*
* @since 3.2.0
*/
interface ModelInterface
{
/**
* Set the current active table
*
* @param string $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(string $table): self;
/**
* Model the value
* Example: $this->value(value, 'value_key', 'table_name');
*
* @param mixed $value The value to model
* @param string $field The field key
* @param string|null $table The table
*
* @return mixed
* @since 3.2.0
*/
public function value($value, string $field, ?string $table = null);
/**
* Model a value of multiple items
* Example: $this->items(Array, 'value_key', 'table_name');
*
* @param array|null $items The array of values
* @param string $field The field key
* @param string|null $table The table
*
* @return array|null
* @since 3.2.0
*/
public function values(?array $items = null, string $field, ?string $table = null): ?array;
/**
* Model the values of an item
* Example: $this->item(Object, 'table_name');
*
* @param object|null $item The item object
* @param string|null $table The table
*
* @return object|null
* @since 3.2.0
*/
public function item(?object $item, ?string $table = null): ?object;
/**
* Model the values of multiple items
* Example: $this->items(Array, 'table_name');
*
* @param array|null $items The array of item objects
* @param string|null $table The table
*
* @return array|null
* @since 3.2.0
*/
public function items(?array $items = null, ?string $table = null): ?array;
/**
* Model the values of an row
* Example: $this->item(Array, 'table_name');
*
* @param array|null $item The item array
* @param string|null $table The table
*
* @return array|null
* @since 3.2.0
*/
public function row(?array $item, ?string $table = null): ?array;
/**
* Model the values of multiple rows
* Example: $this->items(Array, 'table_name');
*
* @param array|null $items The array of item array
* @param string|null $table The table
*
* @return array|null
* @since 3.2.0
*/
public function rows(?array $items = null, ?string $table = null): ?array;
/**
* Get last modeled ID
* Example: $this->last('table_name');
*
* @param string|null $table The table
*
* @return int|null
* @since 3.2.0
*/
public function last(?string $table = null): ?int;
/**
* Set the current active table
*
* @param string $tableName The table name
*
* @return void
* @since 3.2.2
*/
public function setTable(string $tableName): void;
/**
* Set the switch to control the behaviour of empty values
*
* @param bool $allowEmpty The switch
*
* @return void
* @since 3.2.2
*/
public function setAllowEmpty(bool $allowEmpty): void;
}

View File

@@ -0,0 +1,53 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Interfaces;
/**
* Schema Checking Interface
*
* @since 3.2.1
*/
interface SchemaInterface
{
/**
* Check and update database schema for missing fields or tables.
*
* @return array The array of successful updates/actions, if empty no update/action was taken.
* @since 3.2.1
* @throws \Exception If there is an error during the update process.
*/
public function update(): array;
/**
* Create a table with all necessary fields.
*
* @param string $table The name of the table to create.
*
* @return void
* @since 3.2.1
* @throws \Exception If there is an error creating the table.
*/
public function createTable(string $table): void;
/**
* Update the schema of an existing table.
*
* @param string $table The table to update.
*
* @return void
* @since 3.2.1
* @throws \Exception If there is an error while updating the schema.
*/
public function updateSchema(string $table): void;
}

View File

@@ -0,0 +1,91 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Interfaces;
/**
* The VDM Core Table Interface
*/
interface Tableinterface
{
/**
* Get any value from a item/field/column of an area/view/table
* Example: $this->get('table_name', 'field_name', 'value_key');
* Get an item/field/column of an area/view/table
* Example: $this->get('table_name', 'field_name');
* Get all items/fields/columns of an area/view/table
* Example: $this->get('table_name');
* Get all areas/views/tables with all their item/field/column details
* Example: $this->get('All');
* Example: $this->get();
*
* @param string|null $table The table
* @param string|null $field The field
* @param string|null $key The value key
*
* @return mixed
* @since 3.2.0
*/
public function get(?string $table = null, ?string $field = null, ?string $key = null);
/**
* Get title field from an area/view/table
*
* @param string $table The area
*
* @return ?array
* @since 3.2.0
*/
public function title(string $table): ?array;
/**
* Get title field name
*
* @param string $table The area
*
* @return string
* @since 3.2.0
*/
public function titleName(string $table): string;
/**
* Get all tables
*
* @return array
* @since 3.2.0
*/
public function tables(): array;
/**
* Check if a table (and field) exist
*
* @param string $table The area
* @param string|null $field The area
*
* @return bool
* @since 3.2.0
*/
public function exist(string $table, ?string $field = null): bool;
/**
* Get all fields of an area/view/table
*
* @param string $table The area
* @param bool $default Add the default fields
* @param bool $details Add/Leave fields the details
*
* @return array|null On success an array of fields
* @since 3.2.0
*/
public function fields(string $table, bool $default = false, bool $details = false): ?array;
}

View File

@@ -0,0 +1,72 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Interfaces;
/**
* Database Update Interface
*
* @since 3.2.0
*/
interface UpdateInterface
{
/**
* Update rows in the database (with remapping and filtering columns option)
*
* @param array $data Dataset to update in database [array of arrays (key => value)]
* @param string $key Dataset key column to use in updating the values in the Database
* @param string $table The table where the data is being updated
* @param array $columns Data columns for remapping and filtering
*
* @return bool
* @since 3.2.0
**/
public function rows(array $data, string $key, string $table, array $columns = []): bool;
/**
* Update items in the database (with remapping and filtering columns option)
*
* @param array $data Data to updated in database (array of objects)
* @param string $key Dataset key column to use in updating the values in the Database
* @param string $table The table where the data is being update
* @param array $columns Data columns for remapping and filtering
*
* @return bool
* @since 3.2.0
**/
public function items(array $data, string $key, string $table, array $columns = []): bool;
/**
* Update row in the database
*
* @param array $data Dataset to update in database (key => value)
* @param string $key Dataset key column to use in updating the values in the Database
* @param string $table The table where the data is being updated
*
* @return bool
* @since 3.2.0
**/
public function row(array $data, string $key, string $table): bool;
/**
* Update item in the database
*
* @param object $data Dataset to update in database (key => value)
* @param string $key Dataset key column to use in updating the values in the Database
* @param string $table The table where the data is being updated
*
* @return bool
* @since 3.2.0
**/
public function item(object $data, string $key, string $table): bool;
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,118 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Model;
use JCB\Joomla\Utilities\StringHelper;
use JCB\Joomla\Utilities\ArrayHelper;
use JCB\Joomla\Utilities\ObjectHelper;
use JCB\Joomla\Interfaces\ModelInterface;
use JCB\Joomla\Abstraction\Model;
/**
* Power Model Load
*
* @since 3.2.2
*/
final class Load extends Model implements ModelInterface
{
/**
* Model the value
* Example: $this->value(value, 'field_key', 'table_name');
*
* @param mixed $value The value to model
* @param string $field The field key
* @param string|null $table The table
*
* @return mixed
* @since 3.2.0
*/
public function value($value, string $field, ?string $table = null)
{
// set the table name
if (empty($table))
{
$table = $this->getTable();
}
// check if this is a valid table
if (($store = $this->table->get($table, $field, 'store')) !== null)
{
// open the value based on the store method
switch($store)
{
case 'base64':
$value = base64_decode((string) $value);
break;
case 'json':
$value = json_decode($value);
break;
}
}
return $value;
}
/**
* Validate before the value is modelled
*
* @param mixed $value The field value
* @param string|null $field The field key
* @param string|null $table The table
*
* @return bool
* @since 3.2.0
*/
protected function validateBefore(&$value, ?string $field = null, ?string $table = null): bool
{
// only strings or numbers allowed
if (StringHelper::check($value) || is_numeric($value))
{
return true;
}
// check if we allow empty
elseif ($this->getAllowEmpty() && empty($value))
{
return true;
}
// remove empty values
return false;
}
/**
* Validate after the value is modelled
*
* @param mixed $value The field value
* @param string|null $field The field key
* @param string|null $table The table
*
* @return bool
* @since 3.2.0
*/
protected function validateAfter(&$value, ?string $field = null, ?string $table = null): bool
{
// only strings or numbers allowed
if (StringHelper::check($value) || ArrayHelper::check($value, true) || ObjectHelper::check($value) || is_numeric($value))
{
return true;
}
// check if we allow empty
elseif ($this->getAllowEmpty() && empty($value))
{
return true;
}
// remove empty values
return false;
}
}

View File

@@ -0,0 +1,118 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Model;
use JCB\Joomla\Utilities\StringHelper;
use JCB\Joomla\Utilities\ArrayHelper;
use JCB\Joomla\Utilities\ObjectHelper;
use JCB\Joomla\Interfaces\ModelInterface;
use JCB\Joomla\Abstraction\Model;
/**
* Power Model Update or Insert
*
* @since 3.2.0
*/
final class Upsert extends Model implements ModelInterface
{
/**
* Model the value
* Example: $this->value(value, 'field_key', 'table_name');
*
* @param mixed $value The value to model
* @param string $field The field key
* @param string|null $table The table
*
* @return mixed
* @since 3.2.0
*/
public function value($value, string $field, ?string $table = null)
{
// set the table name
if (empty($table))
{
$table = $this->getTable();
}
// check if this is a valid table
if (($store = $this->table->get($table, $field, 'store')) !== null)
{
// open the value based on the store method
switch($store)
{
case 'base64':
$value = base64_encode((string) $value);
break;
case 'json':
$value = json_encode($value, JSON_FORCE_OBJECT);
break;
}
}
return $value;
}
/**
* Validate before the value is modelled
*
* @param mixed $value The field value
* @param string|null $field The field key
* @param string|null $table The table
*
* @return bool
* @since 3.2.0
*/
protected function validateBefore(&$value, ?string $field = null, ?string $table = null): bool
{
// check values
if (StringHelper::check($value) || ArrayHelper::check($value, true) || ObjectHelper::check($value) || is_numeric($value))
{
return true;
}
// check if we allow empty
elseif ($this->getAllowEmpty() && empty($value))
{
return true;
}
// remove empty values
return false;
}
/**
* Validate after the value is modelled
*
* @param mixed $value The field value
* @param string|null $field The field key
* @param string|null $table The table
*
* @return bool
* @since 3.2.0
*/
protected function validateAfter(&$value, ?string $field = null, ?string $table = null): bool
{
// only strings or numbers allowed
if (StringHelper::check($value) || is_numeric($value))
{
return true;
}
// check if we allow empty
elseif ($this->getAllowEmpty() && empty($value))
{
return true;
}
// remove empty values
return false;
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,200 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Service;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use JCB\Joomla\Data\Action\Load;
use JCB\Joomla\Data\Action\Insert;
use JCB\Joomla\Data\Action\Update;
use JCB\Joomla\Data\Action\Delete;
use JCB\Joomla\Data\Item;
use JCB\Joomla\Data\Items;
use JCB\Joomla\Data\Subform;
use JCB\Joomla\Data\MultiSubform;
/**
* Data Service Provider
*
* @since 3.2.0
*/
class Data implements ServiceProviderInterface
{
/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
* @since 3.2.0
*/
public function register(Container $container)
{
$container->alias(Load::class, 'Data.Load')
->share('Data.Load', [$this, 'getLoad'], true);
$container->alias(Insert::class, 'Data.Insert')
->share('Data.Insert', [$this, 'getInsert'], true);
$container->alias(Update::class, 'Data.Update')
->share('Data.Update', [$this, 'getUpdate'], true);
$container->alias(Delete::class, 'Data.Delete')
->share('Data.Delete', [$this, 'getDelete'], true);
$container->alias(Item::class, 'Data.Item')
->share('Data.Item', [$this, 'getItem'], true);
$container->alias(Items::class, 'Data.Items')
->share('Data.Items', [$this, 'getItems'], true);
$container->alias(Subform::class, 'Data.Subform')
->share('Data.Subform', [$this, 'getSubform'], true);
$container->alias(MultiSubform::class, 'Data.MultiSubform')
->share('Data.MultiSubform', [$this, 'getMultiSubform'], true);
}
/**
* Get The Load Class.
*
* @param Container $container The DI container.
*
* @return Load
* @since 3.2.0
*/
public function getLoad(Container $container): Load
{
return new Load(
$container->get('Model.Load'),
$container->get('Load')
);
}
/**
* Get The Insert Class.
*
* @param Container $container The DI container.
*
* @return Insert
* @since 3.2.0
*/
public function getInsert(Container $container): Insert
{
return new Insert(
$container->get('Model.Upsert'),
$container->get('Insert')
);
}
/**
* Get The Update Class.
*
* @param Container $container The DI container.
*
* @return Update
* @since 3.2.0
*/
public function getUpdate(Container $container): Update
{
return new Update(
$container->get('Model.Upsert'),
$container->get('Update')
);
}
/**
* Get The Delete Class.
*
* @param Container $container The DI container.
*
* @return Delete
* @since 3.2.0
*/
public function getDelete(Container $container): Delete
{
return new Delete(
$container->get('Delete')
);
}
/**
* Get The Item Class.
*
* @param Container $container The DI container.
*
* @return Item
* @since 3.2.0
*/
public function getItem(Container $container): Item
{
return new Item(
$container->get('Data.Load'),
$container->get('Data.Insert'),
$container->get('Data.Update'),
$container->get('Data.Delete'),
$container->get('Load')
);
}
/**
* Get The Items Class.
*
* @param Container $container The DI container.
*
* @return Items
* @since 3.2.0
*/
public function getItems(Container $container): Items
{
return new Items(
$container->get('Data.Load'),
$container->get('Data.Insert'),
$container->get('Data.Update'),
$container->get('Data.Delete'),
$container->get('Load')
);
}
/**
* Get The Subform Class.
*
* @param Container $container The DI container.
*
* @return Subform
* @since 3.2.0
*/
public function getSubform(Container $container): Subform
{
return new Subform(
$container->get('Data.Items')
);
}
/**
* Get The MultiSubform Class.
*
* @param Container $container The DI container.
*
* @return MultiSubform
* @since 3.2.0
*/
public function getMultiSubform(Container $container): MultiSubform
{
return new MultiSubform(
$container->get('Data.Subform')
);
}
}

View File

@@ -0,0 +1,105 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Service;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use JCB\Joomla\Database\Load;
use JCB\Joomla\Database\Insert;
use JCB\Joomla\Database\Update;
use JCB\Joomla\Database\Delete;
/**
* Database Service Provider
*
* @since 3.2.0
*/
class Database implements ServiceProviderInterface
{
/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
* @since 3.2.0
*/
public function register(Container $container)
{
$container->alias(Load::class, 'Load')
->share('Load', [$this, 'getLoad'], true);
$container->alias(Insert::class, 'Insert')
->share('Insert', [$this, 'getInsert'], true);
$container->alias(Update::class, 'Update')
->share('Update', [$this, 'getUpdate'], true);
$container->alias(Delete::class, 'Delete')
->share('Delete', [$this, 'getDelete'], true);
}
/**
* Get the Core Load Database
*
* @param Container $container The DI container.
*
* @return Load
* @since 3.2.0
*/
public function getLoad(Container $container): Load
{
return new Load();
}
/**
* Get the Core Insert Database
*
* @param Container $container The DI container.
*
* @return Insert
* @since 3.2.0
*/
public function getInsert(Container $container): Insert
{
return new Insert();
}
/**
* Get the Core Update Database
*
* @param Container $container The DI container.
*
* @return Update
* @since 3.2.0
*/
public function getUpdate(Container $container): Update
{
return new Update();
}
/**
* Get the Core Delete Database
*
* @param Container $container The DI container.
*
* @return Delete
* @since 3.2.2
*/
public function getDelete(Container $container): Delete
{
return new Delete();
}
}

View File

@@ -0,0 +1,75 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Service;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use JCB\Joomla\Model\Load;
use JCB\Joomla\Model\Upsert;
/**
* Model Service Provider
*
* @since 3.2.0
*/
class Model implements ServiceProviderInterface
{
/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
* @since 3.2.0
*/
public function register(Container $container)
{
$container->alias(Load::class, 'Model.Load')
->share('Model.Load', [$this, 'getLoad'], true);
$container->alias(Upsert::class, 'Model.Upsert')
->share('Model.Upsert', [$this, 'getUpsert'], true);
}
/**
* Get The Load Class.
*
* @param Container $container The DI container.
*
* @return Load
* @since 3.2.0
*/
public function getLoad(Container $container): Load
{
return new Load(
$container->get('Table')
);
}
/**
* Get The Upsert Class.
*
* @param Container $container The DI container.
*
* @return Upsert
* @since 3.2.0
*/
public function getUpsert(Container $container): Upsert
{
return new Upsert(
$container->get('Table')
);
}
}

View File

@@ -0,0 +1,73 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Service;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use JCB\Joomla\Subformpower\Table as DataTable;
use JCB\Joomla\Subformpower\Table\Schema;
/**
* Table Service Provider
*
* @since 3.2.2
*/
class Table implements ServiceProviderInterface
{
/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
* @since 3.2.2
*/
public function register(Container $container)
{
$container->alias(DataTable::class, 'Table')
->share('Table', [$this, 'getTable'], true);
$container->alias(Schema::class, 'Table.Schema')
->share('Table.Schema', [$this, 'getSchema'], true);
}
/**
* Get The Subformpower Data Table Class.
*
* @param Container $container The DI container.
*
* @return DataTable
* @since 3.2.2
*/
public function getTable(Container $container): DataTable
{
return new DataTable();
}
/**
* Get The Schema Class.
*
* @param Container $container The DI container.
*
* @return Schema
* @since 3.2.2
*/
public function getSchema(Container $container): Schema
{
return new Schema(
$container->get('Table')
);
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,243 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Subformpower;
use JCB\Joomla\Interfaces\Tableinterface;
use JCB\Joomla\Abstraction\BaseTable;
/**
* Subformpower Tables
*
* @since 3.2.0
*/
final class Table extends BaseTable implements Tableinterface
{
/**
* All areas/views/tables with their field details
*
* @var array
* @since 3.2.0
**/
protected array $tables = [
'country' => [
'name' => [
'name' => 'name',
'label' => 'COM_SUBFORMPOWER_COUNTRY_NAME_LABEL',
'type' => 'text',
'title' => true,
'list' => 'countries',
'store' => NULL,
'tab_name' => 'Details',
'db' => [
'type' => 'VARCHAR(255)',
'default' => '',
'null_switch' => 'NOT NULL',
'unique_key' => false,
'key' => true,
],
],
'phonecode' => [
'name' => 'phonecode',
'label' => 'COM_SUBFORMPOWER_COUNTRY_PHONECODE_LABEL',
'type' => 'text',
'title' => false,
'list' => 'countries',
'store' => NULL,
'tab_name' => 'Details',
'db' => [
'type' => 'VARCHAR(255)',
'default' => '',
'null_switch' => 'NOT NULL',
'unique_key' => false,
'key' => false,
],
],
'isothree' => [
'name' => 'isothree',
'label' => 'COM_SUBFORMPOWER_COUNTRY_ISOTHREE_LABEL',
'type' => 'text',
'title' => false,
'list' => 'countries',
'store' => NULL,
'tab_name' => 'Details',
'db' => [
'type' => 'VARCHAR(255)',
'default' => '',
'null_switch' => 'NOT NULL',
'unique_key' => false,
'key' => false,
],
],
'timezone' => [
'name' => 'timezone',
'label' => 'COM_SUBFORMPOWER_COUNTRY_TIMEZONE_LABEL',
'type' => 'text',
'title' => false,
'list' => 'countries',
'store' => NULL,
'tab_name' => 'Details',
'db' => [
'type' => 'VARCHAR(255)',
'default' => '',
'null_switch' => 'NOT NULL',
'unique_key' => false,
'key' => false,
],
],
'numcode' => [
'name' => 'numcode',
'label' => 'COM_SUBFORMPOWER_COUNTRY_NUMCODE_LABEL',
'type' => 'text',
'title' => false,
'list' => 'countries',
'store' => NULL,
'tab_name' => 'Details',
'db' => [
'type' => 'VARCHAR(255)',
'default' => '',
'null_switch' => 'NOT NULL',
'unique_key' => false,
'key' => false,
],
],
'iso' => [
'name' => 'iso',
'label' => 'COM_SUBFORMPOWER_COUNTRY_ISO_LABEL',
'type' => 'text',
'title' => false,
'list' => 'countries',
'store' => NULL,
'tab_name' => 'Details',
'db' => [
'type' => 'VARCHAR(255)',
'default' => '',
'null_switch' => 'NOT NULL',
'unique_key' => false,
'key' => false,
],
],
'guid' => [
'name' => 'guid',
'label' => 'COM_SUBFORMPOWER_COUNTRY_GUID_LABEL',
'type' => 'text',
'title' => false,
'list' => 'countries',
'store' => NULL,
'tab_name' => 'publishing',
'db' => [
'type' => 'VARCHAR(36)',
'default' => '',
'null_switch' => 'NOT NULL',
'unique_key' => false,
'key' => true,
],
],
'access' => [
'name' => 'access',
'label' => 'Access',
'type' => 'accesslevel',
'title' => false,
'store' => NULL,
'tab_name' => NULL,
'db' => [
'type' => 'INT(10) unsigned',
'default' => '0',
'key' => true,
'null_switch' => 'NOT NULL',
],
],
],
'currency' => [
'name' => [
'name' => 'name',
'label' => 'COM_SUBFORMPOWER_CURRENCY_NAME_LABEL',
'type' => 'text',
'title' => true,
'list' => 'currencies',
'store' => NULL,
'tab_name' => 'Details',
'db' => [
'type' => 'VARCHAR(255)',
'default' => '',
'null_switch' => 'NOT NULL',
'unique_key' => false,
'key' => true,
],
],
'symbol' => [
'name' => 'symbol',
'label' => 'COM_SUBFORMPOWER_CURRENCY_SYMBOL_LABEL',
'type' => 'text',
'title' => false,
'list' => 'currencies',
'store' => NULL,
'tab_name' => 'Details',
'db' => [
'type' => 'VARCHAR(255)',
'default' => '',
'null_switch' => 'NULL',
'unique_key' => false,
'key' => false,
],
],
'country' => [
'name' => 'country',
'label' => 'COM_SUBFORMPOWER_CURRENCY_COUNTRY_LABEL',
'type' => 'countries',
'title' => false,
'list' => 'currencies',
'store' => NULL,
'tab_name' => 'Details',
'db' => [
'type' => 'VARCHAR(36)',
'default' => '',
'null_switch' => 'NOT NULL',
'unique_key' => false,
'key' => true,
],
],
'guid' => [
'name' => 'guid',
'label' => 'COM_SUBFORMPOWER_CURRENCY_GUID_LABEL',
'type' => 'text',
'title' => false,
'list' => 'currencies',
'store' => NULL,
'tab_name' => 'publishing',
'db' => [
'type' => 'VARCHAR(36)',
'default' => '',
'null_switch' => 'NOT NULL',
'unique_key' => false,
'key' => true,
],
],
'access' => [
'name' => 'access',
'label' => 'Access',
'type' => 'accesslevel',
'title' => false,
'store' => NULL,
'tab_name' => NULL,
'db' => [
'type' => 'INT(10) unsigned',
'default' => '0',
'key' => true,
'null_switch' => 'NOT NULL',
],
],
],
];
}

View File

@@ -0,0 +1,52 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Subformpower\Table;
use JCB\Joomla\Subformpower\Table;
use JCB\Joomla\Interfaces\SchemaInterface;
use JCB\Joomla\Abstraction\Schema as ExtendingSchema;
/**
* Subformpower Tables Schema
*
* @since 3.2.1
*/
final class Schema extends ExtendingSchema implements SchemaInterface
{
/**
* Constructor.
*
* @param Table $table The Table Class.
*
* @since 3.2.1
*/
public function __construct(?Table $table = null)
{
$table ??= new Table;
parent::__construct($table);
}
/**
* Get the targeted component code
*
* @return string
* @since 3.2.1
*/
protected function getCode(): string
{
return 'subformpower';
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,107 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2020
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Utilities;
/**
* Some array tricks helper
*
* @since 3.0.9
*/
abstract class ArrayHelper
{
/**
* Check if have an array with a length
*
* @input array The array to check
*
* @returns int|false number of items in array on success
*
* @since 3.2.0
*/
public static function check($array, $removeEmptyString = false)
{
if (is_array($array) && ($nr = count((array) $array)) > 0)
{
// also make sure the empty strings are removed
if ($removeEmptyString)
{
$array = array_filter($array);
if ($array === [])
{
return false;
}
return count($array);
}
return $nr;
}
return false;
}
/**
* Merge an array of array's
*
* @input array The arrays you would like to merge
*
* @returns array|null merged array on success
*
* @since 3.0.9
*/
public static function merge($arrays): ?array
{
if(self::check($arrays))
{
$merged = [];
foreach ($arrays as $array)
{
if (self::check($array))
{
$merged = array_merge($merged, $array);
}
}
return $merged;
}
return null;
}
/**
* Check if arrays intersect
*
* @input array The first array
* @input array The second array
*
* @returns bool true if intersect else false
*
* @since 3.1.1
*/
public static function intersect($a_array, $b_array): bool
{
// flip the second array
$b_array = array_flip($b_array);
// loop the first array
foreach ($a_array as $v)
{
if (isset($b_array[$v]))
{
return true;
}
}
return false;
}
}

View File

@@ -0,0 +1,296 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2020
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Utilities\Component;
use Joomla\CMS\Factory;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\Input\Input;
use Joomla\Registry\Registry;
use JCB\Joomla\Utilities\String\NamespaceHelper;
/**
* Some component helper
*
* @since 3.0.11
*/
abstract class Helper
{
/**
* The current option
*
* @var string|null
* @since 3.0.11
*/
public static ?string $option = null;
/**
* The component manifest list cache
*
* @var array
* @since 3.2.0
*/
public static array $manifest = [];
/**
* The component params list cache
*
* @var Registry[]
* @since 3.0.11
*/
protected static array $params = [];
/**
* Gets the parameter object for the component
*
* @param string|null $option The option for the component.
*
* @return Registry A Registry object.
* @see Registry
* @since 3.0.11
*/
public static function getParams(?string $option = null): Registry
{
// check that we have an option
if (empty($option))
{
$option = self::getOption();
}
// get global value
if (!isset(self::$params[$option]) || !self::$params[$option] instanceof Registry)
{
self::$params[$option] = ComponentHelper::getParams($option);
}
return self::$params[$option];
}
/**
* Set the component option
*
* @param string|null $option The option
*
* @return void
* @since 3.2.0
*/
public static function setOption(?string $option): void
{
self::$option = $option;
}
/**
* Get the component option
*
* @param string|null $default The default return value if none is found
*
* @return string|null A component option
* @since 3.0.11
*/
public static function getOption(?string $default = 'empty'): ?string
{
if (empty(self::$option))
{
// get the option from the url input
self::$option = (new Input)->getString('option', null);
}
if (empty(self::$option))
{
$app = Factory::getApplication();
// Check if the getInput method exists in the application object
if (method_exists($app, 'getInput'))
{
// get the option from the application
self::$option = $app->getInput()->getCmd('option', $default);
}
else
{
// Use the default value if getInput method does not exist
self::$option = $default;
}
}
return self::$option;
}
/**
* Gets the component code name
*
* @param string|null $option The option for the component.
* @param string|null $default The default return value if none is found
*
* @return string|null A component code name
* @since 3.0.11
*/
public static function getCode(?string $option = null, ?string $default = null): ?string
{
// check that we have an option
if (empty($option))
{
$option = self::getOption();
}
// option with com_
if (is_string($option) && strpos($option, 'com_') === 0)
{
return strtolower(trim(substr($option, 4)));
}
return $default;
}
/**
* Gets the component abstract helper class
*
* @param string|null $option The option for the component.
* @param string|null $default The default return value if none is found
*
* @return string|null A component helper name
*
* @since 3.0.11
*/
public static function get(?string $option = null, ?string $default = null): ?string
{
// check that we have an option
// and get the code name from it
if (($code_name = self::getCode($option, null)) !== null)
{
// we build the helper class name
$helper_name = '\\' . \ucfirst($code_name) . 'Helper';
// check if class exist
if (class_exists($helper_name))
{
return $helper_name;
}
// try loading namespace
if (($namespace = self::getNamespace($option)) !== null)
{
$name = \ucfirst($code_name) . 'Helper';
$namespace_helper = '\\' . $namespace . '\Administrator\Helper\\' . NamespaceHelper::safeSegment($name); // TODO target site or admin locations not just admin...
if (class_exists($namespace_helper))
{
return $namespace_helper;
}
}
}
return $default;
}
/**
* Gets the component namespace if set
*
* @param string|null $option The option for the component.
* @param string|null $default The default return value if none is found
*
* @return string|null A component namespace
*
* @since 3.0.11
*/
public static function getNamespace(?string $option = null): ?string
{
$manifest = self::getManifest($option);
return $manifest->namespace ?? null;
}
/**
* Gets the component abstract helper class
*
* @param string|null $option The option for the component.
* @param string|null $default The default return value if none is found
*
* @return object|null A component helper name
*
* @since 3.0.11
*/
public static function getManifest(?string $option = null): ?object
{
if ($option === null
&& ($option = self::getOption($option)) === null)
{
return null;
}
// get global manifest_cache values
if (!isset(self::$manifest[$option]))
{
$db = Factory::getDbo();
$query = $db->getQuery(true);
$query->select($db->quoteName('manifest_cache'))
->from($db->quoteName('#__extensions'))
->where($db->quoteName('type') . ' = ' . $db->quote('component'))
->where($db->quoteName('element') . ' LIKE ' . $db->quote($option));
$db->setQuery($query);
try {
$manifest = $db->loadResult();
self::$manifest[$option] = json_decode($manifest);
} catch (\Exception $e) {
// Handle the database error appropriately.
self::$manifest[$option] = null;
}
}
return self::$manifest[$option];
}
/**
* Check if the helper class of this component has a method
*
* @param string $method The method name to search for
* @param string|null $option The option for the component.
*
* @return bool true if method exist
*
* @since 3.0.11
*/
public static function methodExists(string $method, ?string $option = null): bool
{
// get the helper class
return ($helper = self::get($option, null)) !== null &&
method_exists($helper, $method);
}
/**
* Check if the helper class of this component has a method, and call it with the arguments
*
* @param string $method The method name to search for
* @param array $arguments The arguments for function.
* @param string|null $option The option for the component.
*
* @return mixed return whatever the method returns or null
* @since 3.2.0
*/
public static function _(string $method, array $arguments = [], ?string $option = null)
{
// get the helper class
if (($helper = self::get($option, null)) !== null &&
method_exists($helper, $method))
{
// we know this is not ideal...
// so we need to move these
// functions to their own classes
return call_user_func_array([$helper, $method], $arguments);
}
return null;
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,187 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Utilities;
use Joomla\CMS\Form\FormHelper as JoomlaFormHelper;
use Joomla\CMS\Form\FormField;
/**
* Form Helper
*
* @since 3.2.0
*/
abstract class FormHelper
{
/**
* get the field xml
*
* @param array $attributes The array of attributes
* @param array $options The options to apply to the XML element
*
* @return \SimpleXMLElement|null
* @since 3.2.0
*/
public static function xml(array $attributes, ?array $options = null): ?\SimpleXMLElement
{
// make sure we have attributes and a type value
if (ArrayHelper::check($attributes))
{
// start field xml
$XML = new \SimpleXMLElement('<field/>');
// load the attributes
self::attributes($XML, $attributes);
// check if we have options
if (ArrayHelper::check($options))
{
// load the options
self::options($XML, $options);
}
// return the field xml
return $XML;
}
return null;
}
/**
* xmlAppend
*
* @param \SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param mixed $node A SimpleXMLElement node to append to the XML element reference,
* or a stdClass object containing a comment attribute to be injected
* before the XML node and a fieldXML attribute containing a SimpleXMLElement
*
* @return void
* @since 3.2.0
*/
public static function append(\SimpleXMLElement &$xml, $node)
{
if (!$node)
{
// element was not returned
return;
}
if ($node instanceof \stdClass)
{
if (property_exists($node, 'comment'))
{
self::comment($xml, $node->comment);
}
if (property_exists($node, 'fieldXML'))
{
self::append($xml, $node->fieldXML);
}
}
elseif ($node instanceof \SimpleXMLElement)
{
$domXML = \dom_import_simplexml($xml);
$domNode = \dom_import_simplexml($node);
$domXML->appendChild($domXML->ownerDocument->importNode($domNode, true));
$xml = \simplexml_import_dom($domXML);
}
}
/**
* xmlComment
*
* @param \SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param string $comment The comment to inject
*
* @return void
* @since 3.2.0
*/
public static function comment(\SimpleXMLElement &$xml, string $comment)
{
$domXML = \dom_import_simplexml($xml);
$domComment = new \DOMComment($comment);
$nodeTarget = $domXML->ownerDocument->importNode($domComment, true);
$domXML->appendChild($nodeTarget);
$xml = \simplexml_import_dom($domXML);
}
/**
* xmlAddAttributes
*
* @param \SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param array $attributes The attributes to apply to the XML element
*
* @return void
* @since 3.2.0
*/
public static function attributes(\SimpleXMLElement &$xml, array $attributes = [])
{
foreach ($attributes as $key => $value)
{
$xml->addAttribute($key, $value ?? '');
}
}
/**
* xmlAddOptions
*
* @param \SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param array $options The options to apply to the XML element
*
* @return void
* @since 3.2.0
*/
public static function options(\SimpleXMLElement &$xml, array $options = [])
{
foreach ($options as $key => $value)
{
$addOption = $xml->addChild('option');
$addOption->addAttribute('value', $key ?? '');
$addOption[] = $value;
}
}
/**
* get the field object
*
* @param array $attributes The array of attributes
* @param string $default The default of the field
* @param array $options The options to apply to the XML element
*
* @return FormField|null
* @since 3.2.0
*/
public static function field(array $attributes, string $default = '', ?array $options = null): ?FormField
{
// make sure we have attributes and a type value
if (ArrayHelper::check($attributes) && isset($attributes['type']))
{
// get field type
if (($field = JoomlaFormHelper::loadFieldType($attributes['type'], true)) === false)
{
return null;
}
// get field xml
$XML = self::xml($attributes, $options);
// setup the field
$field->setup($XML, $default);
// return the field object
return $field;
}
return null;
}
}

View File

@@ -0,0 +1,258 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2020
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Utilities;
use Joomla\CMS\Factory;
use JCB\Joomla\Utilities\Component\Helper;
use JCB\Joomla\Data\Factory as Data;
/**
* Some easy get...
*
* @since 3.0.9
*/
abstract class GetHelper
{
/**
* Get a Variable
*
* @param string|null $table The table from which to get the variable
* @param mixed $where The value where
* @param string $whereString The target/field string where/name
* @param string $what The return field
* @param string $operator The operator between $whereString/field and $where/value
* @param string $main The component in which the table is found
*
* @return mixed string/int/float
* @since 3.0.9
*
* @deprecated 5.1 Use Data::_('Load')->table($table)->value(...)
*/
public static function var(?string $table = null, $where = null,
string $whereString = 'user', string $what = 'id',
string $operator = '=', ?string $main = null)
{
if(empty($where))
{
$where = Factory::getUser()->id;
}
if(empty($main))
{
$main = Helper::getCode();
}
// Get a db connection.
$db = Factory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName(array($what)));
if (empty($table))
{
$query->from($db->quoteName('#__' . $main));
}
else
{
$query->from($db->quoteName('#__' . $main . '_' . $table));
}
if (is_numeric($where))
{
$query->where($db->quoteName($whereString) . ' ' . $operator . ' ' . (int) $where);
}
elseif (is_string($where))
{
$query->where($db->quoteName($whereString) . ' ' . $operator . ' ' . $db->quote((string)$where));
}
else
{
return false;
}
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
return $db->loadResult();
}
return false;
}
/**
* Get array of variables
*
* @param string|null $table The table from which to get the variables
* @param mixed $where The value where
* @param string $whereString The target/field string where/name
* @param string $what The return field
* @param string $operator The operator between $whereString/field and $where/value
* @param string $main The component in which the table is found
* @param bool $unique The switch to return a unique array
*
* @return array|null
* @since 3.0.9
*
* @deprecated 5.1 Use Data::_('Load')->table($table)->values(...)
*/
public static function vars(?string $table = null, $where = null,
string $whereString = 'user', string $what = 'id', string $operator = 'IN',
?string $main = null, bool $unique = true): ?array
{
if(empty($where))
{
$where = Factory::getUser()->id;
}
if($main === null)
{
$main = Helper::getCode();
}
if (!ArrayHelper::check($where) && $where > 0)
{
$where = [$where];
}
if (ArrayHelper::check($where))
{
// prep main <-- why? well if $main='' is empty then $table can be categories or users
if (StringHelper::check($main))
{
$main = '_' . ltrim($main, '_');
}
// Get a db connection.
$db = Factory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName(array($what)));
if (empty($table))
{
$query->from($db->quoteName('#__' . $main));
}
else
{
$query->from($db->quoteName('#_' . $main . '_' . $table));
}
// add strings to array search
if ('IN_STRINGS' === $operator || 'NOT IN_STRINGS' === $operator)
{
$query->where($db->quoteName($whereString) . ' ' . str_replace('_STRINGS', '', $operator) . ' ("' . implode('","', $where) . '")');
}
else
{
$query->where($db->quoteName($whereString) . ' ' . $operator . ' (' . implode(',', $where) . ')');
}
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
if ($unique)
{
return array_unique($db->loadColumn());
}
return $db->loadColumn();
}
}
return null;
}
/**
* get all strings between two other strings
*
* @param string $content The content to search
* @param string $start The starting value
* @param string $end The ending value
*
* @return array|null On success
* @since 3.0.9
*/
public static function allBetween(string $content, string $start, string $end): ?array
{
// reset bucket
$bucket = [];
for ($i = 0; ; $i++)
{
// search for string
$found = self::between($content, $start, $end);
if (StringHelper::check($found))
{
// add to bucket
$bucket[] = $found;
// build removal string
$remove = $start . $found . $end;
// remove from content
$content = str_replace($remove, '', $content);
}
else
{
break;
}
// safety catch
if ($i == 500)
{
break;
}
}
// only return unique array of values
if (ArrayHelper::check($bucket))
{
return array_unique($bucket);
}
return null;
}
/**
* get a string between two other strings
*
* @param string $content The content to search
* @param string $start The starting value
* @param string $end The ending value
* @param string $default The default value if none found
*
* @return string On success / empty string on failure
* @since 3.0.9
*/
public static function between(string $content, string $start, string $end, string $default = ''): string
{
$array = explode($start, $content);
if (isset($array[1]) && strpos($array[1], $end) !== false)
{
$array = explode($end, $array[1]);
// return string found between
return $array[0];
}
return $default;
}
}

View File

@@ -0,0 +1,215 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2020
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Utilities;
use Joomla\CMS\Factory;
use JCB\Joomla\Utilities\Component\Helper;
/**
* Global Unique ID Helper
*
* @since 3.0.9
*/
abstract class GuidHelper
{
/**
* Returns a GUIDv4 string
*
* Thanks to Dave Pearson (and other)
* https://www.php.net/manual/en/function.com-create-guid.php#119168
*
* Uses the best cryptographically secure method
* for all supported platforms with fallback to an older,
* less secure version.
*
* @param bool $trim
*
* @return string
*
* @since 3.0.9
*/
public static function get(bool $trim = true): string
{
// Windows
if (function_exists('com_create_guid'))
{
if ($trim)
{
return trim(com_create_guid(), '{}');
}
return com_create_guid();
}
// set the braces if needed
$lbrace = $trim ? "" : chr(123); // "{"
$rbrace = $trim ? "" : chr(125); // "}"
// OSX/Linux
if (function_exists('openssl_random_pseudo_bytes'))
{
$data = openssl_random_pseudo_bytes(16);
$data[6] = chr( ord($data[6]) & 0x0f | 0x40); // set version to 0100
$data[8] = chr( ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10
return $lbrace . vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)) . $lbrace;
}
// Fallback (PHP 4.2+)
mt_srand((double) microtime() * 10000);
$charid = strtolower( md5( uniqid( rand(), true)));
$hyphen = chr(45); // "-"
$guidv4 = $lbrace.
substr($charid, 0, 8). $hyphen.
substr($charid, 8, 4). $hyphen.
substr($charid, 12, 4). $hyphen.
substr($charid, 16, 4). $hyphen.
substr($charid, 20, 12).
$rbrace;
return $guidv4;
}
/**
* Validate the Globally Unique Identifier ( and check if table already has this identifier)
*
* @param string $guid
* @param string|null $table
* @param int $id
* @param string|null $component
*
* @return bool
*
* @since 3.0.9
*/
public static function valid($guid, ?string $table = null, int $id = 0, ?string $component = null): bool
{
// check if we have a string
if (self::validate($guid))
{
// check if table already has this identifier
if (StringHelper::check($table))
{
// check that we have the component code name
if (!is_string($component))
{
$component = (string) Helper::getCode();
}
// Get the database object and a new query object.
$db = Factory::getDbo();
$query = $db->getQuery(true);
$query->select('COUNT(*)')
->from('#__' . (string) $component . '_' . (string) $table)
->where($db->quoteName('guid') . ' = ' . $db->quote($guid));
// remove this item from the list
if ($id > 0)
{
$query->where($db->quoteName('id') . ' <> ' . (int) $id);
}
// Set and query the database.
$db->setQuery($query);
$duplicate = (bool) $db->loadResult();
if ($duplicate)
{
return false;
}
}
return true;
}
return false;
}
/**
* get the item by guid in a table
*
* @param string $guid
* @param string $table
* @param string|array $what
* @param string|null $component
*
* @return mixed
*
* @since 3.0.9
*/
public static function item($guid, $table, $what = 'a.id', ?string $component = null)
{
// check if we have a string
// check if table already has this identifier
if (self::validate($guid) && StringHelper::check($table))
{
// check that we have the component code name
if (!is_string($component))
{
$component = (string) Helper::getCode();
}
// Get the database object and a new query object.
$db = Factory::getDbo();
$query = $db->getQuery(true);
if (ArrayHelper::check($what))
{
$query->select($db->quoteName($what));
}
else
{
$query->select($what);
}
$query->from($db->quoteName('#__' . (string) $component . '_' . (string) $table, 'a'))
->where($db->quoteName('a.guid') . ' = ' . $db->quote($guid));
// Set and query the database.
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
if (ArrayHelper::check($what) || $what === 'a.*')
{
return $db->loadObject();
}
else
{
return $db->loadResult();
}
}
}
return null;
}
/**
* Validate the Globally Unique Identifier
*
* Thanks to Lewie
* https://stackoverflow.com/a/1515456/1429677
*
* @param string $guid
*
* @return bool
*
* @since 3.0.9
*/
protected static function validate($guid)
{
// check if we have a string
if (StringHelper::check($guid))
{
return preg_match("/^(\{)?[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}(?(1)\})$/i", $guid);
}
return false;
}
}

View File

@@ -0,0 +1,101 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2020
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Utilities;
/**
* The json checker
*
* @since 3.0.9
*/
abstract class JsonHelper
{
/**
* Check if you have a json string
*
* @input string $string The json string to check
*
* @returns bool true on success
*
* @since 3.0.9
*/
public static function check($string): bool
{
if (StringHelper::check($string))
{
json_decode((string) $string);
return (json_last_error() === JSON_ERROR_NONE);
}
return false;
}
/**
* Convert a json object to a string
*
* @input string $value The json string to convert
*
* @returns a string
*
* @since 3.0.9
*/
public static function string($value, $separator = ", ", $table = null, $id = 'id', $name = 'name')
{
// do some table foot work
$external = false;
if (is_string($table) && strpos((string) $table, '#__') !== false)
{
$external = true;
$table = str_replace('#__', '', (string) $table);
}
// check if string is JSON
$result = json_decode((string) $value, true);
if (json_last_error() === JSON_ERROR_NONE)
{
// is JSON
if (ArrayHelper::check($result))
{
if (StringHelper::check($table))
{
$names = [];
foreach ($result as $val)
{
if ($external)
{
if ($_name = GetHelper::var(null, $val, $id, $name, '=', $table))
{
$names[] = $_name;
}
}
else
{
if ($_name = GetHelper::var($table, $val, $id, $name))
{
$names[] = $_name;
}
}
}
if (ArrayHelper::check($names))
{
return (string) implode($separator, $names);
}
}
return (string) implode($separator, $result);
}
return (string) json_decode((string) $value);
}
return $value;
}
}

View File

@@ -0,0 +1,78 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2020
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Utilities;
/**
* Some object tricks
*
* @since 3.0.9
*/
abstract class ObjectHelper
{
/**
* Check if have an object with a length
*
* @input object The object to check
*
* @returns bool true on success
*
* @since 3.0.9
*/
public static function check($object)
{
if (is_object($object))
{
return count((array) $object) > 0;
}
return false;
}
/**
* Compare two objects for equality based on their property values.
*
* Note that this method works only for simple objects that don't
* contain any nested objects or resource references. If you need
* to compare more complex objects, you may need to use a
* more advanced method such as serialization or reflection.
*
* @param object|null $obj1 The first object to compare.
* @param object|null $obj2 The second object to compare.
*
* @return bool True if the objects have the same key-value pairs and false otherwise.
*/
public static function equal(?object $obj1, ?object $obj2): bool
{
// if any is null we return false as that means there is a none object
// we are not comparing null but objects
// but we allow null as some objects while
// not instantiate are still null
if (is_null($obj1) || is_null($obj2))
{
return false;
}
// Convert the objects to arrays of their property values using get_object_vars.
$array1 = get_object_vars($obj1);
$array2 = get_object_vars($obj2);
// Compare the arrays using array_diff_assoc to detect any differences.
$diff1 = array_diff_assoc($array1, $array2);
$diff2 = array_diff_assoc($array2, $array1);
// If the arrays have the same key-value pairs, they will have no differences, so return true.
return empty($diff1) && empty($diff2);
}
}

View File

@@ -0,0 +1,78 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2020
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Utilities\String;
use JCB\Joomla\Utilities\StringHelper;
/**
* Control the naming of a namespace helper
*
* @since 3.0.9
*/
abstract class NamespaceHelper
{
/**
* Making namespace safe
*
* @param string $string The namespace string you would like to make safe
*
* @return string on success
* @since 3.0.9
*/
public static function safe(string $string): string
{
// Remove leading and trailing backslashes
$string = trim($string, '\\');
// Split the string into namespace segments
$segments = explode('\\', $string);
// make each segment safe
$segments = array_map([self::class, 'safeSegment'], $segments);
// Join the namespace segments back together
return implode('\\', $segments);
}
/**
* Making one namespace segment safe
*
* @param string $string The namespace segment string you would like to make safe
*
* @return string on success
* @since 3.0.9
*/
public static function safeSegment(string $string): string
{
// Check if segment starts with a number
if (preg_match("/^\d/", $string))
{
// Extract the starting number(s)
preg_match("/^\d+/", $string, $matches);
if (isset($matches[0]))
{
$numberWord = StringHelper::numbers($matches[0]);
$string = str_replace($matches[0], $numberWord, $string);
}
}
// Transliterate string TODO: look again as this makes it lowercase
// $segment = StringHelper::transliterate($segment);
// Make sure segment only contains valid characters
return preg_replace("/[^A-Za-z0-9]/", '', $string);
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,416 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2020
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace JCB\Joomla\Utilities;
use Joomla\Filter\InputFilter;
use Joomla\CMS\Language\Language;
use JCB\Joomla\Utilities\Component\Helper;
/**
* Some string tricks
*
* @since 3.0.9
*/
abstract class StringHelper
{
/**
* The Main Active Language
*
* @var string
*
* @since 3.0.9
*/
public static $langTag;
/**
* Check if we have a string with a length
*
* @input string $string The string to check
*
* @returns bool true on success
*
* @since 3.0.9
*/
public static function check($string): bool
{
return is_string($string) && strlen($string) > 0;
}
/**
* Shorten a string
*
* @input string The sting that you would like to shorten
*
* @returns string on success
*
* @since 3.2.0
*/
public static function shorten($string, $length = 40, $addTip = true)
{
if (self::check($string))
{
$initial = strlen((string) $string);
$words = preg_split('/([\s\n\r]+)/', (string) $string, -1, PREG_SPLIT_DELIM_CAPTURE);
$words_count = count((array)$words);
$word_length = 0;
$last_word = 0;
for (; $last_word < $words_count; ++$last_word)
{
$word_length += strlen($words[$last_word]);
if ($word_length > $length)
{
break;
}
}
$newString = implode(array_slice($words, 0, $last_word));
$final = strlen($newString);
if ($initial !== $final && $addTip)
{
$title = self::shorten($string, 400 , false);
return '<span class="hasTip" title="' . $title . '" style="cursor:help">' . trim($newString) . '...</span>';
}
elseif ($initial !== $final && !$addTip)
{
return trim($newString) . '...';
}
}
return $string;
}
/**
* Making strings safe (various ways)
*
* @input string The you would like to make safe
*
* @returns string on success
*
* @since 3.0.9
*/
public static function safe($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true)
{
if ($replaceNumbers === true)
{
// remove all numbers and replace with English text version (works well only up to millions)
$string = self::numbers($string);
}
// 0nly continue if we have a string
if (self::check($string))
{
// create file name without the extension that is safe
if ($type === 'filename')
{
// make sure VDM is not in the string
$string = str_replace('VDM', 'vDm', (string) $string);
// Remove anything which isn't a word, whitespace, number
// or any of the following caracters -_()
// If you don't need to handle multi-byte characters
// you can use preg_replace rather than mb_ereg_replace
// Thanks @Łukasz Rysiak!
// $string = mb_ereg_replace("([^\w\s\d\-_\(\)])", '', $string);
$string = preg_replace("([^\w\s\d\-_\(\)])", '', $string);
// http://stackoverflow.com/a/2021729/1429677
return preg_replace('/\s+/', ' ', (string) $string);
}
// remove all other characters
$string = trim((string) $string);
$string = preg_replace('/'.$spacer.'+/', ' ', $string);
$string = preg_replace('/\s+/', ' ', $string);
// Transliterate string
$string = self::transliterate($string);
// remove all and keep only characters
if ($keepOnlyCharacters)
{
$string = preg_replace("/[^A-Za-z ]/", '', (string) $string);
}
// keep both numbers and characters
else
{
$string = preg_replace("/[^A-Za-z0-9 ]/", '', (string) $string);
}
// select final adaptations
if ($type === 'L' || $type === 'strtolower')
{
// replace white space with underscore
$string = preg_replace('/\s+/', (string) $spacer, (string) $string);
// default is to return lower
return strtolower($string);
}
elseif ($type === 'W')
{
// return a string with all first letter of each word uppercase(no underscore)
return ucwords(strtolower($string));
}
elseif ($type === 'w' || $type === 'word')
{
// return a string with all lowercase(no underscore)
return strtolower($string);
}
elseif ($type === 'Ww' || $type === 'Word')
{
// return a string with first letter of the first word uppercase and all the rest lowercase(no underscore)
return ucfirst(strtolower($string));
}
elseif ($type === 'WW' || $type === 'WORD')
{
// return a string with all the uppercase(no underscore)
return strtoupper($string);
}
elseif ($type === 'U' || $type === 'strtoupper')
{
// replace white space with underscore
$string = preg_replace('/\s+/', (string) $spacer, $string);
// return all upper
return strtoupper($string);
}
elseif ($type === 'F' || $type === 'ucfirst')
{
// replace white space with underscore
$string = preg_replace('/\s+/', (string) $spacer, $string);
// return with first character to upper
return ucfirst(strtolower($string));
}
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
{
// convert all words to first letter uppercase
$string = ucwords(strtolower($string));
// remove white space
$string = preg_replace('/\s+/', '', $string);
// now return first letter lowercase
return lcfirst($string);
}
// return string
return $string;
}
// not a string
return '';
}
/**
* Convert none English strings to code usable string
*
* @input an string
*
* @returns a string
*
* @since 3.0.9
*/
public static function transliterate($string)
{
// set tag only once
if (!self::check(self::$langTag))
{
// get global value
self::$langTag = Helper::getParams()->get('language', 'en-GB');
}
// Transliterate on the language requested
$lang = Language::getInstance(self::$langTag);
return $lang->transliterate($string);
}
/**
* make sure a string is HTML save
*
* @input an html string
*
* @returns a string
*
* @since 3.0.9
*/
public static function html($var, $charset = 'UTF-8', $shorten = false, $length = 40, $addTip = true)
{
if (self::check($var))
{
$filter = new InputFilter();
$string = $filter->clean(
html_entity_decode(
htmlentities(
(string) $var,
ENT_COMPAT,
$charset
)
),
'HTML'
);
if ($shorten)
{
return self::shorten($string, $length, $addTip);
}
return $string;
}
else
{
return '';
}
}
/**
* Convert all int in a string to an English word string
*
* @input an string with numbers
*
* @returns a string
*
* @since 3.0.9
*/
public static function numbers($string)
{
// set numbers array
$numbers = [];
$search_replace= [];
// first get all numbers
preg_match_all('!\d+!', (string) $string, $numbers);
// check if we have any numbers
if (isset($numbers[0]) && ArrayHelper::check($numbers[0]))
{
foreach ($numbers[0] as $number)
{
$search_replace[$number] = self::number((int)$number);
}
// now replace numbers in string
$string = str_replace(array_keys($search_replace), array_values($search_replace), (string) $string);
// check if we missed any, strange if we did.
return self::numbers($string);
}
// return the string with no numbers remaining.
return $string;
}
/**
* Convert an integer into an English word string
* Thanks to Tom Nicholson <http://php.net/manual/en/function.strval.php#41988>
*
* @input an int
* @returns a string
*
* @since 3.0.9
*/
public static function number($x)
{
$nwords = array( "zero", "one", "two", "three", "four", "five", "six", "seven",
"eight", "nine", "ten", "eleven", "twelve", "thirteen",
"fourteen", "fifteen", "sixteen", "seventeen", "eighteen",
"nineteen", "twenty", 30 => "thirty", 40 => "forty",
50 => "fifty", 60 => "sixty", 70 => "seventy", 80 => "eighty",
90 => "ninety" );
if(!is_numeric($x))
{
$w = $x;
}
elseif(fmod($x, 1) != 0)
{
$w = $x;
}
else
{
if($x < 0)
{
$w = 'minus ';
$x = -$x;
}
else
{
$w = '';
// ... now $x is a non-negative integer.
}
if($x < 21) // 0 to 20
{
$w .= $nwords[$x];
}
elseif($x < 100) // 21 to 99
{
$w .= $nwords[10 * floor($x/10)];
$r = fmod($x, 10);
if($r > 0)
{
$w .= ' ' . $nwords[$r];
}
}
elseif($x < 1000) // 100 to 999
{
$w .= $nwords[floor($x/100)] .' hundred';
$r = fmod($x, 100);
if($r > 0)
{
$w .= ' and '. self::number($r);
}
}
elseif($x < 1000000) // 1000 to 999999
{
$w .= self::number(floor($x/1000)) .' thousand';
$r = fmod($x, 1000);
if($r > 0)
{
$w .= ' ';
if($r < 100)
{
$w .= 'and ';
}
$w .= self::number($r);
}
}
else // millions
{
$w .= self::number(floor($x/1000000)) .' million';
$r = fmod($x, 1000000);
if($r > 0)
{
$w .= ' ';
if($r < 100)
{
$w .= 'and ';
}
$w .= self::number($r);
}
}
}
return $w;
}
/**
* Random Key
*
* @input int $size The size of the random string
*
* @returns a string
* @since 3.0.9
*/
public static function random(int $size): string
{
$bag = "abcefghijknopqrstuwxyzABCDDEFGHIJKLLMMNOPQRSTUVVWXYZabcddefghijkllmmnopqrstuvvwxyzABCEFGHIJKNOPQRSTUWXYZ";
$key = [];
$bagsize = strlen($bag) - 1;
for ($i = 0; $i < $size; $i++)
{
$get = rand(0, $bagsize);
$key[] = $bag[$get];
}
return implode($key);
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,9 @@
# Apache 2.4+
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
# Apache 2.0-2.2
<IfModule !mod_authz_core.c>
Deny from all
</IfModule>

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<system.web>
<authorization>
<deny users="*" />
</authorization>
</system.web>
</configuration>

View File

@@ -0,0 +1,9 @@
# Apache 2.4+
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
# Apache 2.0-2.2
<IfModule !mod_authz_core.c>
Deny from all
</IfModule>

View File

@@ -0,0 +1,7 @@
<?php
// autoload.php @generated by Composer
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit6afe6fcd54e00add00a5fe0e5fb044f9::getLoader();

View File

@@ -0,0 +1,445 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see http://www.php-fig.org/psr/psr-0/
* @see http://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
// PSR-4
private $prefixLengthsPsr4 = array();
private $prefixDirsPsr4 = array();
private $fallbackDirsPsr4 = array();
// PSR-0
private $prefixesPsr0 = array();
private $fallbackDirsPsr0 = array();
private $useIncludePath = false;
private $classMap = array();
private $classMapAuthoritative = false;
private $missingClasses = array();
private $apcuPrefix;
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', $this->prefixesPsr0);
}
return array();
}
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array $classMap Class to filename map
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*/
public function add($prefix, $paths, $prepend = false)
{
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
(array) $paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
(array) $paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
(array) $paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
(array) $paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
(array) $paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
(array) $paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 base directories
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
}
/**
* Unregisters this instance as an autoloader.
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return bool|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
return true;
}
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
}
return $file;
}
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*/
function includeFile($file)
{
include $file;
}

View File

@@ -0,0 +1,56 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Composer
Upstream-Contact: Jordi Boggiano <j.boggiano@seld.be>
Source: https://github.com/composer/composer
Files: *
Copyright: 2016, Nils Adermann <naderman@naderman.de>
2016, Jordi Boggiano <j.boggiano@seld.be>
License: Expat
Files: src/Composer/Util/TlsHelper.php
Copyright: 2016, Nils Adermann <naderman@naderman.de>
2016, Jordi Boggiano <j.boggiano@seld.be>
2013, Evan Coury <me@evancoury.com>
License: Expat and BSD-2-Clause
License: BSD-2-Clause
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
.
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License: Expat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,240 @@
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Complex\\Complex' => $vendorDir . '/markbaker/complex/classes/src/Complex.php',
'Complex\\Exception' => $vendorDir . '/markbaker/complex/classes/src/Exception.php',
'Matrix\\Builder' => $vendorDir . '/markbaker/matrix/classes/src/Builder.php',
'Matrix\\Exception' => $vendorDir . '/markbaker/matrix/classes/src/Exception.php',
'Matrix\\Functions' => $vendorDir . '/markbaker/matrix/classes/src/Functions.php',
'Matrix\\Matrix' => $vendorDir . '/markbaker/matrix/classes/src/Matrix.php',
'Matrix\\Operators\\Addition' => $vendorDir . '/markbaker/matrix/classes/src/Operators/Addition.php',
'Matrix\\Operators\\DirectSum' => $vendorDir . '/markbaker/matrix/classes/src/Operators/DirectSum.php',
'Matrix\\Operators\\Division' => $vendorDir . '/markbaker/matrix/classes/src/Operators/Division.php',
'Matrix\\Operators\\Multiplication' => $vendorDir . '/markbaker/matrix/classes/src/Operators/Multiplication.php',
'Matrix\\Operators\\Operator' => $vendorDir . '/markbaker/matrix/classes/src/Operators/Operator.php',
'Matrix\\Operators\\Subtraction' => $vendorDir . '/markbaker/matrix/classes/src/Operators/Subtraction.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Calculation' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Category' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Category.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Database' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTime.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Engine\\CyclicReferenceStack' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Engine\\Logger' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Logger.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Exception' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Exception.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\ExceptionHandler' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ExceptionHandler.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Financial' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\FormulaParser' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaParser.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\FormulaToken' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaToken.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Functions' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Logical' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\TextData' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Token\\Stack' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Token/Stack.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\AdvancedValueBinder' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\Cell' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\Coordinate' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\DataType' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataType.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\DataValidation' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataValidation.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\DataValidator' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataValidator.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\DefaultValueBinder' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DefaultValueBinder.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\Hyperlink' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Hyperlink.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\IValueBinder' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/IValueBinder.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\StringValueBinder' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/StringValueBinder.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\Axis' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Axis.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\Chart' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Chart.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\DataSeries' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeries.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\DataSeriesValues' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeriesValues.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\Exception' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Exception.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\GridLines' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/GridLines.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\Layout' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Layout.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\Legend' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Legend.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\PlotArea' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/PlotArea.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\Properties' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Properties.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\Renderer\\IRenderer' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/IRenderer.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\Renderer\\JpGraph' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/JpGraph.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\Title' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Title.php',
'PhpOffice\\PhpSpreadsheet\\Collection\\Cells' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Cells.php',
'PhpOffice\\PhpSpreadsheet\\Collection\\CellsFactory' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/CellsFactory.php',
'PhpOffice\\PhpSpreadsheet\\Collection\\Memory' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory.php',
'PhpOffice\\PhpSpreadsheet\\Comment' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Comment.php',
'PhpOffice\\PhpSpreadsheet\\Document\\Properties' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Properties.php',
'PhpOffice\\PhpSpreadsheet\\Document\\Security' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Security.php',
'PhpOffice\\PhpSpreadsheet\\Exception' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Exception.php',
'PhpOffice\\PhpSpreadsheet\\HashTable' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/HashTable.php',
'PhpOffice\\PhpSpreadsheet\\Helper\\Html' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Html.php',
'PhpOffice\\PhpSpreadsheet\\Helper\\Migrator' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Migrator.php',
'PhpOffice\\PhpSpreadsheet\\Helper\\Sample' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Sample.php',
'PhpOffice\\PhpSpreadsheet\\IComparable' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IComparable.php',
'PhpOffice\\PhpSpreadsheet\\IOFactory' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IOFactory.php',
'PhpOffice\\PhpSpreadsheet\\NamedRange' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/NamedRange.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\BaseReader' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Csv' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\DefaultReadFilter' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/DefaultReadFilter.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Exception' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Exception.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Gnumeric' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Html' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Html.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\IReadFilter' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReadFilter.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\IReader' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReader.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Ods' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Ods\\Properties' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/Properties.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Security\\XmlScanner' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Security/XmlScanner.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Slk' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Slk.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\Color' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\Color\\BIFF5' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color/BIFF5.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\Color\\BIFF8' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color/BIFF8.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\Color\\BuiltIn' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color/BuiltIn.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\ErrorCode' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/ErrorCode.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\Escher' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Escher.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\MD5' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/MD5.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\RC4' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/RC4.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\Style\\Border' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Style/Border.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\Style\\FillPattern' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Style/FillPattern.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\AutoFilter' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\BaseParserClass' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/BaseParserClass.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\Chart' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Chart.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\ColumnAndRowAttributes' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ColumnAndRowAttributes.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\ConditionalStyles' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\DataValidations' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/DataValidations.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\Hyperlinks' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Hyperlinks.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\PageSetup' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/PageSetup.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\Properties' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Properties.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\SheetViewOptions' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/SheetViewOptions.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\SheetViews' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/SheetViews.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\Styles' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Styles.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\Theme' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Theme.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xml' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml.php',
'PhpOffice\\PhpSpreadsheet\\ReferenceHelper' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php',
'PhpOffice\\PhpSpreadsheet\\RichText\\ITextElement' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/ITextElement.php',
'PhpOffice\\PhpSpreadsheet\\RichText\\RichText' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/RichText.php',
'PhpOffice\\PhpSpreadsheet\\RichText\\Run' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/Run.php',
'PhpOffice\\PhpSpreadsheet\\RichText\\TextElement' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/TextElement.php',
'PhpOffice\\PhpSpreadsheet\\Settings' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Settings.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\CodePage' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/CodePage.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Date' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Drawing' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Drawing.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Escher' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DgContainer' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DgContainer\\SpgrContainer' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DgContainer\\SpgrContainer\\SpContainer' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DggContainer' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer\\BSE' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer\\BSE\\Blip' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\File' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/File.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Font' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Font.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\JAMA\\CholeskyDecomposition' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/CholeskyDecomposition.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\JAMA\\EigenvalueDecomposition' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\JAMA\\LUDecomposition' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/LUDecomposition.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\JAMA\\Matrix' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/Matrix.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\JAMA\\QRDecomposition' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\JAMA\\SingularValueDecomposition' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\OLE' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\OLERead' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLERead.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\OLE\\ChainedBlockStream' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\OLE\\PPS' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\OLE\\PPS\\File' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/File.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\OLE\\PPS\\Root' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\PasswordHasher' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/PasswordHasher.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\StringHelper' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/StringHelper.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\TimeZone' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/TimeZone.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Trend\\BestFit' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/BestFit.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Trend\\ExponentialBestFit' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Trend\\LinearBestFit' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LinearBestFit.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Trend\\LogarithmicBestFit' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Trend\\PolynomialBestFit' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Trend\\PowerBestFit' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PowerBestFit.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Trend\\Trend' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\XMLWriter' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Xls' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Xls.php',
'PhpOffice\\PhpSpreadsheet\\Spreadsheet' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Alignment' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Alignment.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Border' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Border.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Borders' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Borders.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Color' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Color.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Conditional' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Conditional.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Fill' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Fill.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Font' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Font.php',
'PhpOffice\\PhpSpreadsheet\\Style\\NumberFormat' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Protection' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Protection.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Style' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Style.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Supervisor' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Supervisor.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\AutoFilter' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\AutoFilter\\Column' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\AutoFilter\\Column\\Rule' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\BaseDrawing' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/BaseDrawing.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\CellIterator' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/CellIterator.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\Column' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Column.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\ColumnCellIterator' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\ColumnDimension' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnDimension.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\ColumnIterator' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnIterator.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\Dimension' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Dimension.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\Drawing' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Drawing.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\Drawing\\Shadow' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\HeaderFooter' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/HeaderFooter.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\HeaderFooterDrawing' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\Iterator' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Iterator.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\MemoryDrawing' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\PageMargins' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/PageMargins.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\PageSetup' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/PageSetup.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\Protection' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Protection.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\Row' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Row.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\RowCellIterator' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowCellIterator.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\RowDimension' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowDimension.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\RowIterator' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowIterator.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\SheetView' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/SheetView.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\Worksheet' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\BaseWriter' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Csv' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Csv.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Exception' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Exception.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Html' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Html.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\IWriter' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/IWriter.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Cell\\Comment' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Cell/Comment.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Content' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Content.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Meta' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Meta.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\MetaInf' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/MetaInf.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Mimetype' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Mimetype.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Settings' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Settings.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Styles' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Styles.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Thumbnails' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Thumbnails.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\WriterPart' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/WriterPart.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Pdf' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\Dompdf' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\Mpdf' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Mpdf.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\Tcpdf' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Tcpdf.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\BIFFwriter' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/BIFFwriter.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Escher' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Escher.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Font' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Font.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Parser' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Parser.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Workbook' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Workbook.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Worksheet' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Worksheet.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Xf' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Xf.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Chart' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Chart.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Comments' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Comments.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\ContentTypes' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\DocProps' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/DocProps.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Drawing' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Drawing.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Rels' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Rels.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\RelsRibbon' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/RelsRibbon.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\RelsVBA' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/RelsVBA.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\StringTable' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/StringTable.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Style' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Style.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Theme' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Theme.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Workbook' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Workbook.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Worksheet' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\WriterPart' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/WriterPart.php',
'Psr\\SimpleCache\\CacheException' => $vendorDir . '/psr/simple-cache/src/CacheException.php',
'Psr\\SimpleCache\\CacheInterface' => $vendorDir . '/psr/simple-cache/src/CacheInterface.php',
'Psr\\SimpleCache\\InvalidArgumentException' => $vendorDir . '/psr/simple-cache/src/InvalidArgumentException.php',
);

View File

@@ -0,0 +1,67 @@
<?php
// autoload_files.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'abede361264e2ae69ec1eee813a101af' => $vendorDir . '/markbaker/complex/classes/src/functions/abs.php',
'21a5860fbef5be28db5ddfbc3cca67c4' => $vendorDir . '/markbaker/complex/classes/src/functions/acos.php',
'1546e3f9d127f2a9bb2d1b6c31c26ef1' => $vendorDir . '/markbaker/complex/classes/src/functions/acosh.php',
'd2516f7f4fba5ea5905f494b4a8262e0' => $vendorDir . '/markbaker/complex/classes/src/functions/acot.php',
'4511163d560956219b96882c0980b65e' => $vendorDir . '/markbaker/complex/classes/src/functions/acoth.php',
'c361f5616dc2a8da4fa3e137077cd4ea' => $vendorDir . '/markbaker/complex/classes/src/functions/acsc.php',
'02d68920fc98da71991ce569c91df0f6' => $vendorDir . '/markbaker/complex/classes/src/functions/acsch.php',
'88e19525eae308b4a6aa3419364875d3' => $vendorDir . '/markbaker/complex/classes/src/functions/argument.php',
'60e8e2d0827b58bfc904f13957e51849' => $vendorDir . '/markbaker/complex/classes/src/functions/asec.php',
'13d2f040713999eab66c359b4d79871d' => $vendorDir . '/markbaker/complex/classes/src/functions/asech.php',
'838ab38beb32c68a79d3cd2c007d5a04' => $vendorDir . '/markbaker/complex/classes/src/functions/asin.php',
'bb28eccd0f8f008333a1b3c163d604ac' => $vendorDir . '/markbaker/complex/classes/src/functions/asinh.php',
'9e483de83558c98f7d3feaa402c78cb3' => $vendorDir . '/markbaker/complex/classes/src/functions/atan.php',
'36b74b5b765ded91ee58c8ee3c0e85e3' => $vendorDir . '/markbaker/complex/classes/src/functions/atanh.php',
'05c15ee9510da7fd6bf6136f436500c0' => $vendorDir . '/markbaker/complex/classes/src/functions/conjugate.php',
'd3208dfbce2505e370788f9f22f6785f' => $vendorDir . '/markbaker/complex/classes/src/functions/cos.php',
'141cf1fb3a3046f8b64534b0ebab33ca' => $vendorDir . '/markbaker/complex/classes/src/functions/cosh.php',
'be660df75fd0dbe7fa7c03b7434b3294' => $vendorDir . '/markbaker/complex/classes/src/functions/cot.php',
'01e31ea298a51bc9e91517e3ce6b9e76' => $vendorDir . '/markbaker/complex/classes/src/functions/coth.php',
'803ddd97f7b1da68982a7b087c3476f6' => $vendorDir . '/markbaker/complex/classes/src/functions/csc.php',
'3001cdfd101ec3c32da34ee43c2e149b' => $vendorDir . '/markbaker/complex/classes/src/functions/csch.php',
'77b2d7629ef2a93fabb8c56754a91051' => $vendorDir . '/markbaker/complex/classes/src/functions/exp.php',
'4a4471296dec796c21d4f4b6552396a9' => $vendorDir . '/markbaker/complex/classes/src/functions/inverse.php',
'c3e9897e1744b88deb56fcdc39d34d85' => $vendorDir . '/markbaker/complex/classes/src/functions/ln.php',
'a83cacf2de942cff288de15a83afd26d' => $vendorDir . '/markbaker/complex/classes/src/functions/log2.php',
'6a861dacc9ee2f3061241d4c7772fa21' => $vendorDir . '/markbaker/complex/classes/src/functions/log10.php',
'4d2522d968c8ba78d6c13548a1b4200e' => $vendorDir . '/markbaker/complex/classes/src/functions/negative.php',
'fd587ca933fc0447fa5ab4843bdd97f7' => $vendorDir . '/markbaker/complex/classes/src/functions/pow.php',
'383ef01c62028fc78cd4388082fce3c2' => $vendorDir . '/markbaker/complex/classes/src/functions/rho.php',
'150fbd1b95029dc47292da97ecab9375' => $vendorDir . '/markbaker/complex/classes/src/functions/sec.php',
'549abd9bae174286d660bdaa07407c68' => $vendorDir . '/markbaker/complex/classes/src/functions/sech.php',
'6bfbf5eaea6b17a0ed85cb21ba80370c' => $vendorDir . '/markbaker/complex/classes/src/functions/sin.php',
'22efe13f1a497b8e199540ae2d9dc59c' => $vendorDir . '/markbaker/complex/classes/src/functions/sinh.php',
'e90135ab8e787795a509ed7147de207d' => $vendorDir . '/markbaker/complex/classes/src/functions/sqrt.php',
'bb0a7923ffc6a90919cd64ec54ff06bc' => $vendorDir . '/markbaker/complex/classes/src/functions/tan.php',
'2d302f32ce0fd4e433dd91c5bb404a28' => $vendorDir . '/markbaker/complex/classes/src/functions/tanh.php',
'24dd4658a952171a4ee79218c4f9fd06' => $vendorDir . '/markbaker/complex/classes/src/functions/theta.php',
'e49b7876281d6f5bc39536dde96d1f4a' => $vendorDir . '/markbaker/complex/classes/src/operations/add.php',
'47596e02b43cd6da7700134fd08f88cf' => $vendorDir . '/markbaker/complex/classes/src/operations/subtract.php',
'883af48563631547925fa4c3b48ead07' => $vendorDir . '/markbaker/complex/classes/src/operations/multiply.php',
'f190e3308e6ca23234a2875edc985c03' => $vendorDir . '/markbaker/complex/classes/src/operations/divideby.php',
'ac9e33ce6841aa5bf5d16d465a2f03a7' => $vendorDir . '/markbaker/complex/classes/src/operations/divideinto.php',
'9d8e013a5160a09477beb8e44f8ae97b' => $vendorDir . '/markbaker/matrix/classes/src/functions/adjoint.php',
'6e78d1bdea6248d6aa117229efae50f2' => $vendorDir . '/markbaker/matrix/classes/src/functions/antidiagonal.php',
'4623d87924d94f5412fe5afbf1cef31d' => $vendorDir . '/markbaker/matrix/classes/src/functions/cofactors.php',
'901fd1f6950a637ca85f66b701a45e13' => $vendorDir . '/markbaker/matrix/classes/src/functions/determinant.php',
'83057abc0e4acc99ba80154ee5d02a49' => $vendorDir . '/markbaker/matrix/classes/src/functions/diagonal.php',
'07b7fd7a434451149b4fd477fca0ce06' => $vendorDir . '/markbaker/matrix/classes/src/functions/identity.php',
'c8d43b340583e07ae89f2a3baef2cf89' => $vendorDir . '/markbaker/matrix/classes/src/functions/inverse.php',
'499bb10ed7a3aee2ba4c09a31a85e8d1' => $vendorDir . '/markbaker/matrix/classes/src/functions/minors.php',
'1cad2e6414d652e8b1c64e8967f6f37d' => $vendorDir . '/markbaker/matrix/classes/src/functions/trace.php',
'95a7f134ac17161d07def442b3b737e8' => $vendorDir . '/markbaker/matrix/classes/src/functions/transpose.php',
'b3a6bc628377118d4b4b8ba08d1eb949' => $vendorDir . '/markbaker/matrix/classes/src/operations/add.php',
'5fef6d0e407f3f8887266dfa4a6c534c' => $vendorDir . '/markbaker/matrix/classes/src/operations/directsum.php',
'684ba247e1385946e3babdaa054119de' => $vendorDir . '/markbaker/matrix/classes/src/operations/subtract.php',
'aa53dcba601214d17ad405b7c291b7e8' => $vendorDir . '/markbaker/matrix/classes/src/operations/multiply.php',
'75c79eb1b25749b05a47976f32b0d8a2' => $vendorDir . '/markbaker/matrix/classes/src/operations/divideby.php',
'6ab8ad87a734f276a6bcd5a0fe1289be' => $vendorDir . '/markbaker/matrix/classes/src/operations/divideinto.php',
);

View File

@@ -0,0 +1,9 @@
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);

View File

@@ -0,0 +1,13 @@
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
'PhpOffice\\PhpSpreadsheet\\' => array($vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet'),
'Matrix\\' => array($vendorDir . '/markbaker/matrix/classes/src'),
'Complex\\' => array($vendorDir . '/markbaker/complex/classes/src'),
);

View File

@@ -0,0 +1,70 @@
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit6afe6fcd54e00add00a5fe0e5fb044f9
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit6afe6fcd54e00add00a5fe0e5fb044f9', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit6afe6fcd54e00add00a5fe0e5fb044f9', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit6afe6fcd54e00add00a5fe0e5fb044f9::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit6afe6fcd54e00add00a5fe0e5fb044f9::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire6afe6fcd54e00add00a5fe0e5fb044f9($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequire6afe6fcd54e00add00a5fe0e5fb044f9($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
}
}

View File

@@ -0,0 +1,348 @@
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit6afe6fcd54e00add00a5fe0e5fb044f9
{
public static $files = array (
'abede361264e2ae69ec1eee813a101af' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/abs.php',
'21a5860fbef5be28db5ddfbc3cca67c4' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acos.php',
'1546e3f9d127f2a9bb2d1b6c31c26ef1' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acosh.php',
'd2516f7f4fba5ea5905f494b4a8262e0' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acot.php',
'4511163d560956219b96882c0980b65e' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acoth.php',
'c361f5616dc2a8da4fa3e137077cd4ea' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acsc.php',
'02d68920fc98da71991ce569c91df0f6' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acsch.php',
'88e19525eae308b4a6aa3419364875d3' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/argument.php',
'60e8e2d0827b58bfc904f13957e51849' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/asec.php',
'13d2f040713999eab66c359b4d79871d' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/asech.php',
'838ab38beb32c68a79d3cd2c007d5a04' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/asin.php',
'bb28eccd0f8f008333a1b3c163d604ac' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/asinh.php',
'9e483de83558c98f7d3feaa402c78cb3' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/atan.php',
'36b74b5b765ded91ee58c8ee3c0e85e3' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/atanh.php',
'05c15ee9510da7fd6bf6136f436500c0' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/conjugate.php',
'd3208dfbce2505e370788f9f22f6785f' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/cos.php',
'141cf1fb3a3046f8b64534b0ebab33ca' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/cosh.php',
'be660df75fd0dbe7fa7c03b7434b3294' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/cot.php',
'01e31ea298a51bc9e91517e3ce6b9e76' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/coth.php',
'803ddd97f7b1da68982a7b087c3476f6' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/csc.php',
'3001cdfd101ec3c32da34ee43c2e149b' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/csch.php',
'77b2d7629ef2a93fabb8c56754a91051' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/exp.php',
'4a4471296dec796c21d4f4b6552396a9' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/inverse.php',
'c3e9897e1744b88deb56fcdc39d34d85' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/ln.php',
'a83cacf2de942cff288de15a83afd26d' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/log2.php',
'6a861dacc9ee2f3061241d4c7772fa21' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/log10.php',
'4d2522d968c8ba78d6c13548a1b4200e' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/negative.php',
'fd587ca933fc0447fa5ab4843bdd97f7' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/pow.php',
'383ef01c62028fc78cd4388082fce3c2' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/rho.php',
'150fbd1b95029dc47292da97ecab9375' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sec.php',
'549abd9bae174286d660bdaa07407c68' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sech.php',
'6bfbf5eaea6b17a0ed85cb21ba80370c' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sin.php',
'22efe13f1a497b8e199540ae2d9dc59c' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sinh.php',
'e90135ab8e787795a509ed7147de207d' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sqrt.php',
'bb0a7923ffc6a90919cd64ec54ff06bc' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/tan.php',
'2d302f32ce0fd4e433dd91c5bb404a28' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/tanh.php',
'24dd4658a952171a4ee79218c4f9fd06' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/theta.php',
'e49b7876281d6f5bc39536dde96d1f4a' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/add.php',
'47596e02b43cd6da7700134fd08f88cf' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/subtract.php',
'883af48563631547925fa4c3b48ead07' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/multiply.php',
'f190e3308e6ca23234a2875edc985c03' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/divideby.php',
'ac9e33ce6841aa5bf5d16d465a2f03a7' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/divideinto.php',
'9d8e013a5160a09477beb8e44f8ae97b' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/adjoint.php',
'6e78d1bdea6248d6aa117229efae50f2' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/antidiagonal.php',
'4623d87924d94f5412fe5afbf1cef31d' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/cofactors.php',
'901fd1f6950a637ca85f66b701a45e13' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/determinant.php',
'83057abc0e4acc99ba80154ee5d02a49' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/diagonal.php',
'07b7fd7a434451149b4fd477fca0ce06' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/identity.php',
'c8d43b340583e07ae89f2a3baef2cf89' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/inverse.php',
'499bb10ed7a3aee2ba4c09a31a85e8d1' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/minors.php',
'1cad2e6414d652e8b1c64e8967f6f37d' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/trace.php',
'95a7f134ac17161d07def442b3b737e8' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/transpose.php',
'b3a6bc628377118d4b4b8ba08d1eb949' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/add.php',
'5fef6d0e407f3f8887266dfa4a6c534c' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/directsum.php',
'684ba247e1385946e3babdaa054119de' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/subtract.php',
'aa53dcba601214d17ad405b7c291b7e8' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/multiply.php',
'75c79eb1b25749b05a47976f32b0d8a2' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/divideby.php',
'6ab8ad87a734f276a6bcd5a0fe1289be' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/divideinto.php',
);
public static $prefixLengthsPsr4 = array (
'P' =>
array (
'Psr\\SimpleCache\\' => 16,
'PhpOffice\\PhpSpreadsheet\\' => 25,
),
'M' =>
array (
'Matrix\\' => 7,
),
'C' =>
array (
'Complex\\' => 8,
),
);
public static $prefixDirsPsr4 = array (
'Psr\\SimpleCache\\' =>
array (
0 => __DIR__ . '/..' . '/psr/simple-cache/src',
),
'PhpOffice\\PhpSpreadsheet\\' =>
array (
0 => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet',
),
'Matrix\\' =>
array (
0 => __DIR__ . '/..' . '/markbaker/matrix/classes/src',
),
'Complex\\' =>
array (
0 => __DIR__ . '/..' . '/markbaker/complex/classes/src',
),
);
public static $classMap = array (
'Complex\\Complex' => __DIR__ . '/..' . '/markbaker/complex/classes/src/Complex.php',
'Complex\\Exception' => __DIR__ . '/..' . '/markbaker/complex/classes/src/Exception.php',
'Matrix\\Builder' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Builder.php',
'Matrix\\Exception' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Exception.php',
'Matrix\\Functions' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions.php',
'Matrix\\Matrix' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Matrix.php',
'Matrix\\Operators\\Addition' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operators/Addition.php',
'Matrix\\Operators\\DirectSum' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operators/DirectSum.php',
'Matrix\\Operators\\Division' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operators/Division.php',
'Matrix\\Operators\\Multiplication' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operators/Multiplication.php',
'Matrix\\Operators\\Operator' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operators/Operator.php',
'Matrix\\Operators\\Subtraction' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operators/Subtraction.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Calculation' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Category' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Category.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Database' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTime.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Engine\\CyclicReferenceStack' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Engine\\Logger' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Logger.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Exception' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Exception.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\ExceptionHandler' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ExceptionHandler.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Financial' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\FormulaParser' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaParser.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\FormulaToken' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaToken.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Functions' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Logical' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\TextData' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData.php',
'PhpOffice\\PhpSpreadsheet\\Calculation\\Token\\Stack' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Token/Stack.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\AdvancedValueBinder' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\Cell' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\Coordinate' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\DataType' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataType.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\DataValidation' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataValidation.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\DataValidator' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataValidator.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\DefaultValueBinder' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DefaultValueBinder.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\Hyperlink' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Hyperlink.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\IValueBinder' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/IValueBinder.php',
'PhpOffice\\PhpSpreadsheet\\Cell\\StringValueBinder' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/StringValueBinder.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\Axis' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Axis.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\Chart' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Chart.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\DataSeries' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeries.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\DataSeriesValues' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeriesValues.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\Exception' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Exception.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\GridLines' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/GridLines.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\Layout' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Layout.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\Legend' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Legend.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\PlotArea' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/PlotArea.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\Properties' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Properties.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\Renderer\\IRenderer' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/IRenderer.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\Renderer\\JpGraph' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/JpGraph.php',
'PhpOffice\\PhpSpreadsheet\\Chart\\Title' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Title.php',
'PhpOffice\\PhpSpreadsheet\\Collection\\Cells' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Cells.php',
'PhpOffice\\PhpSpreadsheet\\Collection\\CellsFactory' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/CellsFactory.php',
'PhpOffice\\PhpSpreadsheet\\Collection\\Memory' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory.php',
'PhpOffice\\PhpSpreadsheet\\Comment' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Comment.php',
'PhpOffice\\PhpSpreadsheet\\Document\\Properties' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Properties.php',
'PhpOffice\\PhpSpreadsheet\\Document\\Security' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Security.php',
'PhpOffice\\PhpSpreadsheet\\Exception' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Exception.php',
'PhpOffice\\PhpSpreadsheet\\HashTable' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/HashTable.php',
'PhpOffice\\PhpSpreadsheet\\Helper\\Html' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Html.php',
'PhpOffice\\PhpSpreadsheet\\Helper\\Migrator' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Migrator.php',
'PhpOffice\\PhpSpreadsheet\\Helper\\Sample' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Sample.php',
'PhpOffice\\PhpSpreadsheet\\IComparable' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IComparable.php',
'PhpOffice\\PhpSpreadsheet\\IOFactory' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IOFactory.php',
'PhpOffice\\PhpSpreadsheet\\NamedRange' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/NamedRange.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\BaseReader' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Csv' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\DefaultReadFilter' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/DefaultReadFilter.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Exception' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Exception.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Gnumeric' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Html' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Html.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\IReadFilter' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReadFilter.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\IReader' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReader.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Ods' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Ods\\Properties' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/Properties.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Security\\XmlScanner' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Security/XmlScanner.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Slk' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Slk.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\Color' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\Color\\BIFF5' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color/BIFF5.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\Color\\BIFF8' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color/BIFF8.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\Color\\BuiltIn' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color/BuiltIn.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\ErrorCode' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/ErrorCode.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\Escher' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Escher.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\MD5' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/MD5.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\RC4' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/RC4.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\Style\\Border' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Style/Border.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xls\\Style\\FillPattern' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Style/FillPattern.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\AutoFilter' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\BaseParserClass' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/BaseParserClass.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\Chart' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Chart.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\ColumnAndRowAttributes' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ColumnAndRowAttributes.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\ConditionalStyles' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\DataValidations' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/DataValidations.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\Hyperlinks' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Hyperlinks.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\PageSetup' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/PageSetup.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\Properties' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Properties.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\SheetViewOptions' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/SheetViewOptions.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\SheetViews' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/SheetViews.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\Styles' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Styles.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\Theme' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Theme.php',
'PhpOffice\\PhpSpreadsheet\\Reader\\Xml' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml.php',
'PhpOffice\\PhpSpreadsheet\\ReferenceHelper' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php',
'PhpOffice\\PhpSpreadsheet\\RichText\\ITextElement' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/ITextElement.php',
'PhpOffice\\PhpSpreadsheet\\RichText\\RichText' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/RichText.php',
'PhpOffice\\PhpSpreadsheet\\RichText\\Run' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/Run.php',
'PhpOffice\\PhpSpreadsheet\\RichText\\TextElement' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/TextElement.php',
'PhpOffice\\PhpSpreadsheet\\Settings' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Settings.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\CodePage' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/CodePage.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Date' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Drawing' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Drawing.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Escher' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DgContainer' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DgContainer\\SpgrContainer' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DgContainer\\SpgrContainer\\SpContainer' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DggContainer' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer\\BSE' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer\\BSE\\Blip' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\File' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/File.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Font' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Font.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\JAMA\\CholeskyDecomposition' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/CholeskyDecomposition.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\JAMA\\EigenvalueDecomposition' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\JAMA\\LUDecomposition' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/LUDecomposition.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\JAMA\\Matrix' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/Matrix.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\JAMA\\QRDecomposition' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\JAMA\\SingularValueDecomposition' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\OLE' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\OLERead' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLERead.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\OLE\\ChainedBlockStream' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\OLE\\PPS' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\OLE\\PPS\\File' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/File.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\OLE\\PPS\\Root' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\PasswordHasher' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/PasswordHasher.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\StringHelper' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/StringHelper.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\TimeZone' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/TimeZone.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Trend\\BestFit' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/BestFit.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Trend\\ExponentialBestFit' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Trend\\LinearBestFit' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LinearBestFit.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Trend\\LogarithmicBestFit' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Trend\\PolynomialBestFit' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Trend\\PowerBestFit' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PowerBestFit.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Trend\\Trend' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\XMLWriter' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php',
'PhpOffice\\PhpSpreadsheet\\Shared\\Xls' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Xls.php',
'PhpOffice\\PhpSpreadsheet\\Spreadsheet' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Alignment' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Alignment.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Border' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Border.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Borders' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Borders.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Color' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Color.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Conditional' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Conditional.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Fill' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Fill.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Font' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Font.php',
'PhpOffice\\PhpSpreadsheet\\Style\\NumberFormat' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Protection' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Protection.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Style' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Style.php',
'PhpOffice\\PhpSpreadsheet\\Style\\Supervisor' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Supervisor.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\AutoFilter' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\AutoFilter\\Column' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\AutoFilter\\Column\\Rule' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\BaseDrawing' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/BaseDrawing.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\CellIterator' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/CellIterator.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\Column' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Column.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\ColumnCellIterator' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\ColumnDimension' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnDimension.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\ColumnIterator' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnIterator.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\Dimension' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Dimension.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\Drawing' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Drawing.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\Drawing\\Shadow' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\HeaderFooter' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/HeaderFooter.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\HeaderFooterDrawing' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\Iterator' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Iterator.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\MemoryDrawing' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\PageMargins' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/PageMargins.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\PageSetup' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/PageSetup.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\Protection' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Protection.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\Row' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Row.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\RowCellIterator' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowCellIterator.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\RowDimension' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowDimension.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\RowIterator' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowIterator.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\SheetView' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/SheetView.php',
'PhpOffice\\PhpSpreadsheet\\Worksheet\\Worksheet' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\BaseWriter' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Csv' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Csv.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Exception' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Exception.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Html' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Html.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\IWriter' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/IWriter.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Cell\\Comment' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Cell/Comment.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Content' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Content.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Meta' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Meta.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\MetaInf' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/MetaInf.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Mimetype' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Mimetype.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Settings' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Settings.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Styles' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Styles.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Thumbnails' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Thumbnails.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\WriterPart' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/WriterPart.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Pdf' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\Dompdf' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\Mpdf' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Mpdf.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\Tcpdf' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Tcpdf.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\BIFFwriter' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/BIFFwriter.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Escher' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Escher.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Font' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Font.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Parser' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Parser.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Workbook' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Workbook.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Worksheet' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Worksheet.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Xf' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Xf.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Chart' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Chart.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Comments' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Comments.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\ContentTypes' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\DocProps' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/DocProps.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Drawing' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Drawing.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Rels' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Rels.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\RelsRibbon' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/RelsRibbon.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\RelsVBA' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/RelsVBA.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\StringTable' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/StringTable.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Style' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Style.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Theme' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Theme.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Workbook' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Workbook.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Worksheet' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\WriterPart' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/WriterPart.php',
'Psr\\SimpleCache\\CacheException' => __DIR__ . '/..' . '/psr/simple-cache/src/CacheException.php',
'Psr\\SimpleCache\\CacheInterface' => __DIR__ . '/..' . '/psr/simple-cache/src/CacheInterface.php',
'Psr\\SimpleCache\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/simple-cache/src/InvalidArgumentException.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit6afe6fcd54e00add00a5fe0e5fb044f9::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit6afe6fcd54e00add00a5fe0e5fb044f9::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit6afe6fcd54e00add00a5fe0e5fb044f9::$classMap;
}, null, ClassLoader::class);
}
}

View File

@@ -0,0 +1,315 @@
[
{
"name": "markbaker/complex",
"version": "1.4.8",
"version_normalized": "1.4.8.0",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPComplex.git",
"reference": "8eaa40cceec7bf0518187530b2e63871be661b72"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/8eaa40cceec7bf0518187530b2e63871be661b72",
"reference": "8eaa40cceec7bf0518187530b2e63871be661b72",
"shasum": ""
},
"require": {
"php": "^5.6.0|^7.0.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
"phpcompatibility/php-compatibility": "^9.0",
"phpdocumentor/phpdocumentor": "2.*",
"phploc/phploc": "2.*",
"phpmd/phpmd": "2.*",
"phpunit/phpunit": "^4.8.35|^5.4.0",
"sebastian/phpcpd": "2.*",
"squizlabs/php_codesniffer": "^3.4.0"
},
"time": "2020-03-11T20:15:49+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Complex\\": "classes/src/"
},
"files": [
"classes/src/functions/abs.php",
"classes/src/functions/acos.php",
"classes/src/functions/acosh.php",
"classes/src/functions/acot.php",
"classes/src/functions/acoth.php",
"classes/src/functions/acsc.php",
"classes/src/functions/acsch.php",
"classes/src/functions/argument.php",
"classes/src/functions/asec.php",
"classes/src/functions/asech.php",
"classes/src/functions/asin.php",
"classes/src/functions/asinh.php",
"classes/src/functions/atan.php",
"classes/src/functions/atanh.php",
"classes/src/functions/conjugate.php",
"classes/src/functions/cos.php",
"classes/src/functions/cosh.php",
"classes/src/functions/cot.php",
"classes/src/functions/coth.php",
"classes/src/functions/csc.php",
"classes/src/functions/csch.php",
"classes/src/functions/exp.php",
"classes/src/functions/inverse.php",
"classes/src/functions/ln.php",
"classes/src/functions/log2.php",
"classes/src/functions/log10.php",
"classes/src/functions/negative.php",
"classes/src/functions/pow.php",
"classes/src/functions/rho.php",
"classes/src/functions/sec.php",
"classes/src/functions/sech.php",
"classes/src/functions/sin.php",
"classes/src/functions/sinh.php",
"classes/src/functions/sqrt.php",
"classes/src/functions/tan.php",
"classes/src/functions/tanh.php",
"classes/src/functions/theta.php",
"classes/src/operations/add.php",
"classes/src/operations/subtract.php",
"classes/src/operations/multiply.php",
"classes/src/operations/divideby.php",
"classes/src/operations/divideinto.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@lange.demon.co.uk"
}
],
"description": "PHP Class for working with complex numbers",
"homepage": "https://github.com/MarkBaker/PHPComplex",
"keywords": [
"complex",
"mathematics"
]
},
{
"name": "markbaker/matrix",
"version": "1.2.0",
"version_normalized": "1.2.0.0",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPMatrix.git",
"reference": "5348c5a67e3b75cd209d70103f916a93b1f1ed21"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/5348c5a67e3b75cd209d70103f916a93b1f1ed21",
"reference": "5348c5a67e3b75cd209d70103f916a93b1f1ed21",
"shasum": ""
},
"require": {
"php": "^5.6.0|^7.0.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
"phpcompatibility/php-compatibility": "dev-master",
"phploc/phploc": "^4",
"phpmd/phpmd": "dev-master",
"phpunit/phpunit": "^5.7",
"sebastian/phpcpd": "^3.0",
"squizlabs/php_codesniffer": "^3.0@dev"
},
"time": "2019-10-06T11:29:25+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Matrix\\": "classes/src/"
},
"files": [
"classes/src/functions/adjoint.php",
"classes/src/functions/antidiagonal.php",
"classes/src/functions/cofactors.php",
"classes/src/functions/determinant.php",
"classes/src/functions/diagonal.php",
"classes/src/functions/identity.php",
"classes/src/functions/inverse.php",
"classes/src/functions/minors.php",
"classes/src/functions/trace.php",
"classes/src/functions/transpose.php",
"classes/src/operations/add.php",
"classes/src/operations/directsum.php",
"classes/src/operations/subtract.php",
"classes/src/operations/multiply.php",
"classes/src/operations/divideby.php",
"classes/src/operations/divideinto.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@lange.demon.co.uk"
}
],
"description": "PHP Class for working with matrices",
"homepage": "https://github.com/MarkBaker/PHPMatrix",
"keywords": [
"mathematics",
"matrix",
"vector"
]
},
{
"name": "phpoffice/phpspreadsheet",
"version": "1.11.0",
"version_normalized": "1.11.0.0",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
"reference": "c2a205e82f9cf1cc9fab86b79e808d86dd680470"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/c2a205e82f9cf1cc9fab86b79e808d86dd680470",
"reference": "c2a205e82f9cf1cc9fab86b79e808d86dd680470",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-dom": "*",
"ext-fileinfo": "*",
"ext-gd": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"ext-xmlreader": "*",
"ext-xmlwriter": "*",
"ext-zip": "*",
"ext-zlib": "*",
"markbaker/complex": "^1.4",
"markbaker/matrix": "^1.2",
"php": "^7.1",
"psr/simple-cache": "^1.0"
},
"require-dev": {
"dompdf/dompdf": "^0.8.3",
"friendsofphp/php-cs-fixer": "^2.16",
"jpgraph/jpgraph": "^4.0",
"mpdf/mpdf": "^8.0",
"phpcompatibility/php-compatibility": "^9.3",
"phpunit/phpunit": "^7.5",
"squizlabs/php_codesniffer": "^3.5",
"tecnickcom/tcpdf": "^6.3"
},
"suggest": {
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
"jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
},
"time": "2020-03-02T13:09:03+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Maarten Balliauw",
"homepage": "https://blog.maartenballiauw.be"
},
{
"name": "Mark Baker",
"homepage": "https://markbakeruk.net"
},
{
"name": "Franck Lefevre",
"homepage": "https://rootslabs.net"
},
{
"name": "Erik Tilt"
},
{
"name": "Adrien Crivelli"
}
],
"description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
"homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
"keywords": [
"OpenXML",
"excel",
"gnumeric",
"ods",
"php",
"spreadsheet",
"xls",
"xlsx"
]
},
{
"name": "psr/simple-cache",
"version": "1.0.1",
"version_normalized": "1.0.1.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/simple-cache.git",
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"time": "2017-10-23T01:57:42+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Psr\\SimpleCache\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interfaces for simple caching",
"keywords": [
"cache",
"caching",
"psr",
"psr-16",
"simple-cache"
]
}
]

View File

@@ -0,0 +1,9 @@
# Apache 2.4+
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
# Apache 2.0-2.2
<IfModule !mod_authz_core.c>
Deny from all
</IfModule>

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,53 @@
<?php
namespace Complex;
/**
*
* Autoloader for Complex classes
*
* @package Complex
* @copyright Copyright (c) 2014 Mark Baker (https://github.com/MarkBaker/PHPComplex)
* @license https://opensource.org/licenses/MIT MIT
*/
class Autoloader
{
/**
* Register the Autoloader with SPL
*
*/
public static function Register()
{
if (function_exists('__autoload')) {
// Register any existing autoloader function with SPL, so we don't get any clashes
spl_autoload_register('__autoload');
}
// Register ourselves with SPL
return spl_autoload_register(['Complex\\Autoloader', 'Load']);
}
/**
* Autoload a class identified by name
*
* @param string $pClassName Name of the object to load
*/
public static function Load($pClassName)
{
if ((class_exists($pClassName, false)) || (strpos($pClassName, 'Complex\\') !== 0)) {
// Either already loaded, or not a Complex class request
return false;
}
$pClassFilePath = __DIR__ . DIRECTORY_SEPARATOR .
'src' . DIRECTORY_SEPARATOR .
str_replace(['Complex\\', '\\'], ['', '/'], $pClassName) .
'.php';
if ((file_exists($pClassFilePath) === false) || (is_readable($pClassFilePath) === false)) {
// Can't load
return false;
}
require($pClassFilePath);
}
}

View File

@@ -0,0 +1,38 @@
<?php
include_once __DIR__ . '/Autoloader.php';
\Complex\Autoloader::Register();
abstract class FilesystemRegexFilter extends RecursiveRegexIterator
{
protected $regex;
public function __construct(RecursiveIterator $it, $regex)
{
$this->regex = $regex;
parent::__construct($it, $regex);
}
}
class FilenameFilter extends FilesystemRegexFilter
{
// Filter files against the regex
public function accept()
{
return (!$this->isFile() || preg_match($this->regex, $this->getFilename()));
}
}
$srcFolder = __DIR__ . DIRECTORY_SEPARATOR . 'src';
$srcDirectory = new RecursiveDirectoryIterator($srcFolder);
$filteredFileList = new FilenameFilter($srcDirectory, '/(?:php)$/i');
$filteredFileList = new FilenameFilter($filteredFileList, '/^(?!.*(Complex|Exception)\.php).*$/i');
foreach (new RecursiveIteratorIterator($filteredFileList) as $file) {
if ($file->isFile()) {
include_once $file;
}
}

View File

@@ -0,0 +1,390 @@
<?php
/**
*
* Class for the management of Complex numbers
*
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
* @license https://opensource.org/licenses/MIT MIT
*/
namespace Complex;
/**
* Complex Number object.
*
* @package Complex
*
* @method float abs()
* @method Complex acos()
* @method Complex acosh()
* @method Complex acot()
* @method Complex acoth()
* @method Complex acsc()
* @method Complex acsch()
* @method float argument()
* @method Complex asec()
* @method Complex asech()
* @method Complex asin()
* @method Complex asinh()
* @method Complex atan()
* @method Complex atanh()
* @method Complex conjugate()
* @method Complex cos()
* @method Complex cosh()
* @method Complex cot()
* @method Complex coth()
* @method Complex csc()
* @method Complex csch()
* @method Complex exp()
* @method Complex inverse()
* @method Complex ln()
* @method Complex log2()
* @method Complex log10()
* @method Complex negative()
* @method Complex pow(int|float $power)
* @method float rho()
* @method Complex sec()
* @method Complex sech()
* @method Complex sin()
* @method Complex sinh()
* @method Complex sqrt()
* @method Complex tan()
* @method Complex tanh()
* @method float theta()
* @method Complex add(...$complexValues)
* @method Complex subtract(...$complexValues)
* @method Complex multiply(...$complexValues)
* @method Complex divideby(...$complexValues)
* @method Complex divideinto(...$complexValues)
*/
class Complex
{
/**
* @constant Euler's Number.
*/
const EULER = 2.7182818284590452353602874713526624977572;
/**
* @constant Regexp to split an input string into real and imaginary components and suffix
*/
const NUMBER_SPLIT_REGEXP =
'` ^
( # Real part
[-+]?(\d+\.?\d*|\d*\.?\d+) # Real value (integer or float)
([Ee][-+]?[0-2]?\d{1,3})? # Optional real exponent for scientific format
)
( # Imaginary part
[-+]?(\d+\.?\d*|\d*\.?\d+) # Imaginary value (integer or float)
([Ee][-+]?[0-2]?\d{1,3})? # Optional imaginary exponent for scientific format
)?
( # Imaginary part is optional
([-+]?) # Imaginary (implicit 1 or -1) only
([ij]?) # Imaginary i or j - depending on whether mathematical or engineering
)
$`uix';
/**
* @var float $realPart The value of of this complex number on the real plane.
*/
protected $realPart = 0.0;
/**
* @var float $imaginaryPart The value of of this complex number on the imaginary plane.
*/
protected $imaginaryPart = 0.0;
/**
* @var string $suffix The suffix for this complex number (i or j).
*/
protected $suffix;
/**
* Validates whether the argument is a valid complex number, converting scalar or array values if possible
*
* @param mixed $complexNumber The value to parse
* @return array
* @throws Exception If the argument isn't a Complex number or cannot be converted to one
*/
private static function parseComplex($complexNumber)
{
// Test for real number, with no imaginary part
if (is_numeric($complexNumber)) {
return [$complexNumber, 0, null];
}
// Fix silly human errors
$complexNumber = str_replace(
['+-', '-+', '++', '--'],
['-', '-', '+', '+'],
$complexNumber
);
// Basic validation of string, to parse out real and imaginary parts, and any suffix
$validComplex = preg_match(
self::NUMBER_SPLIT_REGEXP,
$complexNumber,
$complexParts
);
if (!$validComplex) {
// Neither real nor imaginary part, so test to see if we actually have a suffix
$validComplex = preg_match('/^([\-\+]?)([ij])$/ui', $complexNumber, $complexParts);
if (!$validComplex) {
throw new Exception('Invalid complex number');
}
// We have a suffix, so set the real to 0, the imaginary to either 1 or -1 (as defined by the sign)
$imaginary = 1;
if ($complexParts[1] === '-') {
$imaginary = 0 - $imaginary;
}
return [0, $imaginary, $complexParts[2]];
}
// If we don't have an imaginary part, identify whether it should be +1 or -1...
if (($complexParts[4] === '') && ($complexParts[9] !== '')) {
if ($complexParts[7] !== $complexParts[9]) {
$complexParts[4] = 1;
if ($complexParts[8] === '-') {
$complexParts[4] = -1;
}
} else {
// ... or if we have only the real and no imaginary part
// (in which case our real should be the imaginary)
$complexParts[4] = $complexParts[1];
$complexParts[1] = 0;
}
}
// Return real and imaginary parts and suffix as an array, and set a default suffix if user input lazily
return [
$complexParts[1],
$complexParts[4],
!empty($complexParts[9]) ? $complexParts[9] : 'i'
];
}
public function __construct($realPart = 0.0, $imaginaryPart = null, $suffix = 'i')
{
if ($imaginaryPart === null) {
if (is_array($realPart)) {
// We have an array of (potentially) real and imaginary parts, and any suffix
list ($realPart, $imaginaryPart, $suffix) = array_values($realPart) + [0.0, 0.0, 'i'];
} elseif ((is_string($realPart)) || (is_numeric($realPart))) {
// We've been given a string to parse to extract the real and imaginary parts, and any suffix
list($realPart, $imaginaryPart, $suffix) = self::parseComplex($realPart);
}
}
if ($imaginaryPart != 0.0 && empty($suffix)) {
$suffix = 'i';
} elseif ($imaginaryPart == 0.0 && !empty($suffix)) {
$suffix = '';
}
// Set parsed values in our properties
$this->realPart = (float) $realPart;
$this->imaginaryPart = (float) $imaginaryPart;
$this->suffix = strtolower($suffix);
}
/**
* Gets the real part of this complex number
*
* @return Float
*/
public function getReal()
{
return $this->realPart;
}
/**
* Gets the imaginary part of this complex number
*
* @return Float
*/
public function getImaginary()
{
return $this->imaginaryPart;
}
/**
* Gets the suffix of this complex number
*
* @return String
*/
public function getSuffix()
{
return $this->suffix;
}
/**
* Returns true if this is a real value, false if a complex value
*
* @return Bool
*/
public function isReal()
{
return $this->imaginaryPart == 0.0;
}
/**
* Returns true if this is a complex value, false if a real value
*
* @return Bool
*/
public function isComplex()
{
return !$this->isReal();
}
public function format()
{
$str = "";
if ($this->imaginaryPart != 0.0) {
if (\abs($this->imaginaryPart) != 1.0) {
$str .= $this->imaginaryPart . $this->suffix;
} else {
$str .= (($this->imaginaryPart < 0.0) ? '-' : '') . $this->suffix;
}
}
if ($this->realPart != 0.0) {
if (($str) && ($this->imaginaryPart > 0.0)) {
$str = "+" . $str;
}
$str = $this->realPart . $str;
}
if (!$str) {
$str = "0.0";
}
return $str;
}
public function __toString()
{
return $this->format();
}
/**
* Validates whether the argument is a valid complex number, converting scalar or array values if possible
*
* @param mixed $complex The value to validate
* @return Complex
* @throws Exception If the argument isn't a Complex number or cannot be converted to one
*/
public static function validateComplexArgument($complex)
{
if (is_scalar($complex) || is_array($complex)) {
$complex = new Complex($complex);
} elseif (!is_object($complex) || !($complex instanceof Complex)) {
throw new Exception('Value is not a valid complex number');
}
return $complex;
}
/**
* Returns the reverse of this complex number
*
* @return Complex
*/
public function reverse()
{
return new Complex(
$this->imaginaryPart,
$this->realPart,
($this->realPart == 0.0) ? null : $this->suffix
);
}
public function invertImaginary()
{
return new Complex(
$this->realPart,
$this->imaginaryPart * -1,
($this->imaginaryPart == 0.0) ? null : $this->suffix
);
}
public function invertReal()
{
return new Complex(
$this->realPart * -1,
$this->imaginaryPart,
($this->imaginaryPart == 0.0) ? null : $this->suffix
);
}
protected static $functions = [
'abs',
'acos',
'acosh',
'acot',
'acoth',
'acsc',
'acsch',
'argument',
'asec',
'asech',
'asin',
'asinh',
'atan',
'atanh',
'conjugate',
'cos',
'cosh',
'cot',
'coth',
'csc',
'csch',
'exp',
'inverse',
'ln',
'log2',
'log10',
'negative',
'pow',
'rho',
'sec',
'sech',
'sin',
'sinh',
'sqrt',
'tan',
'tanh',
'theta',
];
protected static $operations = [
'add',
'subtract',
'multiply',
'divideby',
'divideinto',
];
/**
* Returns the result of the function call or operation
*
* @return Complex|float
* @throws Exception|\InvalidArgumentException
*/
public function __call($functionName, $arguments)
{
$functionName = strtolower(str_replace('_', '', $functionName));
// Test for function calls
if (in_array($functionName, self::$functions)) {
$functionName = "\\" . __NAMESPACE__ . "\\{$functionName}";
return $functionName($this, ...$arguments);
}
// Test for operation calls
if (in_array($functionName, self::$operations)) {
$functionName = "\\" . __NAMESPACE__ . "\\{$functionName}";
return $functionName($this, ...$arguments);
}
throw new Exception('Function or Operation does not exist');
}
}

View File

@@ -0,0 +1,13 @@
<?php
/**
* Exception.
*
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
* @license https://opensource.org/licenses/MIT MIT
*/
namespace Complex;
class Exception extends \Exception
{
}

View File

@@ -0,0 +1,29 @@
<?php
/**
*
* Function code for the complex abs() function
*
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
* @license https://opensource.org/licenses/MIT MIT
*/
namespace Complex;
/**
* Returns the absolute value (modulus) of a complex number.
* Also known as the rho of the complex number, i.e. the distance/radius
* from the centrepoint to the representation of the number in polar coordinates.
*
* This function is a synonym for rho()
*
* @param Complex|mixed $complex Complex number or a numeric value.
* @return float The absolute (or rho) value of the complex argument.
* @throws Exception If argument isn't a valid real or complex number.
*
* @see rho
*
*/
function abs($complex)
{
return rho($complex);
}

View File

@@ -0,0 +1,38 @@
<?php
/**
*
* Function code for the complex acos() function
*
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
* @license https://opensource.org/licenses/MIT MIT
*/
namespace Complex;
/**
* Returns the inverse cosine of a complex number.
*
* @param Complex|mixed $complex Complex number or a numeric value.
* @return Complex The inverse cosine of the complex argument.
* @throws Exception If argument isn't a valid real or complex number.
*/
function acos($complex)
{
$complex = Complex::validateComplexArgument($complex);
$square = clone $complex;
$square = multiply($square, $complex);
$invsqrt = new Complex(1.0);
$invsqrt = subtract($invsqrt, $square);
$invsqrt = sqrt($invsqrt);
$adjust = new Complex(
$complex->getReal() - $invsqrt->getImaginary(),
$complex->getImaginary() + $invsqrt->getReal()
);
$log = ln($adjust);
return new Complex(
$log->getImaginary(),
-1 * $log->getReal()
);
}

View File

@@ -0,0 +1,34 @@
<?php
/**
*
* Function code for the complex acosh() function
*
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
* @license https://opensource.org/licenses/MIT MIT
*/
namespace Complex;
/**
* Returns the inverse hyperbolic cosine of a complex number.
*
* @param Complex|mixed $complex Complex number or a numeric value.
* @return Complex The inverse hyperbolic cosine of the complex argument.
* @throws Exception If argument isn't a valid real or complex number.
*/
function acosh($complex)
{
$complex = Complex::validateComplexArgument($complex);
if ($complex->isReal() && ($complex->getReal() > 1)) {
return new Complex(\acosh($complex->getReal()));
}
$acosh = acos($complex)
->reverse();
if ($acosh->getReal() < 0.0) {
$acosh = $acosh->invertReal();
}
return $acosh;
}

View File

@@ -0,0 +1,25 @@
<?php
/**
*
* Function code for the complex acot() function
*
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
* @license https://opensource.org/licenses/MIT MIT
*/
namespace Complex;
/**
* Returns the inverse cotangent of a complex number.
*
* @param Complex|mixed $complex Complex number or a numeric value.
* @return Complex The inverse cotangent of the complex argument.
* @throws Exception If argument isn't a valid real or complex number.
* @throws \InvalidArgumentException If function would result in a division by zero
*/
function acot($complex)
{
$complex = Complex::validateComplexArgument($complex);
return atan(inverse($complex));
}

View File

@@ -0,0 +1,25 @@
<?php
/**
*
* Function code for the complex acoth() function
*
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
* @license https://opensource.org/licenses/MIT MIT
*/
namespace Complex;
/**
* Returns the inverse hyperbolic cotangent of a complex number.
*
* @param Complex|mixed $complex Complex number or a numeric value.
* @return Complex The inverse hyperbolic cotangent of the complex argument.
* @throws Exception If argument isn't a valid real or complex number.
* @throws \InvalidArgumentException If function would result in a division by zero
*/
function acoth($complex)
{
$complex = Complex::validateComplexArgument($complex);
return atanh(inverse($complex));
}

View File

@@ -0,0 +1,29 @@
<?php
/**
*
* Function code for the complex acsc() function
*
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
* @license https://opensource.org/licenses/MIT MIT
*/
namespace Complex;
/**
* Returns the inverse cosecant of a complex number.
*
* @param Complex|mixed $complex Complex number or a numeric value.
* @return Complex The inverse cosecant of the complex argument.
* @throws Exception If argument isn't a valid real or complex number.
* @throws \InvalidArgumentException If function would result in a division by zero
*/
function acsc($complex)
{
$complex = Complex::validateComplexArgument($complex);
if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
return INF;
}
return asin(inverse($complex));
}

View File

@@ -0,0 +1,29 @@
<?php
/**
*
* Function code for the complex acsch() function
*
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
* @license https://opensource.org/licenses/MIT MIT
*/
namespace Complex;
/**
* Returns the inverse hyperbolic cosecant of a complex number.
*
* @param Complex|mixed $complex Complex number or a numeric value.
* @return Complex The inverse hyperbolic cosecant of the complex argument.
* @throws Exception If argument isn't a valid real or complex number.
* @throws \InvalidArgumentException If function would result in a division by zero
*/
function acsch($complex)
{
$complex = Complex::validateComplexArgument($complex);
if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
return INF;
}
return asinh(inverse($complex));
}

View File

@@ -0,0 +1,28 @@
<?php
/**
*
* Function code for the complex argument() function
*
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
* @license https://opensource.org/licenses/MIT MIT
*/
namespace Complex;
/**
* Returns the argument of a complex number.
* Also known as the theta of the complex number, i.e. the angle in radians
* from the real axis to the representation of the number in polar coordinates.
*
* This function is a synonym for theta()
*
* @param Complex|mixed $complex Complex number or a numeric value.
* @return float The argument (or theta) value of the complex argument.
* @throws Exception If argument isn't a valid real or complex number.
*
* @see theta
*/
function argument($complex)
{
return theta($complex);
}

View File

@@ -0,0 +1,29 @@
<?php
/**
*
* Function code for the complex asec() function
*
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
* @license https://opensource.org/licenses/MIT MIT
*/
namespace Complex;
/**
* Returns the inverse secant of a complex number.
*
* @param Complex|mixed $complex Complex number or a numeric value.
* @return Complex The inverse secant of the complex argument.
* @throws Exception If argument isn't a valid real or complex number.
* @throws \InvalidArgumentException If function would result in a division by zero
*/
function asec($complex)
{
$complex = Complex::validateComplexArgument($complex);
if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
return INF;
}
return acos(inverse($complex));
}

View File

@@ -0,0 +1,29 @@
<?php
/**
*
* Function code for the complex asech() function
*
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
* @license https://opensource.org/licenses/MIT MIT
*/
namespace Complex;
/**
* Returns the inverse hyperbolic secant of a complex number.
*
* @param Complex|mixed $complex Complex number or a numeric value.
* @return Complex The inverse hyperbolic secant of the complex argument.
* @throws Exception If argument isn't a valid real or complex number.
* @throws \InvalidArgumentException If function would result in a division by zero
*/
function asech($complex)
{
$complex = Complex::validateComplexArgument($complex);
if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
return INF;
}
return acosh(inverse($complex));
}

View File

@@ -0,0 +1,37 @@
<?php
/**
*
* Function code for the complex asin() function
*
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
* @license https://opensource.org/licenses/MIT MIT
*/
namespace Complex;
/**
* Returns the inverse sine of a complex number.
*
* @param Complex|mixed $complex Complex number or a numeric value.
* @return Complex The inverse sine of the complex argument.
* @throws Exception If argument isn't a valid real or complex number.
*/
function asin($complex)
{
$complex = Complex::validateComplexArgument($complex);
$square = multiply($complex, $complex);
$invsqrt = new Complex(1.0);
$invsqrt = subtract($invsqrt, $square);
$invsqrt = sqrt($invsqrt);
$adjust = new Complex(
$invsqrt->getReal() - $complex->getImaginary(),
$invsqrt->getImaginary() + $complex->getReal()
);
$log = ln($adjust);
return new Complex(
$log->getImaginary(),
-1 * $log->getReal()
);
}

View File

@@ -0,0 +1,33 @@
<?php
/**
*
* Function code for the complex asinh() function
*
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
* @license https://opensource.org/licenses/MIT MIT
*/
namespace Complex;
/**
* Returns the inverse hyperbolic sine of a complex number.
*
* @param Complex|mixed $complex Complex number or a numeric value.
* @return Complex The inverse hyperbolic sine of the complex argument.
* @throws Exception If argument isn't a valid real or complex number.
*/
function asinh($complex)
{
$complex = Complex::validateComplexArgument($complex);
if ($complex->isReal() && ($complex->getReal() > 1)) {
return new Complex(\asinh($complex->getReal()));
}
$asinh = clone $complex;
$asinh = $asinh->reverse()
->invertReal();
$asinh = asin($asinh);
return $asinh->reverse()
->invertImaginary();
}

View File

@@ -0,0 +1,45 @@
<?php
/**
*
* Function code for the complex atan() function
*
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
* @license https://opensource.org/licenses/MIT MIT
*/
namespace Complex;
//include_once 'Math/Complex.php';
//include_once 'Math/ComplexOp.php';
/**
* Returns the inverse tangent of a complex number.
*
* @param Complex|mixed $complex Complex number or a numeric value.
* @return Complex The inverse tangent of the complex argument.
* @throws Exception If argument isn't a valid real or complex number.
* @throws \InvalidArgumentException If function would result in a division by zero
*/
function atan($complex)
{
$complex = Complex::validateComplexArgument($complex);
if ($complex->isReal()) {
return new Complex(\atan($complex->getReal()));
}
$t1Value = new Complex(-1 * $complex->getImaginary(), $complex->getReal());
$uValue = new Complex(1, 0);
$d1Value = clone $uValue;
$d1Value = subtract($d1Value, $t1Value);
$d2Value = add($t1Value, $uValue);
$uResult = $d1Value->divideBy($d2Value);
$uResult = ln($uResult);
return new Complex(
(($uResult->getImaginary() == M_PI) ? -M_PI : $uResult->getImaginary()) * -0.5,
$uResult->getReal() * 0.5,
$complex->getSuffix()
);
}

View File

@@ -0,0 +1,38 @@
<?php
/**
*
* Function code for the complex atanh() function
*
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
* @license https://opensource.org/licenses/MIT MIT
*/
namespace Complex;
/**
* Returns the inverse hyperbolic tangent of a complex number.
*
* @param Complex|mixed $complex Complex number or a numeric value.
* @return Complex The inverse hyperbolic tangent of the complex argument.
* @throws Exception If argument isn't a valid real or complex number.
*/
function atanh($complex)
{
$complex = Complex::validateComplexArgument($complex);
if ($complex->isReal()) {
$real = $complex->getReal();
if ($real >= -1.0 && $real <= 1.0) {
return new Complex(\atanh($real));
} else {
return new Complex(\atanh(1 / $real), (($real < 0.0) ? M_PI_2 : -1 * M_PI_2));
}
}
$iComplex = clone $complex;
$iComplex = $iComplex->invertImaginary()
->reverse();
return atan($iComplex)
->invertReal()
->reverse();
}

Some files were not shown because too many files have changed in this diff Show More