From 7ab62d1cdd5e5e0122e2d91c536bf25eb1d32ad6 Mon Sep 17 00:00:00 2001 From: ffflabs Date: Fri, 11 Sep 2020 04:41:16 -0300 Subject: wrapping wrongly types AdoDB wrapping wrongly types AdoDB --- package.json | 10 +- src/classes/ADORecordSet.php | 10 + src/classes/ArrayRecordSet.php | 17 +- src/classes/Connection.php | 150 +++-- src/classes/ContainerUtils.php | 13 +- src/classes/Misc.php | 2 +- src/classes/ViewManager.php | 34 +- src/controllers/AggregatesController.php | 12 +- src/controllers/AlldbController.php | 4 +- src/controllers/BaseController.php | 34 +- src/controllers/ColpropertiesController.php | 6 +- src/controllers/DataexportController.php | 2 +- src/controllers/DisplayController.php | 2 +- src/controllers/DomainsController.php | 18 +- src/controllers/FulltextController.php | 30 +- src/controllers/FunctionsController.php | 10 +- src/controllers/GroupsController.php | 2 +- src/controllers/IndexesController.php | 6 +- src/controllers/IntroController.php | 8 +- src/controllers/LoginController.php | 8 +- .../MaterializedviewpropertiesController.php | 14 +- src/controllers/MaterializedviewsController.php | 6 +- src/controllers/OperatorsController.php | 6 +- src/controllers/RolesController.php | 12 +- src/controllers/RulesController.php | 4 +- src/controllers/SchemasController.php | 12 +- src/controllers/SequencesController.php | 14 +- src/controllers/ServersController.php | 6 +- src/controllers/TablesController.php | 119 ++-- src/controllers/TablespacesController.php | 4 +- src/controllers/TblpropertiesController.php | 31 +- src/controllers/TriggersController.php | 18 +- src/controllers/TypesController.php | 20 +- src/controllers/UsersController.php | 6 +- src/controllers/ViewpropertiesController.php | 12 +- src/controllers/ViewsController.php | 6 +- src/database/ADOdbBase.php | 94 ++- src/database/Connection.php | 177 +++++ src/database/Postgres.php | 53 +- src/database/Postgres10.php | 8 + src/database/Postgres11.php | 8 + src/database/Postgres12.php | 8 + src/database/Postgres13.php | 8 + src/database/Postgres90.php | 8 + src/database/Postgres91.php | 8 + src/database/Postgres92.php | 8 + src/database/Postgres93.php | 8 + src/database/Postgres94.php | 8 + src/database/Postgres95.php | 8 + src/database/Postgres96.php | 8 + src/database/databasetraits/HasTrait.php | 5 + src/database/databasetraits/TableTrait.php | 186 +++--- src/decorators/CallbackDecorator.php | 2 +- src/decorators/Decorator.php | 10 +- src/help/PostgresDoc.php | 207 ++++++ src/help/PostgresDoc74.php | 179 ----- src/help/PostgresDoc80.php | 35 - src/help/PostgresDoc81.php | 25 - src/help/PostgresDoc82.php | 20 - src/help/PostgresDoc83.php | 35 - src/help/PostgresDoc84.php | 20 - src/help/PostgresDoc90.php | 2 +- src/help/PostgresDoc92.php | 2 +- src/help/PostgresDoc93.php | 12 +- src/lib.inc.php | 24 +- src/router.php | 11 +- src/traits/AdminTrait.php | 6 +- src/traits/HelperTrait.php | 4 +- src/traits/MiscTrait.php | 8 +- src/traits/ViewsMatviewsTrait.php | 6 +- yarn.lock | 743 +++++++++------------ 71 files changed, 1394 insertions(+), 1228 deletions(-) create mode 100644 src/database/Connection.php create mode 100644 src/help/PostgresDoc.php delete mode 100644 src/help/PostgresDoc74.php delete mode 100644 src/help/PostgresDoc80.php delete mode 100644 src/help/PostgresDoc81.php delete mode 100644 src/help/PostgresDoc82.php delete mode 100644 src/help/PostgresDoc83.php delete mode 100644 src/help/PostgresDoc84.php diff --git a/package.json b/package.json index 1d6a718a..92f92bd6 100644 --- a/package.json +++ b/package.json @@ -6,10 +6,10 @@ "author": "ffflabs ", "license": "MIT", "devDependencies": { - "babel-eslint": "^10.0.3", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", - "eslint-plugin-prettier": "^3.1.2", - "prettier": "^1.19.1" + "babel-eslint": "^10.1.0", + "eslint": "^7.8.1", + "eslint-config-prettier": "^6.11.0", + "eslint-plugin-prettier": "^3.1.4", + "prettier": "^2.1.1" } } diff --git a/src/classes/ADORecordSet.php b/src/classes/ADORecordSet.php index cb3cd9df..74c3f989 100644 --- a/src/classes/ADORecordSet.php +++ b/src/classes/ADORecordSet.php @@ -24,6 +24,16 @@ class ADORecordSet extends \ADORecordSet implements \Countable return $this->NumRows(); } + /** + * synonyms RecordCount and RowCount. + * + * @return int number of rows or -1 if this is not supported + */ + public function recordCount() + { + return $this->count(); + } + /** * Returns the recordCount. * diff --git a/src/classes/ArrayRecordSet.php b/src/classes/ArrayRecordSet.php index 692d8236..23a3e84a 100644 --- a/src/classes/ArrayRecordSet.php +++ b/src/classes/ArrayRecordSet.php @@ -6,6 +6,8 @@ namespace PHPPgAdmin; +use Countable; + /** * @file * Really simple RecordSet to allow printTable of arrays. @@ -19,7 +21,7 @@ namespace PHPPgAdmin; * * Id: ArrayRecordSet.php,v 1.3 2007/01/10 01:46:28 soranzo Exp $ */ -class ArrayRecordSet +class ArrayRecordSet implements Countable { public $EOF = false; @@ -27,8 +29,6 @@ class ArrayRecordSet private $_array; - private $_count; - /** * Constructor. * @@ -37,7 +37,6 @@ class ArrayRecordSet public function __construct($data) { $this->_array = $data; - $this->_count = \count($this->_array); $this->fields = \reset($this->_array); if (false === $this->fields) { @@ -45,6 +44,14 @@ class ArrayRecordSet } } + /** + * Returns the recordCount. + */ + public function count(): int + { + return \count($this->_array); + } + /** * Counts the records in the instance array. * @@ -52,7 +59,7 @@ class ArrayRecordSet */ public function recordCount() { - return $this->_count; + return $this->count(); } /** diff --git a/src/classes/Connection.php b/src/classes/Connection.php index 1fdf7c0a..c63ffe21 100644 --- a/src/classes/Connection.php +++ b/src/classes/Connection.php @@ -6,8 +6,6 @@ namespace PHPPgAdmin; -use ADODB2_postgres; - /** * @file * Class to represent a database connection @@ -21,8 +19,11 @@ class Connection public $conn; public $platform = 'UNKNOWN'; - /** @var string */ - private $pgVersion; + + /** + * @var string + */ + public $driver; protected $container; @@ -42,11 +43,18 @@ class Connection '9.1' => 'Postgres91', '9.0' => 'Postgres90', ]; -private $adodb_driver='postgres9'; // or pdo + + /** + * @var string + */ + private $pgVersion; + + private $adodb_driver = 'postgres9'; + + // or pdo // The backend platform. Set to UNKNOWN by default. private $_connection_result; - /** @var string */ - public $driver; + /** * Creates a new connection. Will actually make a database connection. * @@ -73,8 +81,6 @@ private $adodb_driver='postgres9'; // or pdo $this->conn->setFetchMode($fetchMode); // PDO Approach - - /*try { $this->_connection_result = $this->conn->connect($pghost, $user, $password, $database); @@ -83,67 +89,17 @@ private $adodb_driver='postgres9'; // or pdo $this->prtrace(['message' => $e->getMessage(), 'trace' => $e->getTraceAsString()]); */ try { - $connectionResult = $this->adodb_driver === 'pdo' ? - $this->getPDOConnection($host,$port,$sslmode,$database,$user,$password,$fetchMode): - $this->getPG9Connection($host,$port,$sslmode,$database,$user,$password,$fetchMode); + $connectionResult = 'pdo' === $this->adodb_driver ? + $this->getPDOConnection($host, $port, $sslmode, $database, $user, $password, $fetchMode) : + $this->getPG9Connection($host, $port, $sslmode, $database, $user, $password, $fetchMode); //$this->prtrace($this->conn); } catch (\Exception $e) { //dump($dsnString, $this->adodb_driver); - $this->prtrace($e->getMessage(), array_slice($e->getTrace(), 0, 10)); - } - } - - private function getPG9Connection( - string $host,int $port=5432,string $sslmode='prefer', - ?string $database, - - ?string $user, - - ?string $password, - int $fetchMode = \ADODB_FETCH_ASSOC) : \ADODB_postgres9{ - $this->conn = ADONewConnection('postgres9'); - $this->conn->setFetchMode($fetchMode); - // Ignore host if null - if (null === $host || '' === $host) { - if (null !== $port && '' !== $port) { - $pghost = ':' . $port; - } else { - $pghost = ''; - } - } else { - $pghost = "{$host}:{$port}"; + $this->prtrace($e->getMessage(), \array_slice($e->getTrace(), 0, 10)); } - - // Add sslmode to $pghost as needed - if (('disable' === $sslmode) || ('allow' === $sslmode) || ('prefer' === $sslmode) || ('require' === $sslmode)) { - $pghost .= ':' . $sslmode; - } elseif ('legacy' === $sslmode) { - $pghost .= ' requiressl=1'; - } - - - $this->conn->connect($pghost, $user, $password, $database); - - return $this->conn; - } - private function getPDOConnection( - string $host,int $port=5432,string $sslmode='prefer', - ?string $database, - - ?string $user, - ?string $password, - int $fetchMode = \ADODB_FETCH_ASSOC) : \ADODB_pdo { - $this->conn = ADONewConnection('pdo'); - $this->conn->setFetchMode($fetchMode); - $dsnString = sprintf('pgsql:host=%s;port=%d;dbname=%s;sslmode=%s;application_name=PHPPgAdmin6', $host, $port, $database, $sslmode); - $this->conn->connect($dsnString, $user, $password) ; - return $this->conn; - - } - public function getConnectionResult() { return $this->_connection_result; @@ -153,6 +109,7 @@ private $adodb_driver='postgres9'; // or pdo { return $this->pgVersion; } + /** * Gets the name of the correct database driver to use. As a side effect, * sets the platform. @@ -163,11 +120,11 @@ private $adodb_driver='postgres9'; // or pdo */ public function getDriver(&$description) { - if(!$this->conn->IsConnected()) { + if (!$this->conn->IsConnected()) { return null; } - $serverInfo=$this->conn->ServerInfo(); - $this->pgVersion =$serverInfo['version']; + $serverInfo = $this->conn->ServerInfo(); + $this->pgVersion = $serverInfo['version']; $description = "PostgreSQL {$this->pgVersion}"; $version_parts = \explode('.', $this->pgVersion); @@ -177,10 +134,11 @@ private $adodb_driver='postgres9'; // or pdo } else { $major_version = \implode('.', [$version_parts[0], $version_parts[1]]); } - + // if major version is less than 9 return null, we don't support it - if (9 > (float) $major_version) { + if (9 > (float) $major_version) { $this->driver = null; + return null; } @@ -191,7 +149,6 @@ private $adodb_driver='postgres9'; // or pdo $this->driver = $this->version_dictionary[$major_version]; } - // If unknown version, then default to latest driver return $this->driver; } @@ -203,8 +160,59 @@ private $adodb_driver='postgres9'; // or pdo */ public function getLastError() { - return $this->conn->ErrorMsg(); - + } + + private function getPG9Connection( + string $host, + int $port, + string $sslmode, + ?string $database, + ?string $user, + ?string $password, + int $fetchMode = \ADODB_FETCH_ASSOC + ): \ADODB_postgres9 + { + $this->conn = ADONewConnection('postgres9'); + $this->conn->setFetchMode($fetchMode); + // Ignore host if null + if (null === $host || '' === $host) { + if (null !== $port && '' !== $port) { + $pghost = ':' . $port; + } else { + $pghost = ''; + } + } else { + $pghost = "{$host}:{$port}"; + } + + // Add sslmode to $pghost as needed + if (('disable' === $sslmode) || ('allow' === $sslmode) || ('prefer' === $sslmode) || ('require' === $sslmode)) { + $pghost .= ':' . $sslmode; + } elseif ('legacy' === $sslmode) { + $pghost .= ' requiressl=1'; + } + + $this->conn->connect($pghost, $user, $password, $database); + + return $this->conn; + } + + private function getPDOConnection( + string $host, + int $port, + string $sslmode, + ?string $database, + ?string $user, + ?string $password, + int $fetchMode = \ADODB_FETCH_ASSOC + ): \ADODB_pdo + { + $this->conn = ADONewConnection('pdo'); + $this->conn->setFetchMode($fetchMode); + $dsnString = \sprintf('pgsql:host=%s;port=%d;dbname=%s;sslmode=%s;application_name=PHPPgAdmin6', $host, $port, $database, $sslmode); + $this->conn->connect($dsnString, $user, $password); + + return $this->conn; } } diff --git a/src/classes/ContainerUtils.php b/src/classes/ContainerUtils.php index d028c5f8..008214ff 100644 --- a/src/classes/ContainerUtils.php +++ b/src/classes/ContainerUtils.php @@ -40,7 +40,7 @@ class ContainerUtils const THEME_PATH = THEME_PATH; /** - * @var\Psr\Container\ContainerInterface + * @var \Slim\Container */ protected $container; @@ -124,7 +124,7 @@ class ContainerUtils * * @throws \Exception (description) * - * @return\Psr\Container\ContainerInterface the container instance + * @return \Slim\Container the container instance */ public static function getContainerInstance() { @@ -139,13 +139,12 @@ class ContainerUtils /** * Gets the instance. - * - */ - public static function getInstance():self + */ + public static function getInstance(): self { - if (!$_instance=self::$_instance) { + if (!$_instance = self::$_instance) { self::$_instance = new self(); - $_instance=self::$_instance; + $_instance = self::$_instance; } return $_instance; diff --git a/src/classes/Misc.php b/src/classes/Misc.php index c1462d74..fbb4b161 100644 --- a/src/classes/Misc.php +++ b/src/classes/Misc.php @@ -206,7 +206,7 @@ class Misc } /** - * @return string|null + * @return null|string */ public function serverToSha() { diff --git a/src/classes/ViewManager.php b/src/classes/ViewManager.php index ef27b4ae..246448b8 100644 --- a/src/classes/ViewManager.php +++ b/src/classes/ViewManager.php @@ -93,32 +93,46 @@ class ViewManager extends \Slim\Views\Twig * @var \PHPPgAdmin\Misc */ public $misc; - /** + + /** * @var \Slim\Container */ protected $container; private $_connection; -/** @var bool */ + + /** + * @var bool + */ private $_no_db_connection = false; -/** @var bool */ + + /** + * @var bool + */ private $_reload_browser = false; private $_data; private $_database; -/** @var string */ + + /** + * @var string + */ private $_server_id; private $_server_info; - /** @var string */ + + /** + * @var string + */ private $_error_msg = ''; + /** - * Undocumented variable + * Undocumented variable. * * @var self */ - private static $instance ; + private static $instance; /** * @param \Slim\Container $container The container @@ -161,7 +175,7 @@ class ViewManager extends \Slim\Views\Twig } } - public function maybeRenderIframes(ResponseInterface $response, string $subject,string $query_string):ResponseInterface + public function maybeRenderIframes(ResponseInterface $response, string $subject, string $query_string): ResponseInterface { $c = $this->getContainer(); @@ -352,8 +366,8 @@ class ViewManager extends \Slim\Views\Twig * * @return class-string */ - private static function getControllerClassName(string $subject):string - { + private static function getControllerClassName(string $subject): string + { return '\PHPPgAdmin\Controller\\' . \ucfirst($subject) . 'Controller'; } diff --git a/src/controllers/AggregatesController.php b/src/controllers/AggregatesController.php index 68190890..2fa97293 100644 --- a/src/controllers/AggregatesController.php +++ b/src/controllers/AggregatesController.php @@ -34,7 +34,7 @@ class AggregatesController extends BaseController break; case 'save_create': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $this->doSaveCreate(); @@ -46,7 +46,7 @@ class AggregatesController extends BaseController break; case 'save_alter': - if (isset($_POST['alter'])) { + if (null !== $this->getPostParam('alter')) { $this->doSaveAlter(); } else { $this->doProperties(); @@ -54,7 +54,7 @@ class AggregatesController extends BaseController break; case 'drop': - if (isset($_POST['drop'])) { + if (null !== $this->getPostParam('drop')) { $this->doDrop(false); } else { $this->doDefault(); @@ -307,7 +307,7 @@ class AggregatesController extends BaseController echo '

' . \PHP_EOL; echo $this->view->form; echo "lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } @@ -385,7 +385,7 @@ class AggregatesController extends BaseController echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo "lang['stralter']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); } else { echo "

{$this->lang['strnodata']}

" . \PHP_EOL; echo "lang['strback']}\" />

" . \PHP_EOL; @@ -415,7 +415,7 @@ class AggregatesController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['strdrop']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { $status = $this->data->dropAggregate($_POST['aggrname'], $_POST['aggrtype'], isset($_POST['cascade'])); diff --git a/src/controllers/AlldbController.php b/src/controllers/AlldbController.php index 105aa7a6..a940a35c 100644 --- a/src/controllers/AlldbController.php +++ b/src/controllers/AlldbController.php @@ -38,7 +38,7 @@ class AlldbController extends BaseController break; case 'save_create': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $this->doSaveCreate(); @@ -515,7 +515,7 @@ class AlldbController extends BaseController echo '

' . \PHP_EOL; echo $this->view->form; echo "lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } diff --git a/src/controllers/BaseController.php b/src/controllers/BaseController.php index f4c00971..5eec5f66 100644 --- a/src/controllers/BaseController.php +++ b/src/controllers/BaseController.php @@ -67,7 +67,8 @@ class BaseController * @var \PHPPgAdmin\ViewManager */ public $view; - /** + + /** * @var \PHPPgAdmin\Misc */ public $misc; @@ -77,7 +78,10 @@ class BaseController public $phpMinVer; protected $script; - /** @var \Slim\Container */ + + /** + * @var \Slim\Container + */ protected $container; protected $data; @@ -437,36 +441,34 @@ class BaseController } /** - * * @param string $key * @param null|string $default */ public function getRequestParam(string $key, ?string $default = null) { - return $this->container->requestobj->getParam($key, $default); + return \requestInstance()->getParam($key, $default); } /** - * - * @param string $key - * @param bool|null|array|string|int|float $default - * + * @param string $key + * @param null|array|bool|float|int|string $default + * * @return bool| null|array|string|int|float */ public function getPostParam(string $key, $default = null) { - return $this->container->requestobj->getParsedBodyParam($key, $default); + return \requestInstance()->getParsedBodyParam($key, $default); } - /** + + /** + * @param string $key + * @param null|array|float|int|string $default * - * @param string $key - * @param null|array|string|int|float $default - * - * @return null|array|string|int|float + * @return null|array|float|int|string */ - public function getQueryParamstring ($key, $default = null) + public function getQueryParamstring($key, $default = null) { - return $this->container->requestobj->getQueryParam($key, $default); + return \requestInstance()->getQueryParam($key, $default); } /** diff --git a/src/controllers/ColpropertiesController.php b/src/controllers/ColpropertiesController.php index 796798e3..2bd3bc4d 100644 --- a/src/controllers/ColpropertiesController.php +++ b/src/controllers/ColpropertiesController.php @@ -42,7 +42,7 @@ class ColpropertiesController extends BaseController } else { switch ($this->action) { case 'properties': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $this->doAlter(); @@ -337,7 +337,7 @@ class ColpropertiesController extends BaseController echo '

' . \PHP_EOL; echo '' . \PHP_EOL; echo $this->view->form; - echo sprintf('%s',\htmlspecialchars($_REQUEST['table']), \PHP_EOL); + echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); echo '' . \PHP_EOL; echo '' . \PHP_EOL; @@ -353,7 +353,7 @@ class ColpropertiesController extends BaseController echo '' . \PHP_EOL; } echo "lang['stralter']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; echo '" . \PHP_EOL; diff --git a/src/controllers/DataexportController.php b/src/controllers/DataexportController.php index f890531e..01fafcb0 100644 --- a/src/controllers/DataexportController.php +++ b/src/controllers/DataexportController.php @@ -133,7 +133,7 @@ class DataexportController extends BaseController if (isset($_REQUEST['table'])) { echo '' . \PHP_EOL; - echo sprintf('%s',\htmlspecialchars($_REQUEST['table']), \PHP_EOL); + echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); } else { echo '' . \PHP_EOL; } diff --git a/src/controllers/DisplayController.php b/src/controllers/DisplayController.php index c07ebca3..55f96665 100644 --- a/src/controllers/DisplayController.php +++ b/src/controllers/DisplayController.php @@ -825,7 +825,7 @@ class DisplayController extends BaseController } if (isset($_REQUEST['table'])) { - echo sprintf('%s',\htmlspecialchars($_REQUEST['table']), \PHP_EOL); + echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); } if (isset($_REQUEST['subject'])) { diff --git a/src/controllers/DomainsController.php b/src/controllers/DomainsController.php index db93107f..48815930 100644 --- a/src/controllers/DomainsController.php +++ b/src/controllers/DomainsController.php @@ -33,7 +33,7 @@ class DomainsController extends BaseController break; case 'save_add_check': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doProperties(); } else { $this->addCheck(false); @@ -41,7 +41,7 @@ class DomainsController extends BaseController break; case 'drop_con': - if (isset($_POST['drop'])) { + if (null !== $this->getPostParam('drop')) { $this->doDropConstraint(false); } else { $this->doProperties(); @@ -53,7 +53,7 @@ class DomainsController extends BaseController break; case 'save_create': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $this->doSaveCreate(); @@ -65,7 +65,7 @@ class DomainsController extends BaseController break; case 'drop': - if (isset($_POST['drop'])) { + if (null !== $this->getPostParam('drop')) { $this->doDrop(false); } else { $this->doDefault(); @@ -77,7 +77,7 @@ class DomainsController extends BaseController break; case 'save_alter': - if (isset($_POST['alter'])) { + if (null !== $this->getPostParam('alter')) { $this->doSaveAlter(); } else { $this->doProperties(); @@ -310,7 +310,7 @@ class DomainsController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['stralter']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { echo "

{$this->lang['strnodata']}

" . \PHP_EOL; @@ -352,7 +352,7 @@ class DomainsController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['stradd']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { if ('' === \trim($_POST['definition'])) { @@ -566,7 +566,7 @@ class DomainsController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['strdrop']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { $status = $data->dropDomain($_POST['domain'], isset($_POST['cascade'])); @@ -649,7 +649,7 @@ class DomainsController extends BaseController echo '

' . \PHP_EOL; echo $this->view->form; echo "lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } diff --git a/src/controllers/FulltextController.php b/src/controllers/FulltextController.php index 24b40568..3760dd0f 100644 --- a/src/controllers/FulltextController.php +++ b/src/controllers/FulltextController.php @@ -31,7 +31,7 @@ class FulltextController extends BaseController $this->printHeader(); $this->printBody(); - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { if (isset($_POST['prev_action'])) { $this->action = $_POST['prev_action']; } else { @@ -41,7 +41,7 @@ class FulltextController extends BaseController switch ($this->action) { case 'createconfig': - if (isset($_POST['create'])) { + if (null !== $this->getPostParam('create')) { $this->doSaveCreateConfig(); } else { $this->doCreateConfig(); @@ -49,7 +49,7 @@ class FulltextController extends BaseController break; case 'alterconfig': - if (isset($_POST['alter'])) { + if (null !== $this->getPostParam('alter')) { $this->doSaveAlterConfig(); } else { $this->doAlterConfig(); @@ -57,7 +57,7 @@ class FulltextController extends BaseController break; case 'dropconfig': - if (isset($_POST['drop'])) { + if (null !== $this->getPostParam('drop')) { $this->doDropConfig(false); } else { $this->doDropConfig(true); @@ -77,7 +77,7 @@ class FulltextController extends BaseController break; case 'createdict': - if (isset($_POST['create'])) { + if (null !== $this->getPostParam('create')) { $this->doSaveCreateDict(); } else { $this->doCreateDict(); @@ -85,7 +85,7 @@ class FulltextController extends BaseController break; case 'alterdict': - if (isset($_POST['alter'])) { + if (null !== $this->getPostParam('alter')) { $this->doSaveAlterDict(); } else { $this->doAlterDict(); @@ -93,7 +93,7 @@ class FulltextController extends BaseController break; case 'dropdict': - if (isset($_POST['drop'])) { + if (null !== $this->getPostParam('drop')) { $this->doDropDict(false); } else { $this->doDropDict(true); @@ -101,7 +101,7 @@ class FulltextController extends BaseController break; case 'dropmapping': - if (isset($_POST['drop'])) { + if (null !== $this->getPostParam('drop')) { $this->doDropMapping(false); } else { $this->doDropMapping(true); @@ -109,7 +109,7 @@ class FulltextController extends BaseController break; case 'altermapping': - if (isset($_POST['alter'])) { + if (null !== $this->getPostParam('alter')) { $this->doSaveAlterMapping(); } else { $this->doAlterMapping(); @@ -315,7 +315,7 @@ class FulltextController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['strdrop']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { $status = $data->dropFtsConfiguration($_POST['ftscfg'], isset($_POST['cascade'])); @@ -348,7 +348,7 @@ class FulltextController extends BaseController echo '

' . \PHP_EOL; echo $this->view->form; echo "lang['strdrop']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { $status = $data->dropFtsDictionary($_POST['ftsdict'], isset($_POST['cascade'])); @@ -552,7 +552,7 @@ class FulltextController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['stralter']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { echo "

{$this->lang['strnodata']}

" . \PHP_EOL; @@ -988,7 +988,7 @@ class FulltextController extends BaseController echo '

' . \PHP_EOL; echo $this->view->form; echo "lang['stralter']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { echo "

{$this->lang['strnodata']}

" . \PHP_EOL; @@ -1151,7 +1151,7 @@ class FulltextController extends BaseController echo $this->view->form; echo "lang['stralter']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { echo "

{$this->lang['strftsnodictionaries']}

" . \PHP_EOL; @@ -1238,7 +1238,7 @@ class FulltextController extends BaseController echo '

' . \PHP_EOL; echo $this->view->form; echo "lang['stradd']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { echo "

{$this->lang['strftsnodictionaries']}

" . \PHP_EOL; diff --git a/src/controllers/FunctionsController.php b/src/controllers/FunctionsController.php index 726b714c..b5ef9820 100644 --- a/src/controllers/FunctionsController.php +++ b/src/controllers/FunctionsController.php @@ -32,7 +32,7 @@ class FunctionsController extends BaseController switch ($this->action) { case 'save_create': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $this->doSaveCreate(); @@ -45,7 +45,7 @@ class FunctionsController extends BaseController break; case 'drop': - if (isset($_POST['drop'])) { + if (null !== $this->getPostParam('drop')) { $this->doDrop(false); } else { $this->doDefault(); @@ -57,7 +57,7 @@ class FunctionsController extends BaseController break; case 'save_edit': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $this->doSaveEdit(); @@ -469,7 +469,7 @@ class FunctionsController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['stralter']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } @@ -966,7 +966,7 @@ class FunctionsController extends BaseController echo '

' . \PHP_EOL; echo $this->view->form; echo "lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; echo $szJS; } diff --git a/src/controllers/GroupsController.php b/src/controllers/GroupsController.php index c5750ce8..f748d162 100644 --- a/src/controllers/GroupsController.php +++ b/src/controllers/GroupsController.php @@ -353,7 +353,7 @@ class GroupsController extends BaseController echo '' . \PHP_EOL; echo '

' . \PHP_EOL; echo "lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } diff --git a/src/controllers/IndexesController.php b/src/controllers/IndexesController.php index 85a1eacd..c7134d6e 100644 --- a/src/controllers/IndexesController.php +++ b/src/controllers/IndexesController.php @@ -53,7 +53,7 @@ class IndexesController extends BaseController break; case 'save_create_index': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $this->doSaveCreateIndex(); @@ -65,7 +65,7 @@ class IndexesController extends BaseController break; case 'drop_index': - if (isset($_POST['drop'])) { + if (null !== $this->getPostParam('drop')) { $this->doDropIndex(false); } else { $this->doDefault(); @@ -438,7 +438,7 @@ class IndexesController extends BaseController echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo "lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

%s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

%s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } diff --git a/src/controllers/IntroController.php b/src/controllers/IntroController.php index c10231f7..3f30a3ee 100644 --- a/src/controllers/IntroController.php +++ b/src/controllers/IntroController.php @@ -18,13 +18,13 @@ class IntroController extends BaseController */ public function render() { - if (null === $this->container->requestobj->getAttribute('route')) { + if (null === \requestInstance()->getAttribute('route')) { echo $this->doDefault(); } else { - $body = $this->container->responseobj->getBody(); + $body = \responseInstance()->getBody(); $body->write($this->doDefault()); - return $this->container->responseobj; + return \responseInstance(); } } @@ -88,7 +88,7 @@ class IntroController extends BaseController //$intro_html .= '
  • ' . $this->lang['strviewfaq'] . '
  • '; $intro_html .= ''; - if ($this->container->requestobj->getQueryParam('language')) { + if (\requestInstance()->getQueryParam('language')) { $this->misc->setReloadBrowser(true); } diff --git a/src/controllers/LoginController.php b/src/controllers/LoginController.php index 9fd9705c..fe7e40ec 100644 --- a/src/controllers/LoginController.php +++ b/src/controllers/LoginController.php @@ -46,13 +46,13 @@ class LoginController extends BaseController */ public function render() { - if (null === $this->container->requestobj->getAttribute('route')) { + if (null === \requestInstance()->getAttribute('route')) { echo $this->doLoginForm(); } else { - $body = $this->container->responseobj->getBody(); + $body = \responseInstance()->getBody(); $body->write($this->doLoginForm()); - return $this->container->responseobj; + return \responseInstance(); } } @@ -60,7 +60,7 @@ class LoginController extends BaseController { $this->misc->setNoDBConnection(true); - $server_id = $this->container->requestobj->getQueryParam('server'); + $server_id = \requestInstance()->getQueryParam('server'); if (null === $server_id) { $this->prtrace('invalid server param'); diff --git a/src/controllers/MaterializedviewpropertiesController.php b/src/controllers/MaterializedviewpropertiesController.php index ef7cbe11..2a4429dd 100644 --- a/src/controllers/MaterializedviewpropertiesController.php +++ b/src/controllers/MaterializedviewpropertiesController.php @@ -32,7 +32,7 @@ class MaterializedviewpropertiesController extends BaseController switch ($this->action) { case 'save_edit': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefinition(); } else { $this->doSaveEdit(); @@ -56,7 +56,7 @@ class MaterializedviewpropertiesController extends BaseController break; case 'properties': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $this->doProperties(); @@ -64,7 +64,7 @@ class MaterializedviewpropertiesController extends BaseController break; case 'alter': - if (isset($_POST['alter'])) { + if (null !== $this->getPostParam('alter')) { $this->doAlter(false); } else { $this->doDefault(); @@ -76,7 +76,7 @@ class MaterializedviewpropertiesController extends BaseController break; /*case 'drop': - if (isset($_POST['drop'])) { + if($this->getPostParam('drop')!==null){ $this->doDrop(false); } else { $this->doDefault(); @@ -163,7 +163,7 @@ class MaterializedviewpropertiesController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['stralter']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { echo "

    {$this->lang['strnodata']}

    " . \PHP_EOL; @@ -219,7 +219,7 @@ class MaterializedviewpropertiesController extends BaseController echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo "lang['stralter']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; break; @@ -331,7 +331,7 @@ class MaterializedviewpropertiesController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "

    lang['stralter']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { echo "

    {$this->lang['strnodata']}

    " . \PHP_EOL; diff --git a/src/controllers/MaterializedviewsController.php b/src/controllers/MaterializedviewsController.php index 3d58327b..2d765e4e 100644 --- a/src/controllers/MaterializedviewsController.php +++ b/src/controllers/MaterializedviewsController.php @@ -64,7 +64,7 @@ class MaterializedviewsController extends BaseController break; case 'set_params_create': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $this->doSetParamsCreate(); @@ -84,7 +84,7 @@ class MaterializedviewsController extends BaseController break; case 'drop': - if (isset($_POST['drop'])) { + if (null !== $this->getPostParam('drop')) { $this->doDrop(false); } else { $this->doDefault(); @@ -418,7 +418,7 @@ class MaterializedviewsController extends BaseController echo '

    ' . \PHP_EOL; echo $this->view->form; echo "lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } diff --git a/src/controllers/OperatorsController.php b/src/controllers/OperatorsController.php index d1bf39ec..baa78c46 100644 --- a/src/controllers/OperatorsController.php +++ b/src/controllers/OperatorsController.php @@ -29,7 +29,7 @@ class OperatorsController extends BaseController switch ($this->action) { /*case 'save_create': - if (isset($_POST['cancel'])) { + if($this->getPostParam('cancel')!==null){ $this->doDefault(); } else { $this->doSaveCreate(); @@ -41,7 +41,7 @@ class OperatorsController extends BaseController break;*/ case 'drop': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $this->doDrop(false); @@ -263,7 +263,7 @@ class OperatorsController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['strdrop']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { $status = $data->dropOperator($_POST['operator_oid'], isset($_POST['cascade'])); diff --git a/src/controllers/RolesController.php b/src/controllers/RolesController.php index 9dd3d1ce..2fea45c9 100644 --- a/src/controllers/RolesController.php +++ b/src/controllers/RolesController.php @@ -29,7 +29,7 @@ class RolesController extends BaseController break; case 'save_create': - if (isset($_POST['create'])) { + if (null !== $this->getPostParam('create')) { $this->doSaveCreate(); } else { $this->doDefault(); @@ -41,7 +41,7 @@ class RolesController extends BaseController break; case 'save_alter': - if (isset($_POST['alter'])) { + if (null !== $this->getPostParam('alter')) { $this->doSaveAlter(); } else { $this->doDefault(); @@ -53,7 +53,7 @@ class RolesController extends BaseController break; case 'drop': - if (isset($_POST['drop'])) { + if (null !== $this->getPostParam('drop')) { $this->doDrop(false); } else { $this->doDefault(); @@ -317,7 +317,7 @@ class RolesController extends BaseController echo '

    ' . \PHP_EOL; echo $this->view->form; echo "lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } @@ -483,7 +483,7 @@ class RolesController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['stralter']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } @@ -540,7 +540,7 @@ class RolesController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['strdrop']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { $status = $data->dropRole($_REQUEST['rolename']); diff --git a/src/controllers/RulesController.php b/src/controllers/RulesController.php index 33fed67a..41515c60 100644 --- a/src/controllers/RulesController.php +++ b/src/controllers/RulesController.php @@ -32,7 +32,7 @@ class RulesController extends BaseController break; case 'save_create_rule': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $this->createRule(false); @@ -204,7 +204,7 @@ class RulesController extends BaseController '" value="', \htmlspecialchars($_REQUEST[$_REQUEST['subject']]), '" />' . \PHP_EOL; echo $this->view->form; echo "

    lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { if ('' === \trim($_POST['name'])) { diff --git a/src/controllers/SchemasController.php b/src/controllers/SchemasController.php index dbf2b93a..c45a065c 100644 --- a/src/controllers/SchemasController.php +++ b/src/controllers/SchemasController.php @@ -30,7 +30,7 @@ class SchemasController extends BaseController return $this->doSubTree(); } - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->action = ''; } @@ -40,7 +40,7 @@ class SchemasController extends BaseController switch ($this->action) { case 'create': - if (isset($_POST['create'])) { + if (null !== $this->getPostParam('create')) { $this->doSaveCreate(); } else { $this->doCreate(); @@ -48,7 +48,7 @@ class SchemasController extends BaseController break; case 'alter': - if (isset($_POST['alter'])) { + if (null !== $this->getPostParam('alter')) { $this->doSaveAlter(); } else { $this->doAlter(); @@ -56,7 +56,7 @@ class SchemasController extends BaseController break; case 'drop': - if (isset($_POST['drop'])) { + if (null !== $this->getPostParam('drop')) { $this->doDrop(false); } else { $this->doDrop(true); @@ -394,7 +394,7 @@ class SchemasController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['stralter']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { echo "

    {$this->lang['strnodata']}

    " . \PHP_EOL; @@ -455,7 +455,7 @@ class SchemasController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['strdrop']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { if (\is_array($_POST['nsp'])) { diff --git a/src/controllers/SequencesController.php b/src/controllers/SequencesController.php index 617c956c..f4dd6ecb 100644 --- a/src/controllers/SequencesController.php +++ b/src/controllers/SequencesController.php @@ -35,7 +35,7 @@ class SequencesController extends BaseController break; case 'save_create_sequence': - if (isset($_POST['create'])) { + if (null !== $this->getPostParam('create')) { $this->doSaveCreateSequence(); } else { $this->doDefault(); @@ -47,7 +47,7 @@ class SequencesController extends BaseController break; case 'drop': - if (isset($_POST['drop'])) { + if (null !== $this->getPostParam('drop')) { $this->doDrop(false); } else { $this->doDefault(); @@ -83,7 +83,7 @@ class SequencesController extends BaseController break; case 'alter': - if (isset($_POST['alter'])) { + if (null !== $this->getPostParam('alter')) { $this->doSaveAlter(); } else { $this->doDefault(); @@ -426,7 +426,7 @@ class SequencesController extends BaseController echo '

    ' . \PHP_EOL; echo $this->view->form; echo "lang['strdrop']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { if (\is_array($_POST['sequence'])) { @@ -528,7 +528,7 @@ class SequencesController extends BaseController echo '

    ' . \PHP_EOL; echo $this->view->form; echo "lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } @@ -653,7 +653,7 @@ class SequencesController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['strsetval']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { echo "

    {$this->lang['strnodata']}

    " . \PHP_EOL; @@ -829,7 +829,7 @@ class SequencesController extends BaseController echo $this->view->form; echo '' . \PHP_EOL; echo "lang['stralter']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { echo "

    {$this->lang['strnodata']}

    " . \PHP_EOL; diff --git a/src/controllers/ServersController.php b/src/controllers/ServersController.php index ade0da25..a2f32301 100644 --- a/src/controllers/ServersController.php +++ b/src/controllers/ServersController.php @@ -64,13 +64,13 @@ class ServersController extends BaseController $server_html .= $this->printFooter(false); - if (null === $this->container->requestobj->getAttribute('route')) { + if (null === \requestInstance()->getAttribute('route')) { echo $server_html; } else { - $body = $this->container->responseobj->getBody(); + $body = \responseInstance()->getBody(); $body->write($server_html); - return $this->container->responseobj; + return \responseInstance(); } } diff --git a/src/controllers/TablesController.php b/src/controllers/TablesController.php index a4e766cb..7888b709 100644 --- a/src/controllers/TablesController.php +++ b/src/controllers/TablesController.php @@ -43,7 +43,7 @@ class TablesController extends BaseController switch ($this->action) { case 'create': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $header_template = 'header_select2.twig'; @@ -57,7 +57,7 @@ class TablesController extends BaseController break; case 'confcreatelike': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $header_template = 'header_datatables.twig'; $this->doDefault(); } else { @@ -106,7 +106,7 @@ class TablesController extends BaseController break; case 'drop': - if (isset($_POST['drop'])) { + if (null !== $this->getPostParam('drop')) { $this->doDrop(false); } else { $header_template = 'header_datatables.twig'; @@ -160,37 +160,27 @@ class TablesController extends BaseController //\Kint::dump($tables); echo $this->printTable($tables, $columns, $actions, $this->table_place, $this->lang['strnotables']); - + $attr = [ + 'href' => [ + 'url' => 'tables', + 'urlvars' => [ + 'action' => 'createlike', + 'server' => $this->getRequestParam('server'), + 'database' => $this->getRequestParam('database'), + 'schema' => $this->getRequestParam('schema'), + ], + ], + ]; $navlinks = [ 'create' => [ - 'attr' => [ - 'href' => [ - 'url' => 'tables', - 'urlvars' => [ - 'action' => 'create', - 'server' => $_REQUEST['server'], - 'database' => $_REQUEST['database'], - 'schema' => $_REQUEST['schema'], - ], - ], - ], + 'attr' => $attr, 'content' => $this->lang['strcreatetable'], ], ]; if ((0 < $tables->recordCount()) && $data->hasCreateTableLike()) { $navlinks['createlike'] = [ - 'attr' => [ - 'href' => [ - 'url' => 'tables', - 'urlvars' => [ - 'action' => 'createlike', - 'server' => $_REQUEST['server'], - 'database' => $_REQUEST['database'], - 'schema' => $_REQUEST['schema'], - ], - ], - ], + 'attr' => $attr, 'content' => $this->lang['strcreatetablelike'], ]; } @@ -311,10 +301,12 @@ class TablesController extends BaseController echo '' . \PHP_EOL; echo "\t\n\t\t" . \PHP_EOL; echo "\t\t\n\t" . \PHP_EOL; + \htmlspecialchars($_REQUEST['name']), + "\" />\n\t" . \PHP_EOL; echo "\t\n\t\t" . \PHP_EOL; echo "\t\t\n\t" . \PHP_EOL; + \htmlspecialchars($_REQUEST['fields']), + "\" />\n\t" . \PHP_EOL; echo "\t\n\t\t" . \PHP_EOL; echo "\t\t\n\t" . \PHP_EOL; @@ -324,12 +316,14 @@ class TablesController extends BaseController echo "\t\t\n\t" . \PHP_EOL; @@ -337,14 +331,15 @@ class TablesController extends BaseController echo "\t\n\t\t" . \PHP_EOL; echo "\t\t\n\t" . \PHP_EOL; + \htmlspecialchars($_REQUEST['tblcomment']), + "\n\t" . \PHP_EOL; echo '
    {$this->lang['strname']}_maxNameLen}\" value=\"", - \htmlspecialchars($_REQUEST['name']), "\" />
    {$this->lang['strnumcols']}_maxNameLen}\" value=\"", - \htmlspecialchars($_REQUEST['fields']), "\" />
    {$this->lang['stroptions']}
    \n\t\t\t\n\t\t
    {$this->lang['strcomment']}
    ' . \PHP_EOL; echo '

    ' . \PHP_EOL; echo '' . \PHP_EOL; echo $this->view->form; echo "lang['strnext']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; break; @@ -402,14 +397,17 @@ class TablesController extends BaseController echo "\t\n\t\t", $i + 1, '. ' . \PHP_EOL; echo "\t\t_maxNameLen}\" value=\"", - \htmlspecialchars($_REQUEST['field'][$i]), '" />' . \PHP_EOL; + \htmlspecialchars($_REQUEST['field'][$i]), + '" />' . \PHP_EOL; echo "\t\t\n\t\t\t\n\t\t\n"; @@ -440,17 +440,20 @@ class TablesController extends BaseController echo "\t\t\t\n\t\t" . \PHP_EOL; echo "\t\t' . \PHP_EOL; + \htmlspecialchars($_REQUEST['length'][$i]), + '" />' . \PHP_EOL; echo "\t\t' . \PHP_EOL; echo "\t\t' . \PHP_EOL; + . (isset($_REQUEST['uniquekey'][$i]) ? ' checked="checked"' : '') . ' />' . \PHP_EOL; echo "\t\t' . \PHP_EOL; + . (isset($_REQUEST['primarykey'][$i]) ? ' checked="checked"' : '') + . ' />' . \PHP_EOL; echo "\t\t' . \PHP_EOL; + \htmlspecialchars($_REQUEST['default'][$i]), + '" />' . \PHP_EOL; echo "\t\t + \htmlspecialchars($_REQUEST['colcomment'][$i]), + "\" /> \n\t" . \PHP_EOL; } @@ -470,7 +473,7 @@ class TablesController extends BaseController echo '' . \PHP_EOL; } echo "lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; break; @@ -612,18 +615,18 @@ class TablesController extends BaseController } echo "\t\n\t\t{$this->lang['stroptions']}\n\t\t"; echo '"; if ($data->hasCreateTableLikeWithConstraints()) { echo '
    "; } if ($data->hasCreateTableLikeWithIndexes()) { echo '
    "; } echo "\n\t" . \PHP_EOL; @@ -632,7 +635,7 @@ class TablesController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "

    lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { if ('' === \trim($_REQUEST['name'])) { @@ -726,7 +729,8 @@ class TablesController extends BaseController echo "" . \PHP_EOL; echo ''; echo 'fields['attname']]) ? ' checked="checked"' : '', ' />'; + isset($_REQUEST['show'][$attrs->fields['attname']]) ? ' checked="checked"' : '', + ' />'; echo '', $this->misc->printVal($attrs->fields['attname']), ''; echo '', $this->misc->printVal($data->formatType($attrs->fields['type'], $attrs->fields['atttypmod'])), ''; echo ''; @@ -734,7 +738,9 @@ class TablesController extends BaseController foreach (\array_keys($data->selectOps) as $v) { echo '' . \PHP_EOL; + '>', + \htmlspecialchars($v), + '' . \PHP_EOL; } echo "\n" . \PHP_EOL; echo '', $data->printField( @@ -754,11 +760,11 @@ class TablesController extends BaseController } echo '

    ' . \PHP_EOL; - echo sprintf('%s',\htmlspecialchars($_REQUEST['table']), \PHP_EOL); + echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); echo '' . \PHP_EOL; echo $this->view->form; echo "lang['strselect']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; return; @@ -865,7 +871,8 @@ class TablesController extends BaseController ) ); echo "fields['attnum']}]\" value=\"", - \htmlspecialchars($attrs->fields['type']), '" />'; + \htmlspecialchars($attrs->fields['type']), + '" />'; echo '' . \PHP_EOL; echo "' . \PHP_EOL; echo '' . \PHP_EOL; echo '' . \PHP_EOL; - echo sprintf('%s',\htmlspecialchars($_REQUEST['table']), \PHP_EOL); + echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); echo "

    lang['strinsert']}\" />" . \PHP_EOL; echo "lang['strinsertandrepeat']}\" />" . \PHP_EOL; echo "lang['strcancel']}\" />" . \PHP_EOL; @@ -1016,7 +1023,7 @@ class TablesController extends BaseController echo '

    ' . \PHP_EOL; - echo sprintf('%s',\htmlspecialchars($_REQUEST['table']), \PHP_EOL); + echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); // END not mutli empty } echo " "; @@ -1092,7 +1099,7 @@ class TablesController extends BaseController echo '

    ', \sprintf($this->lang['strconfdroptable'], $this->misc->printVal($_REQUEST['table'])), '

    ' . \PHP_EOL; echo '' . \PHP_EOL; - echo sprintf('%s',\htmlspecialchars($_REQUEST['table']), \PHP_EOL); + echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); // END if multi drop } diff --git a/src/controllers/TablespacesController.php b/src/controllers/TablespacesController.php index 98be551e..d14ad956 100644 --- a/src/controllers/TablespacesController.php +++ b/src/controllers/TablespacesController.php @@ -216,7 +216,7 @@ class TablespacesController extends BaseController echo '

    ' . \PHP_EOL; echo '' . \PHP_EOL; echo "lang['stralter']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '
    ' . \PHP_EOL; } else { echo "

    {$this->lang['strnodata']}

    " . \PHP_EOL; @@ -334,7 +334,7 @@ class TablespacesController extends BaseController echo '' . \PHP_EOL; echo '

    ' . \PHP_EOL; echo "lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } diff --git a/src/controllers/TblpropertiesController.php b/src/controllers/TblpropertiesController.php index ab84dd62..81f0db2b 100644 --- a/src/controllers/TblpropertiesController.php +++ b/src/controllers/TblpropertiesController.php @@ -32,7 +32,7 @@ class TblpropertiesController extends BaseController switch ($this->action) { case 'alter': - if (isset($_POST['alter'])) { + if (null !== $this->getPostParam('alter')) { $this->doSaveAlter(); } else { $this->doDefault(); @@ -52,7 +52,7 @@ class TblpropertiesController extends BaseController break; case 'add_column': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $header_template = 'header_select2.twig'; @@ -61,7 +61,7 @@ class TblpropertiesController extends BaseController break; /*case 'properties': - if (isset($_POST['cancel'])) { + if($this->getPostParam('cancel')!==null){ $this->doDefault(); } else { $this->doProperties(); @@ -69,7 +69,7 @@ class TblpropertiesController extends BaseController break; case 'drop': - if (isset($_POST['drop'])) { + if (null !== $this->getPostParam('drop')) { $this->doDrop(false); } else { $this->doDefault(); @@ -287,7 +287,7 @@ class TblpropertiesController extends BaseController $this->coalesceArr($_POST, 'tablespace', null); $this->coalesceArr($_POST, 'newschema', null); - $with_oids = boolval($this->getPostParam('with_oids', false)); + $with_oids = (bool) ($this->getPostParam('with_oids', false)); $status = $data->alterTable( $this->getPostParam('table'), @@ -316,7 +316,6 @@ class TblpropertiesController extends BaseController } $this->doDefault($this->lang['strtablealtered']); } else { - $this->doAlter($this->lang['strtablealteredbad']); } } @@ -417,22 +416,22 @@ class TblpropertiesController extends BaseController } echo "\t\t\t\n\t\t\n\t" . \PHP_EOL; } - echo " " . \PHP_EOL; + echo ' ' . \PHP_EOL; echo ''; - echo sprintf(' %s', $data->hasObjectID($table->fields['relname']) ? 'checked' : '', ' WITH OIDS'); + echo \sprintf(' %s', $data->hasObjectID($table->fields['relname']) ? 'checked' : '', ' WITH OIDS'); echo ''; echo "{$this->lang['strcomment']}" . \PHP_EOL; echo ''; - echo sprintf('', \htmlspecialchars($_POST['comment'])); - echo sprintf('%s%s', \PHP_EOL, \PHP_EOL); + echo \sprintf('', \htmlspecialchars($_POST['comment'])); + echo \sprintf('%s%s', \PHP_EOL, \PHP_EOL); echo '

    ' . \PHP_EOL; - echo sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); + echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); echo $this->view->form; echo "lang['stralter']}\" />" . \PHP_EOL; - echo sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { echo "

    {$this->lang['strnodata']}

    " . \PHP_EOL; @@ -505,7 +504,7 @@ class TblpropertiesController extends BaseController echo '' . \PHP_EOL; echo '

    ' . \PHP_EOL; echo $this->view->form; - echo sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); + echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); echo "lang['strimport']}\" />

    " . \PHP_EOL; echo '' . \PHP_EOL; } @@ -616,13 +615,13 @@ class TblpropertiesController extends BaseController echo '

    ' . \PHP_EOL; echo '' . \PHP_EOL; echo $this->view->form; - echo sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); + echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); if (!$data->hasCreateFieldWithConstraints()) { echo '' . \PHP_EOL; } echo "lang['stradd']}\" />" . \PHP_EOL; - echo sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; echo '" . \PHP_EOL; @@ -683,7 +682,7 @@ class TblpropertiesController extends BaseController echo '
    ' . \PHP_EOL; echo '' . \PHP_EOL; - echo sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); + echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); echo '' . \PHP_EOL; echo $this->view->form; echo "

    " . \PHP_EOL; diff --git a/src/controllers/TriggersController.php b/src/controllers/TriggersController.php index d7c3d34f..83faeb49 100644 --- a/src/controllers/TriggersController.php +++ b/src/controllers/TriggersController.php @@ -29,7 +29,7 @@ class TriggersController extends BaseController switch ($this->action) { case 'alter': - if (isset($_POST['alter'])) { + if (null !== $this->getPostParam('alter')) { $this->doSaveAlter(); } else { $this->doDefault(); @@ -49,7 +49,7 @@ class TriggersController extends BaseController break; case 'save_create': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $this->doSaveCreate(); @@ -281,11 +281,11 @@ class TriggersController extends BaseController \htmlspecialchars($_POST['name']), '" />' . \PHP_EOL; echo '' . \PHP_EOL; echo '

    ' . \PHP_EOL; - echo sprintf('%s',\htmlspecialchars($_REQUEST['table']), \PHP_EOL); + echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); echo '' . \PHP_EOL; echo $this->view->form; echo "lang['strok']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '
    ' . \PHP_EOL; } else { echo "

    {$this->lang['strnodata']}

    " . \PHP_EOL; @@ -313,7 +313,7 @@ class TriggersController extends BaseController echo '
    ' . \PHP_EOL; echo '' . \PHP_EOL; - echo sprintf('%s',\htmlspecialchars($_REQUEST['table']), \PHP_EOL); + echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); echo '' . \PHP_EOL; echo $this->view->form; echo "

    " . \PHP_EOL; @@ -352,7 +352,7 @@ class TriggersController extends BaseController echo '' . \PHP_EOL; echo '' . \PHP_EOL; - echo sprintf('%s',\htmlspecialchars($_REQUEST['table']), \PHP_EOL); + echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); echo '' . \PHP_EOL; echo $this->view->form; echo "lang['stryes']}\" />" . \PHP_EOL; @@ -390,7 +390,7 @@ class TriggersController extends BaseController echo '' . \PHP_EOL; echo '' . \PHP_EOL; - echo sprintf('%s',\htmlspecialchars($_REQUEST['table']), \PHP_EOL); + echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); echo '' . \PHP_EOL; echo $this->view->form; echo "lang['stryes']}\" />" . \PHP_EOL; @@ -473,9 +473,9 @@ class TriggersController extends BaseController echo '()' . \PHP_EOL; echo '' . \PHP_EOL; echo "

    lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; - echo sprintf('%s',\htmlspecialchars($_REQUEST['table']), \PHP_EOL); + echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); echo $this->view->form; echo '
    ' . \PHP_EOL; } diff --git a/src/controllers/TypesController.php b/src/controllers/TypesController.php index f5ea87a2..7c866657 100644 --- a/src/controllers/TypesController.php +++ b/src/controllers/TypesController.php @@ -29,7 +29,7 @@ class TypesController extends BaseController switch ($this->action) { case 'create_comp': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $this->doCreateComposite(); @@ -37,7 +37,7 @@ class TypesController extends BaseController break; case 'create_enum': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $this->doCreateEnum(); @@ -45,7 +45,7 @@ class TypesController extends BaseController break; case 'save_create': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $this->doSaveCreate(); @@ -57,7 +57,7 @@ class TypesController extends BaseController break; case 'drop': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $this->doDrop(false); @@ -350,7 +350,7 @@ class TypesController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['strdrop']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { $status = $data->dropType($_POST['type'], isset($_POST['cascade'])); @@ -404,7 +404,7 @@ class TypesController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['strnext']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; break; @@ -486,7 +486,7 @@ class TypesController extends BaseController echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo "lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; break; @@ -581,7 +581,7 @@ class TypesController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['strnext']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; break; @@ -630,7 +630,7 @@ class TypesController extends BaseController echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo "lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; break; @@ -779,7 +779,7 @@ class TypesController extends BaseController echo '

    ' . \PHP_EOL; echo $this->view->form; echo "lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } diff --git a/src/controllers/UsersController.php b/src/controllers/UsersController.php index bffe2104..54034dfe 100644 --- a/src/controllers/UsersController.php +++ b/src/controllers/UsersController.php @@ -351,7 +351,7 @@ class UsersController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['stralter']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { echo "

    {$this->lang['strnodata']}

    " . \PHP_EOL; @@ -405,7 +405,7 @@ class UsersController extends BaseController echo '' . \PHP_EOL; echo $this->view->form; echo "lang['strdrop']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { $status = $data->dropUser($_REQUEST['username']); @@ -459,7 +459,7 @@ class UsersController extends BaseController echo '

    ' . \PHP_EOL; echo $this->view->form; echo "lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } diff --git a/src/controllers/ViewpropertiesController.php b/src/controllers/ViewpropertiesController.php index 237b0664..523d5c47 100644 --- a/src/controllers/ViewpropertiesController.php +++ b/src/controllers/ViewpropertiesController.php @@ -35,7 +35,7 @@ class ViewpropertiesController extends BaseController switch ($this->action) { case 'save_edit': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefinition(); } else { $this->doSaveEdit(); @@ -57,7 +57,7 @@ class ViewpropertiesController extends BaseController break; case 'properties': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $this->doProperties(); @@ -65,7 +65,7 @@ class ViewpropertiesController extends BaseController break; case 'alter': - if (isset($_POST['alter'])) { + if (null !== $this->getPostParam('alter')) { $this->doAlter(false); } else { $this->doDefault(); @@ -77,7 +77,7 @@ class ViewpropertiesController extends BaseController break; /*case 'drop': - if (isset($_POST['drop'])) { + if($this->getPostParam('drop')!==null){ $this->doDrop(false); } else { $this->doDefault(); @@ -233,7 +233,7 @@ EOT; echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo "lang['stralter']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; break; @@ -345,7 +345,7 @@ EOT; echo '' . \PHP_EOL; echo $this->view->form; echo "

    lang['stralter']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } else { echo "

    {$this->lang['strnodata']}

    " . \PHP_EOL; diff --git a/src/controllers/ViewsController.php b/src/controllers/ViewsController.php index c8212af6..84feea4d 100644 --- a/src/controllers/ViewsController.php +++ b/src/controllers/ViewsController.php @@ -64,7 +64,7 @@ class ViewsController extends BaseController break; case 'set_params_create': - if (isset($_POST['cancel'])) { + if (null !== $this->getPostParam('cancel')) { $this->doDefault(); } else { $this->doSetParamsCreate(); @@ -84,7 +84,7 @@ class ViewsController extends BaseController break; case 'drop': - if (isset($_POST['drop'])) { + if (null !== $this->getPostParam('drop')) { $this->doDrop(false); } else { $this->doDefault(); @@ -418,7 +418,7 @@ class ViewsController extends BaseController echo '

    ' . \PHP_EOL; echo $this->view->form; echo "lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } diff --git a/src/database/ADOdbBase.php b/src/database/ADOdbBase.php index 1b23f47e..abd225b6 100644 --- a/src/database/ADOdbBase.php +++ b/src/database/ADOdbBase.php @@ -6,8 +6,6 @@ namespace PHPPgAdmin\Database; -use PHPPgAdmin\ADONewConnection; - /** * @file * Parent class of all ADODB objects. @@ -18,24 +16,45 @@ class ADOdbBase { use \PHPPgAdmin\Traits\HelperTrait; use \PHPPgAdmin\Database\Traits\HasTrait; -/** @var array */ + + /** + * @var array + */ public $lang; -/** @var array */ + + /** + * @var array + */ public $conf; -/** @var \Slim\Container */ + + /** + * @var \ADODB_postgres9 + */ + public $conn; + + /** + * @var \Slim\Container + */ protected $container; -/** @var array */ + + /** + * @var array + */ protected $server_info; - /** @var string */ + + /** + * @var string + */ protected $lastExecutedSql; + /** * Base constructor. * - * @param \ADODB_postgres9|\ADODB_pdo $conn The connection object + * @param \ADODB_postgres9 $conn The connection object * @param mixed $container * @param mixed $server_info */ - public function __construct( &$conn, $container, $server_info) + public function __construct(&$conn, $container, $server_info) { $this->container = $container; $this->server_info = $server_info; @@ -44,9 +63,9 @@ class ADOdbBase $this->conf = $container->get('conf'); $this->prtrace('instanced connection class'); - $this->lastExecutedSql=''; + $this->lastExecutedSql = ''; $this->conn = $conn; - } + } /** * Sets the comment for an object in the database. @@ -120,14 +139,19 @@ class ADOdbBase } else { $sql .= 'NULL;'; } -$this->lastExecutedSql=$sql; + $this->lastExecutedSql = $sql; + return $this->execute($sql); } -public function getLastExecutedSQL():string { - $lastExecutedSql=$this->lastExecutedSql; - $this->lastExecutedSql=''; - return $lastExecutedSql; -} + + public function getLastExecutedSQL(): string + { + $lastExecutedSql = $this->lastExecutedSql; + $this->lastExecutedSql = ''; + + return $lastExecutedSql; + } + /** * Turns on or off query debugging. * @@ -190,7 +214,7 @@ public function getLastExecutedSQL():string { try { $rs = $this->conn->Execute($sql); - return $this->conn->ErrorNo(); + return $this->ErrorNo(); } catch (\Exception $e) { return $e->getCode(); } @@ -222,6 +246,16 @@ public function getLastExecutedSQL():string { } } + public function ErrorNo(): int + { + return $this->conn->ErrorNo(); + } + + public function ErrorMsg(): string + { + return $this->conn->ErrorMsg(); + } + /** * Retrieves a single value from a query. * @@ -239,7 +273,7 @@ public function getLastExecutedSQL():string { // If failure, or no rows returned, return error value if (!$rs) { - return $this->conn->ErrorNo(); + return $this->ErrorNo(); } if (0 === $rs->recordCount()) { @@ -286,7 +320,7 @@ public function getLastExecutedSQL():string { // Check for failures if (!$this->conn->Execute($sql)) { // Check for referential integrity failure - if (\mb_stristr($this->conn->ErrorMsg(), 'referential')) { + if (\mb_stristr($this->ErrorMsg(), 'referential')) { return -1; } } @@ -296,7 +330,7 @@ public function getLastExecutedSQL():string { return -2; } - return $this->conn->ErrorNo(); + return $this->ErrorNo(); } /** @@ -385,16 +419,16 @@ public function getLastExecutedSQL():string { // Check for failures if (!$this->conn->Execute($sql)) { // Check for unique constraint failure - if (\mb_stristr($this->conn->ErrorMsg(), 'unique')) { + if (\mb_stristr($this->ErrorMsg(), 'unique')) { return -1; } - if (\mb_stristr($this->conn->ErrorMsg(), 'referential')) { + if (\mb_stristr($this->ErrorMsg(), 'referential')) { return -2; } // Check for referential integrity failure } - return $this->conn->ErrorNo(); + return $this->ErrorNo(); } /** @@ -456,11 +490,11 @@ public function getLastExecutedSQL():string { // Check for failures if (!$this->conn->Execute($setClause . $whereClause)) { // Check for unique constraint failure - if (\mb_stristr($this->conn->ErrorMsg(), 'unique')) { + if (\mb_stristr($this->ErrorMsg(), 'unique')) { return -1; } - if (\mb_stristr($this->conn->ErrorMsg(), 'referential')) { + if (\mb_stristr($this->ErrorMsg(), 'referential')) { return -2; } // Check for referential integrity failure } @@ -470,7 +504,7 @@ public function getLastExecutedSQL():string { return -3; } - return $this->conn->ErrorNo(); + return $this->ErrorNo(); } /** @@ -480,7 +514,7 @@ public function getLastExecutedSQL():string { */ public function beginTransaction() { - return intval(!$this->conn->BeginTrans()); + return (int) (!$this->conn->BeginTrans()); } /** @@ -490,7 +524,7 @@ public function getLastExecutedSQL():string { */ public function endTransaction() { - return intval(!$this->conn->CommitTrans()); + return (int) (!$this->conn->CommitTrans()); } /** @@ -500,7 +534,7 @@ public function getLastExecutedSQL():string { */ public function rollbackTransaction() { - return intval( !$this->conn->RollbackTrans()); + return (int) (!$this->conn->RollbackTrans()); } /** diff --git a/src/database/Connection.php b/src/database/Connection.php new file mode 100644 index 00000000..db541416 --- /dev/null +++ b/src/database/Connection.php @@ -0,0 +1,177 @@ + 'Postgres13', + '12' => 'Postgres12', + '11' => 'Postgres11', + '10' => 'Postgres10', + '9.7' => 'Postgres96', + '9.6' => 'Postgres96', + '9.5' => 'Postgres95', + '9.4' => 'Postgres94', + '9.3' => 'Postgres93', + '9.2' => 'Postgres92', + '9.1' => 'Postgres91', + '9.0' => 'Postgres90', + ]; + + // The backend platform. Set to UNKNOWN by default. + private $_connection_result; + + /** + * Creates a new connection. Will actually make a database connection. + * + * @param array $server_info + * @param string $database database name + * @param \Slim\Container $container + * @param int $fetchMode Defaults to associative. Override for different behaviour + */ + public function __construct($server_info, $database, $container, $fetchMode = \ADODB_FETCH_ASSOC) + { + $host = $server_info['host']; + $port = $server_info['port']; + $sslmode = $server_info['sslmode']; + $user = $server_info['username']; + $password = $server_info['password']; + + $this->server_info = $server_info; + + $this->container = $container; + + $this->conn = \ADONewConnection('postgres9'); + //$this->conn->debug = true; + $this->conn->setFetchMode($fetchMode); + + // Ignore host if null + if (null === $host || '' === $host) { + if (null !== $port && '' !== $port) { + $pghost = ':' . $port; + } else { + $pghost = ''; + } + } else { + $pghost = "{$host}:{$port}"; + } + + // Add sslmode to $pghost as needed + if (('disable' === $sslmode) || ('allow' === $sslmode) || ('prefer' === $sslmode) || ('require' === $sslmode)) { + $pghost .= ':' . $sslmode; + } elseif ('legacy' === $sslmode) { + $pghost .= ' requiressl=1'; + } + + try { + $this->conn->connect($pghost, $user, $password, $database); + //$this->prtrace($this->conn); + } catch (\Exception $e) { + dump($e); + $this->prtrace($e->getMessage(), $e->getTrace()); + } + } + + public function getConnectionResult() + { + return $this->_connection_result; + } + + /** + * Gets the name of the correct database driver to use. As a side effect, + * sets the platform. + * + * @param string $description A description of the database and version (returns by reference) + * + * @return string The driver. e.g. Postgres96 + */ + public function getDriver(&$description) + { + $version = null; + + if ($this->conn->_connectionID) { + $v = \pg_version($this->conn->_connectionID); + + //\PhpConsole\Handler::getInstance()->debug($v, 'pg_version'); + + if (isset($v['server'])) { + $version = $v['server']; + } + } + // If we didn't manage to get the version without a query, query... + if (!isset($version)) { + $adodb = new ADOdbBase($this->conn, $this->container, $this->server_info); + + $sql = 'SELECT VERSION() AS version'; + $field = $adodb->selectField($sql, 'version'); + + // Check the platform, if it's mingw, set it + if (\preg_match('/ mingw /i', $field)) { + $this->platform = 'MINGW'; + } + + $params = \explode(' ', $field); + + if (!isset($params[1])) { + return null; + } + + $version = $params[1]; // eg. 8.4.4 + } + + $description = "PostgreSQL {$version}"; + + $version_parts = \explode('.', $version); + + if ((int) (10 <= $version_parts[0])) { + $major_version = $version_parts[0]; + } else { + $major_version = \implode('.', [$version_parts[0], $version_parts[1]]); + } + + //$this->prtrace(['pg_version' => pg_version($this->conn->_connectionID), 'version' => $version, 'major_version' => $major_version]); + // Detect version and choose appropriate database driver + if (\array_key_exists($major_version, $this->version_dictionary)) { + return $this->version_dictionary[$major_version]; + } + + // if major version is less than 9 return null, we don't support it + if (9 > (int) \mb_substr($version, 0, 1)) { + return null; + } + + // If unknown version, then default to latest driver + return 'Postgres'; + } + + /** + * Get the last error in the connection. + * + * @return string Error string + */ + public function getLastError() + { + return \pg_last_error($this->conn->_connectionID); + } +} diff --git a/src/database/Postgres.php b/src/database/Postgres.php index d2c31f8a..3d2d8449 100644 --- a/src/database/Postgres.php +++ b/src/database/Postgres.php @@ -36,6 +36,21 @@ class Postgres extends ADOdbBase public $conf; + /** + * @var float + */ + public $major_version = 9.6; + + /** + * @var class-string + */ + public $help_classname = \PHPPgAdmin\Help\PostgresDoc::class; + + /** + * @var \PHPPgAdmin\Help\PostgresDoc + */ + public $help_class; + protected $container; protected $server_info; @@ -49,6 +64,8 @@ class Postgres extends ADOdbBase $this->lang = $container->get('lang'); $this->conf = $container->get('conf'); $this->server_info = $server_info; + $this->help_class = new $this->help_classname($this->conf, $this->major_version); + $this->lastExecutedSql = ''; } /** @@ -60,23 +77,24 @@ class Postgres extends ADOdbBase */ public function getHelp($help) { - $this->getHelpPages(); + $this->help_page = $this->help_class->getHelpTopics(); + $this->help_base = $this->help_class->getHelpBase(); - if (isset($this->help_page[$help])) { - if (\is_array($this->help_page[$help])) { - $urls = []; + if (!$topicResult = $this->help_class->getHelpTopic($help)) { + return null; + } - foreach ($this->help_page[$help] as $link) { - $urls[] = $this->help_base . $link; - } + if (\is_array($topicResult)) { + $urls = []; - return $urls; + foreach ($topicResult as $link) { + $urls[] = $this->help_base . $link; } - return $this->help_base . $this->help_page[$help]; + return $urls; } - return null; + return $this->help_base . $topicResult; } /** @@ -84,15 +102,9 @@ class Postgres extends ADOdbBase * get help page by instancing the corresponding help class * if $this->help_page and $this->help_base are set, this function is a noop. */ - public function getHelpPages(): void + public function getHelpPages(): array { - if (null === $this->help_page || null === $this->help_base) { - $help_classname = '\PHPPgAdmin\Help\PostgresDoc' . \str_replace('.', '', $this->major_version); - - $help_class = new $help_classname($this->conf, $this->major_version); - $this->help_page = $help_class->getHelpPage(); - $this->help_base = $help_class->getHelpBase(); - } + return $this->help_class->getHelpTopics(); } // Formatting functions @@ -144,7 +156,7 @@ class Postgres extends ADOdbBase if (null !== $value) { $value = $this->escapeBytea($value); } - // no break + // no break case 'text': case 'text[]': case 'json': @@ -493,7 +505,8 @@ class Postgres extends ADOdbBase * end of quote if matching non-backslashed character. * backslashes don't count for double quotes, though. */ - if (\mb_substr($line, $i, 1) === $in_quote && + if ( + \mb_substr($line, $i, 1) === $in_quote && (0 === $bslash_count % 2 || '"' === $in_quote) ) { $in_quote = 0; diff --git a/src/database/Postgres10.php b/src/database/Postgres10.php index c14ba493..a076d824 100644 --- a/src/database/Postgres10.php +++ b/src/database/Postgres10.php @@ -20,8 +20,16 @@ namespace PHPPgAdmin\Database; */ class Postgres10 extends Postgres96 { + /** + * @var float + */ public $major_version = 10; + /** + * @var class-string + */ + public $help_classname = \PHPPgAdmin\Help\PostgresDoc10::class; + /** * Return all tables in current database (and schema). * diff --git a/src/database/Postgres11.php b/src/database/Postgres11.php index 850ae822..9dfce029 100644 --- a/src/database/Postgres11.php +++ b/src/database/Postgres11.php @@ -15,8 +15,16 @@ namespace PHPPgAdmin\Database; */ class Postgres11 extends Postgres10 { + /** + * @var float + */ public $major_version = 11; + /** + * @var class-string + */ + public $help_classname = \PHPPgAdmin\Help\PostgresDoc11::class; + /** * Returns a list of all functions in the database. * In PG 11 proagg was replaced with prokind. diff --git a/src/database/Postgres12.php b/src/database/Postgres12.php index d2b63461..aa8495e1 100644 --- a/src/database/Postgres12.php +++ b/src/database/Postgres12.php @@ -15,8 +15,16 @@ namespace PHPPgAdmin\Database; */ class Postgres12 extends Postgres11 { + /** + * @var float + */ public $major_version = 12; + /** + * @var class-string + */ + public $help_classname = \PHPPgAdmin\Help\PostgresDoc12::class; + /** * Checks to see whether or not a table has a unique id column. * diff --git a/src/database/Postgres13.php b/src/database/Postgres13.php index d3528398..853d5b8c 100644 --- a/src/database/Postgres13.php +++ b/src/database/Postgres13.php @@ -16,5 +16,13 @@ namespace PHPPgAdmin\Database; */ class Postgres13 extends Postgres12 { + /** + * @var float + */ public $major_version = 13; + + /** + * @var class-string + */ + public $help_classname = \PHPPgAdmin\Help\PostgresDoc12::class; } diff --git a/src/database/Postgres90.php b/src/database/Postgres90.php index 6315aa6e..2b06faf0 100644 --- a/src/database/Postgres90.php +++ b/src/database/Postgres90.php @@ -14,5 +14,13 @@ namespace PHPPgAdmin\Database; */ class Postgres90 extends Postgres91 { + /** + * @var float + */ public $major_version = 9.0; + + /** + * @var class-string + */ + public $help_classname = \PHPPgAdmin\Help\PostgresDoc90::class; } diff --git a/src/database/Postgres91.php b/src/database/Postgres91.php index e981f240..43fec0ca 100644 --- a/src/database/Postgres91.php +++ b/src/database/Postgres91.php @@ -16,8 +16,16 @@ namespace PHPPgAdmin\Database; */ class Postgres91 extends Postgres92 { + /** + * @var float + */ public $major_version = 9.1; + /** + * @var class-string + */ + public $help_classname = \PHPPgAdmin\Help\PostgresDoc91::class; + // Administration functions /** diff --git a/src/database/Postgres92.php b/src/database/Postgres92.php index cb2ff754..4e78d22c 100644 --- a/src/database/Postgres92.php +++ b/src/database/Postgres92.php @@ -14,8 +14,16 @@ class Postgres92 extends Postgres93 { public $typIndexes = ['BTREE', 'RTREE', 'GIST', 'GIN', 'HASH']; + /** + * @var float + */ public $major_version = 9.2; + /** + * @var class-string + */ + public $help_classname = \PHPPgAdmin\Help\PostgresDoc92::class; + /** * Returns all available process information. * diff --git a/src/database/Postgres93.php b/src/database/Postgres93.php index b2a0747f..f39a3842 100644 --- a/src/database/Postgres93.php +++ b/src/database/Postgres93.php @@ -12,8 +12,16 @@ namespace PHPPgAdmin\Database; */ class Postgres93 extends Postgres94 { + /** + * @var float + */ public $major_version = 9.3; + /** + * @var class-string + */ + public $help_classname = \PHPPgAdmin\Help\PostgresDoc93::class; + /** * Returns a list of all functions in the database. * diff --git a/src/database/Postgres94.php b/src/database/Postgres94.php index 7fe10201..0f23d0a0 100644 --- a/src/database/Postgres94.php +++ b/src/database/Postgres94.php @@ -14,5 +14,13 @@ class Postgres94 extends Postgres95 { public $typIndexes = ['BTREE', 'RTREE', 'GIST', 'GIN', 'HASH', 'SP-GIST']; + /** + * @var class-string + */ + public $help_classname = \PHPPgAdmin\Help\PostgresDoc94::class; + + /** + * @var float + */ public $major_version = 9.4; } diff --git a/src/database/Postgres95.php b/src/database/Postgres95.php index d6f1f93b..023b24d8 100644 --- a/src/database/Postgres95.php +++ b/src/database/Postgres95.php @@ -14,5 +14,13 @@ class Postgres95 extends Postgres96 { public $typIndexes = ['BTREE', 'BRIN', 'RTREE', 'GIST', 'GIN', 'HASH']; + /** + * @var class-string + */ + public $help_classname = \PHPPgAdmin\Help\PostgresDoc95::class; + + /** + * @var float + */ public $major_version = 9.5; } diff --git a/src/database/Postgres96.php b/src/database/Postgres96.php index ef2ad7e5..2f74c9cf 100644 --- a/src/database/Postgres96.php +++ b/src/database/Postgres96.php @@ -14,8 +14,16 @@ class Postgres96 extends Postgres { public $typIndexes = ['BTREE', 'BRIN', 'RTREE', 'GIST', 'GIN', 'HASH', 'SP-GIST']; + /** + * @var float + */ public $major_version = 9.6; + /** + * @var class-string + */ + public $help_classname = \PHPPgAdmin\Help\PostgresDoc96::class; + // Administration functions /** diff --git a/src/database/databasetraits/HasTrait.php b/src/database/databasetraits/HasTrait.php index aabaa1e9..895449e5 100644 --- a/src/database/databasetraits/HasTrait.php +++ b/src/database/databasetraits/HasTrait.php @@ -16,6 +16,11 @@ trait HasTrait // The backend platform. Set to UNKNOWN by default. public $platform = 'UNKNOWN'; + /** @var string */ + + /** + * @var float + */ public $major_version = 9.6; // Max object name length diff --git a/src/database/databasetraits/TableTrait.php b/src/database/databasetraits/TableTrait.php index 6a27be9c..6df728fe 100644 --- a/src/database/databasetraits/TableTrait.php +++ b/src/database/databasetraits/TableTrait.php @@ -187,8 +187,6 @@ trait TableTrait $sql .= ')'; - - // Handle WITHOUT OIDS if ($this->hasObjectID($table)) { $sql .= ' WITH OIDS'; @@ -793,7 +791,8 @@ trait TableTrait * @param string $schema The new schema for the table * @param string $comment The comment on the table * @param string $tablespace The new tablespace for the table ('' means leave as is) - * @param bool $with_oids If set to FALSE, will drop oids column + * @param bool $with_oids If set to FALSE, will drop oids column + * * @return bool|int 0 success */ public function alterTable($table, $name, $owner, $schema, $comment, $tablespace, bool $with_oids = true) @@ -805,16 +804,16 @@ trait TableTrait } $status = $this->beginTransaction(); - dump(['beginTransaction' => $status]); + //dump(['beginTransaction' => $status]); if (0 !== $status) { $this->rollbackTransaction(); return -1; } - $sql_sentence="ALTER TABLE \"{$this->_schema}\".\"{$tblrs->fields['relname']}\" "; - $status = $this->_alterTable($tblrs, $name, $owner, $schema, $comment, $tablespace, !$with_oids,$sql_sentence); - dump(['_alterTable' => [$status, $sql_sentence.$this->getLastExecutedSQL()]]); + $sql_sentence = "ALTER TABLE \"{$this->_schema}\".\"{$tblrs->fields['relname']}\" "; + $status = $this->_alterTable($tblrs, $name, $owner, $schema, $comment, $tablespace, !$with_oids, $sql_sentence); + //dump(['_alterTable' => [$status, $sql_sentence.$this->getLastExecutedSQL()]]); if (0 !== $status) { $this->rollbackTransaction(); @@ -824,88 +823,14 @@ trait TableTrait return $this->endTransaction(); } - /** - * Protected method which alter a table - * SHOULDN'T BE CALLED OUTSIDE OF A TRANSACTION. - * - * @param \PHPPgAdmin\ADORecordSet $tblrs The table recordSet returned by getTable() - * @param string $name The new name for the table - * @param string $owner The new owner for the table - * @param string $schema The new schema for the table - * @param string $comment The comment on the table - * @param string $tablespace The new tablespace for the table ('' means leave as is) - * @param bool $withoutoids If set to TRUE, will drop oids column - * @return int 0 success - */ - protected function _alterTable($tblrs, $name, $owner, $schema, $comment, $tablespace, bool $withoutoids = false ) - { - $this->fieldArrayClean($tblrs->fields); - - // Comment - $status = $this->setComment('TABLE', '', $tblrs->fields['relname'], $comment); - dump(['setComment' => $this->getLastExecutedSQL()]); - - $this->lastExecutedSql=$this->getLastExecutedSQL(); - if (0 !== $status) { - return -4; - } - - // Owner - $this->fieldClean($owner); - [$TableOwnerStatus,$TableOwnerSQL] = $this->alterTableOwner($tblrs, $owner); - $this->lastExecutedSql.=$TableOwnerSQL?sprintf('%s%s',\PHP_EOL,$TableOwnerSQL):''; - //dump(['alterTableOwner' => [$TableOwnerStatus,$TableOwnerSQL]]); - - if (0 !== $TableOwnerStatus) { - return -5; - } - - // Tablespace - $this->fieldClean($tablespace); - [$TableTablespaceStatus,$TableTablespaceSQL] = $this->alterTableTablespace($tblrs, $tablespace); - $this->lastExecutedSql.=$TableTablespaceSQL?sprintf('%s%s',\PHP_EOL,$TableTablespaceSQL):''; - //dump(['alterTableTablespace' => [$TableTablespaceStatus,$TableTablespaceSQL]]); - - if (0 !== $TableTablespaceStatus) { - return -6; - } - - // Rename - $this->fieldClean($name); - [$TableNameStatus,$TableNameSQL] = $this->alterTableName($tblrs, $name); - $this->lastExecutedSql.=$TableNameSQL?sprintf('%s%s',\PHP_EOL,$TableNameSQL):''; - //dump(['alterTableName' => [$TableNameStatus,$TableNameSQL]]); - - if (0 !== $TableNameStatus) { - return -3; - } - - // Schema - $this->fieldClean($schema); - [$TableSchemaStatus,$TableSchemaSQL] = $this->alterTableSchema($tblrs, $schema); - $this->lastExecutedSql.=$TableSchemaSQL?sprintf('%s%s',\PHP_EOL,$TableSchemaSQL):''; - //dump(['alterTableSchema' => [$TableSchemaStatus,$TableSchemaSQL]]); - - if (0 !== $TableSchemaStatus) { - return -7; - } - [$TableOidsStatus,$TableOidsSQL] = $this->alterTableOids($tblrs, $withoutoids); - $this->lastExecutedSql.=$TableOidsSQL?sprintf('%s%s',\PHP_EOL,$TableOidsSQL):''; - //dump(['alterTableOids' => [$TableOidsStatus,$TableOidsSQL]]); - if (0 !== $TableOidsStatus) { - return -7; - } - - - return 0; - } /** * Enables or disables the oid system column to a table a table's owner * /!\ this function is called from _alterTable which take care of escaping fields. * - * @param \PHPPgAdmin\ADORecordSet $tblrs The table RecordSet returned by getTable() + * @param \PHPPgAdmin\ADORecordSet $tblrs The table RecordSet returned by getTable() * @param null|string $owner + * @param bool $withoutoids * * @return array{0:int,1:string} [status:0 if successful, change_sql: changed attribute] */ @@ -914,27 +839,27 @@ trait TableTrait $status = 0; $change_sql = ''; // no changes. Return 0 - if (boolval($this->hasObjectID($tblrs->fields['relname'])) !== !$withoutoids) { - - + if ((bool) ($this->hasObjectID($tblrs->fields['relname'])) !== !$withoutoids) { /* vars cleaned in _alterTable */ $f_schema = $this->_schema; $this->fieldClean($f_schema); $alter_sql = "ALTER TABLE \"{$f_schema}\".\"{$tblrs->fields['relname']}\" "; - $change_sql = " SET "; + $change_sql = ' SET '; + if ($withoutoids) { $change_sql .= ' WITHOUT OIDS'; } else { $change_sql .= ' WITH OIDS'; } - $sql = implode(' ', [$alter_sql, $change_sql]); + $sql = \implode(' ', [$alter_sql, $change_sql]); $status = $this->execute($sql); } return [$status, $change_sql]; } + /** * Alter a table's owner * /!\ this function is called from _alterTable which take care of escaping fields. @@ -957,7 +882,7 @@ trait TableTrait // superuser only function. $alter_sql = "ALTER TABLE \"{$f_schema}\".\"{$tblrs->fields['relname']}\" "; $change_sql = " OWNER TO \"{$owner}\""; - $sql = implode(' ', [$alter_sql, $change_sql]); + $sql = \implode(' ', [$alter_sql, $change_sql]); $status = $this->execute($sql); } @@ -965,7 +890,6 @@ trait TableTrait return [$status, $change_sql]; } - /** * Alter a table's tablespace * /!\ this function is called from _alterTable which take care of escaping fields. @@ -988,7 +912,7 @@ trait TableTrait // don't want to do this unnecessarily. $alter_sql = "ALTER TABLE \"{$f_schema}\".\"{$tblrs->fields['relname']}\" "; $change_sql = " SET TABLESPACE \"{$tablespace}\""; - $sql = implode(' ', [$alter_sql, $change_sql]); + $sql = \implode(' ', [$alter_sql, $change_sql]); $status = $this->execute($sql); } @@ -1017,7 +941,7 @@ trait TableTrait $alter_sql = "ALTER TABLE \"{$f_schema}\".\"{$tblrs->fields['relname']}\" "; $change_sql = " RENAME TO \"{$name}\""; - $sql = implode(' ', [$alter_sql, $change_sql]); + $sql = \implode(' ', [$alter_sql, $change_sql]); $status = $this->execute($sql); if (0 === $status) { @@ -1051,7 +975,7 @@ trait TableTrait // don't want to do this unnecessarily. $alter_sql = "ALTER TABLE \"{$f_schema}\".\"{$tblrs->fields['relname']}\" "; $change_sql = " SET SCHEMA \"{$schema}\""; - $sql = implode(' ', [$alter_sql, $change_sql]); + $sql = \implode(' ', [$alter_sql, $change_sql]); $status = $this->execute($sql); } @@ -1396,6 +1320,82 @@ trait TableTrait abstract public function getAttributeNames($table, $atts); + /** + * Protected method which alter a table + * SHOULDN'T BE CALLED OUTSIDE OF A TRANSACTION. + * + * @param \PHPPgAdmin\ADORecordSet $tblrs The table recordSet returned by getTable() + * @param string $name The new name for the table + * @param string $owner The new owner for the table + * @param string $schema The new schema for the table + * @param string $comment The comment on the table + * @param string $tablespace The new tablespace for the table ('' means leave as is) + * @param bool $withoutoids If set to TRUE, will drop oids column + * + * @return int 0 success + */ + protected function _alterTable($tblrs, $name, $owner, $schema, $comment, $tablespace, bool $withoutoids = false) + { + $this->fieldArrayClean($tblrs->fields); + + // Comment + $status = $this->setComment('TABLE', '', $tblrs->fields['relname'], $comment); + //dump(['setComment' => $this->getLastExecutedSQL()]); + + $this->lastExecutedSql = $this->getLastExecutedSQL(); + + if (0 !== $status) { + return -4; + } + + // Owner + $this->fieldClean($owner); + [$TableOwnerStatus,$TableOwnerSQL] = $this->alterTableOwner($tblrs, $owner); + $this->lastExecutedSql .= $TableOwnerSQL ? \sprintf('%s%s', \PHP_EOL, $TableOwnerSQL) : ''; + //dump(['alterTableOwner' => [$TableOwnerStatus,$TableOwnerSQL]]); + + if (0 !== $TableOwnerStatus) { + return -5; + } + + // Tablespace + $this->fieldClean($tablespace); + [$TableTablespaceStatus,$TableTablespaceSQL] = $this->alterTableTablespace($tblrs, $tablespace); + $this->lastExecutedSql .= $TableTablespaceSQL ? \sprintf('%s%s', \PHP_EOL, $TableTablespaceSQL) : ''; + //dump(['alterTableTablespace' => [$TableTablespaceStatus,$TableTablespaceSQL]]); + + if (0 !== $TableTablespaceStatus) { + return -6; + } + + // Rename + $this->fieldClean($name); + [$TableNameStatus,$TableNameSQL] = $this->alterTableName($tblrs, $name); + $this->lastExecutedSql .= $TableNameSQL ? \sprintf('%s%s', \PHP_EOL, $TableNameSQL) : ''; + //dump(['alterTableName' => [$TableNameStatus,$TableNameSQL]]); + + if (0 !== $TableNameStatus) { + return -3; + } + + // Schema + $this->fieldClean($schema); + [$TableSchemaStatus,$TableSchemaSQL] = $this->alterTableSchema($tblrs, $schema); + $this->lastExecutedSql .= $TableSchemaSQL ? \sprintf('%s%s', \PHP_EOL, $TableSchemaSQL) : ''; + //dump(['alterTableSchema' => [$TableSchemaStatus,$TableSchemaSQL]]); + + if (0 !== $TableSchemaStatus) { + return -7; + } + [$TableOidsStatus,$TableOidsSQL] = $this->alterTableOids($tblrs, $withoutoids); + $this->lastExecutedSql .= $TableOidsSQL ? \sprintf('%s%s', \PHP_EOL, $TableOidsSQL) : ''; + //dump(['alterTableOids' => [$TableOidsStatus,$TableOidsSQL]]); + if (0 !== $TableOidsStatus) { + return -7; + } + + return 0; + } /** * Dumps serial-like columns in the table. diff --git a/src/decorators/CallbackDecorator.php b/src/decorators/CallbackDecorator.php index 57b4b3e4..970370c6 100644 --- a/src/decorators/CallbackDecorator.php +++ b/src/decorators/CallbackDecorator.php @@ -8,7 +8,7 @@ namespace PHPPgAdmin\Decorators; class CallbackDecorator extends Decorator { - public function __construct($callback, $param = null) + public function __construct(\Closure $callback, $param = null) { $this->fn = $callback; $this->p = $param; diff --git a/src/decorators/Decorator.php b/src/decorators/Decorator.php index 73e9324c..07947bdc 100644 --- a/src/decorators/Decorator.php +++ b/src/decorators/Decorator.php @@ -44,7 +44,7 @@ class Decorator */ public static function get_sanitized_value(&$var, array &$fields, ?string $esc = null) { - if (\is_a($var, 'PHPPgAdmin\Decorators\Decorator')) { + if ($var instanceof self) { $val = $var->value($fields); } else { $val = &$var; @@ -71,12 +71,12 @@ class Decorator } /** - * @param \Closure|\Closure|\Closure $callback - * @param (mixed|string)[]|null $params + * @param \Closure $callback + * @param (mixed|string)[]|null $params */ - public static function callback($callback, ?array $params = null) + public static function callback(\Closure $callback, ?array $params = null) { - return new \PHPPgAdmin\Decorators\CallbackDecorator($callback, $params); + return new CallbackDecorator($callback, $params); } /** diff --git a/src/help/PostgresDoc.php b/src/help/PostgresDoc.php new file mode 100644 index 00000000..c25c3938 --- /dev/null +++ b/src/help/PostgresDoc.php @@ -0,0 +1,207 @@ +major_version = $major_version; + $this->conf = $conf; + + // TODO: Check and fix links + $this->help_topics = [ + 'pg.database' => 'managing-databases.html', + 'pg.database.create' => ['sql-createdatabase.html', 'manage-ag-createdb.html'], + 'pg.database.alter' => 'sql-alterdatabase.html', + 'pg.database.drop' => ['sql-dropdatabase.html', 'manage-ag-dropdb.html'], + 'pg.admin.analyze' => 'sql-analyze.html', + 'pg.admin.vacuum' => 'sql-vacuum.html', + 'pg.cast' => ['sql-expressions.html#SQL-SYNTAX-TYPE-CASTS', 'sql-createcast.html'], + 'pg.cast.create' => 'sql-createcast.html', + 'pg.cast.drop' => 'sql-dropcast.html', + 'pg.column.add' => ['ddl-alter.html#AEN2115', 'sql-altertable.html'], + 'pg.column.alter' => ['ddl-alter.html', 'sql-altertable.html'], + 'pg.column.drop' => ['ddl-alter.html#AEN2124', 'sql-altertable.html'], + 'pg.constraint' => 'ddl-constraints.html', + 'pg.constraint.add' => 'ddl-alter.html#AEN2131', + 'pg.constraint.check' => 'ddl-constraints.html#AEN1895', + 'pg.constraint.drop' => 'ddl-alter.html#AEN2140', + 'pg.constraint.foreign_key' => 'ddl-constraints.html#DDL-CONSTRAINTS-FK', + 'pg.constraint.primary_key' => 'ddl-constraints.html#AEN1972', + 'pg.constraint.unique_key' => 'ddl-constraints.html#AEN1950', + + 'pg.conversion' => 'multibyte.html', + 'pg.conversion.alter' => 'sql-alterconversion.html', + 'pg.conversion.create' => 'sql-createconversion.html', + 'pg.conversion.drop' => 'sql-dropconversion.html', + + 'pg.domain' => 'extend-type-system.html#AEN28657', + 'pg.domain.alter' => 'sql-alterdomain.html', + 'pg.domain.create' => 'sql-createdomain.html', + 'pg.domain.drop' => 'sql-dropdomain.html', + + 'pg.function' => ['xfunc.html', 'functions.html', 'sql-expressions.html#AEN1599'], + 'pg.function.alter' => 'sql-alterfunction.html', + 'pg.function.create' => 'sql-createfunction.html', + 'pg.function.create.c' => ['xfunc-c.html', 'sql-createfunction.html'], + 'pg.function.create.internal' => ['xfunc-internal.html', 'sql-createfunction.html'], + 'pg.function.create.pl' => ['xfunc-sql.html', 'xfunc-pl.html', 'sql-createfunction.html'], + 'pg.function.drop' => 'sql-dropfunction.html', + + 'pg.group' => 'groups.html', + 'pg.group.alter' => ['sql-altergroup.html', 'groups.html'], + 'pg.group.create' => 'sql-creategroup.html', + 'pg.group.drop' => 'sql-dropgroup.html', + + 'pg.index' => 'indexes.html', + 'pg.index.cluster' => 'sql-cluster.html', + 'pg.index.drop' => 'sql-dropindex.html', + 'pg.index.create' => 'sql-createindex.html', + 'pg.index.reindex' => 'sql-reindex.html', + + 'pg.language' => 'xplang.html', + 'pg.language.alter' => 'sql-alterlanguage.html', + 'pg.language.create' => 'sql-createlanguage.html', + 'pg.language.drop' => 'sql-droplanguage.html', + + 'pg.opclass' => 'indexes-opclass.html', + 'pg.opclass.alter' => 'sql-alteropclass.html', + 'pg.opclass.create' => 'sql-createopclass.html', + 'pg.opclass.drop' => 'sql-dropopclass.html', + + 'pg.operator' => ['xoper.html', 'functions.html', 'sql-expressions.html#AEN1570'], + 'pg.operator.alter' => 'sql-alteroperator.html', + 'pg.operator.create' => 'sql-createoperator.html', + 'pg.operator.drop' => 'sql-dropoperator.html', + + 'pg.pl' => 'xplang.html', + 'pg.pl.plperl' => 'plperl.html', + 'pg.pl.plpgsql' => 'plpgsql.html', + 'pg.pl.plpython' => 'plpython.html', + 'pg.pl.pltcl' => 'pltcl.html', + + 'pg.privilege' => ['privileges.html', 'ddl-priv.html'], + 'pg.privilege.grant' => 'sql-grant.html', + 'pg.privilege.revoke' => 'sql-revoke.html', + + 'pg.process' => 'monitoring.html', + + 'pg.rule' => 'rules.html', + 'pg.rule.create' => 'sql-createrule.html', + 'pg.rule.drop' => 'sql-droprule.html', + + 'pg.schema' => 'ddl-schemas.html', + 'pg.schema.alter' => 'sql-alterschema.html', + 'pg.schema.create' => ['sql-createschema.html', 'ddl-schemas.html#DDL-SCHEMAS-CREATE'], + 'pg.schema.drop' => 'sql-dropschema.html', + 'pg.schema.search_path' => 'ddl-schemas.html#DDL-SCHEMAS-PATH', + + 'pg.sequence' => 'functions-sequence.html', + 'pg.sequence.alter' => 'sql-altersequence.html', + 'pg.sequence.create' => 'sql-createsequence.html', + 'pg.sequence.drop' => 'sql-dropsequence.html', + + 'pg.sql' => ['sql.html', 'sql-commands.html'], + 'pg.sql.insert' => 'sql-insert.html', + 'pg.sql.select' => 'sql-select.html', + 'pg.sql.update' => 'sql-update.html', + + 'pg.table' => 'ddl.html#DDL-BASICS', + 'pg.table.alter' => 'sql-altertable.html', + 'pg.table.create' => 'sql-createtable.html', + 'pg.table.drop' => 'sql-droptable.html', + 'pg.table.empty' => 'sql-truncate.html', + + 'pg.tablespace' => 'manage-ag-tablespaces.html', + 'pg.tablespace.alter' => 'sql-altertablespace.html', + 'pg.tablespace.create' => 'sql-createtablespace.html', + 'pg.tablespace.drop' => 'sql-droptablespace.html', + + 'pg.trigger' => 'triggers.html', + 'pg.trigger.alter' => 'sql-altertrigger.html', + 'pg.trigger.create' => 'sql-createtrigger.html', + 'pg.trigger.drop' => 'sql-droptrigger.html', + + 'pg.type' => ['xtypes.html', 'datatype.html', 'extend-type-system.html'], + 'pg.type.alter' => 'sql-altertype.html', + 'pg.type.create' => 'sql-createtype.html', + 'pg.type.drop' => 'sql-droptype.html', + + 'pg.user.alter' => ['sql-alteruser.html', 'user-attributes.html'], + 'pg.user.create' => ['sql-createuser.html', 'user-manag.html#DATABASE-USERS'], + 'pg.user.drop' => ['sql-dropuser.html', 'user-manag.html#DATABASE-USERS'], + + 'pg.variable' => 'runtime-config.html', + + 'pg.view' => 'tutorial-views.html', + 'pg.view.alter' => ['sql-createview.html', 'sql-altertable.html'], + 'pg.view.create' => 'sql-createview.html', + 'pg.view.drop' => 'sql-dropview.html', + + 'pg.aggregate' => ['xaggr.html', 'tutorial-agg.html', 'functions-aggregate.html', 'sql-expressions.html#SYNTAX-AGGREGATES'], + 'pg.aggregate.create' => 'sql-createaggregate.html', + 'pg.aggregate.drop' => 'sql-dropaggregate.html', + 'pg.aggregate.alter' => 'sql-alteraggregate.html', + + 'pg.server' => 'admin.html', + + 'pg.user' => 'user-manag.html', + + 'pg.locks' => 'view-pg-locks.html', + ]; + } + + public function getHelpBase() + { + return \sprintf(\str_replace('http://', 'https://', $this->conf['help_base']), (string) ($this->major_version)); + } + + /** + * Undocumented function. + * + * @param null|string $topic + * + * @return null|string|string[] + */ + public function getHelpTopics(?string $topic = null): array + { + return $topic ? $this->help_topics[$topic] ?? null : $this->help_topics; + } + + /** + * Undocumented function. + * + * @param string $topic + * + * @return null|string|string[] + */ + public function getHelpTopic(string $topic) + { + return $this->help_topics[$topic] ?? null; + } +} diff --git a/src/help/PostgresDoc74.php b/src/help/PostgresDoc74.php deleted file mode 100644 index b606df36..00000000 --- a/src/help/PostgresDoc74.php +++ /dev/null @@ -1,179 +0,0 @@ -major_version = $major_version; - $this->conf = $conf; - - // TODO: Check and fix links - $this->help_page = [ - 'pg.database' => 'managing-databases.html', - 'pg.database.create' => ['sql-createdatabase.html', 'manage-ag-createdb.html'], - 'pg.database.alter' => 'sql-alterdatabase.html', - 'pg.database.drop' => ['sql-dropdatabase.html', 'manage-ag-dropdb.html'], - 'pg.admin.analyze' => 'sql-analyze.html', - 'pg.admin.vacuum' => 'sql-vacuum.html', - 'pg.cast' => ['sql-expressions.html#SQL-SYNTAX-TYPE-CASTS', 'sql-createcast.html'], - 'pg.cast.create' => 'sql-createcast.html', - 'pg.cast.drop' => 'sql-dropcast.html', - 'pg.column.add' => ['ddl-alter.html#AEN2115', 'sql-altertable.html'], - 'pg.column.alter' => ['ddl-alter.html', 'sql-altertable.html'], - 'pg.column.drop' => ['ddl-alter.html#AEN2124', 'sql-altertable.html'], - 'pg.constraint' => 'ddl-constraints.html', - 'pg.constraint.add' => 'ddl-alter.html#AEN2131', - 'pg.constraint.check' => 'ddl-constraints.html#AEN1895', - 'pg.constraint.drop' => 'ddl-alter.html#AEN2140', - 'pg.constraint.foreign_key' => 'ddl-constraints.html#DDL-CONSTRAINTS-FK', - 'pg.constraint.primary_key' => 'ddl-constraints.html#AEN1972', - 'pg.constraint.unique_key' => 'ddl-constraints.html#AEN1950', - - 'pg.conversion' => 'multibyte.html', - 'pg.conversion.alter' => 'sql-alterconversion.html', - 'pg.conversion.create' => 'sql-createconversion.html', - 'pg.conversion.drop' => 'sql-dropconversion.html', - - 'pg.domain' => 'extend-type-system.html#AEN28657', - 'pg.domain.alter' => 'sql-alterdomain.html', - 'pg.domain.create' => 'sql-createdomain.html', - 'pg.domain.drop' => 'sql-dropdomain.html', - - 'pg.function' => ['xfunc.html', 'functions.html', 'sql-expressions.html#AEN1599'], - 'pg.function.alter' => 'sql-alterfunction.html', - 'pg.function.create' => 'sql-createfunction.html', - 'pg.function.create.c' => ['xfunc-c.html', 'sql-createfunction.html'], - 'pg.function.create.internal' => ['xfunc-internal.html', 'sql-createfunction.html'], - 'pg.function.create.pl' => ['xfunc-sql.html', 'xfunc-pl.html', 'sql-createfunction.html'], - 'pg.function.drop' => 'sql-dropfunction.html', - - 'pg.group' => 'groups.html', - 'pg.group.alter' => ['sql-altergroup.html', 'groups.html'], - 'pg.group.create' => 'sql-creategroup.html', - 'pg.group.drop' => 'sql-dropgroup.html', - - 'pg.index' => 'indexes.html', - 'pg.index.cluster' => 'sql-cluster.html', - 'pg.index.drop' => 'sql-dropindex.html', - 'pg.index.create' => 'sql-createindex.html', - 'pg.index.reindex' => 'sql-reindex.html', - - 'pg.language' => 'xplang.html', - 'pg.language.alter' => 'sql-alterlanguage.html', - 'pg.language.create' => 'sql-createlanguage.html', - 'pg.language.drop' => 'sql-droplanguage.html', - - 'pg.opclass' => 'indexes-opclass.html', - 'pg.opclass.alter' => 'sql-alteropclass.html', - 'pg.opclass.create' => 'sql-createopclass.html', - 'pg.opclass.drop' => 'sql-dropopclass.html', - - 'pg.operator' => ['xoper.html', 'functions.html', 'sql-expressions.html#AEN1570'], - 'pg.operator.alter' => 'sql-alteroperator.html', - 'pg.operator.create' => 'sql-createoperator.html', - 'pg.operator.drop' => 'sql-dropoperator.html', - - 'pg.pl' => 'xplang.html', - 'pg.pl.plperl' => 'plperl.html', - 'pg.pl.plpgsql' => 'plpgsql.html', - 'pg.pl.plpython' => 'plpython.html', - 'pg.pl.pltcl' => 'pltcl.html', - - 'pg.privilege' => ['privileges.html', 'ddl-priv.html'], - 'pg.privilege.grant' => 'sql-grant.html', - 'pg.privilege.revoke' => 'sql-revoke.html', - - 'pg.process' => 'monitoring.html', - - 'pg.rule' => 'rules.html', - 'pg.rule.create' => 'sql-createrule.html', - 'pg.rule.drop' => 'sql-droprule.html', - - 'pg.schema' => 'ddl-schemas.html', - 'pg.schema.alter' => 'sql-alterschema.html', - 'pg.schema.create' => ['sql-createschema.html', 'ddl-schemas.html#DDL-SCHEMAS-CREATE'], - 'pg.schema.drop' => 'sql-dropschema.html', - 'pg.schema.search_path' => 'ddl-schemas.html#DDL-SCHEMAS-PATH', - - 'pg.sequence' => 'functions-sequence.html', - 'pg.sequence.alter' => 'sql-altersequence.html', - 'pg.sequence.create' => 'sql-createsequence.html', - 'pg.sequence.drop' => 'sql-dropsequence.html', - - 'pg.sql' => ['sql.html', 'sql-commands.html'], - 'pg.sql.insert' => 'sql-insert.html', - 'pg.sql.select' => 'sql-select.html', - 'pg.sql.update' => 'sql-update.html', - - 'pg.table' => 'ddl.html#DDL-BASICS', - 'pg.table.alter' => 'sql-altertable.html', - 'pg.table.create' => 'sql-createtable.html', - 'pg.table.drop' => 'sql-droptable.html', - 'pg.table.empty' => 'sql-truncate.html', - - 'pg.tablespace' => 'manage-ag-tablespaces.html', - 'pg.tablespace.alter' => 'sql-altertablespace.html', - 'pg.tablespace.create' => 'sql-createtablespace.html', - 'pg.tablespace.drop' => 'sql-droptablespace.html', - - 'pg.trigger' => 'triggers.html', - 'pg.trigger.alter' => 'sql-altertrigger.html', - 'pg.trigger.create' => 'sql-createtrigger.html', - 'pg.trigger.drop' => 'sql-droptrigger.html', - - 'pg.type' => ['xtypes.html', 'datatype.html', 'extend-type-system.html'], - 'pg.type.alter' => 'sql-altertype.html', - 'pg.type.create' => 'sql-createtype.html', - 'pg.type.drop' => 'sql-droptype.html', - - 'pg.user.alter' => ['sql-alteruser.html', 'user-attributes.html'], - 'pg.user.create' => ['sql-createuser.html', 'user-manag.html#DATABASE-USERS'], - 'pg.user.drop' => ['sql-dropuser.html', 'user-manag.html#DATABASE-USERS'], - - 'pg.variable' => 'runtime-config.html', - - 'pg.view' => 'tutorial-views.html', - 'pg.view.alter' => ['sql-createview.html', 'sql-altertable.html'], - 'pg.view.create' => 'sql-createview.html', - 'pg.view.drop' => 'sql-dropview.html', - - 'pg.aggregate' => ['xaggr.html', 'tutorial-agg.html', 'functions-aggregate.html', 'sql-expressions.html#SYNTAX-AGGREGATES'], - 'pg.aggregate.create' => 'sql-createaggregate.html', - 'pg.aggregate.drop' => 'sql-dropaggregate.html', - 'pg.aggregate.alter' => 'sql-alteraggregate.html', - - 'pg.server' => 'admin.html', - - 'pg.user' => 'user-manag.html', - - 'pg.locks' => 'view-pg-locks.html', - ]; - } - - public function getHelpBase() - { - return \sprintf(\str_replace('http://', 'https://', $this->conf['help_base']), (string) ($this->major_version)); - } - - public function getHelpPage() - { - return $this->help_page; - } -} diff --git a/src/help/PostgresDoc80.php b/src/help/PostgresDoc80.php deleted file mode 100644 index cbf7f87f..00000000 --- a/src/help/PostgresDoc80.php +++ /dev/null @@ -1,35 +0,0 @@ -help_page['pg.column.add'][0] = 'ddl-alter.html#AEN2217'; - $this->help_page['pg.column.drop'][0] = 'ddl-alter.html#AEN2226'; - - $this->help_page['pg.constraint.add'] = 'ddl-alter.html#AEN2217'; - $this->help_page['pg.constraint.check'] = 'ddl-constraints.html#AEN1978'; - $this->help_page['pg.constraint.drop'] = 'ddl-alter.html#AEN2226'; - $this->help_page['pg.constraint.primary_key'] = 'ddl-constraints.html#AEN2055'; - $this->help_page['pg.constraint.unique_key'] = 'ddl-constraints.html#AEN2033'; - - $this->help_page['pg.domain'] = 'extend-type-system.html#AEN27940'; - - $this->help_page['pg.function'][2] = 'sql-expressions.html#AEN1652'; - - $this->help_page['pg.operator'][2] = 'sql-expressions.html#AEN1623'; - } -} diff --git a/src/help/PostgresDoc81.php b/src/help/PostgresDoc81.php deleted file mode 100644 index b5fe8916..00000000 --- a/src/help/PostgresDoc81.php +++ /dev/null @@ -1,25 +0,0 @@ -help_page['pg.role'] = 'user-manag.html'; - $this->help_page['pg.role.create'] = ['sql-createrole.html', 'user-manag.html#DATABASE-ROLES']; - $this->help_page['pg.role.alter'] = ['sql-alterrole.html', 'role-attributes.html']; - $this->help_page['pg.role.drop'] = ['sql-droprole.html', 'user-manag.html#DATABASE-ROLES']; - } -} diff --git a/src/help/PostgresDoc82.php b/src/help/PostgresDoc82.php deleted file mode 100644 index b5abc90a..00000000 --- a/src/help/PostgresDoc82.php +++ /dev/null @@ -1,20 +0,0 @@ -help_page['pg.fts'] = 'textsearch.html'; - - $this->help_page['pg.ftscfg'] = 'textsearch-intro.html#TEXTSEARCH-INTRO-CONFIGURATIONS'; - $this->help_page['pg.ftscfg.example'] = 'textsearch-configuration.html'; - $this->help_page['pg.ftscfg.drop'] = 'sql-droptsconfig.html'; - $this->help_page['pg.ftscfg.create'] = 'sql-createtsconfig.html'; - $this->help_page['pg.ftscfg.alter'] = 'sql-altertsconfig.html'; - - $this->help_page['pg.ftsdict'] = 'textsearch-dictionaries.html'; - $this->help_page['pg.ftsdict.drop'] = 'sql-droptsdictionary.html'; - $this->help_page['pg.ftsdict.create'] = ['sql-createtsdictionary.html', 'sql-createtstemplate.html']; - $this->help_page['pg.ftsdict.alter'] = 'sql-altertsdictionary.html'; - - $this->help_page['pg.ftsparser'] = 'textsearch-parsers.html'; - } -} diff --git a/src/help/PostgresDoc84.php b/src/help/PostgresDoc84.php deleted file mode 100644 index a9ece52b..00000000 --- a/src/help/PostgresDoc84.php +++ /dev/null @@ -1,20 +0,0 @@ -help_page['pg.rule.view'] = 'rules-views.html'; + $this->help_topics['pg.rule.view'] = 'rules-views.html'; } } diff --git a/src/help/PostgresDoc93.php b/src/help/PostgresDoc93.php index 8fef2fdb..cad85288 100644 --- a/src/help/PostgresDoc93.php +++ b/src/help/PostgresDoc93.php @@ -17,13 +17,13 @@ class PostgresDoc93 extends PostgresDoc92 { parent::__construct($conf, $major_version); - $this->help_page['pg.matview'] = 'sql-creatematerializedview.html'; + $this->help_topics['pg.matview'] = 'sql-creatematerializedview.html'; - $this->help_page['pg.matview.create'] = 'sql-creatematerializedview.html'; - $this->help_page['pg.matview.drop'] = 'sql-dropmaterializedview.html'; - $this->help_page['pg.matview.alter'] = 'sql-altermaterializedview.html'; - $this->help_page['pg.matview.refresh'] = 'sql-refreshmaterializedview.html'; + $this->help_topics['pg.matview.create'] = 'sql-creatematerializedview.html'; + $this->help_topics['pg.matview.drop'] = 'sql-dropmaterializedview.html'; + $this->help_topics['pg.matview.alter'] = 'sql-altermaterializedview.html'; + $this->help_topics['pg.matview.refresh'] = 'sql-refreshmaterializedview.html'; - $this->help_page['pg.rule.matview'] = 'rules-materializedviews.html'; + $this->help_topics['pg.rule.matview'] = 'rules-materializedviews.html'; } } diff --git a/src/lib.inc.php b/src/lib.inc.php index 4dd06496..a2417192 100644 --- a/src/lib.inc.php +++ b/src/lib.inc.php @@ -69,7 +69,7 @@ if (DEBUGMODE) { $conf['register_debuggers'](); } } -define('ADODB_ASSOC_CASE',ADODB_ASSOC_CASE_NATIVE); +\define('ADODB_ASSOC_CASE', ADODB_ASSOC_CASE_NATIVE); // Fetch App and DI Container $app = \PHPPgAdmin\ContainerUtils::createApp($conf); $container = $app->getContainer(); @@ -77,19 +77,21 @@ $container = $app->getContainer(); if (!$container instanceof \Slim\Container) { \trigger_error('App Container must be an instance of \\Slim\\Container', \E_USER_ERROR); } -function container():\Slim\Container { -return \PHPPgAdmin\ContainerUtils::getContainerInstance(); +function containerInstance(): \Slim\Container +{ + return \PHPPgAdmin\ContainerUtils::getContainerInstance(); +} + +function requestInstance(): \Slim\Http\Request +{ + return containerInstance()->request; } - -function request():\Slim\Http\Request { - return container()->request; - } - function response():\Slim\Http\Response { - return container()->response; - } + function responseInstance(): \Slim\Http\Response + { + return containerInstance()->response; + } - // This should be deprecated once we're sure no php scripts are required directly $container->offsetSet('server', $_REQUEST['server'] ?? null); $container->offsetSet('database', $_REQUEST['database'] ?? null); diff --git a/src/router.php b/src/router.php index 144c7248..c3d707c1 100644 --- a/src/router.php +++ b/src/router.php @@ -13,7 +13,8 @@ $app->get('/status', function ( /* @scrutinizer ignore-unused */ array $args ) { - phpinfo(); + \phpinfo(); + return; //dump($this->get('settings')->all()); return $response @@ -131,13 +132,11 @@ $app->get('/{subject:\w+}[/{server_id}]', function ( \Slim\Http\Response $response, /* @scrutinizer ignore-unused */ array $args - ) { - $subject=$args['subject']??'intro'; - $server_id=$args['server_id']??$request->getQueryParam('server'); - //ddd($subject, $server_id); + $subject = $args['subject'] ?? 'intro'; + $server_id = $args['server_id'] ?? $request->getQueryParam('server'); + //ddd($subject, $server_id); $_server_info = $this->misc->getServerInfo(); - //$this->utils->prtrace($_server_info); diff --git a/src/traits/AdminTrait.php b/src/traits/AdminTrait.php index 034ee177..8460eaa3 100644 --- a/src/traits/AdminTrait.php +++ b/src/traits/AdminTrait.php @@ -289,7 +289,7 @@ trait AdminTrait echo '
    " . \PHP_EOL; echo $this->view->form; echo '' . \PHP_EOL; - echo sprintf('%s',\htmlspecialchars($_REQUEST['table']), \PHP_EOL); + echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); echo "
    \n
    \n" . \PHP_EOL; echo "\t" . \PHP_EOL; @@ -321,7 +321,7 @@ trait AdminTrait echo '
    '; echo '
    '; echo "lang['strsave']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } @@ -352,7 +352,7 @@ trait AdminTrait echo "" . \PHP_EOL; echo '' . \PHP_EOL; echo $this->view->form; - echo sprintf('%s',\htmlspecialchars($_REQUEST['table']), \PHP_EOL); + echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); echo '' . \PHP_EOL; echo "lang['stryes']}\" />" . \PHP_EOL; echo "lang['strcancel']}\" />" . \PHP_EOL; diff --git a/src/traits/HelperTrait.php b/src/traits/HelperTrait.php index 347366d1..0728ede1 100644 --- a/src/traits/HelperTrait.php +++ b/src/traits/HelperTrait.php @@ -50,10 +50,10 @@ trait HelperTrait */ public function halt($msg = 'An error has happened'): void { - $body = $this->container->responseobj->getBody(); + $body = \responseInstance()->getBody(); $body->write($msg); - throw new \Slim\Exception\SlimException($this->container->requestobj, $this->container->responseobj); + throw new \Slim\Exception\SlimException(\requestInstance(), \responseInstance()); } public static function getBackTrace($offset = 0) diff --git a/src/traits/MiscTrait.php b/src/traits/MiscTrait.php index 8adb912b..7c5e21b4 100644 --- a/src/traits/MiscTrait.php +++ b/src/traits/MiscTrait.php @@ -287,7 +287,7 @@ trait MiscTrait case 'cid': case 'tid': $align = 'right'; - $out = \nl2br(\htmlspecialchars(\PHPPgAdmin\Traits\HelperTrait::br2ln($str))); + $out = \nl2br(\htmlspecialchars(self::br2ln($str))); break; case 'yesno': @@ -319,7 +319,7 @@ trait MiscTrait break; case 'nbsp': - $out = \nl2br(\str_replace(' ', ' ', \PHPPgAdmin\Traits\HelperTrait::br2ln($str))); + $out = \nl2br(\str_replace(' ', ' ', self::br2ln($str))); break; case 'verbatim': @@ -331,7 +331,7 @@ trait MiscTrait break; case 'prettysize': - $out = \PHPPgAdmin\Traits\HelperTrait::formatSizeUnits($str, $lang); + $out = self::formatSizeUnits($str, $lang); break; @@ -345,7 +345,7 @@ trait MiscTrait $out = \htmlspecialchars($str); } else { //$tag = 'span'; - $out = \nl2br(\htmlspecialchars(\PHPPgAdmin\Traits\HelperTrait::br2ln($str))); + $out = \nl2br(\htmlspecialchars(self::br2ln($str))); } } diff --git a/src/traits/ViewsMatviewsTrait.php b/src/traits/ViewsMatviewsTrait.php index 610dd121..9a35516d 100644 --- a/src/traits/ViewsMatviewsTrait.php +++ b/src/traits/ViewsMatviewsTrait.php @@ -139,7 +139,7 @@ trait ViewsMatviewsTrait echo '' . \PHP_EOL; echo $this->view->form; echo "lang['strselect']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; return; @@ -206,7 +206,7 @@ trait ViewsMatviewsTrait echo '

    ' . \PHP_EOL; echo $this->view->form; echo "lang['strnext']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } @@ -462,7 +462,7 @@ trait ViewsMatviewsTrait echo $this->view->form; echo "lang['strcreate']}\" />" . \PHP_EOL; - echo sprintf('

    %s',$this->lang['strcancel'], \PHP_EOL); + echo \sprintf('

    %s', $this->lang['strcancel'], \PHP_EOL); echo '' . \PHP_EOL; } diff --git a/yarn.lock b/yarn.lock index bad763d9..ab1fe0cc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,119 +2,142 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e" - integrity sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" + integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg== dependencies: - "@babel/highlight" "^7.8.3" + "@babel/highlight" "^7.10.4" -"@babel/generator@^7.8.4": - version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.8.4.tgz#35bbc74486956fe4251829f9f6c48330e8d0985e" - integrity sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA== +"@babel/generator@^7.11.5": + version "7.11.6" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.11.6.tgz#b868900f81b163b4d464ea24545c61cbac4dc620" + integrity sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA== dependencies: - "@babel/types" "^7.8.3" + "@babel/types" "^7.11.5" jsesc "^2.5.1" - lodash "^4.17.13" source-map "^0.5.0" -"@babel/helper-function-name@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz#eeeb665a01b1f11068e9fb86ad56a1cb1a824cca" - integrity sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA== +"@babel/helper-function-name@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz#d2d3b20c59ad8c47112fa7d2a94bc09d5ef82f1a" + integrity sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ== dependencies: - "@babel/helper-get-function-arity" "^7.8.3" - "@babel/template" "^7.8.3" - "@babel/types" "^7.8.3" + "@babel/helper-get-function-arity" "^7.10.4" + "@babel/template" "^7.10.4" + "@babel/types" "^7.10.4" -"@babel/helper-get-function-arity@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz#b894b947bd004381ce63ea1db9f08547e920abd5" - integrity sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA== +"@babel/helper-get-function-arity@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz#98c1cbea0e2332f33f9a4661b8ce1505b2c19ba2" + integrity sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A== dependencies: - "@babel/types" "^7.8.3" + "@babel/types" "^7.10.4" -"@babel/helper-split-export-declaration@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz#31a9f30070f91368a7182cf05f831781065fc7a9" - integrity sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA== +"@babel/helper-split-export-declaration@^7.11.0": + version "7.11.0" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz#f8a491244acf6a676158ac42072911ba83ad099f" + integrity sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg== dependencies: - "@babel/types" "^7.8.3" + "@babel/types" "^7.11.0" -"@babel/highlight@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.8.3.tgz#28f173d04223eaaa59bc1d439a3836e6d1265797" - integrity sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg== +"@babel/helper-validator-identifier@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" + integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== + +"@babel/highlight@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" + integrity sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA== dependencies: + "@babel/helper-validator-identifier" "^7.10.4" chalk "^2.0.0" - esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.8.3", "@babel/parser@^7.8.4": - version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.4.tgz#d1dbe64691d60358a974295fa53da074dd2ce8e8" - integrity sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw== - -"@babel/template@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.8.3.tgz#e02ad04fe262a657809327f578056ca15fd4d1b8" - integrity sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ== - dependencies: - "@babel/code-frame" "^7.8.3" - "@babel/parser" "^7.8.3" - "@babel/types" "^7.8.3" - -"@babel/traverse@^7.0.0": - version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.8.4.tgz#f0845822365f9d5b0e312ed3959d3f827f869e3c" - integrity sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg== - dependencies: - "@babel/code-frame" "^7.8.3" - "@babel/generator" "^7.8.4" - "@babel/helper-function-name" "^7.8.3" - "@babel/helper-split-export-declaration" "^7.8.3" - "@babel/parser" "^7.8.4" - "@babel/types" "^7.8.3" +"@babel/parser@^7.10.4", "@babel/parser@^7.11.5", "@babel/parser@^7.7.0": + version "7.11.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.11.5.tgz#c7ff6303df71080ec7a4f5b8c003c58f1cf51037" + integrity sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q== + +"@babel/template@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.10.4.tgz#3251996c4200ebc71d1a8fc405fba940f36ba278" + integrity sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/parser" "^7.10.4" + "@babel/types" "^7.10.4" + +"@babel/traverse@^7.7.0": + version "7.11.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.11.5.tgz#be777b93b518eb6d76ee2e1ea1d143daa11e61c3" + integrity sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/generator" "^7.11.5" + "@babel/helper-function-name" "^7.10.4" + "@babel/helper-split-export-declaration" "^7.11.0" + "@babel/parser" "^7.11.5" + "@babel/types" "^7.11.5" debug "^4.1.0" globals "^11.1.0" - lodash "^4.17.13" + lodash "^4.17.19" -"@babel/types@^7.0.0", "@babel/types@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.8.3.tgz#5a383dffa5416db1b73dedffd311ffd0788fb31c" - integrity sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg== +"@babel/types@^7.10.4", "@babel/types@^7.11.0", "@babel/types@^7.11.5", "@babel/types@^7.7.0": + version "7.11.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.11.5.tgz#d9de577d01252d77c6800cee039ee64faf75662d" + integrity sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q== dependencies: - esutils "^2.0.2" - lodash "^4.17.13" + "@babel/helper-validator-identifier" "^7.10.4" + lodash "^4.17.19" to-fast-properties "^2.0.0" -acorn-jsx@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.1.0.tgz#294adb71b57398b0680015f0a38c563ee1db5384" - integrity sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw== +"@eslint/eslintrc@^0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.1.3.tgz#7d1a2b2358552cc04834c0979bd4275362e37085" + integrity sha512-4YVwPkANLeNtRjMekzux1ci8hIaH5eGKktGqR0d3LWsKNn5B2X/1Z6Trxy7jQXl9EBGE6Yj02O+t09FMeRllaA== + dependencies: + ajv "^6.12.4" + debug "^4.1.1" + espree "^7.3.0" + globals "^12.1.0" + ignore "^4.0.6" + import-fresh "^3.2.1" + js-yaml "^3.13.1" + lodash "^4.17.19" + minimatch "^3.0.4" + strip-json-comments "^3.1.1" -acorn@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.0.tgz#949d36f2c292535da602283586c2477c57eb2d6c" - integrity sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ== +"@types/color-name@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" + integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== -ajv@^6.10.0, ajv@^6.10.2: - version "6.12.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7" - integrity sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw== +acorn-jsx@^5.2.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" + integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== + +acorn@^7.4.0: + version "7.4.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.0.tgz#e1ad486e6c54501634c6c397c5c121daa383607c" + integrity sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w== + +ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.4: + version "6.12.4" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.4.tgz#0614facc4522127fa713445c6bfd3ebd376e2234" + integrity sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ== dependencies: fast-deep-equal "^3.1.1" fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ansi-escapes@^4.2.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.0.tgz#a4ce2b33d6b214b7950d8595c212f12ac9cc569d" - integrity sha512-EiYhwo0v255HUL6eDyuLrXEkTi7WwVCLAw+SeOQ7M7qdun1z1pum4DEm/nuqIVbPvi9RPPc9k9LbyBv6H0DwVg== - dependencies: - type-fest "^0.8.1" +ansi-colors@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== ansi-regex@^4.1.0: version "4.1.0" @@ -133,6 +156,14 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" +ansi-styles@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359" + integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA== + dependencies: + "@types/color-name" "^1.1.1" + color-convert "^2.0.1" + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -145,15 +176,15 @@ astral-regex@^1.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== -babel-eslint@^10.0.3: - version "10.0.3" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.3.tgz#81a2c669be0f205e19462fed2482d33e4687a88a" - integrity sha512-z3U7eMY6r/3f3/JB9mTsLjyxrv0Yb1zb8PCWCLpguxfCzBIZUwy23R1t/XKewP+8mEN2Ck8Dtr4q20z6ce6SoA== +babel-eslint@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" + integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.0.0" - "@babel/traverse" "^7.0.0" - "@babel/types" "^7.0.0" + "@babel/parser" "^7.7.0" + "@babel/traverse" "^7.7.0" + "@babel/types" "^7.7.0" eslint-visitor-keys "^1.0.0" resolve "^1.12.0" @@ -175,7 +206,7 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -chalk@^2.0.0, chalk@^2.1.0, chalk@^2.4.2: +chalk@^2.0.0: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -184,22 +215,13 @@ chalk@^2.0.0, chalk@^2.1.0, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - -cli-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" - integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== +chalk@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" + integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== dependencies: - restore-cursor "^3.1.0" - -cli-width@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" - integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= + ansi-styles "^4.1.0" + supports-color "^7.1.0" color-convert@^1.9.0: version "1.9.3" @@ -208,35 +230,45 @@ color-convert@^1.9.0: dependencies: color-name "1.1.3" +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -cross-spawn@^6.0.5: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== +cross-spawn@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" -debug@^4.0.1, debug@^4.1.0: +debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== dependencies: ms "^2.1.1" -deep-is@~0.1.3: +deep-is@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= @@ -253,66 +285,70 @@ emoji-regex@^7.0.1: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +enquirer@^2.3.5: + version "2.3.6" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" + integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== + dependencies: + ansi-colors "^4.1.1" escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -eslint-config-prettier@^6.10.0: - version "6.10.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.10.0.tgz#7b15e303bf9c956875c948f6b21500e48ded6a7f" - integrity sha512-AtndijGte1rPILInUdHjvKEGbIV06NuvPrqlIEaEaWtbtvJh464mDeyGMdZEQMsGvC0ZVkiex1fSNcC4HAbRGg== +eslint-config-prettier@^6.11.0: + version "6.11.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz#f6d2238c1290d01c859a8b5c1f7d352a0b0da8b1" + integrity sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA== dependencies: get-stdin "^6.0.0" -eslint-plugin-prettier@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz#432e5a667666ab84ce72f945c72f77d996a5c9ba" - integrity sha512-GlolCC9y3XZfv3RQfwGew7NnuFDKsfI4lbvRK+PIIo23SFH+LemGs4cKwzAaRa+Mdb+lQO/STaIayno8T5sJJA== +eslint-plugin-prettier@^3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz#168ab43154e2ea57db992a2cd097c828171f75c2" + integrity sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg== dependencies: prettier-linter-helpers "^1.0.0" -eslint-scope@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9" - integrity sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw== +eslint-scope@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.0.tgz#d0f971dfe59c69e0cada684b23d49dbf82600ce5" + integrity sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w== dependencies: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-utils@^1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" - integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== +eslint-utils@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" + integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== dependencies: eslint-visitor-keys "^1.1.0" -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" - integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== +eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" + integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== -eslint@^6.8.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" - integrity sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== +eslint@^7.8.1: + version "7.8.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.8.1.tgz#e59de3573fb6a5be8ff526c791571646d124a8fa" + integrity sha512-/2rX2pfhyUG0y+A123d0ccXtMm7DV7sH1m3lk9nk2DZ2LReq39FXHueR9xZwshE5MdfSf0xunSaMWRqyIA6M1w== dependencies: "@babel/code-frame" "^7.0.0" + "@eslint/eslintrc" "^0.1.3" ajv "^6.10.0" - chalk "^2.1.0" - cross-spawn "^6.0.5" + chalk "^4.0.0" + cross-spawn "^7.0.2" debug "^4.0.1" doctrine "^3.0.0" - eslint-scope "^5.0.0" - eslint-utils "^1.4.3" - eslint-visitor-keys "^1.1.0" - espree "^6.1.2" - esquery "^1.0.1" + enquirer "^2.3.5" + eslint-scope "^5.1.0" + eslint-utils "^2.1.0" + eslint-visitor-keys "^1.3.0" + espree "^7.3.0" + esquery "^1.2.0" esutils "^2.0.2" file-entry-cache "^5.0.1" functional-red-black-tree "^1.0.1" @@ -321,76 +357,70 @@ eslint@^6.8.0: ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^7.0.0" is-glob "^4.0.0" js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.14" + levn "^0.4.1" + lodash "^4.17.19" minimatch "^3.0.4" - mkdirp "^0.5.1" natural-compare "^1.4.0" - optionator "^0.8.3" + optionator "^0.9.1" progress "^2.0.0" - regexpp "^2.0.1" - semver "^6.1.2" - strip-ansi "^5.2.0" - strip-json-comments "^3.0.1" + regexpp "^3.1.0" + semver "^7.2.1" + strip-ansi "^6.0.0" + strip-json-comments "^3.1.0" table "^5.2.3" text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^6.1.2: - version "6.1.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-6.1.2.tgz#6c272650932b4f91c3714e5e7b5f5e2ecf47262d" - integrity sha512-2iUPuuPP+yW1PZaMSDM9eyVf8D5P0Hi8h83YtZ5bPc/zHYjII5khoixIUTMO794NOY8F/ThF1Bo8ncZILarUTA== +espree@^7.3.0: + version "7.3.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.0.tgz#dc30437cf67947cf576121ebd780f15eeac72348" + integrity sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw== dependencies: - acorn "^7.1.0" - acorn-jsx "^5.1.0" - eslint-visitor-keys "^1.1.0" + acorn "^7.4.0" + acorn-jsx "^5.2.0" + eslint-visitor-keys "^1.3.0" esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.1.0.tgz#c5c0b66f383e7656404f86b31334d72524eddb48" - integrity sha512-MxYW9xKmROWF672KqjO75sszsA8Mxhw06YFeS5VHlB98KDHbOSurm3ArsjO60Eaf3QmGMCP1yn+0JQkNLo/97Q== +esquery@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.3.1.tgz#b78b5828aa8e214e29fb74c4d5b752e1c033da57" + integrity sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ== dependencies: - estraverse "^4.0.0" + estraverse "^5.1.0" esrecurse@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" - integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== dependencies: - estraverse "^4.1.0" + estraverse "^5.2.0" -estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: +estraverse@^4.1.1: version "4.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== +estraverse@^5.1.0, estraverse@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" + integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== + esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -external-editor@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - fast-deep-equal@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" - integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fast-diff@^1.1.2: version "1.2.0" @@ -402,18 +432,11 @@ fast-json-stable-stringify@^2.0.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== -fast-levenshtein@~2.0.6: +fast-levenshtein@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= -figures@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" - integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== - dependencies: - escape-string-regexp "^1.0.5" - file-entry-cache@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" @@ -431,9 +454,9 @@ flat-cache@^2.0.1: write "1.0.3" flatted@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" - integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== + version "2.0.2" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" + integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== fs.realpath@^1.0.0: version "1.0.0" @@ -451,9 +474,9 @@ get-stdin@^6.0.0: integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== glob-parent@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2" - integrity sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw== + version "5.1.1" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" + integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== dependencies: is-glob "^4.0.1" @@ -475,9 +498,9 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globals@^12.1.0: - version "12.3.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-12.3.0.tgz#1e564ee5c4dded2ab098b0f88f24702a3c56be13" - integrity sha512-wAfjdLgFsPZsklLJvOBUBmzYE8/CwhEqSBEMRXA3qxIiNtyqvjYurAtIfDh6chlEPUfmTY3MnZh5Hfh4q0UlIw== + version "12.4.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8" + integrity sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== dependencies: type-fest "^0.8.1" @@ -486,19 +509,17 @@ has-flag@^3.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= -iconv-lite@^0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -import-fresh@^3.0.0: +import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.1.tgz#633ff618506e793af5ac91bf48b72677e15cbe66" integrity sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ== @@ -524,25 +545,6 @@ inherits@2: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inquirer@^7.0.0: - version "7.0.4" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.0.4.tgz#99af5bde47153abca23f5c7fc30db247f39da703" - integrity sha512-Bu5Td5+j11sCkqfqmUTiwv+tWisMtP0L7Q8WrqA2C/BbBhy1YTdFrvjjlrKq8oagA/tLQBski2Gcx/Sqyi2qSQ== - dependencies: - ansi-escapes "^4.2.1" - chalk "^2.4.2" - cli-cursor "^3.1.0" - cli-width "^2.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.15" - mute-stream "0.0.8" - run-async "^2.2.0" - rxjs "^6.5.3" - string-width "^4.1.0" - strip-ansi "^5.1.0" - through "^2.3.6" - is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -553,11 +555,6 @@ is-fullwidth-code-point@^2.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - is-glob@^4.0.0, is-glob@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" @@ -565,11 +562,6 @@ is-glob@^4.0.0, is-glob@^4.0.1: dependencies: is-extglob "^2.1.1" -is-promise@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" - integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= - isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -581,9 +573,9 @@ js-tokens@^4.0.0: integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^3.13.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" - integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== + version "3.14.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" + integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -603,23 +595,18 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15: - version "4.17.15" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" - integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + prelude-ls "^1.2.1" + type-check "~0.4.0" -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== +lodash@^4.17.14, lodash@^4.17.19: + version "4.17.20" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" + integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== minimatch@^3.0.4: version "3.0.4" @@ -628,38 +615,28 @@ minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= +minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + version "0.5.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" + integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== dependencies: - minimist "0.0.8" + minimist "^1.2.5" ms@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -mute-stream@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" - integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== - natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -667,29 +644,17 @@ once@^1.3.0: dependencies: wrappy "1" -onetime@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.0.tgz#fff0f3c91617fe62bb50189636e99ac8a6df7be5" - integrity sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q== - dependencies: - mimic-fn "^2.1.0" - -optionator@^0.8.3: - version "0.8.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== +optionator@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" + integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - -os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + word-wrap "^1.2.3" parent-module@^1.0.0: version "1.0.1" @@ -703,20 +668,20 @@ path-is-absolute@^1.0.0: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prettier-linter-helpers@^1.0.0: version "1.0.0" @@ -725,10 +690,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== +prettier@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.1.tgz#d9485dd5e499daa6cb547023b87a6cf51bee37d6" + integrity sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw== progress@^2.0.0: version "2.0.3" @@ -740,10 +705,10 @@ punycode@^2.1.0: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -regexpp@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" - integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== +regexpp@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" + integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== resolve-from@^4.0.0: version "4.0.0" @@ -751,20 +716,12 @@ resolve-from@^4.0.0: integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== resolve@^1.12.0: - version "1.15.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8" - integrity sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w== + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== dependencies: path-parse "^1.0.6" -restore-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" - integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== - dependencies: - onetime "^5.1.0" - signal-exit "^3.0.2" - rimraf@2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" @@ -772,51 +729,22 @@ rimraf@2.6.3: dependencies: glob "^7.1.3" -run-async@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" - integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= - dependencies: - is-promise "^2.1.0" - -rxjs@^6.5.3: - version "6.5.4" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.4.tgz#e0777fe0d184cec7872df147f303572d414e211c" - integrity sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q== - dependencies: - tslib "^1.9.0" - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -semver@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -semver@^6.1.2: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.2.1: + version "7.3.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" + integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== dependencies: - shebang-regex "^1.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + shebang-regex "^3.0.0" -signal-exit@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== slice-ansi@^2.1.0: version "2.1.0" @@ -846,16 +774,7 @@ string-width@^3.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string-width@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" - integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" - -strip-ansi@^5.1.0, strip-ansi@^5.2.0: +strip-ansi@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== @@ -869,10 +788,10 @@ strip-ansi@^6.0.0: dependencies: ansi-regex "^5.0.0" -strip-json-comments@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7" - integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw== +strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== supports-color@^5.3.0: version "5.5.0" @@ -881,6 +800,13 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + table@^5.2.3: version "5.4.6" resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" @@ -896,34 +822,17 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= -through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= -tslib@^1.9.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.0.tgz#f1f3528301621a53220d58373ae510ff747a66bc" - integrity sha512-BmndXUtiTn/VDDrJzQE7Mm22Ix3PxgLltW9bSNLoeCY31gnG2OPx0QqJnuc9oMIKioYrz487i6K9o4Pdn0j+Kg== - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== dependencies: - prelude-ls "~1.1.2" + prelude-ls "^1.2.1" type-fest@^0.8.1: version "0.8.1" @@ -931,25 +840,25 @@ type-fest@^0.8.1: integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== uri-js@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" - integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + version "4.4.0" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.0.tgz#aa714261de793e8a82347a7bcc9ce74e86f28602" + integrity sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g== dependencies: punycode "^2.1.0" v8-compile-cache@^2.0.3: - version "2.1.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" - integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g== + version "2.1.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz#54bc3cdd43317bca91e35dcaf305b1a7237de745" + integrity sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ== -which@^1.2.9: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== dependencies: isexe "^2.0.0" -word-wrap@~1.2.3: +word-wrap@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== -- cgit v1.2.3 From 78b76c8435398cfab1e80fdc29f23f49c2992c74 Mon Sep 17 00:00:00 2001 From: ffflabs Date: Fri, 11 Sep 2020 04:48:07 -0300 Subject: github_action adds reviewdog, preparing more checks adds reviewdog, preparing more checks adds reviewdog, preparing more checks adds reviewdog, preparing more checks containerutils now extends Slim\Container adds PR ckecks for psalm, phpstan, phpcs and phpmd preparing next deploy removes psalm from scrutinizer next attempt at github actions removing usage of Kint for githu actions cache for style checks cache for style checks cache for style checks cache for style checks cache for style checks cache for style checks after csfixer after csfixer update baselines add rector check remove usage of 'with(...)' from js scripts tiny syntax improvements use flash messages to check for treejs refresh being set first POC of messaging API to propagate query requests and jstree refresh instructions instruction to refresh jsTree must be passed to the view manager, not to Misc adds rector github action ignore rector.php when running code style checks and transforms typo fix formatting of theme css normalize composer passing static analysis passing tests passing tests passing tests --- .configs/debug.kint.php | 52 + .configs/debug.var_dumper.php | 43 + .github/workflows/codeception_tests.yml | 73 + .github/workflows/coding_standards.yml | 100 + .github/workflows/rector_checkstyle.yml | 80 + .github/workflows/static_analysis.yml | 115 ++ .gitignore | 13 +- .phive/phars.xml | 9 + .php_cs.php | 7 +- .phpcs.xml | 19 + .prettierrc | 42 + .reviewdog.yml | 23 + .scrutinizer.yml | 2 +- Makefile | 101 +- README.md | 4 +- assets/js/ac_insert_row.js | 370 ++-- assets/js/codemirror/addon/sql-lint.js | 62 +- assets/js/codemirror/codemirror_footer.js | 58 +- assets/js/codemirror/instance_codemirror.js | 37 +- assets/js/database.js | 143 +- assets/js/display.js | 191 +- assets/js/footer_scripts.js | 28 +- assets/js/footer_sqledit.js | 52 +- assets/js/functions.js | 414 ++-- assets/js/indexes.js | 139 +- assets/js/insert_or_edit_row.js | 42 +- assets/js/less.min.js | 17 - assets/js/multiactionform.js | 14 +- assets/js/polyfills.js | 9 +- assets/js/tables.js | 11 +- assets/sw.dev.js | 78 + assets/sw.js | 1340 +++++++++++++ assets/templates/components/common_head.twig | 11 +- assets/templates/footer_iframe.twig | 21 + assets/themes/global.css | 485 +++++ assets/vendor/less.min.js | 17 + composer-require-checker.json | 34 + composer.json | 143 +- composer.lock | 2113 +++++++++++++------- config.inc.php-dist | 119 +- globals.d.ts | 8 + mk_linters.mk | 189 ++ package.json | 19 +- phpstan-baseline.neon | 492 +++++ phpstan.neon | 42 +- psalm-baseline.xml | 599 ++++++ psalm.xml | 3 +- rector.php | 48 + src/classes/ADONewConnection.php | 5 - src/classes/ADORecordSet.php | 5 - src/classes/ADOdbException.php | 73 +- src/classes/Connection.php | 57 +- src/classes/ContainerHandlers.php | 146 ++ src/classes/ContainerUtils.php | 357 ++-- src/classes/Misc.php | 116 +- src/classes/ViewManager.php | 180 +- src/controllers/AggregatesController.php | 10 +- src/controllers/AlldbController.php | 29 +- src/controllers/BaseController.php | 70 +- src/controllers/ColpropertiesController.php | 8 +- src/controllers/ConstraintsController.php | 4 +- src/controllers/DatabaseController.php | 70 +- src/controllers/DataexportController.php | 4 +- src/controllers/DataimportController.php | 1 + src/controllers/DbexportController.php | 2 +- src/controllers/DisplayController.php | 28 +- src/controllers/DomainsController.php | 10 +- src/controllers/FulltextController.php | 26 +- src/controllers/FunctionsController.php | 43 +- src/controllers/GroupsController.php | 6 +- src/controllers/HistoryController.php | 7 +- src/controllers/IndexesController.php | 10 +- src/controllers/IntroController.php | 12 +- src/controllers/LoginController.php | 2 +- .../MaterializedviewpropertiesController.php | 10 +- src/controllers/MaterializedviewsController.php | 25 +- src/controllers/OperatorsController.php | 2 +- src/controllers/PrivilegesController.php | 4 +- src/controllers/RolesController.php | 10 +- src/controllers/RulesController.php | 4 +- src/controllers/SchemasController.php | 31 +- src/controllers/SequencesController.php | 91 +- src/controllers/ServersController.php | 8 +- src/controllers/SqlController.php | 5 +- src/controllers/SqleditController.php | 2 +- src/controllers/TablesController.php | 122 +- src/controllers/TablespacesController.php | 6 +- src/controllers/TblpropertiesController.php | 19 +- src/controllers/TreeController.php | 12 +- src/controllers/TriggersController.php | 10 +- src/controllers/TypesController.php | 16 +- src/controllers/UsersController.php | 8 +- src/controllers/ViewpropertiesController.php | 10 +- src/controllers/ViewsController.php | 25 +- src/database/ADOdbBase.php | 50 +- src/database/Connection.php | 177 -- src/database/Postgres.php | 58 +- src/database/databasetraits/RoleTrait.php | 6 +- src/database/databasetraits/SequenceTrait.php | 34 +- src/database/databasetraits/TableTrait.php | 3 +- src/decorators/ActionUrlDecorator.php | 2 +- src/decorators/BranchUrlDecorator.php | 4 +- src/decorators/Decorator.php | 15 - src/decorators/RedirectUrlDecorator.php | 4 +- src/decorators/UrlDecorator.php | 4 +- src/help/PostgresDoc.php | 4 +- src/help/PostgresDoc10.php | 2 + src/help/PostgresDoc11.php | 2 + src/help/PostgresDoc12.php | 2 + src/help/PostgresDoc90.php | 2 + src/help/PostgresDoc91.php | 2 + src/help/PostgresDoc92.php | 2 + src/help/PostgresDoc93.php | 2 + src/help/PostgresDoc94.php | 2 + src/help/PostgresDoc95.php | 2 + src/help/PostgresDoc96.php | 2 + src/lib.inc.php | 145 +- src/middleware/PopulateRequestResponse.php | 33 +- src/router.php | 56 +- src/traits/AdminTrait.php | 139 +- src/traits/ExportTrait.php | 2 +- src/traits/HelperTrait.php | 35 - src/traits/InsertEditRowTrait.php | 4 +- src/traits/MiscTrait.php | 56 +- src/traits/ViewsMatviewsTrait.php | 16 +- src/translations/Afrikaans.php | 2 + src/translations/Arabic.php | 2 + src/translations/Catalan.php | 2 + src/translations/ChineseSim.php | 2 + src/translations/ChineseTr.php | 2 + src/translations/ChineseUtf8ZhCn.php | 2 + src/translations/ChineseUtf8ZhTw.php | 2 + src/translations/Czech.php | 2 + src/translations/Danish.php | 2 + src/translations/Dutch.php | 2 + src/translations/English.php | 2 + src/translations/French.php | 2 + src/translations/Galician.php | 2 + src/translations/German.php | 2 + src/translations/Greek.php | 2 + src/translations/Hebrew.php | 2 + src/translations/Hungarian.php | 2 + src/translations/Italian.php | 2 + src/translations/Japanese.php | 2 + src/translations/Lithuanian.php | 2 + src/translations/Mongol.php | 2 + src/translations/Polish.php | 2 + src/translations/PortugueseBr.php | 2 + src/translations/PortuguesePt.php | 2 + src/translations/Romanian.php | 2 + src/translations/Russian.php | 2 + src/translations/RussianUtf8.php | 2 + src/translations/Slovak.php | 2 + src/translations/Spanish.php | 2 + src/translations/Swedish.php | 2 + src/translations/Turkish.php | 2 + src/translations/Ukrainian.php | 2 + src/xhtml/HTMLController.php | 28 +- src/xhtml/HTMLFooterController.php | 2 +- src/xhtml/HTMLHeaderController.php | 14 +- src/xhtml/HTMLNavbarController.php | 42 +- src/xhtml/HTMLTableController.php | 3 +- src/xhtml/XHtmlSimpleElement.php | 14 - tests/_support/Helper/Unit.php | 28 +- tests/unit/ContainerTest.php | 6 +- tests/unit/DataEntitiesTest.php | 2 +- tests/unit/PublicSectionsTest.php | 2 +- tests/unit/TablesAndViewsTest.php | 2 +- tests/unit/UserEntitiesTest.php | 2 +- tests/unit/ViewTest.php | 2 +- tools/composer-require-checker | 1 + tools/phpcpd | 1 + tools/phpcs | 1 + tools/phpmd | 1 + tools/reviewdog | Bin 0 -> 16261120 bytes tsconfig.json | 22 + workbox-config.js | 20 + yarn.lock | 353 +++- 178 files changed, 8114 insertions(+), 3095 deletions(-) create mode 100644 .configs/debug.kint.php create mode 100644 .configs/debug.var_dumper.php create mode 100644 .github/workflows/codeception_tests.yml create mode 100644 .github/workflows/coding_standards.yml create mode 100644 .github/workflows/rector_checkstyle.yml create mode 100644 .github/workflows/static_analysis.yml create mode 100644 .phive/phars.xml create mode 100644 .phpcs.xml create mode 100644 .prettierrc create mode 100644 .reviewdog.yml delete mode 100644 assets/js/less.min.js create mode 100644 assets/sw.dev.js create mode 100644 assets/sw.js create mode 100644 assets/themes/global.css create mode 100644 assets/vendor/less.min.js create mode 100644 composer-require-checker.json create mode 100644 globals.d.ts create mode 100644 mk_linters.mk create mode 100644 phpstan-baseline.neon create mode 100644 psalm-baseline.xml create mode 100644 rector.php create mode 100644 src/classes/ContainerHandlers.php delete mode 100644 src/database/Connection.php create mode 120000 tools/composer-require-checker create mode 120000 tools/phpcpd create mode 120000 tools/phpcs create mode 120000 tools/phpmd create mode 100755 tools/reviewdog create mode 100644 tsconfig.json create mode 100644 workbox-config.js diff --git a/.configs/debug.kint.php b/.configs/debug.kint.php new file mode 100644 index 00000000..97394bd6 --- /dev/null +++ b/.configs/debug.kint.php @@ -0,0 +1,52 @@ + new CliContextProvider(), + 'source' => new SourceContextProvider(), + ]); + + VarDumper::setHandler(function ($var) use ($cloner, $dumper): void { + $dumper->dump($cloner->cloneVar($var)); + }); +} +if (false && \PHP_SAPI !== 'cli') { + \define('SESSION_SAVE_PATH', \implode(\DIRECTORY_SEPARATOR, [BASE_PATH, 'temp/sessions'])); + \defined('IN_TEST') || \define('IN_TEST', false); + + if (!IN_TEST && \defined('SESSION_SAVE_PATH') + && ( + \is_dir(SESSION_SAVE_PATH) + || \mkdir(SESSION_SAVE_PATH, 0777, true) + ) + ) { + \session_save_path(SESSION_SAVE_PATH); + } +} diff --git a/.github/workflows/codeception_tests.yml b/.github/workflows/codeception_tests.yml new file mode 100644 index 00000000..5fa7a7d0 --- /dev/null +++ b/.github/workflows/codeception_tests.yml @@ -0,0 +1,73 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +name: "Codeception_Tests" + +on: + push: + branches: + - master + - develop + pull_request: + branches: + - master + - develop + +env: + MIN_COVERED_MSI: 100 + MIN_MSI: 100 + PHP_EXTENSIONS: "mbstring, pgsql" + key: cache-v1 # can be any string, change to clear the extension cache. +jobs: + tests: + name: "Codeception_Tests" + + runs-on: "ubuntu-latest" + + strategy: + matrix: + php_version: + - "7.3" + + dependencies: + - "locked" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2.3.1" + + - name: Setup cache environment + id: extcache + uses: shivammathur/cache-extensions@v1 + with: + php-version: ${{ matrix.php_version }} + extensions: ${{ env.PHP_EXTENSIONS }} + key: ${{ env.key }} + + - name: Cache extensions + uses: "actions/cache@v2.1.1" + with: + path: ${{ steps.extcache.outputs.dir }} + key: ${{ steps.extcache.outputs.key }} + restore-keys: ${{ steps.extcache.outputs.key }} + + - name: "Install PHP with extensions" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + extensions: "${{ env.PHP_EXTENSIONS }}" + php-version: "${{ matrix.php_version }}" + tools: composer + + - name: Cache Composer + uses: "actions/cache@v2.1.1" + with: + path: "~/.composer/cache" + key: "composer-${{ hashFiles('composer.lock') }}" + restore-keys: "composer-" + + - name: "Install locked dependencies from composer.lock" + run: "composer install --no-interaction --no-progress --no-suggest" + + - run: cp config.inc.php-dist config.inc.php + - name: "Run vendor/bin/codecept" + run: "vendor/bin/codecept run unit" diff --git a/.github/workflows/coding_standards.yml b/.github/workflows/coding_standards.yml new file mode 100644 index 00000000..c3c810c4 --- /dev/null +++ b/.github/workflows/coding_standards.yml @@ -0,0 +1,100 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +name: "Coding_Standards" + +on: + push: + branches: + - master + - develop + pull_request: + branches: + - master + - develop + +env: + MIN_COVERED_MSI: 100 + MIN_MSI: 100 + PHP_EXTENSIONS: "mbstring, pgsql" + key: cache-v1 # can be any string, change to clear the extension cache. +jobs: + coding_standards: + name: "Coding_Standards" + + runs-on: "ubuntu-latest" + + strategy: + matrix: + php_version: + - "7.3" + + dependencies: + - "locked" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2.3.3" + + - uses: n1hility/cancel-previous-runs@v2 + with: + token: ${{ secrets.GH_ACTIONS_TOKEN }} + + - name: Setup cache environment + id: extcache + uses: shivammathur/cache-extensions@v1 + with: + php-version: ${{ matrix.php_version }} + extensions: ${{ env.PHP_EXTENSIONS }} + key: ${{ env.key }} + + - name: Cache extensions + uses: "actions/cache@v2.1.1" + with: + path: ${{ steps.extcache.outputs.dir }} + key: ${{ steps.extcache.outputs.key }} + restore-keys: ${{ steps.extcache.outputs.key }} + + - name: "Install PHP with extensions" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + extensions: "${{ env.PHP_EXTENSIONS }}" + php-version: "${{ matrix.php_version }}" + tools: composer, phpcs, cs2pr + + - name: Cache Composer + uses: "actions/cache@v2.1.1" + with: + path: "~/.composer/cache" + key: "composer-${{ hashFiles('composer.lock') }}" + restore-keys: "composer-" + + - name: "Install locked dependencies from composer.lock" + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "Create dummy config files" + run: "cp config.inc.php-dist config.inc.php" + + - name: "Run ergebnis/composer-normalize" + run: "composer normalize --dry-run" + + - name: "Create cache directories and files for friendsofphp/php-cs-fixer" + run: "mkdir -p .build/phpcs" + - run: touch .build/phpcs/php-cs.cache + - run: touch .build/phpcs/csfixer.cache + + + + - name: "Cache cache directory for phpcs and friendsofphp/php-cs-fixer" + uses: "actions/cache@v2.1.1" + with: + path: ".build/phpcs" + key: "php-${{ matrix.php_version }}-phpcs-${{ github.sha }}" + restore-keys: "php-${{ matrix.php_version }}-phpcs-" + +# - name: "Run CodeShiffer" +# run: phpcs --standard=.phpcs.xml --parallel=2 --cache=.build/phpcs/php-cs.cache --report=checkstyle src/* | cs2pr + + + - name: "Run friendsofphp/php-cs-fixer" + run: "vendor/bin/php-cs-fixer fix --config=.php_cs.php --diff --diff-format=udiff --cache-file=.build/phpcs/csfixer.cache --dry-run --format=checkstyle | cs2pr" diff --git a/.github/workflows/rector_checkstyle.yml b/.github/workflows/rector_checkstyle.yml new file mode 100644 index 00000000..795d3a3a --- /dev/null +++ b/.github/workflows/rector_checkstyle.yml @@ -0,0 +1,80 @@ +name: Rector Checkstyle +'on': + push: + branches: + - master + - develop + + +env: + MIN_COVERED_MSI: 100 + MIN_MSI: 100 + PHP_EXTENSIONS: "mbstring, pgsql" + key: cache-v1 # can be any string, change to clear the extension cache. + +jobs: + rector_checkstyle: + runs-on: ubuntu-latest + strategy: + matrix: + php_version: + - "7.3" + dependencies: + - "locked" + steps: + - name: Checkout + uses: actions/checkout@v2.3.3 + - uses: n1hility/cancel-previous-runs@v2 + with: + token: '${{ secrets.GH_ACTIONS_TOKEN }}' + - name: Setup cache environment + id: extcache + uses: shivammathur/cache-extensions@v1 + with: + php-version: '${{ matrix.php_version }}' + extensions: '${{ env.PHP_EXTENSIONS }}' + key: '${{ env.key }}' + - name: Cache extensions + uses: actions/cache@v2.1.1 + with: + path: '${{ steps.extcache.outputs.dir }}' + key: '${{ steps.extcache.outputs.key }}' + restore-keys: '${{ steps.extcache.outputs.key }}' + + + - name: Install locked dependencies from composer.lock + run: composer install --no-interaction --no-progress --no-suggest + - name: Create dummy config files + run: cp config.inc.php-dist config.inc.php + + - name: Install PHP with extensions + uses: shivammathur/setup-php@v2 + with: + coverage: none + extensions: '${{ env.PHP_EXTENSIONS }}' + php-version: '${{ matrix.php_version }}' + tools: 'composer, cs2pr' + + - name: Cache Composer + uses: "actions/cache@v2.1.1" + with: + path: "~/.composer/cache" + key: "composer-${{ hashFiles('composer.lock') }}" + restore-keys: "composer-" + + - name: "Install locked dependencies from composer.lock" + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "Create cache folder for rector" + run: "mkdir -p .build/rector" + + - name: "Cache cache directory for rector" + uses: "actions/cache@v2.1.1" + with: + path: ".build/rector" + key: "php-${{ matrix.php_version }}-rector-${{ github.sha }}" + restore-keys: "php-${{ matrix.php_version }}-rector-" + + - run: >- + vendor/bin/rector process --ansi --dry-run --output-format=checkstyle + | cs2pr diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml new file mode 100644 index 00000000..aa4b9edd --- /dev/null +++ b/.github/workflows/static_analysis.yml @@ -0,0 +1,115 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +name: "Static_Analysis" + +on: + pull_request: + branches: + - master + - develop + +env: + MIN_COVERED_MSI: 100 + MIN_MSI: 100 + PHP_EXTENSIONS: "mbstring, pgsql" + GH_ACTIONS_TOKEN: ${{ secrets.GH_ACTIONS_TOKEN }} + PHP_TOOLS: composer, prestissimo, composer-require-checker, composer-normalize, composer-unused, phpcs, cs2pr + key: cache-v1 # can be any string, change to clear the extension cache. +jobs: + Static_Analysis: + name: "Static_Analysis" + + runs-on: "ubuntu-latest" + + strategy: + matrix: + php_version: + - "7.3" + + dependencies: + - "locked" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2.3.3" + + - uses: n1hility/cancel-previous-runs@v2 + with: + token: ${{ secrets.GH_ACTIONS_TOKEN }} + + - name: Setup cache for extensions + id: extcache + uses: shivammathur/cache-extensions@v1 + with: + php-version: ${{ matrix.php_version }} + extensions: ${{ env.PHP_EXTENSIONS }} + key: ${{ env.key }} + + - name: Create cache entry for extensions + uses: "actions/cache@v2.1.1" + with: + path: ${{ steps.extcache.outputs.dir }} + key: ${{ steps.extcache.outputs.key }} + restore-keys: ${{ steps.extcache.outputs.key }} + + - name: "Install PHP with extensions" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + extensions: "${{ env.PHP_EXTENSIONS }}" + php-version: "${{ matrix.php_version }}" + tools: "${{ env.PHP_TOOLS }}" + + - name: Create cache entry for Composer + uses: "actions/cache@v2.1.1" + with: + path: "~/.composer/cache" + key: "composer-${{ hashFiles('composer.lock') }}" + restore-keys: "composer-" + + - name: "Install locked dependencies from composer.lock" + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "Create dummy config files" + run: "cp config.inc.php-dist config.inc.php" + + - name: "Run php-parallel-lint" + run: "vendor/bin/parallel-lint --exclude vendor --exclude .build ." + + - name: "Create cache directory for phpstan/phpstan" + run: "mkdir -p .build/phpstan" + + - name: "Create cache directory for vimeo/psalm" + run: "mkdir -p .build/psalm" + + - name: "Create cache entry for phpstan/phpstan" + uses: "actions/cache@v2.1.1" + with: + path: ".build/phpstan" + key: "php-7.3-phpstan-${{ github.sha }}" + restore-keys: "php-7.3-phpstan-" + + - name: "Run phpstan/phpstan" + run: "vendor/bin/phpstan analyse --configuration=phpstan.neon --error-format=checkstyle | cs2pr" + + + - name: "Create cache entry for vimeo/psalm" + uses: "actions/cache@v2.1.1" + with: + path: ".build/psalm" + key: "php-7.3-psalm-${{ github.sha }}" + restore-keys: "php-7.3-psalm-" + + - name: "Run vimeo/psalm" + run: "vendor/bin/psalm --config=psalm.xml --shepherd --show-info=false --output-format=checkstyle --diff --diff-methods --threads=4 | cs2pr" + + +# - uses: reviewdog/action-setup@v1 +# with: +# reviewdog_version: latest # Optional. [latest,nightly,v.X.Y.Z] +# +# - name: Run reviewdog +# env: +# REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GH_ACTIONS_TOKEN }} +# run: | +# reviewdog -conf=.reviewdog.yml -reporter=github-check \ No newline at end of file diff --git a/.gitignore b/.gitignore index bc9be95c..ecc5e4cd 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,7 @@ playground *.log tests/_output temp/*.output.txt -*baseline.* + ###> Vendor files node_modules @@ -36,7 +36,7 @@ vendor ###> Config files other tan examples config.yml -.configs/ +.configs sftp-config* config.*.php* !config.inc.php-dist @@ -47,3 +47,12 @@ config.*.php* .build .php_cs.cache .phpunit.result.cache + +### Linter's reports +temp/*.checkstyle.xml +temp/*.junit.xml +temp/*.report.json +temp/*.report.xml +tools/composer* +tools/phpcbf +tools/phpmd_checkstyle \ No newline at end of file diff --git a/.phive/phars.xml b/.phive/phars.xml new file mode 100644 index 00000000..76e86e56 --- /dev/null +++ b/.phive/phars.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.php_cs.php b/.php_cs.php index 43d3c524..1c5b6884 100644 --- a/.php_cs.php +++ b/.php_cs.php @@ -16,7 +16,6 @@ $header = "PHPPgAdmin {$version}"; $config = Config\Factory::fromRuleSet(new Config\RuleSet\Php71($header), [ 'declare_strict_types' => false, - //'header_comment' => ['commentType' => 'PHPDoc', 'header' => $header], 'escape_implicit_backslashes' => false, 'final_class' => false, 'final_internal_class' => false, @@ -35,6 +34,7 @@ $config = Config\Factory::fromRuleSet(new Config\RuleSet\Php71($header), [ $config->getFinder() ->ignoreDotFiles(false) ->in(__DIR__) + ->notName('rector.php') ->exclude([ '.build', '.configs', @@ -43,12 +43,13 @@ $config->getFinder() 'docs', 'node_modules', 'temp', + 'rector.php', 'src/router.php', 'vendor', '.github', ]) - ->name('.php_cs'); + ->name('.php_cs.php'); -$config->setCacheFile(__DIR__ . '/.build/php-cs-fixer/php_cs.cache'); +$config->setCacheFile(__DIR__ . '/.build/phpcs/csfixer.cache'); return $config; diff --git a/.phpcs.xml b/.phpcs.xml new file mode 100644 index 00000000..ad9c46af --- /dev/null +++ b/.phpcs.xml @@ -0,0 +1,19 @@ + + + Slim coding standard + lib + + */lib/_(boilerplate|bootstrap)\.php$ + + + + + + + + + + + Slim + tests + diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..65017653 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,42 @@ +{ + "singleQuote": true, + "semi": true, + "tabWidth": 2, + "useTabs": false, + "trailingComma": "es5", + "overrides": [ + { + "files": "*.json", + "options": { + "useTabs": false, + "parser": "json" + } + }, + { + "files": "*.scss", + "options": { + "useTabs": false, + "parser": "scss" + } + }, + { + "files": "*.less", + "options": { + "useTabs": false, + "parser": "less" + } + } + ], + "twigPrintWidth": 120, + "twigMultiTags": [ + "if,endif", + "nav,endnav", + "switch,case,default,endswitch", + "ifchildren,endifchildren", + "cache,endcache", + "js,endjs" + ], + "plugins": [ + "./node_modules/prettier-plugin-twig-melody" + ] +} \ No newline at end of file diff --git a/.reviewdog.yml b/.reviewdog.yml new file mode 100644 index 00000000..7a3f065a --- /dev/null +++ b/.reviewdog.yml @@ -0,0 +1,23 @@ +runner: + phpstan: + cmd: vendor/bin/phpstan analyse --memory-limit=2G --configuration phpstan.neon --error-format=checkstyle + level: info + + psalm: + cmd: vendor/bin/psalm --config=psalm.xml --diff --diff-methods --output-format=checkstyle + level: info + name: checkstyle + + csfixer: + cmd: vendor/bin/php-cs-fixer fix --config=.php_cs.php --cache-file=.build/phpcs/csfixer.cache --format=checkstyle --dry-run --diff + level: info + name: checkstyle + + phpcs: + cmd: phpcs --standard=.phpcs.xml --parallel=2 --cache=.build/phpcs/php-cs.cache --report=checkstyle src/* + level: info + name: checkstyle + + eslint: + cmd: node_modules/.bin/eslint --ext js --ignore-path .eslintignore assets + level: info diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 884d5307..8c1d2821 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -34,6 +34,7 @@ filter: paths: [src/*] excluded_paths: - "tests/*" + - "router.php" - "*.min.js" - "assets/js/" @@ -56,6 +57,5 @@ build: - "php-scrutinizer-run" - "phpcs-run ./src/" - "make test" - - "make psalm" nodes: tests: true diff --git a/Makefile b/Makefile index eb2a8fe6..b991a84c 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +include mk_linters.mk + VERSION = $(shell cat composer.json | sed -n 's/.*"version": "\([^"]*\)"/\1/p') SHELL = /usr/bin/env bash @@ -7,6 +9,7 @@ XDSWI := $(shell command -v xd_swi 2> /dev/null) HAS_PHPMD := $(shell command -v phpmd 2> /dev/null) HAS_CSFIXER:= $(shell command -v php-cs-fixer 2> /dev/null) XDSWI_STATUS:=$(shell command xd_swi stat 2> /dev/null) +HAS_PHIVE:=$(shell command phive --version 2> /dev/null) CURRENT_BRANCH:=$(shell command git rev-parse --abbrev-ref HEAD 2> /dev/null) DATENOW:=`date +'%Y-%m-%d'` YELLOW=\033[0;33m @@ -35,8 +38,9 @@ install: fix_permissions: @sudo chmod 777 temp -R ;\ sudo chown -R $$USER:www-data temp/sessions ;\ + sudo rm -R --force temp/twigcache ;\ + git checkout HEAD temp/twigcache ;\ sudo chown -R $$USER:www-data temp/twigcache ;\ - sudo rm -R --force temp/twigcache/* composer_update: @echo -e "updating composer with params ${YELLOW}--lock --root-reqs --prefer-dist --prefer-stable --no-suggest -a${WHITE}" ;\ @@ -73,7 +77,12 @@ tag_and_push: -tag: test update_version csfixer lint tag_and_push +tag: test update_version csfixer fixers +tag: + @yarn prettier --write ;\ + yarn build ;\ + ${MAKE} tag_and_push --no-print-directory + test: ifeq ("$(wildcard config.inc.php)","") @@ -83,40 +92,6 @@ endif -csfixer: - @if [ -f "vendor/bin/php-cs-fixer" ]; then \ - echo "XDEBUG was: "$(XDSWI_STATUS) ;\ - ${MAKE} disable_xdebug --no-print-directory ;\ - mkdir -p .build/php-cs-fixer ;\ - vendor/bin/php-cs-fixer fix --config=.php_cs.php --verbose ;\ - ${MAKE} enable_xdebug new_status=$(XDSWI_STATUS) --no-print-directory;\ - else \ - echo -e "$(GREEN)php-cs-fixer$(WHITE) is $(RED)NOT$(WHITE) installed. " ;\ - echo -e "Install it with $(GREEN)composer install --dev friendsofphp/php-cs-fixer$(WHITE)" ;\ - fi ;\ - sudo rm -rf temp/route.cache.php - - - -disable_xdebug: - @if [[ "$(XDSWI)" != "" ]]; then \ - xd_swi off ;\ - fi - -enable_xdebug: - @if [[ "$(XDSWI)" != "" ]]; then \ - xd_swi $(new_status) ;\ - fi - -phpmd: - @if [ "$(HAS_PHPMD)" == "" ]; then \ - echo -e "$(GREEN)phpmd$(WHITE) is $(RED)NOT$(WHITE) installed. " ;\ - echo -e "Install it with $(GREEN)phive install phpmd$(WHITE)" ;\ - else \ - phpmd src text .phpmd.xml | sed "s/.*\///" ;\ - fi ;\ - echo "" - var_dumper: @if [ -f "vendor/bin/var-dump-server" ]; then \ vendor/bin/var-dump-server ;\ @@ -127,57 +102,6 @@ var_dumper: @echo "" - -psalm: - @${MAKE} disable_xdebug --no-print-directory - @if [ ! -f "vendor/bin/psalm" ]; then \ - echo -e "$(GREEN)psalm$(WHITE) is $(RED)NOT$(WHITE) installed. " ;\ - echo -e "Install it with $(GREEN)composer require --dev vimeo/psalm$(WHITE)" ;\ - exit 0 ;\ - fi - - @mkdir -p .build/psalm ;\ - vendor/bin/psalm --show-info=false --long-progress --threads=2 --config=psalm.xml | tee temp/psalm.output.txt - @${MAKE} enable_xdebug new_status=$(XDSWI_STATUS) --no-print-directory ;\ - echo "" - -phpstan: - @${MAKE} disable_xdebug --no-print-directory - @if [ ! -f "vendor/bin/phpstan" ]; then \ - echo -e "$(GREEN)phpstan$(WHITE) is $(RED)NOT$(WHITE) installed. " ;\ - echo -e "Install it with $(GREEN)composer require --dev phpstan/phpstan$(WHITE)" ;\ - exit 0 ;\ - fi - - @mkdir -p .build/phpstan ;\ - ./vendor/bin/phpstan analyse --memory-limit=2G --configuration phpstan.neon | tee temp/phpstan.output.txt - @${MAKE} enable_xdebug new_status=$(XDSWI_STATUS) --no-print-directory ;\ - echo "" - -lint: - @if [ -f "vendor/bin/parallel-lint" ]; then \ - mkdir -p .build/parallel ;\ - ${MAKE} disable_xdebug --no-print-directory ;\ - vendor/bin/parallel-lint --ignore-fails --exclude vendor src ;\ - ${MAKE} enable_xdebug new_status=$(XDSWI_STATUS) --no-print-directory;\ - else \ - echo -e "$(GREEN)parallel-lint$(WHITE) is $(RED)NOT$(WHITE) installed. " ;\ - echo -e "Install it with $(GREEN)composer require --dev php-parallel-lint/php-parallel-lint$(WHITE)" ;\ - fi - @find ./src -name \*.php -print0 | xargs -0 -n 1 php -l - @echo "" - -update_baselines: - @${MAKE} disable_xdebug --no-print-directory ;\ - find .build/phpstan -mtime +5 -type f -name "*.php" -exec rm -rf {} \; - @vendor/bin/phpstan analyze --configuration phpstan.neon --generate-baseline ;\ - find .build/psalm -mtime +5 -type f -exec rm -rf {} \; - @vendor/bin/psalm --config=psalm.xml --update-baseline --ignore-baseline --set-baseline=psalm-baseline.xml ;\ - ${MAKE} enable_xdebug new_status=$(XDSWI_STATUS) --no-print-directory - - -fixers: phpmd psalm phpstan - create_testdb: PGPASSWORD=scrutinizer psql -U scrutinizer -h localhost -f tests/simpletest/data/ppatests_install.sql @@ -186,4 +110,5 @@ destroy_testdb: run_local: ${MAKE} fix_permissions - php -S localhost:8000 index.php \ No newline at end of file + php -S localhost:8000 index.php + diff --git a/README.md b/README.md index ab2dfa7c..df11d495 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,10 @@ PHP Based administration tool for PostgreSQL. Blazing fast routing with [Slim Fr [![Codacy Badge](https://api.codacy.com/project/badge/Grade/289a56c1c7d94216b3d089c220689e9e)](https://www.codacy.com/app/amenadiel/phpPgAdmin6?utm_source=github.com&utm_medium=referral&utm_content=HuasoFoundries/phpPgAdmin6&utm_campaign=Badge_Grade) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/HuasoFoundries/phpPgAdmin6/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/HuasoFoundries/phpPgAdmin6/?branch=develop) [![Build Status](https://scrutinizer-ci.com/g/HuasoFoundries/phpPgAdmin6/badges/build.png?b=develop)](https://scrutinizer-ci.com/g/HuasoFoundries/phpPgAdmin6/build-status/develop) +[![License](https://img.shields.io/badge/license-MIT-428f7e.svg?logo=open%20source%20initiative&logoColor=white&labelColor=555555)](LICENSE.md) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FHuasoFoundries%2FphpPgAdmin6.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FHuasoFoundries%2FphpPgAdmin6?ref=badge_shield) - +![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/huasofoundries/phppgadmin6?logo=php&labelColor=efefef) +____________ This project is inspired in [phppgadmin](https://github.com/phppgadmin/phppgadmin). Said project stalled a few years ago so we took it, refactored almost entirely and added: - Composer Installation and dependency management diff --git a/assets/js/ac_insert_row.js b/assets/js/ac_insert_row.js index d6eff8fd..23abb75c 100644 --- a/assets/js/ac_insert_row.js +++ b/assets/js/ac_insert_row.js @@ -1,224 +1,224 @@ +/** globals jQuery */ var fkl_hasnext = false; var fkl_hasprev = false; +jQuery.ppa = jQuery.ppa || { + root: $('#root'), +}; /* hide the value list */ function hideAc() { - jQuery.ppa.o = 0; - with(jQuery.ppa) { - fklist.hide(); - fkbg.hide(); - } + jQuery.ppa.o = 0; + let { fklist, fkbg } = jQuery.ppa || {}; + fklist.hide(); + fkbg.hide(); } +/* open/update the value list */ +function autocomplete(event) { + /* if pressing enter, fire a click on the selected line */ + if (event.keyCode == 13) { + if (jQuery.ppa.i > 0) { + jQuery.ppa.fklist.find('tr').eq(jQuery.ppa.i).click(); + } + return false; + } else if (event.keyCode == 38 || event.keyCode == 40) { + /* ignoring 38:up and 40:down */ + return false; + } else if ( + /* ignoring 9:tab, 37:left, 39:right, 16:shift, ctrl: 17, alt:18, 20:lockmaj */ + event.keyCode == 9 || + event.keyCode == 37 || + event.keyCode == 39 || + event.keyCode == 16 || + event.keyCode == 17 || + event.keyCode == 18 || + event.keyCode == 20 + ) { + return true; + } else if (event.keyCode == 27) { + /* esc */ + hideAc(); + } else { + /* request the list of possible values asynchronously */ + /* if we refresh because of a value update, + * we reset back to offset 0 so we catch values + * if list is smaller than 11 values */ + if (event.type == 'keyup') { + jQuery.ppa.o = 0; + } + openlist(this); + } + return true; +} /* enable/disable auto-complete feature */ function triggerAc(ac) { - if (ac) { - jQuery.ppa.attrs - .bind('keyup.ac_action', autocomplete) - .bind('focus.ac_action', autocomplete) - .bind('keypress.ac_action', move) - .addClass('ac_field'); - } else { - jQuery.ppa.attrs - .removeClass('ac_field') - .unbind('.ac_action'); - } + if (ac) { + jQuery.ppa.attrs + .bind('keyup.ac_action', autocomplete) + .bind('focus.ac_action', autocomplete) + .bind('keypress.ac_action', move) + .addClass('ac_field'); + } else { + jQuery.ppa.attrs.removeClass('ac_field').unbind('.ac_action'); + } } /* select the given index value and highlight it */ function selectVal(index) { - if (index == jQuery.ppa.i) - return; - - // we catch the header as well so it takes th index 0 - var trs = jQuery.ppa.fklist.find('tr'); - - // change colors for unselected - if (jQuery.ppa.i > 0) - trs.eq(jQuery.ppa.i).find('*').css({ - 'background-color': '#fff', - 'color': '' - }); - - // change colors for newly selected - trs.eq(index).find('*').css({ - 'background-color': '#3d80df', - 'color': '#fff' + if (index == jQuery.ppa.i) { + return; + } + + // we catch the header as well so it takes th index 0 + var trs = jQuery.ppa.fklist.find('tr'); + + // change colors for unselected + if (jQuery.ppa.i > 0) { + trs.eq(jQuery.ppa.i).find('*').css({ + 'background-color': '#fff', + color: '', }); + } + + // change colors for newly selected + trs.eq(index).find('*').css({ + 'background-color': '#3d80df', + color: '#fff', + }); - jQuery.ppa.i = index; + jQuery.ppa.i = index; } function openlist(e) { - var elt = jQuery(e); - var attnum = elt.attr('id').match(/\d+/)[0]; - /* FIXME we only support the first FK constraint of the field */ - var conid = attrs['attr_' + attnum][0]; - - var constr = constrs["constr_" + conid]; - - // get the changed attribute position in the arrays - for (i = 0; - (constr.pattnums[i] != attnum); i++); - - var datas = { - fattpos: i, - fvalue: e.value, - database: database, - 'keys[]': constr.pattnums, - 'keynames[]': constr.pattnames, - 'fkeynames[]': constr.fattnames, - f_table: constr.f_table, - f_schema: constr.f_schema, - offset: jQuery.ppa.o - }; - - jQuery.ajax({ - url: subfolder + '/src/views/acinsert.php?server=' + server, - type: 'post', - data: datas, - dataType: 'html', - cache: false, - contentType: 'application/x-www-form-urlencoded', - success: function (ret) { - jQuery.ppa.i = 0; - jQuery.ppa.fkbg.show(); - with(jQuery.ppa.fklist) { - html(ret); - appendTo('#row_att_' + attnum); - css('width', elt.css('width')); - show(); - jQuery.ppa.numrow = find('tr').length; - } - } - }); + var elt = jQuery(e); + var attnum = elt.attr('id').match(/\d+/)[0]; + /* FIXME we only support the first FK constraint of the field */ + var conid = attrs['attr_' + attnum][0]; + + var constr = constrs['constr_' + conid]; + + // get the changed attribute position in the arrays + for (i = 0; constr.pattnums[i] != attnum; i++) {} + + var datas = { + fattpos: i, + fvalue: e.value, + database: database, + 'keys[]': constr.pattnums, + 'keynames[]': constr.pattnames, + 'fkeynames[]': constr.fattnames, + f_table: constr.f_table, + f_schema: constr.f_schema, + offset: jQuery.ppa.o, + }; + + jQuery.ajax({ + url: subfolder + '/src/views/acinsert.php?server=' + server, + type: 'post', + data: datas, + dataType: 'html', + cache: false, + contentType: 'application/x-www-form-urlencoded', + success: function (ret) { + jQuery.ppa.i = 0; + jQuery.ppa.fkbg.show(); + + jQuery.ppa.fklist + .html(ret) + .appendTo('#row_att_' + attnum) + .css('width', elt.css('width')) + .show(); + jQuery.ppa.numrow = jQuery.ppa.fklist.find('tr').length; + }, + }); } - /* move the cursor down or up, * load available next/prev values if going out of bound */ function move(event) { - /* selecting next value down. - * if the list is closed, it will open next */ - if (event.keyCode == 40) { - if (jQuery.ppa.fklist[0].style.display == 'block') { - if ((jQuery.ppa.i + 1) < jQuery.ppa.numrow) { - selectVal(jQuery.ppa.i + 1); - } else if (fkl_hasnext == true) { - jQuery.ppa.o += 11; - openlist(this); - } - } else { - openlist(this); - } + /* selecting next value down. + * if the list is closed, it will open next */ + if (event.keyCode == 40) { + if (jQuery.ppa.fklist[0].style.display == 'block') { + if (jQuery.ppa.i + 1 < jQuery.ppa.numrow) { + selectVal(jQuery.ppa.i + 1); + } else if (fkl_hasnext == true) { + jQuery.ppa.o += 11; + openlist(this); + } + } else { + openlist(this); } + } else if (event.keyCode == 38) { /* selecting prev value up */ - else if (event.keyCode == 38) { - if ((jQuery.ppa.i - 1) > 0) { - selectVal(jQuery.ppa.i - 1); - } else if ((fkl_hasprev == true) && (jQuery.ppa.i == 1)) { - jQuery.ppa.o -= 11; - openlist(this); - } else { - selectVal(jQuery.ppa.numrow - 1); - } - } -} - -/* open/update the value list */ -function autocomplete(event) { - - /* if pressing enter, fire a click on the selected line */ - if (event.keyCode == 13) { - if (jQuery.ppa.i > 0) { - jQuery.ppa.fklist.find('tr').eq(jQuery.ppa.i).click(); - } - return false; - } - /* ignoring 38:up and 40:down */ - else if (event.keyCode == 38 || event.keyCode == 40) { - return false; - } - /* ignoring 9:tab, 37:left, 39:right, 16:shift, ctrl: 17, alt:18, 20:lockmaj */ - else if (event.keyCode == 9 || event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 16 || event.keyCode == 17 || event.keyCode == 18 || event.keyCode == 20) { - return true; - } - /* esc */ - else if (event.keyCode == 27) { - hideAc(); - } - /* request the list of possible values asynchronously */ - else { - /* if we refresh because of a value update, - * we reset back to offset 0 so we catch values - * if list is smaller than 11 values */ - if (event.type == 'keyup') - jQuery.ppa.o = 0; - openlist(this); + if (jQuery.ppa.i - 1 > 0) { + selectVal(jQuery.ppa.i - 1); + } else if (fkl_hasprev == true && jQuery.ppa.i == 1) { + jQuery.ppa.o -= 11; + openlist(this); + } else { + selectVal(jQuery.ppa.numrow - 1); } - - return true; + } } /* bind actions on values lines: hover for style change, click for select */ jQuery('tr.acline').on('mouseover', function () { - selectVal(jQuery('table.ac_values tr').index(this)); + selectVal(jQuery('table.ac_values tr').index(this)); }); jQuery('tr.acline').on('click', function () { - var a = jQuery(this).find('td > a.fkval'); + var a = jQuery(this).find('td > a.fkval'); - for (i = 0; i < a.length; i++) { - jQuery('input[name="values[' + a[i].name + ']"]').val(jQuery(a[i]).text()); - } - hideAc(); + for (i = 0; i < a.length; i++) { + jQuery('input[name="values[' + a[i].name + ']"]').val(jQuery(a[i]).text()); + } + hideAc(); }); - jQuery(document).ready(function () { - /* register some global value in the ppa namespace */ - jQuery.ppa = { - fklist: jQuery('#fklist'), - attrs: jQuery('input[id^=attr_]'), // select fields with FK - fkbg: jQuery('#fkbg'), - i: 0, // selected value indice - o: 0 // offset when navigating prev/next - }; - - jQuery.ppa.fklist.on('click', '#fkprev', function () { - jQuery.ppa.o -= 11; - /* get the field that is the previous html elt from the #fklist - * and trigger its focus to refresh the list AND actualy - * focus back on the field */ - jQuery('#fklist').prev().focus(); - }); - - - jQuery.ppa.fklist.on('click', '#fknext', function () { - jQuery.ppa.o += 11; - /* get the field that is the previous html elt from the #fklist - * and trigger its focus to refresh the list AND actualy - * focus back on the field*/ - jQuery('#fklist').prev().focus(); - }); - - /* close the list when clicking outside of it */ - jQuery.ppa.fkbg.click(function (e) { - hideAc(); - }); + /* register some global value in the ppa namespace */ + jQuery.ppa = { + fklist: jQuery('#fklist'), + attrs: jQuery('input[id^=attr_]'), // select fields with FK + fkbg: jQuery('#fkbg'), + i: 0, // selected value indice + o: 0, // offset when navigating prev/next + }; + + jQuery.ppa.fklist.on('click', '#fkprev', function () { + jQuery.ppa.o -= 11; + /* get the field that is the previous html elt from the #fklist + * and trigger its focus to refresh the list AND actualy + * focus back on the field */ + jQuery('#fklist').prev().focus(); + }); + + jQuery.ppa.fklist.on('click', '#fknext', function () { + jQuery.ppa.o += 11; + /* get the field that is the previous html elt from the #fklist + * and trigger its focus to refresh the list AND actualy + * focus back on the field*/ + jQuery('#fklist').prev().focus(); + }); + + /* close the list when clicking outside of it */ + jQuery.ppa.fkbg.click(function (e) { + hideAc(); + }); - /* do not submit the form when selecting a value by pressing enter */ - jQuery.ppa.attrs - .keydown(function (e) { - if (e.keyCode == 13 && jQuery.ppa.fklist[0].style.display == 'block') - return false; - }); - - /* enable/disable auto-complete according to the checkbox */ - triggerAc( - jQuery('#no_ac').click(function () { - triggerAc(this.checked); - })[0].checked - ); -}); \ No newline at end of file + /* do not submit the form when selecting a value by pressing enter */ + jQuery.ppa.attrs.keydown(function (e) { + if (e.keyCode == 13 && jQuery.ppa.fklist[0].style.display == 'block') { + return false; + } + }); + + /* enable/disable auto-complete according to the checkbox */ + triggerAc( + jQuery('#no_ac').click(function () { + triggerAc(this.checked); + })[0].checked + ); +}); diff --git a/assets/js/codemirror/addon/sql-lint.js b/assets/js/codemirror/addon/sql-lint.js index 800c8d7a..064bc954 100644 --- a/assets/js/codemirror/addon/sql-lint.js +++ b/assets/js/codemirror/addon/sql-lint.js @@ -1,38 +1,34 @@ CodeMirror.sqlLint = function (text, updateLinting, options, cm) { - // Skipping check if text box is empty. - if (text.trim() === '') { - updateLinting(cm, []); - return; - } - - function handleResponse (response) { - var found = []; - for (var idx in response) { - found.push({ - from: CodeMirror.Pos( - response[idx].fromLine, response[idx].fromColumn - ), - to: CodeMirror.Pos( - response[idx].toLine, response[idx].toColumn - ), - messageHTML: response[idx].message, - severity : response[idx].severity - }); - } + // Skipping check if text box is empty. + if (text.trim() === '') { + updateLinting(cm, []); + return; + } - updateLinting(cm, found); + function handleResponse(response) { + var found = []; + for (var idx in response) { + found.push({ + from: CodeMirror.Pos(response[idx].fromLine, response[idx].fromColumn), + to: CodeMirror.Pos(response[idx].toLine, response[idx].toColumn), + messageHTML: response[idx].message, + severity: response[idx].severity, + }); } - $.ajax({ - method: 'POST', - url: 'lint.php', - dataType: 'json', - data: { - sql_query: text, - server: PMA_commonParams.get('server'), - options: options.lintOptions, - no_history: true, - }, - success: handleResponse - }); + updateLinting(cm, found); + } + + $.ajax({ + method: 'POST', + url: 'lint.php', + dataType: 'json', + data: { + sql_query: text, + server: PMA_commonParams.get('server'), + options: options.lintOptions, + no_history: true, + }, + success: handleResponse, + }); }; diff --git a/assets/js/codemirror/codemirror_footer.js b/assets/js/codemirror/codemirror_footer.js index 9613ea2c..b5b6f0ee 100644 --- a/assets/js/codemirror/codemirror_footer.js +++ b/assets/js/codemirror/codemirror_footer.js @@ -2,8 +2,8 @@ var avoid_bogus_character = true; var windowsize; function autoResize(cb) { //console.log('window size', windowsize); - jQuery(".CodeMirror").css( - "height", + jQuery('.CodeMirror').css( + 'height', jQuery(window).innerHeight() - windowsize.height_difference ); if (cb) { @@ -12,59 +12,59 @@ function autoResize(cb) { } function setResizable() { requestAnimationFrame(() => { - jQuery(".CodeMirror") - .css("resize", "both") - .attr("resizable", "true") + jQuery('.CodeMirror') + .css('resize', 'both') + .attr('resizable', 'true') .resizable({ - handles: "all", - resize: function() { + handles: 'all', + resize: function () { window.codemirrorEditor.setSize($(this).width(), $(this).height()); - } + }, }); }); } -window.addEventListener("load", event => { +window.addEventListener('load', (event) => { console.log("'Todos los recursos terminaron de cargar!"); if ( !avoid_bogus_character || - typeof CodeMirror === "undefined" || - !document.querySelector("textarea#query") + typeof CodeMirror === 'undefined' || + !document.querySelector('textarea#query') ) { return; } - jQuery(document).ready(function() { + jQuery(document).ready(function () { windowsize = { height: jQuery(window).innerHeight(), - width: jQuery(window).innerWidth() + width: jQuery(window).innerWidth(), }; let modeCM, specCM, - editorMode = "text/x-pgsql"; + editorMode = 'text/x-pgsql'; - CodeMirror.autoLoadMode = function(instance, mode) { + CodeMirror.autoLoadMode = function (instance, mode) { console.log({ instance, mode }); if (CodeMirror.modes.hasOwnProperty(mode)) { return; } - CodeMirror.requireMode(mode, function() { - instance.setOption("mode", instance.getOption("mode")); - jQuery(".CodeMirror").css("height", $("#query").attr("rows") * 26); + CodeMirror.requireMode(mode, function () { + instance.setOption('mode', instance.getOption('mode')); + jQuery('.CodeMirror').css('height', $('#query').attr('rows') * 26); requestAnimationFrame(() => { if (window.inPopUp) { windowsize.height_difference = - windowsize.height - jQuery(".CodeMirror").innerHeight(); - jQuery(window).on("resize", autoResize); + windowsize.height - jQuery('.CodeMirror').innerHeight(); + jQuery(window).on('resize', autoResize); } window.codemirrorEditor = instance; autoResize(setResizable); }); }); }; - CodeMirror.commands.sendQuery = function() { - jQuery("#sqlform").submit(); + CodeMirror.commands.sendQuery = function () { + jQuery('#sqlform').submit(); }; /* window.editor = CodeMirror.fromTextArea(document.querySelector("#query"), { @@ -89,7 +89,7 @@ window.addEventListener("load", event => { */ let codemirrorEditor = CodeMirror.fromTextArea( - document.querySelector("#query"), + document.querySelector('#query'), /*{ // mode: "text/x-pgsql", indentWithTabs: true, @@ -106,7 +106,7 @@ window.addEventListener("load", event => { //foldGutter: {rangeFinder: CodeMirror.fold.brace }, gutters: ["CodeMirror-linenumbers", "CodeMirror-lint-markers"] }*/ { - mode: "text/x-pgsql", + mode: 'text/x-pgsql', indentWithTabs: true, smartIndent: true, lineNumbers: true, @@ -115,11 +115,11 @@ window.addEventListener("load", event => { autofocus: true, addModeClass: true, extraKeys: { - "Ctrl-Enter": "sendQuery", - "Ctrl-Q": function(cm) { + 'Ctrl-Enter': 'sendQuery', + 'Ctrl-Q': function (cm) { cm.foldCode(cm.getCursor()); - } - } + }, + }, //foldGutter: true, // foldGutter: { rangeFinder: CodeMirror.fold.brace }, //gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"] @@ -129,7 +129,7 @@ window.addEventListener("load", event => { var modeInfo = CodeMirror.findModeByMIME(editorMode); console.log({ editorMode, modeInfo }); if (modeInfo && modeInfo.mode) { - codemirrorEditor.setOption("mode", editorMode); + codemirrorEditor.setOption('mode', editorMode); CodeMirror.autoLoadMode(codemirrorEditor, modeInfo.mode); } }); diff --git a/assets/js/codemirror/instance_codemirror.js b/assets/js/codemirror/instance_codemirror.js index 8e295b25..9dd63d02 100644 --- a/assets/js/codemirror/instance_codemirror.js +++ b/assets/js/codemirror/instance_codemirror.js @@ -1,27 +1,26 @@ -if (typeof CodeMirror !== "undefined") { +if (typeof CodeMirror !== 'undefined') { let modeCM, specCM, - editorMode = "text/x-pgsql"; - CodeMirror.autoLoadMode = function(instance, mode) { + editorMode = 'text/x-pgsql'; + CodeMirror.autoLoadMode = function (instance, mode) { console.log({ instance, mode }); - if (!CodeMirror.modes.hasOwnProperty(mode)) - CodeMirror.requireMode(mode, function() { - instance.setOption("mode", instance.getOption("mode")); - jQuery(".CodeMirror").css("height", $("#query").attr("rows") * 26); + if (!CodeMirror.modes.hasOwnProperty(mode)) { + CodeMirror.requireMode(mode, function () { + instance.setOption('mode', instance.getOption('mode')); + jQuery('.CodeMirror').css('height', $('#query').attr('rows') * 26); - window.setTimeout(function() { - jQuery(".CodeMirror") - .attr("resizable", "true") - .focus(); + window.setTimeout(function () { + jQuery('.CodeMirror').attr('resizable', 'true').focus(); }, 2500); }); + } }; - CodeMirror.commands.sendQuery = function() { - jQuery("#sqlform").submit(); + CodeMirror.commands.sendQuery = function () { + jQuery('#sqlform').submit(); }; - if (document.querySelector("textarea#query")) { - window.editor = CodeMirror.fromTextArea(document.querySelector("#query"), { + if (document.querySelector('textarea#query')) { + window.editor = CodeMirror.fromTextArea(document.querySelector('#query'), { // mode: "text/x-pgsql", indentWithTabs: true, smartIndent: true, @@ -31,11 +30,11 @@ if (typeof CodeMirror !== "undefined") { autofocus: true, addModeClass: true, extraKeys: { - "Ctrl-Space": "autocomplete", - "Ctrl-Enter": "sendQuery" + 'Ctrl-Space': 'autocomplete', + 'Ctrl-Enter': 'sendQuery', }, //foldGutter: {rangeFinder: CodeMirror.fold.brace }, - gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"] + gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'], }); var modeInfo = CodeMirror.findModeByMIME(editorMode); @@ -44,7 +43,7 @@ if (typeof CodeMirror !== "undefined") { mode = modeInfo.mode; spec = modeInfo; - window.editor.setOption("mode", modeInfo); + window.editor.setOption('mode', modeInfo); CodeMirror.autoLoadMode(window.editor, modeInfo.mode); } } diff --git a/assets/js/database.js b/assets/js/database.js index 7e04dea1..f42d3954 100644 --- a/assets/js/database.js +++ b/assets/js/database.js @@ -1,72 +1,89 @@ $(document).ready(function () { + var timeid = (query = null); + var controlLink = $('#control'); - var timeid = query = null; - var controlLink = $('#control'); + console.log('Database is', Database); - console.log('Database is', Database); + var errmsg = $('

    ' + Database.errmsg + '

    ') + .insertBefore(controlLink) + .hide(); - var errmsg = $('

    ' + Database.errmsg + '

    ') - .insertBefore(controlLink) - .hide(); + var loading = $( + '[loading]' + ) + .insertAfter(controlLink) + .hide(); - var loading = $('[loading]') - .insertAfter(controlLink) - .hide(); + controlLink.show(); - controlLink.show(); + function refreshTable() { + if (Database.ajax_time_refresh > 0) { + loading.show(); + query = $.ajax({ + type: 'GET', + dataType: 'html', + data: { + server: Database.server, + database: Database.dbname, + action: Database.action, + }, + url: '/src/views/database.php', + cache: false, + contentType: 'application/x-www-form-urlencoded', + success: function (html) { + $('#data_block').html(html); + timeid = window.setTimeout(refreshTable, Database.ajax_time_refresh); + loading.hide(); + }, + error: function () { + controlLink.click(); + //errmsg.show(); + }, + complete: function () { + //loading.hide(); + }, + }); + } + } + controlLink.on('click', function () { + console.log(timeid); + if (timeid === null) { + console.log('toggle 1'); + timeid = window.setTimeout(refreshTable, Database.ajax_time_refresh); + controlLink + .empty() + .append( + ' ' + + Database.str_stop.text + + '   ' + ); + } else { + console.log('toggle 2'); + window.clearInterval(timeid); + if (query) { + query.abort(); + } + controlLink + .empty() + .append( + ' ' + + Database.str_start.text + ); + } + }); - function refreshTable() { - if (Database.ajax_time_refresh > 0) { - loading.show(); - query = $.ajax({ - type: 'GET', - dataType: 'html', - data: { - server: Database.server, - database: Database.dbname, - action: Database.action - }, - url: '/src/views/database.php', - cache: false, - contentType: 'application/x-www-form-urlencoded', - success: function (html) { - $('#data_block').html(html); - timeid = window.setTimeout(refreshTable, Database.ajax_time_refresh) - loading.hide(); - }, - error: function () { - controlLink.click(); - //errmsg.show(); - }, - complete: function () { - //loading.hide(); - } - }); - } - } + /* preload images */ + $('#control img') + .hide() + .attr('src', Database.str_start.icon) + .attr('src', Database.str_stop.icon) + .show(); - controlLink.on('click', function () { - console.log(timeid); - if (timeid === null) { - console.log('toggle 1'); - timeid = window.setTimeout(refreshTable, Database.ajax_time_refresh); - controlLink.empty().append(' ' + Database.str_stop.text + '   '); - } else { - console.log('toggle 2'); - window.clearInterval(timeid); - if (query) query.abort(); - controlLink.empty().append(' ' + Database.str_start.text); - } - }); - - - /* preload images */ - $('#control img').hide() - .attr('src', Database.str_start.icon) - .attr('src', Database.str_stop.icon) - .show(); - - /* start refreshing */ - controlLink.click(); -}); \ No newline at end of file + /* start refreshing */ + controlLink.click(); +}); diff --git a/assets/js/display.js b/assets/js/display.js index 10719811..cf1a23dd 100644 --- a/assets/js/display.js +++ b/assets/js/display.js @@ -1,93 +1,106 @@ -$(document).ready(function () { - - /* init some needed tags and values */ - - $('table#data').wrap('
    '); - $('#fkcontainer').append('
    '); - - jQuery.ppa = { - root: $('#root') - }; - - $("a.fk").on('click', function (event) { - /* make the cursor being a waiting cursor */ - $('body').css('cursor', 'wait'); - - query = $.ajax({ - type: 'GET', - dataType: 'html', - data: { - action: 'dobrowsefk' - }, - url: $(this).attr('href'), - cache: false, - context: $(this), - contentType: 'application/x-www-form-urlencoded', - success: function (answer) { - pdiv = this.closest('div.fk'); - divclass = this.attr('class').split(' ')[1]; - - /* if we are clicking on a FK from the original table +$(function () { + /* init some needed tags and values */ + + $('table#data').wrap('
    '); + $('#fkcontainer').append('
    '); + + jQuery.ppa = jQuery.ppa || { + root: $('#root'), + }; + + $('a.fk').on('click', function (event) { + /* make the cursor being a waiting cursor */ + $('body').css('cursor', 'wait'); + let $this = $(this); + $.ajax({ + type: 'GET', + dataType: 'html', + data: { + action: 'dobrowsefk', + }, + url: String($(this).attr('href')), + cache: false, + context: $(this), + contentType: 'application/x-www-form-urlencoded', + }) + .done((answer) => { + let pdiv = $this.closest('div.fk'), + divclass = $this.attr('class').split(' ')[1]; + + /* if we are clicking on a FK from the original table (level 0), we are using the #root div as parent-div */ - if (pdiv[0].id == 'fkcontainer') { - /* computing top position, which is the topid as well */ - var top = this.position().top + 2 + this.height(); - /* if the requested top position is different than + if (pdiv[0].id == 'fkcontainer') { + /* computing top position, which is the topid as well */ + var top = $this.position().top + 2 + $this.height(); + /* if the requested top position is different than the previous topid position of #root, empty and position it */ - if (top != jQuery.ppa.root.topid) - jQuery.ppa.root.empty() - .css({ - left: (pdiv.position().left) + 'px', - top: top + 'px' - }) - /* this "topid" allows to track if we are + if (top != jQuery.ppa.root.topid) { + /* this "topid" allows to track if we are opening a FK from the same line in the original table */ - .topid = top; - - pdiv = jQuery.ppa.root; - - /* Remove equal rows in the root div */ - jQuery.ppa.root.children('.' + divclass).remove(); - } else { - /* Remove equal rows in the pdiv */ - pdiv.children('div.' + divclass).remove(); - } - - /* creating the data div */ - newdiv = $('
    ').html(answer); - - /* highlight referencing fields */ - newdiv.data('ref', this).data('refclass', $(this).attr('class').split(' ')[1]) - .mouseenter(function (event) { - $(this).data('ref').closest('tr').find('a.' + $(this).data('refclass')).closest('div').addClass('highlight'); - }) - .mouseleave(function (event) { - $(this).data('ref').closest('tr').find('a.' + $(this).data('refclass')).closest('div').removeClass('highlight'); - }); - - /* appending it to the level-1 div */ - pdiv.append(newdiv); - - newdiv.on('click', '.fk_delete', function (event) { - console.log('clicked .fk_delete', jQuery(this)); - with($(this).closest('div')) { - data('ref').closest('tr').find('a.' + data('refclass')).closest('div').removeClass('highlight'); - remove(); - } - }); - }, - - error: function () { - this.closest('div.fk').append('

    ' + Display.errmsg + '

    '); - }, - - complete: function () { - $('body').css('cursor', 'auto'); - } + jQuery.ppa.root.empty().css({ + left: pdiv.position().left + 'px', + top: top + 'px', + }).topid = top; + } + + pdiv = jQuery.ppa.root; + + /* Remove equal rows in the root div */ + jQuery.ppa.root.children('.' + divclass).remove(); + } else { + /* Remove equal rows in the pdiv */ + pdiv.children('div.' + divclass).remove(); + } + + /* creating the data div */ + let newdiv = $('
    ').html(answer); + + /* highlight referencing fields */ + newdiv + .data('ref', $this) + .data('refclass', $(this).attr('class').split(' ')[1]); + newdiv + .on('mouseenter', function (event) { + $(this) + .data('ref') + .closest('tr') + .find('a.' + $(this).data('refclass')) + .closest('div') + .addClass('highlight'); + }) + .on('mouseleave', function (event) { + $(this) + .data('ref') + .closest('tr') + .find('a.' + $(this).data('refclass')) + .closest('div') + .removeClass('highlight'); + }); + + /* appending it to the level-1 div */ + pdiv.append(newdiv); + + newdiv.on('click', '.fk_delete', function (event) { + console.log('clicked .fk_delete', jQuery(this)); + let closestDiv = $(this).closest('div'); + closestDiv + .data('ref') + .closest('tr') + .find('a.' + closestDiv.data('refclass')) + .closest('div') + .removeClass('highlight'); + closestDiv.remove(); }); - - return false; // do not refresh the page - }); - - -}); \ No newline at end of file + }) + .fail((err) => { + $this + .closest('div.fk') + .append('

    ' + Display.errmsg + '

    '); + }) + .always(() => { + $('body').css('cursor', 'auto'); + }); + + return false; // do not refresh the page + }); +}); diff --git a/assets/js/footer_scripts.js b/assets/js/footer_scripts.js index b9cfbc20..ee9aa69f 100644 --- a/assets/js/footer_scripts.js +++ b/assets/js/footer_scripts.js @@ -1,3 +1,6 @@ +function historyApiBack() { + window.history && window.history.back(); +} function redirectToIframesView() { if ( window.inPopUp || @@ -26,16 +29,18 @@ function addBehaviorToTopLinks(amIDetailFrame) { amIDetailFrame && window.parent.document.querySelector('#detail'), toplink_logout = amIDetailFrame && - parentHandle.contentDocument.querySelector('#toplink_logout'); + (parentHandle.contentDocument || document).querySelector( + '#toplink_logout' + ); parentHandle && [ - ...parentHandle.contentDocument.querySelectorAll( + ...(parentHandle.contentDocument || document).querySelectorAll( '.toplink a.toplink_popup' ), - ].forEach(element => { + ].forEach((element) => { let href = element.href; - element.addEventListener('click', e => { + element.addEventListener('click', (e) => { e.preventDefault(); window .open( @@ -50,7 +55,7 @@ function addBehaviorToTopLinks(amIDetailFrame) { element.href = 'javascript:void(this.click())'; // eslint-disable-line }); toplink_logout && - toplink_logout.addEventListener('click', e => { + toplink_logout.addEventListener('click', (e) => { e.preventDefault(); if (confirm(stateObj.strconfdropcred)) { window.location.href = e.target.href; @@ -67,6 +72,13 @@ if ( ) { redirectToIframesView(); } +let { + frames: { browser }, +} = window.parent; +if (browser && browser.jsTree && stateObj.reload) { + browser.jsTree.jstree('refresh'); +} + $.ready .then(() => { let amIDetailFrame = document.body.classList.contains('detailbody'); @@ -103,7 +115,7 @@ $.ready }) .then(() => { if (window.location.href.indexOf('servers?action=logout') !== -1) { - window.setTimeout(function() { + window.setTimeout(function () { window.parent.location.replace(`${stateObj.subfolder}/servers`); }, 3000); } else if ( @@ -130,12 +142,12 @@ $.ready } } if (typeof hljs !== 'undefined') { - $('pre code.hljs').each(function(i, block) { + $('pre code.hljs').each(function (i, block) { hljs.highlightBlock(block); }); } return; }) - .catch(err => { + .catch((err) => { console.error(err); }); diff --git a/assets/js/footer_sqledit.js b/assets/js/footer_sqledit.js index fe4b4505..15a7f33d 100644 --- a/assets/js/footer_sqledit.js +++ b/assets/js/footer_sqledit.js @@ -1,57 +1,57 @@ -$(document).ready(function() { +$(function () { if (window.inPopUp) { - jQuery("table.tabs").prependTo("body"); - jQuery("table.printconnection").prependTo(".sqlform"); + jQuery('table.tabs').prependTo('body'); + jQuery('table.printconnection').prependTo('.sqlform'); } - var the_action = $("#the_action").val(); + var the_action = $('#the_action').val(); function get_action_params(from) { var action_params = []; - if (the_action === "sql") { + if (the_action === 'sql') { action_params = [ - "query=" + encodeURI(window.editor.getValue()), - "search_path=" + - (from === "server" ? "public" : encodeURI($("#search_path").val())) + 'query=' + encodeURI(window.editor.getValue()), + 'search_path=' + + (from === 'server' ? 'public' : encodeURI($('#search_path').val())), ]; - if (jQuery("#paginate").is(":checked")) { - action_params.push("paginate=on"); + if (jQuery('#paginate').is(':checked')) { + action_params.push('paginate=on'); } - } else if (the_action === "find") { + } else if (the_action === 'find') { action_params = [ - "term=" + encodeURI($("#term").val()), - "filter=" + encodeURI($("#filter").val()) + 'term=' + encodeURI($('#term').val()), + 'filter=' + encodeURI($('#filter').val()), ]; } return action_params; } - $("#selectserver").on("change", function() { - console.log("server changed to ", $(this).val()); + $('#selectserver').on('change', function () { + console.log('server changed to ', $(this).val()); - var base_location = location.href.split("&")[0], - next_location = [base_location, "server=" + $(this).val()]; + var base_location = location.href.split('&')[0], + next_location = [base_location, 'server=' + $(this).val()]; - next_location = next_location.concat(get_action_params("server")); + next_location = next_location.concat(get_action_params('server')); - location.href = next_location.join("&"); + location.href = next_location.join('&'); //console.log('next_location would be',next_location.join('&')); }); - $("#selectdb").on("change", function() { - console.log("database changed to ", $(this).val()); + $('#selectdb').on('change', function () { + console.log('database changed to ', $(this).val()); - var base_location = location.href.split("&")[0], + var base_location = location.href.split('&')[0], next_location = [ base_location, - "server=" + $("#selectserver").val(), - "database=" + $(this).val() + 'server=' + $('#selectserver').val(), + 'database=' + $(this).val(), ]; - next_location = next_location.concat(get_action_params("database")); + next_location = next_location.concat(get_action_params('database')); - location.href = next_location.join("&"); + location.href = next_location.join('&'); //console.log('next_location would be',next_location.join('&')); }); }); diff --git a/assets/js/functions.js b/assets/js/functions.js index d37e61d0..3ee87ba1 100644 --- a/assets/js/functions.js +++ b/assets/js/functions.js @@ -1,222 +1,250 @@ -var g_args = 0; -var g_no_args = new Boolean(false); +let g_args = 0, + g_no_args = false; /* function for adding arguments */ function addArg(subfolder) { - var baseTR = baseArgTR(subfolder); - console.log('addArg', subfolder); - if (document.getElementById("args_table").insertBefore(baseTR, document.getElementById("parent_add_tr"))) { - g_args++; - return baseTR; - } + var baseTR = baseArgTR(subfolder); + console.log('addArg', subfolder); + if ( + document + .getElementById('args_table') + .insertBefore(baseTR, document.getElementById('parent_add_tr')) + ) { + g_args++; + return baseTR; + } } function buildArgImages(orig_td, subfolder) { - var table = document.createElement("table"); - var tbody = document.createElement("tbody"); - var tr = document.createElement("tr"); - var td = document.createElement("td"); - var img = document.createElement("img"); - img.src = subfolder + "/assets/images/themes/default/RaiseArgument.png"; - td.onmouseover = function () { - this.style.cursor = 'pointer'; - this.title = g_lang_strargraise; - } - td.onclick = function () { - swapArgTR(this.parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling, this.parentNode.parentNode.parentNode.parentNode.parentNode); - } - img.className = 'arg_icon'; - td.appendChild(img); - td.className = "data1"; - tr.appendChild(td); - var img = document.createElement("img"); - var td = document.createElement("td"); - img.src = subfolder + "/assets/images/themes/default/LowerArgument.png"; - img.className = 'arg_icon'; - td.appendChild(img); - td.className = "data1"; - td.onmouseover = function () { - this.style.cursor = 'pointer'; - this.title = g_lang_strarglower; - } - td.onclick = function () { - swapArgTR(this.parentNode.parentNode.parentNode.parentNode.parentNode, this.parentNode.parentNode.parentNode.parentNode.parentNode.nextSibling); - } - tr.appendChild(td); - var img = document.createElement("img"); - var td = document.createElement("td"); - img.src = subfolder + "/assets/images/themes/default/RemoveArgument.png"; - img.title = g_lang_strargremove; - img.className = 'arg_icon'; - td.appendChild(img); - td.className = "data1"; - td.onmouseover = function () { - this.style.cursor = 'pointer'; - this.title = 'Remove'; - } - td.onclick = function () { - if (g_args > 1) { - if (confirm(g_lang_strargremoveconfirm)) document.getElementById("args_table").removeChild(this.parentNode.parentNode.parentNode.parentNode.parentNode); - g_args--; - } else { - if (g_no_args == false) { - disableArgTR(this.parentNode.parentNode.parentNode.parentNode.parentNode); - this.childNodes[0].src = subfolder + '/images/themes/default/EnableArgument.png'; - this.childNodes[0].title = g_lang_strargenableargs; - this.childNodes[0].id = "1st_arg_iag"; - alert(g_lang_strargnoargs); - g_no_args = true; - g_args--; - } else { - enableArgTR(this.parentNode.parentNode.parentNode.parentNode.parentNode); - this.childNodes[0].src = subfolder + '/images/themes/default/RemoveArgument.png'; - this.childNodes[0].title = g_lang_strargremove; - g_args++; - g_no_args = false; - } - } - } - td.onmouseout = function () {} - if (g_args == 0) { - td.id = "1st_arg_td"; - } - tr.className = 'arg_tr_pc'; - tr.appendChild(td); - tbody.appendChild(tr); - table.appendChild(tbody); - orig_td.appendChild(table); - return orig_td; + var table = document.createElement('table'); + var tbody = document.createElement('tbody'); + var tr = document.createElement('tr'); + var td = document.createElement('td'); + var img = document.createElement('img'); + img.src = subfolder + '/assets/images/themes/default/RaiseArgument.png'; + td.onmouseover = function () { + this.style.cursor = 'pointer'; + this.title = g_lang_strargraise; + }; + td.onclick = function () { + swapArgTR( + this.parentNode.parentNode.parentNode.parentNode.parentNode + .previousSibling, + this.parentNode.parentNode.parentNode.parentNode.parentNode + ); + }; + img.className = 'arg_icon'; + td.appendChild(img); + td.className = 'data1'; + tr.appendChild(td); + var img = document.createElement('img'); + var td = document.createElement('td'); + img.src = subfolder + '/assets/images/themes/default/LowerArgument.png'; + img.className = 'arg_icon'; + td.appendChild(img); + td.className = 'data1'; + td.onmouseover = function () { + this.style.cursor = 'pointer'; + this.title = g_lang_strarglower; + }; + td.onclick = function () { + swapArgTR( + this.parentNode.parentNode.parentNode.parentNode.parentNode, + this.parentNode.parentNode.parentNode.parentNode.parentNode.nextSibling + ); + }; + tr.appendChild(td); + var img = document.createElement('img'); + var td = document.createElement('td'); + img.src = subfolder + '/assets/images/themes/default/RemoveArgument.png'; + img.title = g_lang_strargremove; + img.className = 'arg_icon'; + td.appendChild(img); + td.className = 'data1'; + td.onmouseover = function () { + this.style.cursor = 'pointer'; + this.title = 'Remove'; + }; + td.onclick = function () { + if (g_args > 1) { + if (confirm(g_lang_strargremoveconfirm)) { + document + .getElementById('args_table') + .removeChild( + this.parentNode.parentNode.parentNode.parentNode.parentNode + ); + } + g_args--; + } else if (g_no_args == false) { + disableArgTR(this.parentNode.parentNode.parentNode.parentNode.parentNode); + this.childNodes[0].src = + subfolder + '/images/themes/default/EnableArgument.png'; + this.childNodes[0].title = g_lang_strargenableargs; + this.childNodes[0].id = '1st_arg_iag'; + alert(g_lang_strargnoargs); + g_no_args = true; + g_args--; + } else { + enableArgTR(this.parentNode.parentNode.parentNode.parentNode.parentNode); + this.childNodes[0].src = + subfolder + '/images/themes/default/RemoveArgument.png'; + this.childNodes[0].title = g_lang_strargremove; + g_args++; + g_no_args = false; + } + }; + td.onmouseout = function () {}; + if (g_args == 0) { + td.id = '1st_arg_td'; + } + tr.className = 'arg_tr_pc'; + tr.appendChild(td); + tbody.appendChild(tr); + table.appendChild(tbody); + orig_td.appendChild(table); + return orig_td; } function noArgsRebuild(tr) { - disableArgTR(tr); - var td = document.getElementById("1st_arg_td"); - td.childNodes[0].src = 'images/themes/default/EnableArgument.png'; - td.childNodes[0].title = g_lang_strargenableargs; - td.childNodes[0].id = "1st_arg_iag"; - g_no_args = true; - g_args--; + disableArgTR(tr); + var td = document.getElementById('1st_arg_td'); + td.childNodes[0].src = 'images/themes/default/EnableArgument.png'; + td.childNodes[0].title = g_lang_strargenableargs; + td.childNodes[0].id = '1st_arg_iag'; + g_no_args = true; + g_args--; } function swapArgTR(first, second) { - var tmp = null; - tmp = second; - second = first; - first = tmp; - if (first.className == 'arg_tr_pc' && second.className == 'arg_tr_pc') { - document.getElementById("args_table").insertBefore(first, second); - } else if (first.className == 'arg_tr_pc' && second.className != 'arg_tr_pc') { - alert(g_lang_strargnorowabove); - } else if (first.className != 'arg_tr_pc' && second.className == 'arg_tr_pc') { - alert(g_lang_strargnorowbelow); - } + var tmp = null; + tmp = second; + second = first; + first = tmp; + if (first.className == 'arg_tr_pc' && second.className == 'arg_tr_pc') { + document.getElementById('args_table').insertBefore(first, second); + } else if ( + first.className == 'arg_tr_pc' && + second.className != 'arg_tr_pc' + ) { + alert(g_lang_strargnorowabove); + } else if ( + first.className != 'arg_tr_pc' && + second.className == 'arg_tr_pc' + ) { + alert(g_lang_strargnorowbelow); + } } function disableArgTR(tr) { - var children = (tr.childNodes); - for (i in children) { - var secondary_children = children[i].childNodes; - for (i2 in secondary_children) { - secondary_children[i2].disabled = true; - } - } + var children = tr.childNodes; + for (i in children) { + var secondary_children = children[i].childNodes; + for (i2 in secondary_children) { + secondary_children[i2].disabled = true; + } + } } function enableArgTR(tr) { - var children = (tr.childNodes); - for (i in children) { - var secondary_children = children[i].childNodes; - for (i2 in secondary_children) { - secondary_children[i2].disabled = false; - } - } + var children = tr.childNodes; + for (i in children) { + var secondary_children = children[i].childNodes; + for (i2 in secondary_children) { + secondary_children[i2].disabled = false; + } + } } function RebuildArgTR(mode, arg_name, arg_type, arg_array, subfolder) { - var tr = document.createElement("tr"); - var td = document.createElement("td"); - var modes_select = buildSelect("formArgModes[]", g_main_modes, mode); - modes_select.style.width = '100%'; - td.appendChild(modes_select); - tr.appendChild(td); - var arg_txt = document.createElement("input"); - arg_txt.type = 'text'; - arg_txt.name = 'formArgName[]'; - arg_txt.style.width = '100%'; - arg_txt.value = arg_name; - var td = document.createElement("td"); - td.appendChild(arg_txt); - tr.appendChild(td); - var td = document.createElement("td"); - td.appendChild(buildSelect("formArgType[]", g_main_types, arg_type)); - if (arg_array == true) { - var szArr = "[]"; - } else { - var szArr = ""; - } - td.appendChild(buildSelect("formArgArray[]", new Array("", "[]"), szArr)); - tr.appendChild(td); - var td = document.createElement("td"); - td = buildArgImages(td, subfolder); - td.className = "data3"; - tr.className = 'arg_tr_pc'; - tr.appendChild(td); - if (document.getElementById("args_table").insertBefore(tr, document.getElementById("parent_add_tr"))) { - g_args++; - } + var tr = document.createElement('tr'); + var td = document.createElement('td'); + var modes_select = buildSelect('formArgModes[]', g_main_modes, mode); + modes_select.style.width = '100%'; + td.appendChild(modes_select); + tr.appendChild(td); + var arg_txt = document.createElement('input'); + arg_txt.type = 'text'; + arg_txt.name = 'formArgName[]'; + arg_txt.style.width = '100%'; + arg_txt.value = arg_name; + var td = document.createElement('td'); + td.appendChild(arg_txt); + tr.appendChild(td); + var td = document.createElement('td'); + td.appendChild(buildSelect('formArgType[]', g_main_types, arg_type)); + if (arg_array == true) { + var szArr = '[]'; + } else { + var szArr = ''; + } + td.appendChild(buildSelect('formArgArray[]', new Array('', '[]'), szArr)); + tr.appendChild(td); + var td = document.createElement('td'); + td = buildArgImages(td, subfolder); + td.className = 'data3'; + tr.className = 'arg_tr_pc'; + tr.appendChild(td); + if ( + document + .getElementById('args_table') + .insertBefore(tr, document.getElementById('parent_add_tr')) + ) { + g_args++; + } } function buildSelect(name, options, selected) { - var s = document.createElement('select'); - for (i = 0; i < options.length; i++) { - var o = document.createElement('option'); - o.value = options[i]; - o.text = options[i]; - if (options[i].toLowerCase() == selected.toLowerCase()) { - o.selected = "selected"; - } - s.appendChild(o); - } - s.name = name; - return s; + var s = document.createElement('select'); + for (i = 0; i < options.length; i++) { + var o = document.createElement('option'); + o.value = options[i]; + o.text = options[i]; + if (options[i].toLowerCase() == selected.toLowerCase()) { + o.selected = 'selected'; + } + s.appendChild(o); + } + s.name = name; + return s; } function baseArgTR(subfolder) { - if (g_no_args == false) { - var tr = document.createElement("tr"); - var td = document.createElement("td"); - var txt = document.createElement("input"); - tr.className = 'arg_tr_pc'; - td.className = 'data3'; - td.innerHTML = g_modes_select; - tr.appendChild(td); - txt.type = 'text'; - txt.name = 'formArgName[]'; - txt.style.width = '100%'; - txt.value = g_name; - var td = document.createElement("td"); - td.className = 'data3'; - td.appendChild(txt); - tr.appendChild(td); - var td = document.createElement("td"); - td.className = 'data3'; - td.innerHTML = g_types_select; - tr.appendChild(td); - var td = document.createElement("td"); - td = buildArgImages(td, subfolder); - td.className = "data3"; - tr.appendChild(td); - if (g_args == 0) { - tr.id = "1st_arg_tr"; - } - return tr; - } else { - var p_tr = document.getElementById("1st_arg_tr"); - enableArgTR(p_tr.childNodes[4]); - document.getElementById("1st_arg_iag").src = subfolder + '/images/themes/default/RemoveArgument.png'; - g_args++; - g_no_args = false; - } -} \ No newline at end of file + if (g_no_args == false) { + var tr = document.createElement('tr'); + var td = document.createElement('td'); + var txt = document.createElement('input'); + tr.className = 'arg_tr_pc'; + td.className = 'data3'; + td.innerHTML = g_modes_select; + tr.appendChild(td); + txt.type = 'text'; + txt.name = 'formArgName[]'; + txt.style.width = '100%'; + txt.value = g_name; + var td = document.createElement('td'); + td.className = 'data3'; + td.appendChild(txt); + tr.appendChild(td); + var td = document.createElement('td'); + td.className = 'data3'; + td.innerHTML = g_types_select; + tr.appendChild(td); + var td = document.createElement('td'); + td = buildArgImages(td, subfolder); + td.className = 'data3'; + tr.appendChild(td); + if (g_args == 0) { + tr.id = '1st_arg_tr'; + } + return tr; + } else { + var p_tr = document.getElementById('1st_arg_tr'); + enableArgTR(p_tr.childNodes[4]); + document.getElementById('1st_arg_iag').src = + subfolder + '/images/themes/default/RemoveArgument.png'; + g_args++; + g_no_args = false; + } +} diff --git a/assets/js/indexes.js b/assets/js/indexes.js index dc85f932..ab762498 100644 --- a/assets/js/indexes.js +++ b/assets/js/indexes.js @@ -1,71 +1,68 @@ - // Globals - - /* - * Multiple Selection lists in HTML Document - */ - var tableColumnList; - var indexColumnList; - - /* - * Two Array vars - */ - var indexColumns, - tableColumns; - - function buttonPressed(object) { - - if (object.name == "add") { - from = tableColumnList; - to = indexColumnList; - } else { - to = tableColumnList; - from = indexColumnList; - } - - var selectedOptions = getSelectedOptions(from); - - for (i = 0; i < selectedOptions.length; i++) { - option = new Option(selectedOptions[i].text); - addToArray(to, option); - removeFromArray(from, selectedOptions[i].index); - } - } - - function doSelectAll() { - for (var x = 0; x < indexColumnList.options.length; x++) { - indexColumnList.options[x].selected = true; - } - } - - function init() { - indexColumnList = document.getElementById("IndexColumnList"); - if (indexColumnList) { - indexColumns = indexColumnList.options; - } - - if (document.formIndex) { - tableColumnList = document.formIndex.TableColumnList; - tableColumns = tableColumnList.options; - } - - } - - function getSelectedOptions(obj) { - var selectedOptions = []; - - for (i = 0; i < obj.options.length; i++) { - if (obj.options[i].selected) { - selectedOptions.push(obj.options[i]); - } - } - - return selectedOptions; - } - - function removeFromArray(obj, index) { - obj.remove(index); - } - - function addToArray(obj, item) { - obj.options[obj.options.length] = item; - } \ No newline at end of file +// Globals + +/* + * Multiple Selection lists in HTML Document + */ +var tableColumnList; +var indexColumnList; + +/* + * Two Array vars + */ +var indexColumns, tableColumns; + +function buttonPressed(object) { + if (object.name == 'add') { + from = tableColumnList; + to = indexColumnList; + } else { + to = tableColumnList; + from = indexColumnList; + } + + var selectedOptions = getSelectedOptions(from); + + for (i = 0; i < selectedOptions.length; i++) { + option = new Option(selectedOptions[i].text); + addToArray(to, option); + removeFromArray(from, selectedOptions[i].index); + } +} + +function doSelectAll() { + for (var x = 0; x < indexColumnList.options.length; x++) { + indexColumnList.options[x].selected = true; + } +} + +function init() { + indexColumnList = document.getElementById('IndexColumnList'); + if (indexColumnList) { + indexColumns = indexColumnList.options; + } + + if (document.formIndex) { + tableColumnList = document.formIndex.TableColumnList; + tableColumns = tableColumnList.options; + } +} + +function getSelectedOptions(obj) { + var selectedOptions = []; + + for (i = 0; i < obj.options.length; i++) { + if (obj.options[i].selected) { + selectedOptions.push(obj.options[i]); + } + } + + return selectedOptions; +} + +function removeFromArray(obj, index) { + obj.remove(index); +} + +function addToArray(obj, item) { + obj.options[obj.options.length] = item; +} diff --git a/assets/js/insert_or_edit_row.js b/assets/js/insert_or_edit_row.js index 0d5cdea5..f7dbf12d 100644 --- a/assets/js/insert_or_edit_row.js +++ b/assets/js/insert_or_edit_row.js @@ -1,25 +1,23 @@ -$(document).ready(function () { +$(function () { + jQuery('.insert_row_input').on('change blur', function () { + const tr = $(this).closest('tr'), + checkbox = tr.find('.nullcheckbox'); - jQuery('.insert_row_input').on('change blur', function () { - var tr = $(this).closest('tr'), - checkbox = tr.find('.nullcheckbox'); + if ($(this).val() !== '') { + checkbox.prop('checked', false); + } + }); + jQuery('.btn_back').on('click', () => { + window.history && window.history.back(); + }); + jQuery('input[type=submit]').on('mouseover', function () { + jQuery('.insert_row_input').each(function () { + const tr = $(this).closest('tr'), + checkbox = tr.find('.nullcheckbox'); - if ($(this).val() !== '') { - checkbox.prop('checked', false); - } - - }); - - jQuery('input[type=submit]').on('mouseover', function () { - jQuery('.insert_row_input').each(function () { - var tr = $(this).closest('tr'), - checkbox = tr.find('.nullcheckbox'); - - if ($(this).val() !== '') { - checkbox.prop('checked', false); - } - }); + if ($(this).val() !== '') { + checkbox.prop('checked', false); + } }); - - -}); \ No newline at end of file + }); +}); diff --git a/assets/js/less.min.js b/assets/js/less.min.js deleted file mode 100644 index 6319704f..00000000 --- a/assets/js/less.min.js +++ /dev/null @@ -1,17 +0,0 @@ -/*! - * Less - Leaner CSS v2.7.2 - * http://lesscss.org - * - * Copyright (c) 2009-2017, Alexis Sellier - * Licensed under the Apache-2.0 License. - * - */ - - /** * @license Apache-2.0 - */ - -!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.less=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g0||b.isFileProtocol?"development":"production");var c=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(a.location.hash);c&&(b.dumpLineNumbers=c[1]),void 0===b.useFileCache&&(b.useFileCache=!0),void 0===b.onReady&&(b.onReady=!0)}},{"./browser":3,"./utils":10}],2:[function(a,b,c){function d(a){a.filename&&console.warn(a),e.async||h.removeChild(i)}a("promise/polyfill.js");var e=window.less||{};a("./add-default-options")(window,e);var f=b.exports=a("./index")(window,e);window.less=f;var g,h,i;e.onReady&&(/!watch/.test(window.location.hash)&&f.watch(),e.async||(g="body { display: none !important }",h=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style"),i.type="text/css",i.styleSheet?i.styleSheet.cssText=g:i.appendChild(document.createTextNode(g)),h.appendChild(i)),f.registerStylesheetsImmediately(),f.pageLoadFinished=f.refresh("development"===f.env).then(d,d))},{"./add-default-options":1,"./index":8,"promise/polyfill.js":97}],3:[function(a,b,c){var d=a("./utils");b.exports={createCSS:function(a,b,c){var e=c.href||"",f="less:"+(c.title||d.extractId(e)),g=a.getElementById(f),h=!1,i=a.createElement("style");i.setAttribute("type","text/css"),c.media&&i.setAttribute("media",c.media),i.id=f,i.styleSheet||(i.appendChild(a.createTextNode(b)),h=null!==g&&g.childNodes.length>0&&i.childNodes.length>0&&g.firstChild.nodeValue===i.firstChild.nodeValue);var j=a.getElementsByTagName("head")[0];if(null===g||h===!1){var k=c&&c.nextSibling||null;k?k.parentNode.insertBefore(i,k):j.appendChild(i)}if(g&&h===!1&&g.parentNode.removeChild(g),i.styleSheet)try{i.styleSheet.cssText=b}catch(l){throw new Error("Couldn't reassign styleSheet.cssText.")}},currentScript:function(a){var b=a.document;return b.currentScript||function(){var a=b.getElementsByTagName("script");return a[a.length-1]}()}}},{"./utils":10}],4:[function(a,b,c){b.exports=function(a,b,c){var d=null;if("development"!==b.env)try{d="undefined"==typeof a.localStorage?null:a.localStorage}catch(e){}return{setCSS:function(a,b,e,f){if(d){c.info("saving "+a+" to cache.");try{d.setItem(a,f),d.setItem(a+":timestamp",b),e&&d.setItem(a+":vars",JSON.stringify(e))}catch(g){c.error('failed to save "'+a+'" to local storage for caching.')}}},getCSS:function(a,b,c){var e=d&&d.getItem(a),f=d&&d.getItem(a+":timestamp"),g=d&&d.getItem(a+":vars");if(c=c||{},f&&b.lastModified&&new Date(b.lastModified).valueOf()===new Date(f).valueOf()&&(!c&&!g||JSON.stringify(c)===g))return e}}}},{}],5:[function(a,b,c){var d=a("./utils"),e=a("./browser");b.exports=function(a,b,c){function f(b,f){var g,h,i="less-error-message:"+d.extractId(f||""),j='
  • {content}
  • ',k=a.document.createElement("div"),l=[],m=b.filename||f,n=m.match(/([^\/]+(\?.*)?)$/)[1];k.id=i,k.className="less-error-message",h="

    "+(b.type||"Syntax")+"Error: "+(b.message||"There is an error in your .less file")+'

    in '+n+" ";var o=function(a,b,c){void 0!==a.extract[b]&&l.push(j.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};b.extract&&(o(b,0,""),o(b,1,"line"),o(b,2,""),h+="on line "+b.line+", column "+(b.column+1)+":

      "+l.join("")+"
    "),b.stack&&(b.extract||c.logLevel>=4)&&(h+="
    Stack Trace
    "+b.stack.split("\n").slice(1).join("
    ")),k.innerHTML=h,e.createCSS(a.document,[".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),k.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),"development"===c.env&&(g=setInterval(function(){var b=a.document,c=b.body;c&&(b.getElementById(i)?c.replaceChild(k,b.getElementById(i)):c.insertBefore(k,c.firstChild),clearInterval(g))},10))}function g(b){var c=a.document.getElementById("less-error-message:"+d.extractId(b));c&&c.parentNode.removeChild(c)}function h(a){}function i(a){c.errorReporting&&"html"!==c.errorReporting?"console"===c.errorReporting?h(a):"function"==typeof c.errorReporting&&c.errorReporting("remove",a):g(a)}function j(a,d){var e="{line} {content}",f=a.filename||d,g=[],h=(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+" in "+f+" ",i=function(a,b,c){void 0!==a.extract[b]&&g.push(e.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};a.extract&&(i(a,0,""),i(a,1,"line"),i(a,2,""),h+="on line "+a.line+", column "+(a.column+1)+":\n"+g.join("\n")),a.stack&&(a.extract||c.logLevel>=4)&&(h+="\nStack Trace\n"+a.stack),b.logger.error(h)}function k(a,b){c.errorReporting&&"html"!==c.errorReporting?"console"===c.errorReporting?j(a,b):"function"==typeof c.errorReporting&&c.errorReporting("add",a,b):f(a,b)}return{add:k,remove:i}}},{"./browser":3,"./utils":10}],6:[function(a,b,c){b.exports=function(b,c){function d(){if(window.XMLHttpRequest&&!("file:"===window.location.protocol&&"ActiveXObject"in window))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){return c.error("browser doesn't support AJAX."),null}}var e=a("../less/environment/abstract-file-manager.js"),f={},g=function(){};return g.prototype=new e,g.prototype.alwaysMakePathsAbsolute=function(){return!0},g.prototype.join=function(a,b){return a?this.extractUrlParts(b,a).path:b},g.prototype.doXHR=function(a,e,f,g){function h(b,c,d){b.status>=200&&b.status<300?c(b.responseText,b.getResponseHeader("Last-Modified")):"function"==typeof d&&d(b.status,a)}var i=d(),j=!b.isFileProtocol||b.fileAsync;"function"==typeof i.overrideMimeType&&i.overrideMimeType("text/css"),c.debug("XHR: Getting '"+a+"'"),i.open("GET",a,j),i.setRequestHeader("Accept",e||"text/x-less, text/css; q=0.9, */*; q=0.5"),i.send(null),b.isFileProtocol&&!b.fileAsync?0===i.status||i.status>=200&&i.status<300?f(i.responseText):g(i.status,a):j?i.onreadystatechange=function(){4==i.readyState&&h(i,f,g)}:h(i,f,g)},g.prototype.supports=function(a,b,c,d){return!0},g.prototype.clearFileCache=function(){f={}},g.prototype.loadFile=function(a,b,c,d,e){b&&!this.isPathAbsolute(a)&&(a=b+a),c=c||{};var g=this.extractUrlParts(a,window.location.href),h=g.url;if(c.useFileCache&&f[h])try{var i=f[h];e(null,{contents:i,filename:h,webInfo:{lastModified:new Date}})}catch(j){e({filename:h,message:"Error loading file "+h+" error was "+j.message})}else this.doXHR(h,c.mime,function(a,b){f[h]=a,e(null,{contents:a,filename:h,webInfo:{lastModified:b}})},function(a,b){e({type:"File",message:"'"+b+"' wasn't found ("+a+")",href:h})})},g}},{"../less/environment/abstract-file-manager.js":15}],7:[function(a,b,c){b.exports=function(){function b(){throw{type:"Runtime",message:"Image size functions are not supported in browser version of less"}}var c=a("./../less/functions/function-registry"),d={"image-size":function(a){return b(this,a),-1},"image-width":function(a){return b(this,a),-1},"image-height":function(a){return b(this,a),-1}};c.addMultiple(d)}},{"./../less/functions/function-registry":22}],8:[function(a,b,c){var d=a("./utils").addDataAttr,e=a("./browser");b.exports=function(b,c){function f(a){return c.postProcessor&&"function"==typeof c.postProcessor&&(a=c.postProcessor.call(a,a)||a),a}function g(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function h(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){var d=c.concat(Array.prototype.slice.call(arguments,0));return a.apply(b,d)}}function i(a){for(var b,d=m.getElementsByTagName("style"),e=0;e=c&&console.log(a)},info:function(a){b.logLevel>=d&&console.log(a)},warn:function(a){b.logLevel>=e&&console.warn(a)},error:function(a){b.logLevel>=f&&console.error(a)}}]);for(var g=0;g0&&(a=a.slice(0,b)),b=a.lastIndexOf("/"),b<0&&(b=a.lastIndexOf("\\")),b<0?"":a.slice(0,b+1)},d.prototype.tryAppendExtension=function(a,b){return/(\.[a-z]*$)|([\?;].*)$/.test(a)?a:a+b},d.prototype.tryAppendLessExtension=function(a){return this.tryAppendExtension(a,".less")},d.prototype.supportsSync=function(){return!1},d.prototype.alwaysMakePathsAbsolute=function(){return!1},d.prototype.isPathAbsolute=function(a){return/^(?:[a-z-]+:|\/|\\|#)/i.test(a)},d.prototype.join=function(a,b){return a?a+b:b},d.prototype.pathDiff=function(a,b){var c,d,e,f,g=this.extractUrlParts(a),h=this.extractUrlParts(b),i="";if(g.hostPart!==h.hostPart)return"";for(d=Math.max(h.directories.length,g.directories.length),c=0;c0&&(h.splice(c-1,2),c-=2)}return g.hostPart=f[1],g.directories=h,g.path=(f[1]||"")+h.join("/"),g.fileUrl=g.path+(f[4]||""),g.url=g.fileUrl+(f[5]||""),g},b.exports=d},{}],16:[function(a,b,c){var d=a("../logger"),e=function(a,b){this.fileManagers=b||[],a=a||{};for(var c=["encodeBase64","mimeLookup","charsetLookup","getSourceMapGenerator"],d=[],e=d.concat(c),f=0;f=0;h--){var i=g[h];if(i[f?"supportsSync":"supports"](a,b,c,e))return i}return null},e.prototype.addFileManager=function(a){this.fileManagers.push(a)},e.prototype.clearFileManagers=function(){this.fileManagers=[]},b.exports=e},{"../logger":33}],17:[function(a,b,c){function d(a,b,c){var d,f,g,h,i=b.alpha,j=c.alpha,k=[];g=j+i*(1-j);for(var l=0;l<3;l++)d=b.rgb[l]/255,f=c.rgb[l]/255,h=a(d,f),g&&(h=(j*f+i*(d-j*(d+f-h)))/g),k[l]=255*h;return new e(k,g)}var e=a("../tree/color"),f=a("./function-registry"),g={multiply:function(a,b){return a*b},screen:function(a,b){return a+b-a*b},overlay:function(a,b){return a*=2,a<=1?g.multiply(a,b):g.screen(a-1,b)},softlight:function(a,b){var c=1,d=a;return b>.5&&(d=1,c=a>.25?Math.sqrt(a):((16*a-12)*a+4)*a),a-(1-2*b)*d*(c-a)},hardlight:function(a,b){return g.overlay(b,a)},difference:function(a,b){return Math.abs(a-b)},exclusion:function(a,b){return a+b-2*a*b},average:function(a,b){return(a+b)/2},negation:function(a,b){return 1-Math.abs(a+b-1)}};for(var h in g)g.hasOwnProperty(h)&&(d[h]=d.bind(null,g[h]));f.addMultiple(d)},{"../tree/color":50,"./function-registry":22}],18:[function(a,b,c){function d(a){return Math.min(1,Math.max(0,a))}function e(a){return h.hsla(a.h,a.s,a.l,a.a)}function f(a){if(a instanceof i)return parseFloat(a.unit.is("%")?a.value/100:a.value);if("number"==typeof a)return a;throw{type:"Argument",message:"color functions take numbers as parameters"}}function g(a,b){return a instanceof i&&a.unit.is("%")?parseFloat(a.value*b/100):f(a)}var h,i=a("../tree/dimension"),j=a("../tree/color"),k=a("../tree/quoted"),l=a("../tree/anonymous"),m=a("./function-registry");h={rgb:function(a,b,c){return h.rgba(a,b,c,1)},rgba:function(a,b,c,d){var e=[a,b,c].map(function(a){return g(a,255)});return d=f(d),new j(e,d)},hsl:function(a,b,c){return h.hsla(a,b,c,1)},hsla:function(a,b,c,e){function g(a){return a=a<0?a+1:a>1?a-1:a,6*a<1?i+(j-i)*a*6:2*a<1?j:3*a<2?i+(j-i)*(2/3-a)*6:i}var i,j;return a=f(a)%360/360,b=d(f(b)),c=d(f(c)),e=d(f(e)),j=c<=.5?c*(b+1):c+b-c*b,i=2*c-j,h.rgba(255*g(a+1/3),255*g(a),255*g(a-1/3),e)},hsv:function(a,b,c){return h.hsva(a,b,c,1)},hsva:function(a,b,c,d){a=f(a)%360/360*360,b=f(b),c=f(c),d=f(d);var e,g;e=Math.floor(a/60%6),g=a/60-e;var i=[c,c*(1-b),c*(1-g*b),c*(1-(1-g)*b)],j=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return h.rgba(255*i[j[e][0]],255*i[j[e][1]],255*i[j[e][2]],d)},hue:function(a){return new i(a.toHSL().h)},saturation:function(a){return new i(100*a.toHSL().s,"%")},lightness:function(a){return new i(100*a.toHSL().l,"%")},hsvhue:function(a){return new i(a.toHSV().h)},hsvsaturation:function(a){return new i(100*a.toHSV().s,"%")},hsvvalue:function(a){return new i(100*a.toHSV().v,"%")},red:function(a){return new i(a.rgb[0])},green:function(a){return new i(a.rgb[1])},blue:function(a){return new i(a.rgb[2])},alpha:function(a){return new i(a.toHSL().a)},luma:function(a){return new i(a.luma()*a.alpha*100,"%")},luminance:function(a){var b=.2126*a.rgb[0]/255+.7152*a.rgb[1]/255+.0722*a.rgb[2]/255;return new i(b*a.alpha*100,"%")},saturate:function(a,b,c){if(!a.rgb)return null;var f=a.toHSL();return f.s+="undefined"!=typeof c&&"relative"===c.value?f.s*b.value/100:b.value/100,f.s=d(f.s),e(f)},desaturate:function(a,b,c){var f=a.toHSL();return f.s-="undefined"!=typeof c&&"relative"===c.value?f.s*b.value/100:b.value/100,f.s=d(f.s),e(f)},lighten:function(a,b,c){var f=a.toHSL();return f.l+="undefined"!=typeof c&&"relative"===c.value?f.l*b.value/100:b.value/100,f.l=d(f.l),e(f)},darken:function(a,b,c){var f=a.toHSL();return f.l-="undefined"!=typeof c&&"relative"===c.value?f.l*b.value/100:b.value/100,f.l=d(f.l),e(f)},fadein:function(a,b,c){var f=a.toHSL();return f.a+="undefined"!=typeof c&&"relative"===c.value?f.a*b.value/100:b.value/100,f.a=d(f.a),e(f)},fadeout:function(a,b,c){var f=a.toHSL();return f.a-="undefined"!=typeof c&&"relative"===c.value?f.a*b.value/100:b.value/100,f.a=d(f.a),e(f)},fade:function(a,b){var c=a.toHSL();return c.a=b.value/100,c.a=d(c.a),e(c)},spin:function(a,b){var c=a.toHSL(),d=(c.h+b.value)%360;return c.h=d<0?360+d:d,e(c)},mix:function(a,b,c){a.toHSL&&b.toHSL||(console.log(b.type),console.dir(b)),c||(c=new i(50));var d=c.value/100,e=2*d-1,f=a.toHSL().a-b.toHSL().a,g=((e*f==-1?e:(e+f)/(1+e*f))+1)/2,h=1-g,k=[a.rgb[0]*g+b.rgb[0]*h,a.rgb[1]*g+b.rgb[1]*h,a.rgb[2]*g+b.rgb[2]*h],l=a.alpha*d+b.alpha*(1-d);return new j(k,l)},greyscale:function(a){return h.desaturate(a,new i(100))},contrast:function(a,b,c,d){if(!a.rgb)return null;if("undefined"==typeof c&&(c=h.rgba(255,255,255,1)),"undefined"==typeof b&&(b=h.rgba(0,0,0,1)),b.luma()>c.luma()){var e=c;c=b,b=e}return d="undefined"==typeof d?.43:f(d),a.luma()=t&&this.context.ieCompat!==!1?(g.warn("Skipped data-uri embedding of "+i+" because its size ("+s.length+" characters) exceeds IE8-safe "+t+" characters!"),f(this,e||a)):new d(new c('"'+s+'"',s,(!1),this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../logger":33,"../tree/quoted":73,"../tree/url":80,"./function-registry":22}],20:[function(a,b,c){var d=a("../tree/keyword"),e=a("./function-registry"),f={eval:function(){var a=this.value_,b=this.error_;if(b)throw b;if(null!=a)return a?d.True:d.False},value:function(a){this.value_=a},error:function(a){this.error_=a},reset:function(){this.value_=this.error_=null}};e.add("default",f.eval.bind(f)),b.exports=f},{"../tree/keyword":65,"./function-registry":22}],21:[function(a,b,c){var d=a("../tree/expression"),e=function(a,b,c,d){this.name=a.toLowerCase(),this.index=c,this.context=b,this.currentFileInfo=d,this.func=b.frames[0].functionRegistry.get(this.name)};e.prototype.isValid=function(){return Boolean(this.func)},e.prototype.call=function(a){return Array.isArray(a)&&(a=a.filter(function(a){return"Comment"!==a.type}).map(function(a){if("Expression"===a.type){var b=a.value.filter(function(a){return"Comment"!==a.type});return 1===b.length?b[0]:new d(b)}return a})),this.func.apply(this,a)},b.exports=e},{"../tree/expression":59}],22:[function(a,b,c){function d(a){return{_data:{},add:function(a,b){a=a.toLowerCase(),this._data.hasOwnProperty(a),this._data[a]=b},addMultiple:function(a){Object.keys(a).forEach(function(b){this.add(b,a[b])}.bind(this))},get:function(b){return this._data[b]||a&&a.get(b)},inherit:function(){return d(this)}}}b.exports=d(null)},{}],23:[function(a,b,c){b.exports=function(b){var c={functionRegistry:a("./function-registry"),functionCaller:a("./function-caller")};return a("./default"),a("./color"),a("./color-blending"),a("./data-uri")(b),a("./math"),a("./number"),a("./string"),a("./svg")(b),a("./types"),c}},{"./color":18,"./color-blending":17,"./data-uri":19,"./default":20,"./function-caller":21,"./function-registry":22,"./math":25,"./number":26,"./string":27,"./svg":28,"./types":29}],24:[function(a,b,c){var d=a("../tree/dimension"),e=function(){};e._math=function(a,b,c){if(!(c instanceof d))throw{type:"Argument",message:"argument must be a number"};return null==b?b=c.unit:c=c.unify(),new d(a(parseFloat(c.value)),b)},b.exports=e},{"../tree/dimension":56}],25:[function(a,b,c){var d=a("./function-registry"),e=a("./math-helper.js"),f={ceil:null,floor:null,sqrt:null,abs:null,tan:"",sin:"",cos:"",atan:"rad",asin:"rad",acos:"rad"};for(var g in f)f.hasOwnProperty(g)&&(f[g]=e._math.bind(null,Math[g],f[g]));f.round=function(a,b){var c="undefined"==typeof b?0:b.value;return e._math(function(a){return a.toFixed(c)},null,a)},d.addMultiple(f)},{"./function-registry":22,"./math-helper.js":24}],26:[function(a,b,c){var d=a("../tree/dimension"),e=a("../tree/anonymous"),f=a("./function-registry"),g=a("./math-helper.js"),h=function(a,b){switch(b=Array.prototype.slice.call(b),b.length){case 0:throw{type:"Argument",message:"one or more arguments required"}}var c,f,g,h,i,j,k,l,m=[],n={};for(c=0;ci.value)&&(m[f]=g);else{if(void 0!==k&&j!==k)throw{type:"Argument",message:"incompatible types"};n[j]=m.length,m.push(g)}else Array.isArray(b[c].value)&&Array.prototype.push.apply(b,Array.prototype.slice.call(b[c].value));return 1==m.length?m[0]:(b=m.map(function(a){return a.toCSS(this.context)}).join(this.context.compress?",":", "),new e((a?"min":"max")+"("+b+")"))};f.addMultiple({min:function(){return h(!0,arguments)},max:function(){return h(!1,arguments)},convert:function(a,b){return a.convertTo(b.value)},pi:function(){return new d(Math.PI)},mod:function(a,b){return new d(a.value%b.value,a.unit)},pow:function(a,b){if("number"==typeof a&&"number"==typeof b)a=new d(a),b=new d(b);else if(!(a instanceof d&&b instanceof d))throw{type:"Argument",message:"arguments must be numbers"};return new d(Math.pow(a.value,b.value),a.unit)},percentage:function(a){var b=g._math(function(a){return 100*a},"%",a);return b}})},{"../tree/anonymous":46,"../tree/dimension":56,"./function-registry":22,"./math-helper.js":24}],27:[function(a,b,c){var d=a("../tree/quoted"),e=a("../tree/anonymous"),f=a("../tree/javascript"),g=a("./function-registry");g.addMultiple({e:function(a){return new e(a instanceof f?a.evaluated:a.value)},escape:function(a){return new e(encodeURI(a.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},replace:function(a,b,c,e){var f=a.value;return c="Quoted"===c.type?c.value:c.toCSS(),f=f.replace(new RegExp(b.value,e?e.value:""),c),new d(a.quote||"",f,a.escaped)},"%":function(a){for(var b=Array.prototype.slice.call(arguments,1),c=a.value,e=0;e",k=0;k";return j+="',j=encodeURIComponent(j),j="data:image/svg+xml,"+j,new g(new f("'"+j+"'",j,(!1),this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../tree/color":50,"../tree/dimension":56,"../tree/expression":59,"../tree/quoted":73,"../tree/url":80,"./function-registry":22}],29:[function(a,b,c){var d=a("../tree/keyword"),e=a("../tree/detached-ruleset"),f=a("../tree/dimension"),g=a("../tree/color"),h=a("../tree/quoted"),i=a("../tree/anonymous"),j=a("../tree/url"),k=a("../tree/operation"),l=a("./function-registry"),m=function(a,b){return a instanceof b?d.True:d.False},n=function(a,b){if(void 0===b)throw{type:"Argument",message:"missing the required second argument to isunit."};if(b="string"==typeof b.value?b.value:b,"string"!=typeof b)throw{type:"Argument",message:"Second argument to isunit should be a unit or a string."};return a instanceof f&&a.unit.is(b)?d.True:d.False},o=function(a){var b=Array.isArray(a.value)?a.value:Array(a);return b};l.addMultiple({isruleset:function(a){return m(a,e)},iscolor:function(a){return m(a,g)},isnumber:function(a){return m(a,f)},isstring:function(a){return m(a,h)},iskeyword:function(a){return m(a,d)},isurl:function(a){return m(a,j)},ispixel:function(a){return n(a,"px")},ispercentage:function(a){return n(a,"%")},isem:function(a){return n(a,"em")},isunit:n,unit:function(a,b){if(!(a instanceof f))throw{type:"Argument",message:"the first argument to unit must be a number"+(a instanceof k?". Have you forgotten parenthesis?":"")};return b=b?b instanceof d?b.value:b.toCSS():"",new f(a.value,b)},"get-unit":function(a){return new i(a.unit)},extract:function(a,b){return b=b.value-1,o(a)[b]},length:function(a){return new f(o(a).length)}})},{"../tree/anonymous":46,"../tree/color":50,"../tree/detached-ruleset":55,"../tree/dimension":56,"../tree/keyword":65,"../tree/operation":71,"../tree/quoted":73,"../tree/url":80,"./function-registry":22}],30:[function(a,b,c){var d=a("./contexts"),e=a("./parser/parser"),f=a("./plugins/function-importer");b.exports=function(a){var b=function(a,b){this.rootFilename=b.filename,this.paths=a.paths||[],this.contents={},this.contentsIgnoredChars={},this.mime=a.mime,this.error=null,this.context=a,this.queue=[],this.files={}};return b.prototype.push=function(b,c,g,h,i){var j=this;this.queue.push(b);var k=function(a,c,d){j.queue.splice(j.queue.indexOf(b),1);var e=d===j.rootFilename;h.optional&&a?i(null,{rules:[]},!1,null):(j.files[d]=c,a&&!j.error&&(j.error=a),i(a,c,e,d))},l={relativeUrls:this.context.relativeUrls,entryPath:g.entryPath,rootpath:g.rootpath,rootFilename:g.rootFilename},m=a.getFileManager(b,g.currentDirectory,this.context,a);if(!m)return void k({message:"Could not find a file-manager for "+b});c&&(b=m.tryAppendExtension(b,h.plugin?".js":".less"));var n=function(a){var b=a.filename,c=a.contents.replace(/^\uFEFF/,"");l.currentDirectory=m.getPath(b),l.relativeUrls&&(l.rootpath=m.join(j.context.rootpath||"",m.pathDiff(l.currentDirectory,l.entryPath)),!m.isPathAbsolute(l.rootpath)&&m.alwaysMakePathsAbsolute()&&(l.rootpath=m.join(l.entryPath,l.rootpath))),l.filename=b;var i=new d.Parse(j.context);i.processImports=!1,j.contents[b]=c,(g.reference||h.reference)&&(l.reference=!0),h.plugin?new f(i,l).eval(c,function(a,c){k(a,c,b)}):h.inline?k(null,c,b):new e(i,j,l).parse(c,function(a,c){k(a,c,b)})},o=m.loadFile(b,g.currentDirectory,this.context,a,function(a,b){a?k(a):n(b)});o&&o.then(n,k)},b}},{"./contexts":11,"./parser/parser":38,"./plugins/function-importer":40}],31:[function(a,b,c){b.exports=function(b,c){var d,e,f,g,h,i={version:[2,7,2],data:a("./data"),tree:a("./tree"),Environment:h=a("./environment/environment"),AbstractFileManager:a("./environment/abstract-file-manager"),environment:b=new h(b,c),visitors:a("./visitors"),Parser:a("./parser/parser"),functions:a("./functions")(b),contexts:a("./contexts"),SourceMapOutput:d=a("./source-map-output")(b),SourceMapBuilder:e=a("./source-map-builder")(d,b),ParseTree:f=a("./parse-tree")(e),ImportManager:g=a("./import-manager")(b),render:a("./render")(b,f,g),parse:a("./parse")(b,f,g),LessError:a("./less-error"),transformTree:a("./transform-tree"),utils:a("./utils"),PluginManager:a("./plugin-manager"),logger:a("./logger")};return i}},{"./contexts":11,"./data":13,"./environment/abstract-file-manager":15,"./environment/environment":16,"./functions":23,"./import-manager":30,"./less-error":32,"./logger":33,"./parse":35,"./parse-tree":34,"./parser/parser":38,"./plugin-manager":39,"./render":41,"./source-map-builder":42,"./source-map-output":43,"./transform-tree":44,"./tree":62,"./utils":83,"./visitors":87}],32:[function(a,b,c){var d=a("./utils"),e=b.exports=function(a,b,c){Error.call(this);var e=a.filename||c;if(b&&e){var f=b.contents[e],g=d.getLocation(a.index,f),h=g.line,i=g.column,j=a.call&&d.getLocation(a.call,f).line,k=f.split("\n");this.type=a.type||"Syntax",this.filename=e,this.index=a.index,this.line="number"==typeof h?h+1:null,this.callLine=j+1,this.callExtract=k[j],this.column=i,this.extract=[k[h-1],k[h],k[h+1]]}this.message=a.message,this.stack=a.stack};if("undefined"==typeof Object.create){var f=function(){};f.prototype=Error.prototype,e.prototype=new f}else e.prototype=Object.create(Error.prototype);e.prototype.constructor=e},{"./utils":83}],33:[function(a,b,c){b.exports={error:function(a){this._fireEvent("error",a)},warn:function(a){this._fireEvent("warn",a)},info:function(a){this._fireEvent("info",a)},debug:function(a){this._fireEvent("debug",a)},addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var b=0;b=97&&j<=122||j<34))switch(j){case 40:o++,e=h;continue;case 41:if(--o<0)return b("missing opening `(`",h);continue;case 59:o||c();continue;case 123:n++,d=h;continue;case 125:if(--n<0)return b("missing opening `{`",h);n||o||c();continue;case 92:if(h96)){if(k==j){l=1;break}if(92==k){if(h==m-1)return b("unescaped `\\`",h);h++}}if(l)continue;return b("unmatched `"+String.fromCharCode(j)+"`",i);case 47:if(o||h==m-1)continue;if(k=a.charCodeAt(h+1),47==k)for(h+=2;hd&&g>f?b("missing closing `}` or `*/`",d):b("missing closing `}`",d):0!==o?b("missing closing `)`",e):(c(!0),p)}},{}],37:[function(a,b,c){var d=a("./chunker");b.exports=function(){function a(d){for(var e,f,j,p=k.i,q=c,s=k.i-i,t=k.i+h.length-s,u=k.i+=d,v=b;k.i=0){j={index:k.i,text:v.substr(k.i,x+2-k.i),isLineComment:!1},k.i+=j.text.length-1,k.commentStore.push(j);continue}}break}if(e!==l&&e!==n&&e!==m&&e!==o)break}if(h=h.slice(d+k.i-u+s),i=k.i,!h.length){if(ce||k.i===e&&a&&!f)&&(e=k.i,f=a);var b=j.pop();h=b.current,i=k.i=b.i,c=b.j},k.forget=function(){j.pop()},k.isWhitespace=function(a){var c=k.i+(a||0),d=b.charCodeAt(c);return d===l||d===o||d===m||d===n},k.$re=function(b){k.i>i&&(h=h.slice(k.i-i),i=k.i);var c=b.exec(h);return c?(a(c[0].length),"string"==typeof c?c:1===c.length?c[0]:c):null},k.$char=function(c){return b.charAt(k.i)!==c?null:(a(1),c)},k.$str=function(c){for(var d=c.length,e=0;es||a=b.length;return k.i=b.length-1,furthestChar:b[k.i]}},k}},{"./chunker":36}],38:[function(a,b,c){var d=a("../less-error"),e=a("../tree"),f=a("../visitors"),g=a("./parser-input"),h=a("../utils"),i=function j(a,b,c){function i(a,e){throw new d({index:o.i,filename:c.filename,type:e||"Syntax",message:a},b)}function k(a,b,c){var d=a instanceof Function?a.call(n):o.$re(a);return d?d:void i(b||("string"==typeof a?"expected '"+a+"' got '"+o.currentChar()+"'":"unexpected token"))}function l(a,b){return o.$char(a)?a:void i(b||"expected '"+a+"' got '"+o.currentChar()+"'")}function m(a){var b=c.filename;return{lineNumber:h.getLocation(a,o.getInput()).line+1,fileName:b}}var n,o=g();return{parse:function(g,h,i){var k,l,m,n,p=null,q="";if(l=i&&i.globalVars?j.serializeVars(i.globalVars)+"\n":"",m=i&&i.modifyVars?"\n"+j.serializeVars(i.modifyVars):"",a.pluginManager)for(var r=a.pluginManager.getPreProcessors(),s=0;s1&&(b=new e.Value(g)),d.push(b),g=[])}return o.forget(),a?d:f},literal:function(){return this.dimension()||this.color()||this.quoted()||this.unicodeDescriptor()},assignment:function(){var a,b;return o.save(),(a=o.$re(/^\w+(?=\s?=)/i))&&o.$char("=")&&(b=n.entity())?(o.forget(),new e.Assignment(a,b)):void o.restore()},url:function(){var a,b=o.i;return o.autoCommentAbsorb=!1,o.$str("url(")?(a=this.quoted()||this.variable()||o.$re(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/)||"",o.autoCommentAbsorb=!0,l(")"),new e.URL(null!=a.value||a instanceof e.Variable?a:new e.Anonymous(a),b,c)):void(o.autoCommentAbsorb=!0)},variable:function(){var a,b=o.i;if("@"===o.currentChar()&&(a=o.$re(/^@@?[\w-]+/)))return new e.Variable(a,b,c)},variableCurly:function(){var a,b=o.i;if("@"===o.currentChar()&&(a=o.$re(/^@\{([\w-]+)\}/)))return new e.Variable("@"+a[1],b,c)},color:function(){var a;if("#"===o.currentChar()&&(a=o.$re(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/))){var b=a.input.match(/^#([\w]+).*/);return b=b[1],b.match(/^[A-Fa-f0-9]+$/)||i("Invalid HEX color code"),new e.Color(a[1],(void 0),"#"+b)}},colorKeyword:function(){o.save();var a=o.autoCommentAbsorb;o.autoCommentAbsorb=!1;var b=o.$re(/^[_A-Za-z-][_A-Za-z0-9-]+/);if(o.autoCommentAbsorb=a,!b)return void o.forget();o.restore();var c=e.Color.fromKeyword(b);return c?(o.$str(b),c):void 0},dimension:function(){if(!o.peekNotNumeric()){var a=o.$re(/^([+-]?\d*\.?\d+)(%|[a-z_]+)?/i);return a?new e.Dimension(a[1],a[2]):void 0}},unicodeDescriptor:function(){var a;if(a=o.$re(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/))return new e.UnicodeDescriptor(a[0])},javascript:function(){var a,b=o.i;o.save();var d=o.$char("~"),f=o.$char("`");return f?(a=o.$re(/^[^`]*`/))?(o.forget(),new e.JavaScript(a.substr(0,a.length-1),Boolean(d),b,c)):void o.restore("invalid javascript definition"):void o.restore()}},variable:function(){var a;if("@"===o.currentChar()&&(a=o.$re(/^(@[\w-]+)\s*:/)))return a[1]},rulesetCall:function(){var a;if("@"===o.currentChar()&&(a=o.$re(/^(@[\w-]+)\(\s*\)\s*;/)))return new e.RulesetCall(a[1])},extend:function(a){var b,d,f,g,h,j=o.i;if(o.$str(a?"&:extend(":":extend(")){do{for(f=null,b=null;!(f=o.$re(/^(all)(?=\s*(\)|,))/))&&(d=this.element());)b?b.push(d):b=[d];f=f&&f[1],b||i("Missing target selector for :extend()."),h=new e.Extend(new e.Selector(b),f,j,c),g?g.push(h):g=[h]}while(o.$char(","));return k(/^\)/),a&&k(/^;/),g}},extendRule:function(){return this.extend(!0)},mixin:{call:function(){var a,b,d,f,g,h,i=o.currentChar(),j=!1,k=o.i;if("."===i||"#"===i){for(o.save();;){if(a=o.i,f=o.$re(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/),!f)break;d=new e.Element(g,f,a,c),b?b.push(d):b=[d],g=o.$char(">")}return b&&(o.$char("(")&&(h=this.args(!0).args,l(")")),n.important()&&(j=!0),n.end())?(o.forget(),new e.mixin.Call(b,h,k,c,j)):void o.restore()}},args:function(a){var b,c,d,f,g,h,j,k=n.entities,l={args:null,variadic:!1},m=[],p=[],q=[];for(o.save();;){if(a)h=n.detachedRuleset()||n.expression();else{if(o.commentStore.length=0,o.$str("...")){l.variadic=!0,o.$char(";")&&!b&&(b=!0),(b?p:q).push({variadic:!0});break}h=k.variable()||k.literal()||k.keyword()}if(!h)break;f=null,h.throwAwayComments&&h.throwAwayComments(),g=h;var r=null;if(a?h.value&&1==h.value.length&&(r=h.value[0]):r=h,r&&r instanceof e.Variable)if(o.$char(":")){if(m.length>0&&(b&&i("Cannot mix ; and , as delimiter types"),c=!0),g=n.detachedRuleset()||n.expression(),!g){if(!a)return o.restore(),l.args=[],l;i("could not understand value for named argument")}f=d=r.name}else if(o.$str("...")){if(!a){l.variadic=!0,o.$char(";")&&!b&&(b=!0),(b?p:q).push({name:h.name,variadic:!0});break}j=!0}else a||(d=f=r.name,g=null);g&&m.push(g),q.push({name:f,value:g,expand:j}),o.$char(",")||(o.$char(";")||b)&&(c&&i("Cannot mix ; and , as delimiter types"),b=!0,m.length>1&&(g=new e.Value(m)),p.push({name:d,value:g,expand:j}),d=null,m=[],c=!1)}return o.forget(),l.args=b?p:q,l},definition:function(){var a,b,c,d,f=[],g=!1;if(!("."!==o.currentChar()&&"#"!==o.currentChar()||o.peek(/^[^{]*\}/)))if(o.save(),b=o.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){a=b[1];var h=this.args(!1);if(f=h.args,g=h.variadic,!o.$char(")"))return void o.restore("Missing closing ')'");if(o.commentStore.length=0,o.$str("when")&&(d=k(n.conditions,"expected condition")),c=n.block())return o.forget(),new e.mixin.Definition(a,f,c,d,g);o.restore()}else o.forget()}},entity:function(){var a=this.entities;return this.comment()||a.literal()||a.variable()||a.url()||a.call()||a.keyword()||a.javascript()},end:function(){return o.$char(";")||o.peek("}")},alpha:function(){var a;if(o.$re(/^opacity=/i))return a=o.$re(/^\d+/),a||(a=k(this.entities.variable,"Could not parse alpha")),l(")"),new e.Alpha(a)},element:function(){var a,b,d,f=o.i;if(b=this.combinator(),a=o.$re(/^(?:\d+\.\d+|\d+)%/)||o.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||o.$char("*")||o.$char("&")||this.attribute()||o.$re(/^\([^&()@]+\)/)||o.$re(/^[\.#:](?=@)/)||this.entities.variableCurly(),a||(o.save(),o.$char("(")?(d=this.selector())&&o.$char(")")?(a=new e.Paren(d),o.forget()):o.restore("Missing closing ')'"):o.forget()),a)return new e.Element(b,a,f,c)},combinator:function(){var a=o.currentChar();if("/"===a){o.save();var b=o.$re(/^\/[a-z]+\//i);if(b)return o.forget(),new e.Combinator(b);o.restore()}if(">"===a||"+"===a||"~"===a||"|"===a||"^"===a){for(o.i++,"^"===a&&"^"===o.currentChar()&&(a="^^",o.i++);o.isWhitespace();)o.i++;return new e.Combinator(a)}return new e.Combinator(o.isWhitespace(-1)?" ":null)},lessSelector:function(){return this.selector(!0)},selector:function(a){for(var b,d,f,g,h,j,l,m=o.i;(a&&(d=this.extend())||a&&(j=o.$str("when"))||(g=this.element()))&&(j?l=k(this.conditions,"expected condition"):l?i("CSS guard can only be used at the end of selector"):d?h=h?h.concat(d):d:(h&&i("Extend can only be used at the end of selector"),f=o.currentChar(),b?b.push(g):b=[g],g=null),"{"!==f&&"}"!==f&&";"!==f&&","!==f&&")"!==f););return b?new e.Selector(b,h,l,m,c):void(h&&i("Extend must be used to extend a selector, it cannot be used on its own"))},attribute:function(){if(o.$char("[")){var a,b,c,d=this.entities;return(a=d.variableCurly())||(a=k(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),c=o.$re(/^[|~*$^]?=/),c&&(b=d.quoted()||o.$re(/^[0-9]+%/)||o.$re(/^[\w-]+/)||d.variableCurly()),l("]"),new e.Attribute(a,c,b)}},block:function(){var a;if(o.$char("{")&&(a=this.primary())&&o.$char("}"))return a},blockRuleset:function(){var a=this.block();return a&&(a=new e.Ruleset(null,a)),a},detachedRuleset:function(){var a=this.blockRuleset();if(a)return new e.DetachedRuleset(a)},ruleset:function(){var b,c,d,f;for(o.save(),a.dumpLineNumbers&&(f=m(o.i));;){if(c=this.lessSelector(),!c)break;if(b?b.push(c):b=[c],o.commentStore.length=0,c.condition&&b.length>1&&i("Guards are only currently allowed on a single selector."),!o.$char(","))break;c.condition&&i("Guards are only currently allowed on a single selector."),o.commentStore.length=0}if(b&&(d=this.block())){o.forget();var g=new e.Ruleset(b,d,a.strictImports);return a.dumpLineNumbers&&(g.debugInfo=f),g}o.restore()},rule:function(b){var d,f,g,h,i,j=o.i,k=o.currentChar();if("."!==k&&"#"!==k&&"&"!==k&&":"!==k)if(o.save(),d=this.variable()||this.ruleProperty()){if(i="string"==typeof d,i&&(f=this.detachedRuleset()),o.commentStore.length=0,!f){h=!i&&d.length>1&&d.pop().value;var l=!b&&(a.compress||i);if(l&&(f=this.value()),!f&&(f=this.anonymousValue()))return o.forget(),new e.Rule(d,f,(!1),h,j,c);l||f||(f=this.value()),g=this.important()}if(f&&this.end())return o.forget(),new e.Rule(d,f,g,h,j,c);if(o.restore(),f&&!b)return this.rule(!0)}else o.forget()},anonymousValue:function(){var a=o.$re(/^([^@+\/'"*`(;{}-]*);/);if(a)return new e.Anonymous(a[1])},"import":function(){var a,b,d=o.i,f=o.$re(/^@import?\s+/);if(f){var g=(f?this.importOptions():null)||{};if(a=this.entities.quoted()||this.entities.url())return b=this.mediaFeatures(),o.$char(";")||(o.i=d,i("missing semi-colon or unrecognised media features on import")),b=b&&new e.Value(b),new e.Import(a,b,g,d,c);o.i=d,i("malformed import statement")}},importOptions:function(){var a,b,c,d={};if(!o.$char("("))return null;do if(a=this.importOption()){switch(b=a,c=!0,b){case"css":b="less",c=!1;break;case"once":b="multiple",c=!1}if(d[b]=c,!o.$char(","))break}while(a);return l(")"),d},importOption:function(){var a=o.$re(/^(less|css|multiple|once|inline|reference|optional)/);if(a)return a[1]},mediaFeature:function(){var a,b,d=this.entities,f=[];o.save();do a=d.keyword()||d.variable(),a?f.push(a):o.$char("(")&&(b=this.property(),a=this.value(),o.$char(")")?b&&a?f.push(new e.Paren(new e.Rule(b,a,null,null,o.i,c,(!0)))):a?f.push(new e.Paren(a)):i("badly formed media feature definition"):i("Missing closing ')'","Parse"));while(a);if(o.forget(),f.length>0)return new e.Expression(f)},mediaFeatures:function(){var a,b=this.entities,c=[];do if(a=this.mediaFeature()){if(c.push(a),!o.$char(","))break}else if(a=b.variable(),a&&(c.push(a),!o.$char(",")))break;while(a);return c.length>0?c:null},media:function(){var b,d,f,g,h=o.i;return a.dumpLineNumbers&&(g=m(h)),o.save(),o.$str("@media")?(b=this.mediaFeatures(),d=this.block(),d||i("media definitions require block statements after any features"),o.forget(),f=new e.Media(d,b,h,c),a.dumpLineNumbers&&(f.debugInfo=g),f):void o.restore()},plugin:function(){var a,b=o.i,d=o.$re(/^@plugin?\s+/);if(d){var f={plugin:!0};if(a=this.entities.quoted()||this.entities.url())return o.$char(";")||(o.i=b,i("missing semi-colon on plugin")),new e.Import(a,null,f,b,c);o.i=b,i("malformed plugin statement")}},directive:function(){var b,d,f,g,h,j,k,l=o.i,n=!0,p=!0;if("@"===o.currentChar()){if(d=this["import"]()||this.plugin()||this.media())return d;if(o.save(),b=o.$re(/^@[a-z-]+/)){switch(g=b,"-"==b.charAt(1)&&b.indexOf("-",2)>0&&(g="@"+b.slice(b.indexOf("-",2)+1)),g){case"@charset":h=!0,n=!1;break;case"@namespace":j=!0,n=!1;break;case"@keyframes":case"@counter-style":h=!0;break;case"@document":case"@supports":k=!0,p=!1;break;default:k=!0}return o.commentStore.length=0,h?(d=this.entity(),d||i("expected "+b+" identifier")):j?(d=this.expression(),d||i("expected "+b+" expression")):k&&(d=(o.$re(/^[^{;]+/)||"").trim(),n="{"==o.currentChar(),d&&(d=new e.Anonymous(d))),n&&(f=this.blockRuleset()),f||!n&&d&&o.$char(";")?(o.forget(),new e.Directive(b,d,f,l,c,a.dumpLineNumbers?m(l):null,p)):void o.restore("directive options not recognised")}}},value:function(){var a,b=[];do if(a=this.expression(),a&&(b.push(a),!o.$char(",")))break;while(a);if(b.length>0)return new e.Value(b)},important:function(){if("!"===o.currentChar())return o.$re(/^! *important/)},sub:function(){var a,b;return o.save(),o.$char("(")?(a=this.addition(),a&&o.$char(")")?(o.forget(),b=new e.Expression([a]),b.parens=!0,b):void o.restore("Expected ')'")):void o.restore()},multiplication:function(){var a,b,c,d,f;if(a=this.operand()){for(f=o.isWhitespace(-1);;){if(o.peek(/^\/[*\/]/))break;if(o.save(),c=o.$char("/")||o.$char("*"),!c){o.forget();break}if(b=this.operand(),!b){o.restore();break}o.forget(),a.parensInOp=!0,b.parensInOp=!0,d=new e.Operation(c,[d||a,b],f),f=o.isWhitespace(-1)}return d||a}},addition:function(){var a,b,c,d,f;if(a=this.multiplication()){for(f=o.isWhitespace(-1);;){if(c=o.$re(/^[-+]\s+/)||!f&&(o.$char("+")||o.$char("-")),!c)break;if(b=this.multiplication(),!b)break;a.parensInOp=!0,b.parensInOp=!0,d=new e.Operation(c,[d||a,b],f),f=o.isWhitespace(-1)}return d||a}},conditions:function(){var a,b,c,d=o.i;if(a=this.condition()){for(;;){if(!o.peek(/^,\s*(not\s*)?\(/)||!o.$char(","))break;if(b=this.condition(),!b)break;c=new e.Condition("or",c||a,b,d)}return c||a}},condition:function(){function a(){return o.$str("or")}var b,c,d;if(b=this.conditionAnd(this)){if(c=a()){if(d=this.condition(),!d)return;b=new e.Condition(c,b,d)}return b}},conditionAnd:function(){function a(a){return a.negatedCondition()||a.parenthesisCondition()}function b(){return o.$str("and")}var c,d,f;if(c=a(this)){if(d=b()){if(f=this.conditionAnd(),!f)return;c=new e.Condition(d,c,f)}return c}},negatedCondition:function(){if(o.$str("not")){var a=this.parenthesisCondition();return a&&(a.negate=!a.negate),a}},parenthesisCondition:function(){function a(a){var b;return o.save(),(b=a.condition())&&o.$char(")")?(o.forget(),b):void o.restore()}var b;return o.save(),o.$str("(")?(b=a(this))?(o.forget(),b):(b=this.atomicCondition())?o.$char(")")?(o.forget(),b):void o.restore("expected ')' got '"+o.currentChar()+"'"):void o.restore():void o.restore()},atomicCondition:function(){var a,b,c,d,f=this.entities,g=o.i;if(a=this.addition()||f.keyword()||f.quoted())return o.$char(">")?d=o.$char("=")?">=":">":o.$char("<")?d=o.$char("=")?"<=":"<":o.$char("=")&&(d=o.$char(">")?"=>":o.$char("<")?"=<":"="),d?(b=this.addition()||f.keyword()||f.quoted(),b?c=new e.Condition(d,a,b,g,(!1)):i("expected expression")):c=new e.Condition("=",a,new e.Keyword("true"),g,(!1)),c},operand:function(){var a,b=this.entities;o.peek(/^-[@\(]/)&&(a=o.$char("-"));var c=this.sub()||b.dimension()||b.color()||b.variable()||b.call()||b.colorKeyword();return a&&(c.parensInOp=!0,c=new e.Negative(c)),c},expression:function(){var a,b,c=[];do a=this.comment(),a?c.push(a):(a=this.addition()||this.entity(),a&&(c.push(a),o.peek(/^\/[\/*]/)||(b=o.$char("/"),b&&c.push(new e.Anonymous(b)))));while(a);if(c.length>0)return new e.Expression(c)},property:function(){var a=o.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);if(a)return a[1]},ruleProperty:function(){function a(a){var b=o.i,c=o.$re(a);if(c)return g.push(b),f.push(c[1])}var b,d,f=[],g=[];o.save();var h=o.$re(/^([_a-zA-Z0-9-]+)\s*:/);if(h)return f=[new e.Keyword(h[1])],o.forget(),f;for(a(/^(\*?)/);;)if(!a(/^((?:[\w-]+)|(?:@\{[\w-]+\}))/))break;if(f.length>1&&a(/^((?:\+_|\+)?)\s*:/)){for(o.forget(),""===f[0]&&(f.shift(),g.shift()),d=0;d=b);c++);this.preProcessors.splice(c,0,{preProcessor:a,priority:b})},d.prototype.addPostProcessor=function(a,b){var c;for(c=0;c=b);c++);this.postProcessors.splice(c,0,{postProcessor:a,priority:b})},d.prototype.addFileManager=function(a){this.fileManagers.push(a)},d.prototype.getPreProcessors=function(){for(var a=[],b=0;b0){var d,e=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?d=this.sourceMapURL:this._sourceMapFilename&&(d=this._sourceMapFilename),this.sourceMapURL=d,this.sourceMap=e}return this._css.join("")},b}},{}],44:[function(a,b,c){var d=a("./contexts"),e=a("./visitors"),f=a("./tree");b.exports=function(a,b){b=b||{};var c,g=b.variables,h=new d.Eval(b);"object"!=typeof g||Array.isArray(g)||(g=Object.keys(g).map(function(a){var b=g[a];return b instanceof f.Value||(b instanceof f.Expression||(b=new f.Expression([b])),b=new f.Value([b])),new f.Rule("@"+a,b,(!1),null,0)}),h.frames=[new f.Ruleset(null,g)]);var i,j=[],k=[new e.JoinSelectorVisitor,new e.MarkVisibleSelectorsVisitor((!0)),new e.ExtendVisitor,new e.ToCSSVisitor({compress:Boolean(b.compress)})];if(b.pluginManager){var l=b.pluginManager.getVisitors();for(i=0;i.5?j/(2-g-h):j/(g+h),g){case c:a=(d-e)/j+(d="===a||"=<"===a||"<="===a;case 1:return">"===a||">="===a;default:return!1}}}(this.op,this.lvalue.eval(a),this.rvalue.eval(a));return this.negate?!b:b},b.exports=e},{"./node":70}],54:[function(a,b,c){var d=function(a,b,c){var e="";if(a.dumpLineNumbers&&!a.compress)switch(a.dumpLineNumbers){case"comments":e=d.asComment(b);break;case"mediaquery":e=d.asMediaQuery(b);break;case"all":e=d.asComment(b)+(c||"")+d.asMediaQuery(b)}return e};d.asComment=function(a){return"/* line "+a.debugInfo.lineNumber+", "+a.debugInfo.fileName+" */\n"},d.asMediaQuery=function(a){var b=a.debugInfo.fileName;return/^[a-z]+:\/\//i.test(b)||(b="file://"+b),"@media -sass-debug-info{filename{font-family:"+b.replace(/([.:\/\\])/g,function(a){return"\\"==a&&(a="/"),"\\"+a})+"}line{font-family:\\00003"+a.debugInfo.lineNumber+"}}\n"},b.exports=d},{}],55:[function(a,b,c){var d=a("./node"),e=a("../contexts"),f=function(a,b){this.ruleset=a,this.frames=b};f.prototype=new d,f.prototype.type="DetachedRuleset",f.prototype.evalFirst=!0,f.prototype.accept=function(a){this.ruleset=a.visit(this.ruleset)},f.prototype.eval=function(a){var b=this.frames||a.frames.slice(0);return new f(this.ruleset,b)},f.prototype.callEval=function(a){return this.ruleset.eval(this.frames?new e.Eval(a,this.frames.concat(a.frames)):a)},b.exports=f},{"../contexts":11,"./node":70}],56:[function(a,b,c){var d=a("./node"),e=a("../data/unit-conversions"),f=a("./unit"),g=a("./color"),h=function(a,b){this.value=parseFloat(a),this.unit=b&&b instanceof f?b:new f(b?[b]:void 0)};h.prototype=new d,h.prototype.type="Dimension",h.prototype.accept=function(a){this.unit=a.visit(this.unit)},h.prototype.eval=function(a){return this},h.prototype.toColor=function(){return new g([this.value,this.value,this.value])},h.prototype.genCSS=function(a,b){if(a&&a.strictUnits&&!this.unit.isSingular())throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "+this.unit.toString());var c=this.fround(a,this.value),d=String(c);if(0!==c&&c<1e-6&&c>-1e-6&&(d=c.toFixed(20).replace(/0+$/,"")),a&&a.compress){if(0===c&&this.unit.isLength())return void b.add(d);c>0&&c<1&&(d=d.substr(1))}b.add(d),this.unit.genCSS(a,b)},h.prototype.operate=function(a,b,c){var d=this._operate(a,b,this.value,c.value),e=this.unit.clone();if("+"===b||"-"===b)if(0===e.numerator.length&&0===e.denominator.length)e=c.unit.clone(),this.unit.backupUnit&&(e.backupUnit=this.unit.backupUnit);else if(0===c.unit.numerator.length&&0===e.denominator.length);else{if(c=c.convertTo(this.unit.usedUnits()),a.strictUnits&&c.unit.toString()!==e.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+e.toString()+"' and '"+c.unit.toString()+"'.");d=this._operate(a,b,this.value,c.value)}else"*"===b?(e.numerator=e.numerator.concat(c.unit.numerator).sort(),e.denominator=e.denominator.concat(c.unit.denominator).sort(),e.cancel()):"/"===b&&(e.numerator=e.numerator.concat(c.unit.denominator).sort(),e.denominator=e.denominator.concat(c.unit.numerator).sort(),e.cancel());return new h(d,e)},h.prototype.compare=function(a){var b,c;if(a instanceof h){if(this.unit.isEmpty()||a.unit.isEmpty())b=this,c=a;else if(b=this.unify(),c=a.unify(),0!==b.unit.compare(c.unit))return;return d.numericCompare(b.value,c.value)}},h.prototype.unify=function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},h.prototype.convertTo=function(a){var b,c,d,f,g,i=this.value,j=this.unit.clone(),k={};if("string"==typeof a){for(b in e)e[b].hasOwnProperty(a)&&(k={},k[b]=a);a=k}g=function(a,b){return d.hasOwnProperty(a)?(b?i/=d[a]/d[f]:i*=d[a]/d[f],f):a};for(c in a)a.hasOwnProperty(c)&&(f=a[c],d=e[c],j.map(g));return j.cancel(),new h(i,j)},b.exports=h},{"../data/unit-conversions":14,"./color":50,"./node":70,"./unit":79}],57:[function(a,b,c){var d=a("./node"),e=a("./selector"),f=a("./ruleset"),g=function(a,b,c,d,f,g,h,i){var j;if(this.name=a,this.value=b,c)for(Array.isArray(c)?this.rules=c:(this.rules=[c],this.rules[0].selectors=new e([],null,null,this.index,f).createEmptySelectors()),j=0;j1?b=new g(this.value.map(function(b){return b.eval(a)})):1===this.value.length?(this.value[0].parens&&!this.value[0].parensInOp&&(d=!0),b=this.value[0].eval(a)):b=this,c&&a.outOfParenthesis(),this.parens&&this.parensInOp&&!a.isMathOn()&&!d&&(b=new e(b)),b},g.prototype.genCSS=function(a,b){for(var c=0;c0&&c.length&&""===c[0].combinator.value&&(c[0].combinator.value=" "),d=d.concat(a[b].elements);this.selfSelectors=[new e(d)],this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo())},b.exports=f},{"./node":70,"./selector":77}],61:[function(a,b,c){var d=a("./node"),e=a("./media"),f=a("./url"),g=a("./quoted"),h=a("./ruleset"),i=a("./anonymous"),j=function(a,b,c,d,e,f){if(this.options=c,this.index=d,this.path=a,this.features=b,this.currentFileInfo=e,this.allowRoot=!0,void 0!==this.options.less||this.options.inline)this.css=!this.options.less||this.options.inline;else{var g=this.getPath();g&&/[#\.\&\?\/]css([\?;].*)?$/.test(g)&&(this.css=!0)}this.copyVisibilityInfo(f)};j.prototype=new d,j.prototype.type="Import",j.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.path=a.visit(this.path),this.options.plugin||this.options.inline||!this.root||(this.root=a.visit(this.root))},j.prototype.genCSS=function(a,b){this.css&&void 0===this.path.currentFileInfo.reference&&(b.add("@import ",this.currentFileInfo,this.index),this.path.genCSS(a,b),this.features&&(b.add(" "),this.features.genCSS(a,b)),b.add(";"))},j.prototype.getPath=function(){return this.path instanceof f?this.path.value.value:this.path.value},j.prototype.isVariableImport=function(){var a=this.path;return a instanceof f&&(a=a.value),!(a instanceof g)||a.containsVariables()},j.prototype.evalForImport=function(a){var b=this.path;return b instanceof f&&(b=b.value),new j(b.eval(a),this.features,this.options,this.index,this.currentFileInfo,this.visibilityInfo())},j.prototype.evalPath=function(a){var b=this.path.eval(a),c=this.currentFileInfo&&this.currentFileInfo.rootpath;if(!(b instanceof f)){if(c){var d=b.value;d&&a.isPathRelative(d)&&(b.value=c+d)}b.value=a.normalizePath(b.value)}return b},j.prototype.eval=function(a){var b=this.doEval(a);return(this.options.reference||this.blocksVisibility())&&(b.length||0===b.length?b.forEach(function(a){a.addVisibilityBlock()}):b.addVisibilityBlock()),b},j.prototype.doEval=function(a){var b,c,d=this.features&&this.features.eval(a);if(this.options.plugin)return c=a.frames[0]&&a.frames[0].functionRegistry,c&&this.root&&this.root.functions&&c.addMultiple(this.root.functions),[];if(this.skip&&("function"==typeof this.skip&&(this.skip=this.skip()),this.skip))return[];if(this.options.inline){var f=new i(this.root,0,{filename:this.importedFilename,reference:this.path.currentFileInfo&&this.path.currentFileInfo.reference},(!0),(!0));return this.features?new e([f],this.features.value):[f]}if(this.css){var g=new j(this.evalPath(a),d,this.options,this.index);if(!g.css&&this.error)throw this.error;return g}return b=new h(null,this.root.rules.slice(0)),b.evalImports(a),this.features?new e(b.rules,this.features.value):b.rules},b.exports=j},{"./anonymous":46,"./media":66,"./node":70,"./quoted":73,"./ruleset":76,"./url":80}],62:[function(a,b,c){var d={};d.Node=a("./node"),d.Alpha=a("./alpha"),d.Color=a("./color"),d.Directive=a("./directive"),d.DetachedRuleset=a("./detached-ruleset"),d.Operation=a("./operation"),d.Dimension=a("./dimension"),d.Unit=a("./unit"),d.Keyword=a("./keyword"),d.Variable=a("./variable"),d.Ruleset=a("./ruleset"),d.Element=a("./element"),d.Attribute=a("./attribute"),d.Combinator=a("./combinator"),d.Selector=a("./selector"),d.Quoted=a("./quoted"),d.Expression=a("./expression"),d.Rule=a("./rule"),d.Call=a("./call"),d.URL=a("./url"),d.Import=a("./import"),d.mixin={Call:a("./mixin-call"),Definition:a("./mixin-definition")},d.Comment=a("./comment"),d.Anonymous=a("./anonymous"),d.Value=a("./value"),d.JavaScript=a("./javascript"),d.Assignment=a("./assignment"),d.Condition=a("./condition"),d.Paren=a("./paren"),d.Media=a("./media"),d.UnicodeDescriptor=a("./unicode-descriptor"),d.Negative=a("./negative"),d.Extend=a("./extend"),d.RulesetCall=a("./ruleset-call"),b.exports=d},{"./alpha":45,"./anonymous":46,"./assignment":47,"./attribute":48,"./call":49,"./color":50,"./combinator":51,"./comment":52,"./condition":53,"./detached-ruleset":55,"./dimension":56,"./directive":57,"./element":58,"./expression":59,"./extend":60,"./import":61,"./javascript":63,"./keyword":65,"./media":66,"./mixin-call":67,"./mixin-definition":68,"./negative":69,"./node":70,"./operation":71,"./paren":72,"./quoted":73,"./rule":74,"./ruleset":76,"./ruleset-call":75,"./selector":77,"./unicode-descriptor":78,"./unit":79,"./url":80,"./value":81,"./variable":82}],63:[function(a,b,c){var d=a("./js-eval-node"),e=a("./dimension"),f=a("./quoted"),g=a("./anonymous"),h=function(a,b,c,d){this.escaped=b,this.expression=a,this.index=c,this.currentFileInfo=d};h.prototype=new d,h.prototype.type="JavaScript",h.prototype.eval=function(a){var b=this.evaluateJavaScript(this.expression,a);return"number"==typeof b?new e(b):"string"==typeof b?new f('"'+b+'"',b,this.escaped,this.index):new g(Array.isArray(b)?b.join(", "):b)},b.exports=h},{"./anonymous":46,"./dimension":56,"./js-eval-node":64,"./quoted":73}],64:[function(a,b,c){var d=a("./node"),e=a("./variable"),f=function(){};f.prototype=new d,f.prototype.evaluateJavaScript=function(a,b){var c,d=this,f={};if(void 0!==b.javascriptEnabled&&!b.javascriptEnabled)throw{message:"You are using JavaScript, which has been disabled.",filename:this.currentFileInfo.filename,index:this.index};a=a.replace(/@\{([\w-]+)\}/g,function(a,c){return d.jsify(new e("@"+c,d.index,d.currentFileInfo).eval(b))});try{a=new Function("return ("+a+")")}catch(g){throw{message:"JavaScript evaluation error: "+g.message+" from `"+a+"`",filename:this.currentFileInfo.filename,index:this.index}}var h=b.frames[0].variables();for(var i in h)h.hasOwnProperty(i)&&(f[i.slice(1)]={value:h[i].value,toJS:function(){return this.value.eval(b).toCSS()}});try{c=a.call(f)}catch(g){throw{message:"JavaScript evaluation error: '"+g.name+": "+g.message.replace(/["]/g,"'")+"'",filename:this.currentFileInfo.filename,index:this.index}}return c},f.prototype.jsify=function(a){return Array.isArray(a.value)&&a.value.length>1?"["+a.value.map(function(a){return a.toCSS()}).join(", ")+"]":a.toCSS()},b.exports=f},{"./node":70,"./variable":82}],65:[function(a,b,c){var d=a("./node"),e=function(a){this.value=a};e.prototype=new d,e.prototype.type="Keyword",e.prototype.genCSS=function(a,b){if("%"===this.value)throw{type:"Syntax",message:"Invalid % without number"};b.add(this.value)},e.True=new e("true"),e.False=new e("false"),b.exports=e},{"./node":70}],66:[function(a,b,c){var d=a("./ruleset"),e=a("./value"),f=a("./selector"),g=a("./anonymous"),h=a("./expression"),i=a("./directive"),j=function(a,b,c,g,h){this.index=c,this.currentFileInfo=g;var i=new f([],null,null,this.index,this.currentFileInfo).createEmptySelectors();this.features=new e(b),this.rules=[new d(i,a)],this.rules[0].allowImports=!0,this.copyVisibilityInfo(h),this.allowRoot=!0};j.prototype=new i,j.prototype.type="Media",j.prototype.isRulesetLike=!0,j.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.rules&&(this.rules=a.visitArray(this.rules))},j.prototype.genCSS=function(a,b){b.add("@media ",this.currentFileInfo,this.index),this.features.genCSS(a,b),this.outputRuleset(a,b,this.rules)},j.prototype.eval=function(a){a.mediaBlocks||(a.mediaBlocks=[],a.mediaPath=[]);var b=new j(null,[],this.index,this.currentFileInfo,this.visibilityInfo());this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,b.debugInfo=this.debugInfo);var c=!1;a.strictMath||(c=!0,a.strictMath=!0);try{b.features=this.features.eval(a)}finally{c&&(a.strictMath=!1)}return a.mediaPath.push(b),a.mediaBlocks.push(b),this.rules[0].functionRegistry=a.frames[0].functionRegistry.inherit(),a.frames.unshift(this.rules[0]),b.rules=[this.rules[0].eval(a)],a.frames.shift(),a.mediaPath.pop(),0===a.mediaPath.length?b.evalTop(a):b.evalNested(a)},j.prototype.evalTop=function(a){var b=this;if(a.mediaBlocks.length>1){var c=new f([],null,null,this.index,this.currentFileInfo).createEmptySelectors();b=new d(c,a.mediaBlocks),b.multiMedia=!0,b.copyVisibilityInfo(this.visibilityInfo())}return delete a.mediaBlocks,delete a.mediaPath,b},j.prototype.evalNested=function(a){var b,c,f=a.mediaPath.concat([this]);for(b=0;b0;b--)a.splice(b,0,new g("and"));return new h(a)})),new d([],[])},j.prototype.permute=function(a){if(0===a.length)return[];if(1===a.length)return a[0];for(var b=[],c=this.permute(a.slice(1)),d=0;d0){for(n=!0,k=0;k0)p=B;else if(p=A,q[A]+q[B]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(t)+"`",index:this.index,filename:this.currentFileInfo.filename};for(k=0;kthis.params.length)return!1}c=Math.min(f,this.arity);for(var g=0;gb?1:void 0},d.prototype.blocksVisibility=function(){return null==this.visibilityBlocks&&(this.visibilityBlocks=0),0!==this.visibilityBlocks},d.prototype.addVisibilityBlock=function(){null==this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks+1},d.prototype.removeVisibilityBlock=function(){null==this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks-1},d.prototype.ensureVisibility=function(){this.nodeVisible=!0},d.prototype.ensureInvisibility=function(){this.nodeVisible=!1},d.prototype.isVisible=function(){return this.nodeVisible},d.prototype.visibilityInfo=function(){return{visibilityBlocks:this.visibilityBlocks,nodeVisible:this.nodeVisible}},d.prototype.copyVisibilityInfo=function(a){a&&(this.visibilityBlocks=a.visibilityBlocks,this.nodeVisible=a.nodeVisible)},b.exports=d},{}],71:[function(a,b,c){var d=a("./node"),e=a("./color"),f=a("./dimension"),g=function(a,b,c){this.op=a.trim(),this.operands=b,this.isSpaced=c};g.prototype=new d,g.prototype.type="Operation",g.prototype.accept=function(a){this.operands=a.visit(this.operands)},g.prototype.eval=function(a){var b=this.operands[0].eval(a),c=this.operands[1].eval(a);if(a.isMathOn()){if(b instanceof f&&c instanceof e&&(b=b.toColor()),c instanceof f&&b instanceof e&&(c=c.toColor()),!b.operate)throw{type:"Operation",message:"Operation on an invalid type"};return b.operate(a,this.op,c)}return new g(this.op,[b,c],this.isSpaced)},g.prototype.genCSS=function(a,b){this.operands[0].genCSS(a,b),this.isSpaced&&b.add(" "),b.add(this.op),this.isSpaced&&b.add(" "),this.operands[1].genCSS(a,b)},b.exports=g},{"./color":50,"./dimension":56,"./node":70}],72:[function(a,b,c){var d=a("./node"),e=function(a){this.value=a};e.prototype=new d,e.prototype.type="Paren",e.prototype.genCSS=function(a,b){b.add("("),this.value.genCSS(a,b),b.add(")")},e.prototype.eval=function(a){return new e(this.value.eval(a))},b.exports=e},{"./node":70}],73:[function(a,b,c){var d=a("./node"),e=a("./js-eval-node"),f=a("./variable"),g=function(a,b,c,d,e){this.escaped=null==c||c,this.value=b||"",this.quote=a.charAt(0),this.index=d,this.currentFileInfo=e};g.prototype=new e,g.prototype.type="Quoted",g.prototype.genCSS=function(a,b){this.escaped||b.add(this.quote,this.currentFileInfo,this.index),b.add(this.value),this.escaped||b.add(this.quote)},g.prototype.containsVariables=function(){return this.value.match(/(`([^`]+)`)|@\{([\w-]+)\}/)},g.prototype.eval=function(a){function b(a,b,c){var d=a;do a=d,d=a.replace(b,c);while(a!==d);return d}var c=this,d=this.value,e=function(b,d){return String(c.evaluateJavaScript(d,a))},h=function(b,d){var e=new f("@"+d,c.index,c.currentFileInfo).eval(a,!0);return e instanceof g?e.value:e.toCSS()};return d=b(d,/`([^`]+)`/g,e),d=b(d,/@\{([\w-]+)\}/g,h),new g(this.quote+d+this.quote,d,this.escaped,this.index,this.currentFileInfo)},g.prototype.compare=function(a){return"Quoted"!==a.type||this.escaped||a.escaped?a.toCSS&&this.toCSS()===a.toCSS()?0:void 0:d.numericCompare(this.value,a.value)},b.exports=g},{"./js-eval-node":64,"./node":70,"./variable":82}],74:[function(a,b,c){function d(a,b){var c,d="",e=b.length,f={add:function(a){d+=a}};for(c=0;cd){if(!c||c(h)){e=h.find(new f(a.elements.slice(d)),b,c);for(var j=0;j0&&b.add(k),a.firstSelector=!0,h[0].genCSS(a,b),a.firstSelector=!1,e=1;e0?(e=a.slice(0),f=e.pop(),h=d.createDerived(f.elements.slice(0))):h=d.createDerived([]),b.length>0){var i=c.combinator,j=b[0].elements[0];i.emptyOrWhitespace&&!j.combinator.emptyOrWhitespace&&(i=j.combinator),h.elements.push(new g(i,j.value,c.index,c.currentFileInfo)),h.elements=h.elements.concat(b[0].elements.slice(1))}if(0!==h.elements.length&&e.push(h),b.length>1){var k=b.slice(1);k=k.map(function(a){return a.createDerived(a.elements,[])}),e=e.concat(k)}return e}function j(a,b,c,d,e){var f;for(f=0;f0?d[d.length-1]=d[d.length-1].createDerived(d[d.length-1].elements.concat(a)):d.push(new f(a))}}function l(a,b,c){function f(a){var b;return"Paren"!==a.value.type?null:(b=a.value.value,"Selector"!==b.type?null:b)}var h,m,n,o,p,q,r,s,t,u,v=!1;for(o=[],p=[[]],h=0;h0&&r[0].elements.push(new g(s.combinator,"",s.index,s.currentFileInfo)),q.push(r);else for(n=0;n0&&(a.push(p[h]),u=p[h][t-1],p[h][t-1]=u.createDerived(u.elements,c.extendList));return v}function m(a,b){var c=b.createDerived(b.elements,b.extendList,b.evaldCondition);return c.copyVisibilityInfo(a),c}var n,o,p;if(o=[],p=l(o,b,c),!p)if(b.length>0)for(o=[],n=0;n0)for(b=0;b=0&&"\n"!==b.charAt(c);)e++;return"number"==typeof a&&(d=(b.slice(0,a).match(/\n/g)||"").length),{line:d,column:e}}}},{}],84:[function(a,b,c){var d=a("../tree"),e=a("./visitor"),f=a("../logger"),g=function(){this._visitor=new e(this),this.contexts=[],this.allExtendsStack=[[]]};g.prototype={run:function(a){return a=this._visitor.visit(a),a.allExtends=this.allExtendsStack[0],a},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitRuleset:function(a,b){if(!a.root){var c,e,f,g,h=[],i=a.rules,j=i?i.length:0;for(c=0;c=0||(i=[k.selfSelectors[0]],g=n.findMatch(j,i),g.length&&(j.hasFoundMatches=!0,j.selfSelectors.forEach(function(a){var b=k.visibilityInfo();h=n.extendSelector(g,i,a,j.isVisible()),l=new d.Extend(k.selector,k.option,0,k.currentFileInfo,b),l.selfSelectors=h,h[h.length-1].extendList=[l],m.push(l),l.ruleset=k.ruleset,l.parent_ids=l.parent_ids.concat(k.parent_ids,j.parent_ids),k.firstExtendOnThisSelectorPath&&(l.firstExtendOnThisSelectorPath=!0,k.ruleset.paths.push(h))})));if(m.length){if(this.extendChainCount++,c>100){var o="{unable to calculate}",p="{unable to calculate}";try{o=m[0].selfSelectors[0].toCSS(),p=m[0].selector.toCSS()}catch(q){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+o+":extend("+p+")"}}return m.concat(n.doExtendChaining(m,b,c+1))}return m},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitSelector:function(a,b){b.visitDeeper=!1},visitRuleset:function(a,b){if(!a.root){var c,d,e,f,g=this.allExtendsStack[this.allExtendsStack.length-1],h=[],i=this;for(e=0;e0&&k[i.matched].combinator.value!==g?i=null:i.matched++,i&&(i.finished=i.matched===k.length,i.finished&&!a.allowAfter&&(e+1k&&l>0&&(m[m.length-1].elements=m[m.length-1].elements.concat(b[k].elements.slice(l)),l=0,k++),j=g.elements.slice(l,i.index).concat([h]).concat(c.elements.slice(1)),k===i.pathIndex&&f>0?m[m.length-1].elements=m[m.length-1].elements.concat(j):(m=m.concat(b.slice(k,i.pathIndex)),m.push(new d.Selector(j))),k=i.endPathIndex,l=i.endPathElementIndex,l>=b[k].elements.length&&(l=0,k++);return k0&&(m[m.length-1].elements=m[m.length-1].elements.concat(b[k].elements.slice(l)),k++),m=m.concat(b.slice(k,b.length)),m=m.map(function(a){var b=a.createDerived(a.elements);return e?b.ensureVisibility():b.ensureInvisibility(),b})},visitMedia:function(a,b){var c=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);c=c.concat(this.doExtendChaining(c,a.allExtends)),this.allExtendsStack.push(c)},visitMediaOut:function(a){var b=this.allExtendsStack.length-1;this.allExtendsStack.length=b},visitDirective:function(a,b){var c=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);c=c.concat(this.doExtendChaining(c,a.allExtends)),this.allExtendsStack.push(c)},visitDirectiveOut:function(a){var b=this.allExtendsStack.length-1;this.allExtendsStack.length=b}},b.exports=h},{"../logger":33,"../tree":62,"./visitor":91}],85:[function(a,b,c){function d(a){this.imports=[],this.variableImports=[],this._onSequencerEmpty=a,this._currentDepth=0}d.prototype.addImport=function(a){var b=this,c={callback:a,args:null,isReady:!1};return this.imports.push(c),function(){c.args=Array.prototype.slice.call(arguments,0),c.isReady=!0,b.tryRun()}},d.prototype.addVariableImport=function(a){this.variableImports.push(a)},d.prototype.tryRun=function(){this._currentDepth++;try{for(;;){for(;this.imports.length>0;){var a=this.imports[0];if(!a.isReady)return; -this.imports=this.imports.slice(1),a.callback.apply(null,a.args)}if(0===this.variableImports.length)break;var b=this.variableImports[0];this.variableImports=this.variableImports.slice(1),b()}}finally{this._currentDepth--}0===this._currentDepth&&this._onSequencerEmpty&&this._onSequencerEmpty()},b.exports=d},{}],86:[function(a,b,c){var d=a("../contexts"),e=a("./visitor"),f=a("./import-sequencer"),g=function(a,b){this._visitor=new e(this),this._importer=a,this._finish=b,this.context=new d.Eval,this.importCount=0,this.onceFileDetectionMap={},this.recursionDetector={},this._sequencer=new f(this._onSequencerEmpty.bind(this))};g.prototype={isReplacing:!1,run:function(a){try{this._visitor.visit(a)}catch(b){this.error=b}this.isFinished=!0,this._sequencer.tryRun()},_onSequencerEmpty:function(){this.isFinished&&this._finish(this.error)},visitImport:function(a,b){var c=a.options.inline;if(!a.css||c){var e=new d.Eval(this.context,this.context.frames.slice(0)),f=e.frames[0];this.importCount++,a.isVariableImport()?this._sequencer.addVariableImport(this.processImportNode.bind(this,a,e,f)):this.processImportNode(a,e,f)}b.visitDeeper=!1},processImportNode:function(a,b,c){var d,e=a.options.inline;try{d=a.evalForImport(b)}catch(f){f.filename||(f.index=a.index,f.filename=a.currentFileInfo.filename),a.css=!0,a.error=f}if(!d||d.css&&!e)this.importCount--,this.isFinished&&this._sequencer.tryRun();else{d.options.multiple&&(b.importMultiple=!0);for(var g=void 0===d.css,h=0;h0},resolveVisibility:function(a,b){if(!a.blocksVisibility()){if(this.isEmpty(a)&&!this.containsSilentNonBlockedChild(b))return;return a}var c=a.rules[0];if(this.keepOnlyVisibleChilds(c),!this.isEmpty(c))return a.ensureVisibility(),a.removeVisibilityBlock(),a},isVisibleRuleset:function(a){return!!a.firstRoot||!this.isEmpty(a)&&!(!a.root&&!this.hasVisibleSelector(a))}};var g=function(a){this._visitor=new e(this),this._context=a,this.utils=new f(a)};g.prototype={isReplacing:!0,run:function(a){return this._visitor.visit(a)},visitRule:function(a,b){if(!a.blocksVisibility()&&!a.variable)return a},visitMixinDefinition:function(a,b){a.frames=[]},visitExtend:function(a,b){},visitComment:function(a,b){if(!a.blocksVisibility()&&!a.isSilent(this._context))return a},visitMedia:function(a,b){var c=a.rules[0].rules;return a.accept(this._visitor),b.visitDeeper=!1,this.utils.resolveVisibility(a,c)},visitImport:function(a,b){if(!a.blocksVisibility())return a},visitDirective:function(a,b){return a.rules&&a.rules.length?this.visitDirectiveWithBody(a,b):this.visitDirectiveWithoutBody(a,b)},visitDirectiveWithBody:function(a,b){function c(a){var b=a.rules;return 1===b.length&&(!b[0].paths||0===b[0].paths.length)}function d(a){var b=a.rules;return c(a)?b[0].rules:b}var e=d(a);return a.accept(this._visitor),b.visitDeeper=!1,this.utils.isEmpty(a)||this._mergeRules(a.rules[0].rules),this.utils.resolveVisibility(a,e)},visitDirectiveWithoutBody:function(a,b){if(!a.blocksVisibility()){if("@charset"===a.name){if(this.charset){if(a.debugInfo){var c=new d.Comment("/* "+a.toCSS(this._context).replace(/\n/g,"")+" */\n");return c.debugInfo=a.debugInfo,this._visitor.visit(c)}return}this.charset=!0}return a}},checkValidNodes:function(a,b){if(a)for(var c=0;c0?a.accept(this._visitor):a.rules=null,b.visitDeeper=!1}return a.rules&&(this._mergeRules(a.rules),this._removeDuplicateRules(a.rules)),this.utils.isVisibleRuleset(a)&&(a.ensureVisibility(),d.splice(0,0,a)),1===d.length?d[0]:d},_compileRulesetPaths:function(a){a.paths&&(a.paths=a.paths.filter(function(a){var b;for(" "===a[0].elements[0].combinator.value&&(a[0].elements[0].combinator=new d.Combinator("")),b=0;b=0;e--)if(c=a[e],c instanceof d.Rule)if(f[c.name]){b=f[c.name],b instanceof d.Rule&&(b=f[c.name]=[f[c.name].toCSS(this._context)]);var g=c.toCSS(this._context);b.indexOf(g)!==-1?a.splice(e,1):b.push(g)}else f[c.name]=c}},_mergeRules:function(a){if(a){for(var b,c,e,f={},g=0;g1){c=b[0];var h=[],i=[];b.map(function(a){"+"===a.merge&&(i.length>0&&h.push(e(i)),i=[]),i.push(a)}),h.push(e(i)),c.value=g(h)}})}},visitAnonymous:function(a,b){if(!a.blocksVisibility())return a.accept(this._visitor),a}},b.exports=g},{"../tree":62,"./visitor":91}],91:[function(a,b,c){function d(a){return a}function e(a,b){var c,d;for(c in a)if(a.hasOwnProperty(c))switch(d=a[c],typeof d){case"function":d.prototype&&d.prototype.type&&(d.prototype.typeIndex=b++);break;case"object":b=e(d,b)}return b}var f=a("../tree"),g={visitDeeper:!0},h=!1,i=function(a){this._implementation=a,this._visitFnCache=[],h||(e(f,1),h=!0)};i.prototype={visit:function(a){if(!a)return a;var b=a.typeIndex;if(!b)return a;var c,e=this._visitFnCache,f=this._implementation,h=b<<1,i=1|h,j=e[h],k=e[i],l=g;if(l.visitDeeper=!0,j||(c="visit"+a.type,j=f[c]||d,k=f[c+"Out"]||d,e[h]=j,e[i]=k),j!==d){var m=j.call(f,a,l);f.isReplacing&&(a=m)}return l.visitDeeper&&a&&a.accept&&a.accept(this),k!=d&&k.call(f,a),a},visitArray:function(a,b){if(!a)return a;var c,d=a.length;if(b||!this._implementation.isReplacing){for(c=0;ck){for(var b=0,c=h.length-j;b { + event.waitUntil(clients.claim()); +}); +if (typeof workbox === 'undefined') { + importScripts( + 'https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js' + ); + workbox.loadModule('workbox-strategies'); + workbox.loadModule('workbox-cacheable-response'); + workbox.loadModule('workbox-expiration'); +} +self.__precacheManifest = [].concat(self.__precacheManifest || []); +if (typeof workbox !== 'undefined' && workbox) { + workbox.core.skipWaiting(); + + workbox.core.clientsClaim(); + + workbox.precaching.precacheAndRoute([]); + + console.log(`Yay! Workbox is loaded 🎉`); + + workbox.routing.registerRoute( + /\/assets\/css/, + new workbox.strategies.CacheFirst({ + cacheName: 'vendor-local-css', + plugins: [ + new workbox.cacheableResponse.CacheableResponse({ statuses: [0, 200] }), + ], + }) + ); + workbox.routing.registerRoute( + /\/assets\/js/, + new workbox.strategies.CacheFirst({ + cacheName: 'vendor-local-js', + plugins: [ + new workbox.cacheableResponse.CacheableResponse({ statuses: [0, 200] }), + ], + }) + ); + workbox.routing.registerRoute( + /\/img/, + new workbox.strategies.CacheFirst({ + cacheName: 'image-files', + plugins: [ + new workbox.cacheableResponse.CacheableResponse({ statuses: [0, 200] }), + ], + }) + ); + + // Cache the Google Fonts stylesheets with a stale-while-revalidate strategy. + workbox.routing.registerRoute( + /^https:\/\/fonts\.googleapis\.com/, + new workbox.strategies.StaleWhileRevalidate({ + cacheName: 'google-fonts-stylesheets', + }) + ); + + // Cache the underlying font files with a cache-first strategy for 1 year. + workbox.routing.registerRoute( + /^https:\/\/fonts\.gstatic\.com/, + new workbox.strategies.CacheFirst({ + cacheName: 'google-fonts-webfonts', + plugins: [ + new workbox.cacheableResponse.CacheableResponse({ statuses: [0, 200] }), + ], + }) + ); +} else { + console.log(`Boo! Workbox didn't load 😬`); +} diff --git a/assets/sw.js b/assets/sw.js new file mode 100644 index 00000000..cdd4e9b5 --- /dev/null +++ b/assets/sw.js @@ -0,0 +1,1340 @@ +self.addEventListener('install', function (/*event*/) { + // The promise that skipWaiting() returns can be safely ignored. + self.skipWaiting(); + + // Perform any other actions required for your + // service worker to install, potentially inside + // of event.waitUntil(); +}); +self.addEventListener('activate', (event) => { + event.waitUntil(clients.claim()); +}); +if (typeof workbox === 'undefined') { + importScripts( + 'https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js' + ); + workbox.loadModule('workbox-strategies'); + workbox.loadModule('workbox-cacheable-response'); + workbox.loadModule('workbox-expiration'); +} +self.__precacheManifest = [].concat(self.__precacheManifest || []); +if (typeof workbox !== 'undefined' && workbox) { + + workbox.core.skipWaiting(); + + workbox.core.clientsClaim(); + + workbox.precaching.precacheAndRoute([ + { + "url": "images/themes/bootstrap/Favicon.ico", + "revision": "7f7f3b73b863ab0db2800b0cc9d87f22" + }, + { + "url": "images/themes/bootstrap/Introduction.png", + "revision": "8dbc90cfbfd4d9a2f5a3e7c5924771ee" + }, + { + "url": "images/themes/bootstrap/logo.png", + "revision": "6987da08785938281c0cef64a08e3263" + }, + { + "url": "images/themes/bootstrap/title.png", + "revision": "6987da08785938281c0cef64a08e3263" + }, + { + "url": "images/themes/cappuccino/inputbckg.png", + "revision": "0836efcda7efd8f7143e6bc944fb2ae1" + }, + { + "url": "images/themes/cappuccino/Lminus.png", + "revision": "4c6ad5374b9518299739fb8f6c0f0dcf" + }, + { + "url": "images/themes/cappuccino/Lplus.png", + "revision": "0e918eec776f591e565f252bbb3935d1" + }, + { + "url": "images/themes/cappuccino/openListe.png", + "revision": "35fec4ef79e5c77f884c28db9d646ff8" + }, + { + "url": "images/themes/cappuccino/title.png", + "revision": "256583a0062c189786a788f550e4833e" + }, + { + "url": "images/themes/cappuccino/Tminus.png", + "revision": "fd64d87ca98273a08a689508c15e21d0" + }, + { + "url": "images/themes/cappuccino/Tplus.png", + "revision": "6be509ad6d0bdf6f5f4bb0112a28a9c4" + }, + { + "url": "images/themes/default/AddArguments.png", + "revision": "5783c8524fa7f4daff4f1ef7bcb4bfb9" + }, + { + "url": "images/themes/default/Admin.png", + "revision": "a82687f9d571988c5a50cd1c4c85e245" + }, + { + "url": "images/themes/default/Aggregate.png", + "revision": "ff0166451279bef06132ca55d2b13bb3" + }, + { + "url": "images/themes/default/Aggregates.png", + "revision": "480dca5e5fa1bef15990e13f7299ac9a" + }, + { + "url": "images/themes/default/AllUsers.png", + "revision": "c8e3e86ffd0a4d7370e08388352fcc53" + }, + { + "url": "images/themes/default/AvailableReplicationSet.png", + "revision": "ce257e663eb495ba4d90fc55feb361ff" + }, + { + "url": "images/themes/default/AvailableSubscription.png", + "revision": "5ec68e4a7bd37d101bdd202890bfb606" + }, + { + "url": "images/themes/default/Backup.png", + "revision": "362dd1ab7684968a9051fb2ffd145a06" + }, + { + "url": "images/themes/default/blank.png", + "revision": "ff372eacef6cd22aa9a962b1fab6b927" + }, + { + "url": "images/themes/default/Cast.png", + "revision": "2b52864370d5111e7a68d3347f0047f4" + }, + { + "url": "images/themes/default/Casts.png", + "revision": "5597d48b8d4b6d0e30762500ced49539" + }, + { + "url": "images/themes/default/CheckConstraint.png", + "revision": "12878c160ad2030c33fbe74b9ef4980c" + }, + { + "url": "images/themes/default/Cluster.png", + "revision": "8ffa29a8aadf2e8a78a58f246ecb8f3a" + }, + { + "url": "images/themes/default/Column.png", + "revision": "e9a7cd147304fa43da5121aca3aa96bd" + }, + { + "url": "images/themes/default/Columns.png", + "revision": "135c695556735ca7bfbec339300d475a" + }, + { + "url": "images/themes/default/Constraints.png", + "revision": "a08d098a40f117173b627f279d3e5c84" + }, + { + "url": "images/themes/default/Conversion.png", + "revision": "0f5b34e3477bc7dec9d214c75624618e" + }, + { + "url": "images/themes/default/Conversions.png", + "revision": "34b35cebcc208e56a590de389650c31c" + }, + { + "url": "images/themes/default/Copy.png", + "revision": "c8f58a82f94ad33c92c4434195211986" + }, + { + "url": "images/themes/default/CorruptedDatabase.png", + "revision": "37d5edb86c49b49e04dc1f31ea61d944" + }, + { + "url": "images/themes/default/Cut.png", + "revision": "13cb3db5b00eb488ea488c11f7ef6c7b" + }, + { + "url": "images/themes/default/Database.png", + "revision": "f5db4650c1155434dd3395449145e185" + }, + { + "url": "images/themes/default/Databases.png", + "revision": "f78fd91345a5f9e6135740c39f94c281" + }, + { + "url": "images/themes/default/Definition.png", + "revision": "01e09c5e6a4dff39c69c69c30e3c2df0" + }, + { + "url": "images/themes/default/Delete.png", + "revision": "909467ce82f287d29b32a3bde5001a98" + }, + { + "url": "images/themes/default/DisabledJob.png", + "revision": "0c7afdc74e664afc728350efdc4f8e54" + }, + { + "url": "images/themes/default/DisconnectedDatabase.png", + "revision": "871a020d4cce6841704c1e6465b5ac11" + }, + { + "url": "images/themes/default/DisconnectedServer.png", + "revision": "0b2aecfe0a2fefbaa9d153e06a12ce4a" + }, + { + "url": "images/themes/default/Domain.png", + "revision": "0573dfc5e4d10eb7d2708dc9be361e1d" + }, + { + "url": "images/themes/default/Domains.png", + "revision": "5bc7b098fd0c94841c7bb39a8d32c3dd" + }, + { + "url": "images/themes/default/EnableArgument.png", + "revision": "075f3f50ae58bea29ea9853ec69f8822" + }, + { + "url": "images/themes/default/Erase.png", + "revision": "cd1bcdc76c1ac1c8d228b3748ed4b469" + }, + { + "url": "images/themes/default/Execute.png", + "revision": "21388b26da2079d313b9df99324550ac" + }, + { + "url": "images/themes/default/ExecuteSave.png", + "revision": "0e75ce0c09fce81f44bb6f71faf15fd8" + }, + { + "url": "images/themes/default/Explain.png", + "revision": "e0e9aa509cbdd8ef731b35fa9a39aa84" + }, + { + "url": "images/themes/default/Export.png", + "revision": "20d4e370edd5f9da50f168bedc708fe2" + }, + { + "url": "images/themes/default/Favicon.ico", + "revision": "7f7f3b73b863ab0db2800b0cc9d87f22" + }, + { + "url": "images/themes/default/Filter.png", + "revision": "6fa649f2cffe185328b703b4a5f69475" + }, + { + "url": "images/themes/default/ForeignKey.png", + "revision": "928e06e119cc3a048912672d40d06abc" + }, + { + "url": "images/themes/default/Fts.png", + "revision": "c13ce81b5e4a3187ce37a55a387cbd8e" + }, + { + "url": "images/themes/default/FtsCfg.png", + "revision": "78a5c183c4ec2f68fa2c124f11df71ad" + }, + { + "url": "images/themes/default/FtsDict.png", + "revision": "72795d6e7ba1eaa63f4353d075eb551c" + }, + { + "url": "images/themes/default/FtsParser.png", + "revision": "512bc774fedde4b56563c935ea5b6a2d" + }, + { + "url": "images/themes/default/Function.png", + "revision": "d1db8bbd46db17458812fd60ae458b4e" + }, + { + "url": "images/themes/default/Functions.png", + "revision": "6c19e68bf4aff2345c62355ae814cd07" + }, + { + "url": "images/themes/default/GurusHint.png", + "revision": "aee27759d60d8b19aea299c1af78c902" + }, + { + "url": "images/themes/default/Help.png", + "revision": "e599e96f305c61cb374326d49834c990" + }, + { + "url": "images/themes/default/Histories.png", + "revision": "dc9c5432bcca789f6e8adcac5fbecb4a" + }, + { + "url": "images/themes/default/History.png", + "revision": "bb6651298f7feca614348a277417b679" + }, + { + "url": "images/themes/default/I.png", + "revision": "7fef7f3891268fbd886d3776d4bb18d2" + }, + { + "url": "images/themes/default/Import.png", + "revision": "591ac6f7a26a67ae9485c9ea5f53bfbe" + }, + { + "url": "images/themes/default/Index.png", + "revision": "50d5f45d81511368d878756d6c26f47d" + }, + { + "url": "images/themes/default/Indexes.png", + "revision": "68100f02b944c3e5814ad9ad679c0169" + }, + { + "url": "images/themes/default/Introduction.png", + "revision": "8dbc90cfbfd4d9a2f5a3e7c5924771ee" + }, + { + "url": "images/themes/default/Job.png", + "revision": "0b6670ea8590f013806ad04e139a4d9e" + }, + { + "url": "images/themes/default/Jobs.png", + "revision": "7c5f31d0ac216e9f90c661e98dba2856" + }, + { + "url": "images/themes/default/Key.png", + "revision": "932e67636e6acbb814a2dded608bb652" + }, + { + "url": "images/themes/default/L.png", + "revision": "e151369d672d2e2cc6f647be2f736e8f" + }, + { + "url": "images/themes/default/Language.png", + "revision": "20938113d067cff7a6ff773f75e07491" + }, + { + "url": "images/themes/default/Languages.png", + "revision": "ac48fd0fdc93ad3f1928cccb9c9e028e" + }, + { + "url": "images/themes/default/Listen.png", + "revision": "788ee2492ef829b80cfba68d56f14430" + }, + { + "url": "images/themes/default/Listens.png", + "revision": "c529a6fda4b2e2a375f7e5f51e577120" + }, + { + "url": "images/themes/default/Lminus.png", + "revision": "d25bce2a91933a53b40ec210c7323372" + }, + { + "url": "images/themes/default/Loading.gif", + "revision": "af1d523a137ef9b2005411770f454b2e" + }, + { + "url": "images/themes/default/LowerArgument.png", + "revision": "1f099fbed522a3980847f07bcc4573ae" + }, + { + "url": "images/themes/default/Lplus.png", + "revision": "b42f13fbc6d7701cd1bb7d827c3113ca" + }, + { + "url": "images/themes/default/MViews.png", + "revision": "a6cdad27aed2812de33ff2d45e00385b" + }, + { + "url": "images/themes/default/Node.png", + "revision": "1c8e6ef452ff7a9770047b469c85a05c" + }, + { + "url": "images/themes/default/Nodes.png", + "revision": "e3f4f6d43a689035a2208662e933f5ea" + }, + { + "url": "images/themes/default/ObjectNotFound.png", + "revision": "8534caffcf3d558648a0662245e2fc3d" + }, + { + "url": "images/themes/default/OfferedReplicationSet.png", + "revision": "adc078de3c9e353b75640c2e180d20e6" + }, + { + "url": "images/themes/default/OfferedSubscription.png", + "revision": "768fc20465c6354398625c4ed5c85cb4" + }, + { + "url": "images/themes/default/Open.png", + "revision": "92bb01a30f897095adb2f98c0036b9e9" + }, + { + "url": "images/themes/default/Operator.png", + "revision": "fb73b5a1f6499159043e5b20dc3285db" + }, + { + "url": "images/themes/default/OperatorClass.png", + "revision": "a9b82cc57bf520190315ddbc833e64c7" + }, + { + "url": "images/themes/default/OperatorClasses.png", + "revision": "b94fc3a6153d8fb2e261ec454d69a252" + }, + { + "url": "images/themes/default/Operators.png", + "revision": "c5cb1662b9cbf877de8cb08d0c8bc4cb" + }, + { + "url": "images/themes/default/Paste.png", + "revision": "db9d9333b530c266bab387ae076a5ada" + }, + { + "url": "images/themes/default/Path.png", + "revision": "f888ffe2c6ab9c59d45ee07ae6199f4a" + }, + { + "url": "images/themes/default/Paths.png", + "revision": "737c12988806ad60b5a5aec244920709" + }, + { + "url": "images/themes/default/PrimaryKey.png", + "revision": "d0744174f9db9929b5be155c9f603e01" + }, + { + "url": "images/themes/default/Privileges.png", + "revision": "1f27241c0f520a279d3665028024b45e" + }, + { + "url": "images/themes/default/Processes.png", + "revision": "bf5538bb0bd23ed8c209997766dac284" + }, + { + "url": "images/themes/default/Property.png", + "revision": "9bfdb2725bc9facafe90474d2c364c8f" + }, + { + "url": "images/themes/default/RaiseArgument.png", + "revision": "e7f18a3dea3acd7e3333cd8f95e3fcce" + }, + { + "url": "images/themes/default/Record.png", + "revision": "acd2ad85dbbd2bf5b71c0062b167b139" + }, + { + "url": "images/themes/default/Records.png", + "revision": "878ff904362c9b59e2d6f6ac93ecc4b8" + }, + { + "url": "images/themes/default/Redo.png", + "revision": "a169b03df76e87e44c45757f6a168e61" + }, + { + "url": "images/themes/default/Refresh.png", + "revision": "cf51d096cc572377189c2bc884936b78" + }, + { + "url": "images/themes/default/RemoveArgument.png", + "revision": "8d804ee75dfd7b8f3ac98b218a847d54" + }, + { + "url": "images/themes/default/Replication.png", + "revision": "cdd35ed8aa98e9b0d356effb0d74548b" + }, + { + "url": "images/themes/default/ReplicationSets.png", + "revision": "7d5e0bff7082704171013afd322821d4" + }, + { + "url": "images/themes/default/Restore.png", + "revision": "94b8007abc4354fd4cdbdbcd6087bea7" + }, + { + "url": "images/themes/default/Roles.png", + "revision": "f1c25bb9e2a4eb52d9c6ea52545ede2d" + }, + { + "url": "images/themes/default/Rule.png", + "revision": "565c4b37066f23c5a08d428f2592ee7b" + }, + { + "url": "images/themes/default/Rules.png", + "revision": "18fed3c727afc31e40941828697047ad" + }, + { + "url": "images/themes/default/Save.png", + "revision": "b5a94436bc66832e0498de05bd72b23e" + }, + { + "url": "images/themes/default/Schedule.png", + "revision": "e2af41bef5d952cb6887723bc3e5921c" + }, + { + "url": "images/themes/default/Schedules.png", + "revision": "2b7a924ed6a9074d4102a547772750bc" + }, + { + "url": "images/themes/default/Schema.png", + "revision": "18b2e143c60c9ef3813032bb45310e67" + }, + { + "url": "images/themes/default/Schemas.png", + "revision": "b9fe50541e03c0b6e503b4ac1e65ddf1" + }, + { + "url": "images/themes/default/Search.png", + "revision": "9cf1fe46d6b8fd3ba257d46a3d05965d" + }, + { + "url": "images/themes/default/Sequence.png", + "revision": "4bfa8c4668036788458732d85630f931" + }, + { + "url": "images/themes/default/Sequences.png", + "revision": "c4bb32230118c69cf6bab8617ef62b16" + }, + { + "url": "images/themes/default/Server.png", + "revision": "bf4a2c360541176e03505124830cddac" + }, + { + "url": "images/themes/default/Servers.png", + "revision": "07681bcc17ebc43645d6c1796f5df219" + }, + { + "url": "images/themes/default/SqlEditor.png", + "revision": "df73ed3b7b0a31d266d97f97d5ac5c5a" + }, + { + "url": "images/themes/default/Statistics.png", + "revision": "b6d59a3d2b8ad767c54305bc91a8243a" + }, + { + "url": "images/themes/default/Step.png", + "revision": "892be7a355b19ffdb0ce39483cd4b6c1" + }, + { + "url": "images/themes/default/Steps.png", + "revision": "5f28c19fac73bc0e869caed580a28457" + }, + { + "url": "images/themes/default/Stop.png", + "revision": "ef7050f86e5ace6f4c026057beca7b91" + }, + { + "url": "images/themes/default/Subscriptions.png", + "revision": "065f6490b63a46edee2162a6a76a9131" + }, + { + "url": "images/themes/default/T.png", + "revision": "fe196453a6e822e7ebbd23692b35fd5e" + }, + { + "url": "images/themes/default/Table.png", + "revision": "edd7db39026ec7c3d78284a319198b8d" + }, + { + "url": "images/themes/default/Tables.png", + "revision": "84533f1145926e2d71aafaa4ca1eb1ac" + }, + { + "url": "images/themes/default/Tablespace.png", + "revision": "4014487f76df092d3f57b6a90a6c96a0" + }, + { + "url": "images/themes/default/Tablespaces.png", + "revision": "7d2334e497eee6e5719b25dfa39cfe66" + }, + { + "url": "images/themes/default/title_blue.png", + "revision": "6987da08785938281c0cef64a08e3263" + }, + { + "url": "images/themes/default/title.png", + "revision": "27762f17ee6301aac5bb3521d34e142b" + }, + { + "url": "images/themes/default/Tminus.png", + "revision": "eb42ed7ec1597a0a9976fb4198a7ee71" + }, + { + "url": "images/themes/default/Tplus.png", + "revision": "fcfd867d96fa1908bd165c97f4099e74" + }, + { + "url": "images/themes/default/Trigger.png", + "revision": "f827a98b8f30eefac6f9ab47d6ca1f16" + }, + { + "url": "images/themes/default/TriggerFunction.png", + "revision": "9337acb5c8b57422cd0aab291aa706bb" + }, + { + "url": "images/themes/default/TriggerFunctions.png", + "revision": "5dc7b60313a7a4f3598050afbddad7d2" + }, + { + "url": "images/themes/default/Triggers.png", + "revision": "6644a0ddffc0487230295acd19de296c" + }, + { + "url": "images/themes/default/Type.png", + "revision": "952a9dae51878f6869b24527bca77b49" + }, + { + "url": "images/themes/default/Types.png", + "revision": "0f1e8651d2422952d224d1657442cc42" + }, + { + "url": "images/themes/default/Undo.png", + "revision": "a60bb9589277159b06882458fc54e1a9" + }, + { + "url": "images/themes/default/UniqueConstraint.png", + "revision": "96ce5e94257ba8115ffb5956e3ed3296" + }, + { + "url": "images/themes/default/User.png", + "revision": "746e073e551917a29630184eace87c8e" + }, + { + "url": "images/themes/default/UserGroup.png", + "revision": "735113096adc5e5a8299a6f6f09c721d" + }, + { + "url": "images/themes/default/UserGroups.png", + "revision": "76c595fe16835a3bf582d0278828fc49" + }, + { + "url": "images/themes/default/Users.png", + "revision": "6dda662436c3178b2a51c306edc1cc89" + }, + { + "url": "images/themes/default/Variables.png", + "revision": "c5b6e5d13e4d159cf5893a0abb7cb9df" + }, + { + "url": "images/themes/default/View.png", + "revision": "2479afdac6324e368251f9d436a86db0" + }, + { + "url": "images/themes/default/Views.png", + "revision": "a8a50a05e97c59f0b6cbd8b123b0a4bd" + }, + { + "url": "images/themes/instaGIS/logo.png", + "revision": "6987da08785938281c0cef64a08e3263" + }, + { + "url": "sw.dev.js", + "revision": "5dea6508fde6f65581a3f467e457d123" + }, + { + "url": "themes/bootstrap/global.css", + "revision": "97f9ebda1b8fb0e35ac35ffce8a5a960" + }, + { + "url": "themes/bootstrap/title.png", + "revision": "6987da08785938281c0cef64a08e3263" + }, + { + "url": "themes/cappuccino/global.css", + "revision": "faeff89daa358a9f481f42e32b77cfc3" + }, + { + "url": "themes/default/global.css", + "revision": "c49fd9c93fd688a1445a17aa316b09bb" + }, + { + "url": "themes/global.css", + "revision": "6cb6f33fdd8a22c780f6f968141c25a3" + }, + { + "url": "themes/gotar/global.css", + "revision": "c5984fcad101f4b5507718d47780c026" + }, + { + "url": "vendor/codemirror/addon/comment/comment.js", + "revision": "f2798285cd723a94866088997228accc" + }, + { + "url": "vendor/codemirror/addon/comment/continuecomment.js", + "revision": "0374616c52803e22bace5dfabbc0e42f" + }, + { + "url": "vendor/codemirror/addon/dialog/dialog.css", + "revision": "c89dce10b44d2882a024e7befc2b63f5" + }, + { + "url": "vendor/codemirror/addon/dialog/dialog.js", + "revision": "904554fefae1a2beb0eaad467018af7a" + }, + { + "url": "vendor/codemirror/addon/display/autorefresh.js", + "revision": "a8525e557b32a9ff330db311f444058b" + }, + { + "url": "vendor/codemirror/addon/display/fullscreen.css", + "revision": "1a278e72b51528270f8ce9ec991929a1" + }, + { + "url": "vendor/codemirror/addon/display/fullscreen.js", + "revision": "744a9a476b90075936f58ebb8b35ac85" + }, + { + "url": "vendor/codemirror/addon/display/panel.js", + "revision": "45aa4eb1759d95e5169397df11a0cd79" + }, + { + "url": "vendor/codemirror/addon/display/placeholder.js", + "revision": "0e8705231c3e7d910611e5cfcfc9145f" + }, + { + "url": "vendor/codemirror/addon/display/rulers.js", + "revision": "38aaf61e611edfe39883f46f89b0b91b" + }, + { + "url": "vendor/codemirror/addon/edit/closebrackets.js", + "revision": "7138da5915e3a819ea35126930b43402" + }, + { + "url": "vendor/codemirror/addon/edit/closetag.js", + "revision": "eb8606363338598e8f3099392a7fa2ce" + }, + { + "url": "vendor/codemirror/addon/edit/continuelist.js", + "revision": "cc1c2b9fd1184a4e8b845e4fb09707e1" + }, + { + "url": "vendor/codemirror/addon/edit/matchbrackets.js", + "revision": "5a44e9d0ad6abe1afd67c48b70d1cbd2" + }, + { + "url": "vendor/codemirror/addon/edit/matchtags.js", + "revision": "d0c67185e94d3a096299b680c0fca7d6" + }, + { + "url": "vendor/codemirror/addon/edit/trailingspace.js", + "revision": "81d50700cee8c27e0e311de3650851bc" + }, + { + "url": "vendor/codemirror/addon/fold/brace-fold.js", + "revision": "c4850e56d89da48a8625e13ed9a076db" + }, + { + "url": "vendor/codemirror/addon/fold/comment-fold.js", + "revision": "9b289797886789d2ce7f40e3f7408c9e" + }, + { + "url": "vendor/codemirror/addon/fold/foldcode.js", + "revision": "67922ad2e2c384c5455bfcacdec393d8" + }, + { + "url": "vendor/codemirror/addon/fold/foldgutter.css", + "revision": "38bb68770b6f7ebaa7adea770a68e0b1" + }, + { + "url": "vendor/codemirror/addon/fold/foldgutter.js", + "revision": "2e6a4ca9c0f057daaecbc330d8f96bc0" + }, + { + "url": "vendor/codemirror/addon/fold/indent-fold.js", + "revision": "5017f49481f30946bd4229a6d05d5fcc" + }, + { + "url": "vendor/codemirror/addon/fold/markdown-fold.js", + "revision": "6e3228db96bbadbb93c79922ecd88ce0" + }, + { + "url": "vendor/codemirror/addon/fold/xml-fold.js", + "revision": "b88e73a8e7bdc8b032adfd5047dfe2c5" + }, + { + "url": "vendor/codemirror/addon/hint/anyword-hint.js", + "revision": "736f4c0aa67db12cf39097f3d1790c8b" + }, + { + "url": "vendor/codemirror/addon/hint/css-hint.js", + "revision": "4958c441a7cdf2d39fa6c8bd4b340168" + }, + { + "url": "vendor/codemirror/addon/hint/html-hint.js", + "revision": "51364bfc06c261a20b9ced6606db9580" + }, + { + "url": "vendor/codemirror/addon/hint/javascript-hint.js", + "revision": "fe11e9d0e373480aa61af6ae86c04dc1" + }, + { + "url": "vendor/codemirror/addon/hint/show-hint.css", + "revision": "49647712414ff96d5846de9736b5dbd3" + }, + { + "url": "vendor/codemirror/addon/hint/show-hint.js", + "revision": "2fa9552bd0d701cac634055d17bb130a" + }, + { + "url": "vendor/codemirror/addon/hint/sql-hint.js", + "revision": "f66526ad34eaaeee2dca6282961808a8" + }, + { + "url": "vendor/codemirror/addon/hint/xml-hint.js", + "revision": "65cf0f4e6ce510f4a189a0b87d943b8c" + }, + { + "url": "vendor/codemirror/addon/lint/coffeescript-lint.js", + "revision": "140f1a44841627e860cafd955e89f4e7" + }, + { + "url": "vendor/codemirror/addon/lint/css-lint.js", + "revision": "6a6166008cb94a6d62e05dc2cab7fc16" + }, + { + "url": "vendor/codemirror/addon/lint/html-lint.js", + "revision": "4ce658b4b1c2cacb8a2685effa0ed4eb" + }, + { + "url": "vendor/codemirror/addon/lint/javascript-lint.js", + "revision": "3db1c5d6629bde3e0a4a694c5cd94065" + }, + { + "url": "vendor/codemirror/addon/lint/json-lint.js", + "revision": "dcfd194ca63e175996aaea2b3a58b598" + }, + { + "url": "vendor/codemirror/addon/lint/lint.css", + "revision": "80cbf240f7114fb23e506da29cced118" + }, + { + "url": "vendor/codemirror/addon/lint/lint.js", + "revision": "16098bd4d5e62f123cbc4482622e1360" + }, + { + "url": "vendor/codemirror/addon/lint/yaml-lint.js", + "revision": "eabad9dfc99d98d6995c37fce194c28c" + }, + { + "url": "vendor/codemirror/addon/merge/merge.css", + "revision": "d4009e57cbbb2c969147cf233671ba42" + }, + { + "url": "vendor/codemirror/addon/merge/merge.js", + "revision": "001c710b643ececdbaf65328bb3419fc" + }, + { + "url": "vendor/codemirror/addon/mode/loadmode.js", + "revision": "f8291cb1ca96e29af58def213012655a" + }, + { + "url": "vendor/codemirror/addon/mode/multiplex_test.js", + "revision": "37963861dd6e41a530a6f84c2b17bdf7" + }, + { + "url": "vendor/codemirror/addon/mode/multiplex.js", + "revision": "b132b004f352bf044cd80a9f55731147" + }, + { + "url": "vendor/codemirror/addon/mode/overlay.js", + "revision": "4f8e4dcaeb7c237cbe4f1f69972cdc8a" + }, + { + "url": "vendor/codemirror/addon/mode/simple.js", + "revision": "eed15e8b955aaee880af0c819b38fa25" + }, + { + "url": "vendor/codemirror/addon/runmode/colorize.js", + "revision": "c8fb49ed714798e04bc3d0289b19efa4" + }, + { + "url": "vendor/codemirror/addon/runmode/runmode-standalone.js", + "revision": "aa4a42bca69b6f096a18cd51203afe6e" + }, + { + "url": "vendor/codemirror/addon/runmode/runmode.js", + "revision": "2c0ddde09a9f1f8f5dc9d4f67f03d2f2" + }, + { + "url": "vendor/codemirror/addon/runmode/runmode.node.js", + "revision": "f3c8c9b85bbeecf3c873e52d3783f39b" + }, + { + "url": "vendor/codemirror/addon/scroll/annotatescrollbar.js", + "revision": "87198e00de438bb7f9afe2e55b6cb4a3" + }, + { + "url": "vendor/codemirror/addon/scroll/scrollpastend.js", + "revision": "92a24e9251be0dc620c11cb61919293f" + }, + { + "url": "vendor/codemirror/addon/scroll/simplescrollbars.css", + "revision": "0352ba51fd6a422fe6cc44925e33ad88" + }, + { + "url": "vendor/codemirror/addon/scroll/simplescrollbars.js", + "revision": "13948e6ef35e3c3d2c65de096af58721" + }, + { + "url": "vendor/codemirror/addon/search/jump-to-line.js", + "revision": "cf5f2c65e9c8e26841923b5e1a6bf611" + }, + { + "url": "vendor/codemirror/addon/search/match-highlighter.js", + "revision": "ace658d3aaf9d8ae9895ff97dd9eb5ca" + }, + { + "url": "vendor/codemirror/addon/search/matchesonscrollbar.css", + "revision": "00ea2770c568a848190bcf52e4241276" + }, + { + "url": "vendor/codemirror/addon/search/matchesonscrollbar.js", + "revision": "b7dfa5fd6a57e306bf7ce99542819883" + }, + { + "url": "vendor/codemirror/addon/search/search.js", + "revision": "1e2c6bec0a25d4e7dea128f048b08931" + }, + { + "url": "vendor/codemirror/addon/search/searchcursor.js", + "revision": "fa73eef9cf913ee2d766c8501a582a0c" + }, + { + "url": "vendor/codemirror/addon/selection/active-line.js", + "revision": "30fc5d6c1847dc207bd0e38c0e97e789" + }, + { + "url": "vendor/codemirror/addon/selection/mark-selection.js", + "revision": "c0240b66ae29bda93e80be5e60c9ed8d" + }, + { + "url": "vendor/codemirror/addon/selection/selection-pointer.js", + "revision": "ae80c5e4d54f8ccb07c6373e66f523a4" + }, + { + "url": "vendor/codemirror/addon/tern/tern.css", + "revision": "4d57ced774b5f3fa9f00dfa398e74819" + }, + { + "url": "vendor/codemirror/addon/tern/tern.js", + "revision": "f6c76d9ec32faccbb8cf23b7a2f6f917" + }, + { + "url": "vendor/codemirror/addon/tern/worker.js", + "revision": "6866b3b6f236f5ae8b89e15b5cf167e1" + }, + { + "url": "vendor/codemirror/addon/wrap/hardwrap.js", + "revision": "359a2bb5a43f724a09f2adbbfe40dd86" + }, + { + "url": "vendor/codemirror/lib/codemirror.css", + "revision": "fc217d502b05f65616356459c0ec1d62" + }, + { + "url": "vendor/codemirror/lib/codemirror.js", + "revision": "82b9491f7e4ecd8ce57812ee3f99014f" + }, + { + "url": "vendor/codemirror/mode/meta.js", + "revision": "3eb5b33a2d2022c4de839b1980511f54" + }, + { + "url": "vendor/codemirror/mode/sql/index.html", + "revision": "91f74a33b9232251058426d1e16e9dce" + }, + { + "url": "vendor/codemirror/mode/sql/sql.js", + "revision": "d21c7a0e713132429cf903be42310a89" + }, + { + "url": "vendor/datatables/datatables.min.css", + "revision": "80026250946cff8a6fc0da995aa02566" + }, + { + "url": "vendor/datatables/datatables.min.js", + "revision": "c1e3d63eab27d1aa7beb191d32340bba" + }, + { + "url": "vendor/datatables/images/sort_asc_disabled.png", + "revision": "d7dc10c78f23615d328581aebcd805eb" + }, + { + "url": "vendor/datatables/images/sort_asc.png", + "revision": "9326ad44ae4bebdedd141e7a53c2a730" + }, + { + "url": "vendor/datatables/images/sort_both.png", + "revision": "9a6486086d09bb38cf66a57cc559ade3" + }, + { + "url": "vendor/datatables/images/sort_desc_disabled.png", + "revision": "bda51e15154a18257b4f955a222fd66f" + }, + { + "url": "vendor/datatables/images/sort_desc.png", + "revision": "1fc418e33fd5a687290258b23fac4e98" + }, + { + "url": "vendor/images/datatables/sort_asc_disabled.png", + "revision": "d7dc10c78f23615d328581aebcd805eb" + }, + { + "url": "vendor/images/datatables/sort_asc.png", + "revision": "9326ad44ae4bebdedd141e7a53c2a730" + }, + { + "url": "vendor/images/datatables/sort_both.png", + "revision": "9a6486086d09bb38cf66a57cc559ade3" + }, + { + "url": "vendor/images/datatables/sort_desc_disabled.png", + "revision": "bda51e15154a18257b4f955a222fd66f" + }, + { + "url": "vendor/images/datatables/sort_desc.png", + "revision": "1fc418e33fd5a687290258b23fac4e98" + }, + { + "url": "vendor/jquery/images/ui-icons_444444_256x240.png", + "revision": "f83a8b8886694eaef4505dd80af7a430" + }, + { + "url": "vendor/jquery/jquery-3.4.1.min.js", + "revision": "220afd743d9e9643852e31a135a9f3ae" + }, + { + "url": "vendor/jquery/jquery-ui.min.css", + "revision": "81188e0c65a0a25d5ebfa7356bf81884" + }, + { + "url": "vendor/jquery/jquery-ui.min.js", + "revision": "8cbf62fc02083afe12a90787cb8f9e3c" + }, + { + "url": "vendor/jstree/jstree.js", + "revision": "66cefd86e219c19be9a32b4a9f6f70b2" + }, + { + "url": "vendor/jstree/jstree.min.js", + "revision": "dc4a6494cf51022fa4a8541d13837166" + }, + { + "url": "vendor/jstree/themes/default-dark/32px.png", + "revision": "eebaf260766f5e0e773f53d3ea4f3e4d" + }, + { + "url": "vendor/jstree/themes/default-dark/40px.png", + "revision": "51286e68b083696edaf4f9fc577e2a2d" + }, + { + "url": "vendor/jstree/themes/default-dark/style.css", + "revision": "6791bf1b92e95d10c8445ac010c429df" + }, + { + "url": "vendor/jstree/themes/default-dark/style.min.css", + "revision": "0236b108a8deddca3b0fae061147a0a6" + }, + { + "url": "vendor/jstree/themes/default-dark/throbber.gif", + "revision": "62be6ed2b189444b472b8000dc187240" + }, + { + "url": "vendor/jstree/themes/default/32px.png", + "revision": "db49c8de4f267eede40a9a8843efcdec" + }, + { + "url": "vendor/jstree/themes/default/40px.png", + "revision": "1f075735090412ed7eb8077d819b19c6" + }, + { + "url": "vendor/jstree/themes/default/style.css", + "revision": "0cf1fc2eadda48373db31569a791ae29" + }, + { + "url": "vendor/jstree/themes/default/style.min.css", + "revision": "8f65ba57d02eadb0c75d0623190d1ee8" + }, + { + "url": "vendor/jstree/themes/default/throbber.gif", + "revision": "9ed4669f524bec38319be63a2ee4ba26" + }, + { + "url": "vendor/jstree/themes/phppgadmin/32px.png", + "revision": "230b82ca8561d9b4111ba8102cae2bb6" + }, + { + "url": "vendor/jstree/themes/phppgadmin/40px.png", + "revision": "1f075735090412ed7eb8077d819b19c6" + }, + { + "url": "vendor/jstree/themes/phppgadmin/style.css", + "revision": "f5a9ca92f2b904247c7b83ce4b054481" + }, + { + "url": "vendor/jstree/themes/phppgadmin/style.min.css", + "revision": "8f65ba57d02eadb0c75d0623190d1ee8" + }, + { + "url": "vendor/jstree/themes/phppgadmin/throbber.gif", + "revision": "9ed4669f524bec38319be63a2ee4ba26" + }, + { + "url": "vendor/less.min.js", + "revision": "df377f04717c4d59bfdec987dff69a0e" + }, + { + "url": "vendor/select2/css/select2.css", + "revision": "887b34f2cf309344f3e0b96aaab2b15d" + }, + { + "url": "vendor/select2/css/select2.min.css", + "revision": "d44571114a90b9226cd654d3c7d9442c" + }, + { + "url": "vendor/select2/js/i18n/ar.js", + "revision": "a8bb27ec698c86bde72c8a6f13a8e9b4" + }, + { + "url": "vendor/select2/js/i18n/az.js", + "revision": "498dc667b34eb0fddc31c4e92330d1aa" + }, + { + "url": "vendor/select2/js/i18n/bg.js", + "revision": "89cba4df3c8694fcb33098dd1646cac1" + }, + { + "url": "vendor/select2/js/i18n/ca.js", + "revision": "2eaad4eb1950a0d542812c58d30c93dd" + }, + { + "url": "vendor/select2/js/i18n/cs.js", + "revision": "a68bcd293adcd6d9ac0b8527c9b39189" + }, + { + "url": "vendor/select2/js/i18n/da.js", + "revision": "cbf897a0ae53b0cffbbe3f50d8b1b136" + }, + { + "url": "vendor/select2/js/i18n/de.js", + "revision": "366d0aacb55f4929cc50bb977abec674" + }, + { + "url": "vendor/select2/js/i18n/el.js", + "revision": "5629ce65500f96c62414a27c6eaed62c" + }, + { + "url": "vendor/select2/js/i18n/en.js", + "revision": "05649b26c08630d2b703bc1e9ef93c7b" + }, + { + "url": "vendor/select2/js/i18n/es.js", + "revision": "dc9dbf9d65df3f69e6b6d650c97bd967" + }, + { + "url": "vendor/select2/js/i18n/et.js", + "revision": "c3953fb90b6bb9669697f5f12e802a66" + }, + { + "url": "vendor/select2/js/i18n/eu.js", + "revision": "11b925456433eaab07e35b8dca7046f5" + }, + { + "url": "vendor/select2/js/i18n/fa.js", + "revision": "98e52839b583e1ca66f4360a4f43f9b0" + }, + { + "url": "vendor/select2/js/i18n/fi.js", + "revision": "659847deefdcfd7e4f8f2ed924d360f4" + }, + { + "url": "vendor/select2/js/i18n/fr.js", + "revision": "b06a3340de45535358a0bc33fa2b9739" + }, + { + "url": "vendor/select2/js/i18n/gl.js", + "revision": "78a87f7c0a519118fbe4f583ff2a3b3f" + }, + { + "url": "vendor/select2/js/i18n/he.js", + "revision": "222d90ee0344ee8beeb5fb1835c93c76" + }, + { + "url": "vendor/select2/js/i18n/hi.js", + "revision": "116a90b7111b953cd092e30a034d6913" + }, + { + "url": "vendor/select2/js/i18n/hr.js", + "revision": "e1d2c70b4df50d98d2c35856804d38be" + }, + { + "url": "vendor/select2/js/i18n/hu.js", + "revision": "db45641f10b2412801d5872e40ef7c2f" + }, + { + "url": "vendor/select2/js/i18n/id.js", + "revision": "6ee6c9c64b945bb8a0f42d247ee0d868" + }, + { + "url": "vendor/select2/js/i18n/is.js", + "revision": "808c7d47acb59537728bc74fdeb0ad0d" + }, + { + "url": "vendor/select2/js/i18n/it.js", + "revision": "bae1661dbb77c15384655faffc10a3fa" + }, + { + "url": "vendor/select2/js/i18n/ja.js", + "revision": "19cf1ce8a03de84ea668e8fec99a8c80" + }, + { + "url": "vendor/select2/js/i18n/km.js", + "revision": "6074a9c5575cfaa8b3c1dccdb3133dde" + }, + { + "url": "vendor/select2/js/i18n/ko.js", + "revision": "74b17541834ff1bb8c5651d321bd2281" + }, + { + "url": "vendor/select2/js/i18n/lt.js", + "revision": "a0783b1bd1594b7c584564cc68b6c6e5" + }, + { + "url": "vendor/select2/js/i18n/lv.js", + "revision": "07fe2a580d17cba308a972fdabbcaea0" + }, + { + "url": "vendor/select2/js/i18n/mk.js", + "revision": "4986d7fc3ff3ed9a5f8af646f5ca587b" + }, + { + "url": "vendor/select2/js/i18n/ms.js", + "revision": "23e7b436957996a10f451bc8d688764d" + }, + { + "url": "vendor/select2/js/i18n/nb.js", + "revision": "137e184004aaec03977a4caf1cca30f4" + }, + { + "url": "vendor/select2/js/i18n/nl.js", + "revision": "c363ace8aa0501526c17a61ab2fb854f" + }, + { + "url": "vendor/select2/js/i18n/pl.js", + "revision": "76465b54a6b0eb6b2204143a0827d0ca" + }, + { + "url": "vendor/select2/js/i18n/pt-BR.js", + "revision": "9efbbac4fda8d23225df16dddecb2718" + }, + { + "url": "vendor/select2/js/i18n/pt.js", + "revision": "5d6ccc53b347b155e1af6afb1bc5fe94" + }, + { + "url": "vendor/select2/js/i18n/ro.js", + "revision": "1ddc2b9980dcdd1008761149e0349a8b" + }, + { + "url": "vendor/select2/js/i18n/ru.js", + "revision": "d83609abf2e0ba927b9ec472bf47e180" + }, + { + "url": "vendor/select2/js/i18n/sk.js", + "revision": "a0f1a818d09228a87ae105d09fdee80c" + }, + { + "url": "vendor/select2/js/i18n/sr-Cyrl.js", + "revision": "2f3047aad49eedd75dd5dacc092a7e02" + }, + { + "url": "vendor/select2/js/i18n/sr.js", + "revision": "157bc6eb978e9a35985bc655d09ac258" + }, + { + "url": "vendor/select2/js/i18n/sv.js", + "revision": "2b21bb3f61100fd656b41d16e25e2f80" + }, + { + "url": "vendor/select2/js/i18n/th.js", + "revision": "2a4ece4c4355b7efd9e9591a53b3edc1" + }, + { + "url": "vendor/select2/js/i18n/tr.js", + "revision": "c1925d8817db211164145dc47b18d333" + }, + { + "url": "vendor/select2/js/i18n/uk.js", + "revision": "3d56f311192daf9ce44246c52777789f" + }, + { + "url": "vendor/select2/js/i18n/vi.js", + "revision": "3520aa7bdea8234161b2c18f631417a0" + }, + { + "url": "vendor/select2/js/i18n/zh-CN.js", + "revision": "419002d3c6c10ec9618ce6275c1057d1" + }, + { + "url": "vendor/select2/js/i18n/zh-TW.js", + "revision": "c021537edf2c555f149509150ff986e3" + }, + { + "url": "vendor/select2/js/select2.full.js", + "revision": "a95323cb476000ee17d7a252786df963" + }, + { + "url": "vendor/select2/js/select2.full.min.js", + "revision": "da607360bcc65284a197ada3d68d5439" + }, + { + "url": "vendor/select2/js/select2.js", + "revision": "b8f26dd6733ccc6263cb273e8f821dab" + }, + { + "url": "vendor/select2/js/select2.min.js", + "revision": "e87ca4c3554f7b9e693605ce12d3a234" + } +]); + + console.log(`Yay! Workbox is loaded 🎉`); + + workbox.routing.registerRoute( + /\/assets\/css/, + new workbox.strategies.CacheFirst({ + cacheName: 'vendor-local-css', + plugins: [ + new workbox.cacheableResponse.CacheableResponse({ statuses: [0, 200] }), + ], + }) + ); + workbox.routing.registerRoute( + /\/assets\/js/, + new workbox.strategies.CacheFirst({ + cacheName: 'vendor-local-js', + plugins: [ + new workbox.cacheableResponse.CacheableResponse({ statuses: [0, 200] }), + ], + }) + ); + workbox.routing.registerRoute( + /\/img/, + new workbox.strategies.CacheFirst({ + cacheName: 'image-files', + plugins: [ + new workbox.cacheableResponse.CacheableResponse({ statuses: [0, 200] }), + + }) + ); + + // Cache the Google Fonts stylesheets with a stale-while-revalidate strategy. + workbox.routing.registerRoute( + /^https:\/\/fonts\.googleapis\.com/, + new workbox.strategies.StaleWhileRevalidate({ + cacheName: 'google-fonts-stylesheets', + }) + ); + + // Cache the underlying font files with a cache-first strategy for 1 year. + workbox.routing.registerRoute( + /^https:\/\/fonts\.gstatic\.com/, + new workbox.strategies.CacheFirst({ + cacheName: 'google-fonts-webfonts', + plugins: [ + new workbox.cacheableResponse.CacheableResponse({ statuses: [0, 200] }), + ], + }) + ); +} else { + console.log(`Boo! Workbox didn't load 😬`); +} diff --git a/assets/templates/components/common_head.twig b/assets/templates/components/common_head.twig index 8c42716d..8f496f78 100644 --- a/assets/templates/components/common_head.twig +++ b/assets/templates/components/common_head.twig @@ -1,7 +1,12 @@ + {% set development_assets=true %} + {% if development_assets==true %} + + {% else %} + + {% endif %} - @@ -24,11 +29,13 @@ subfolder:'{{subfolder}}', path:"{{path}}", query_string:"{{query_string}}", - strconfdropcred:"{{strconfdropcred}}", + strconfdropcred:"{{lang.strconfdropcred}}", }; if (stateObj.reload !== "none" && window.jsTree) { window.jsTree.jstree('refresh') } + + diff --git a/assets/templates/footer_iframe.twig b/assets/templates/footer_iframe.twig index 936f9bd1..321017a1 100644 --- a/assets/templates/footer_iframe.twig +++ b/assets/templates/footer_iframe.twig @@ -21,6 +21,27 @@ window.onpopstate = function (event) { ifr.contentWindow.location.replace(event.state.realurl); } }; +if('serviceWorker' in navigator) { + navigator.serviceWorker.register('assets/sw.dev.js').then(function(registration) { + console.log('Service Worker Registered'); + }).catch(warn=>{ + console.warn(warn); + }) +} +window.addEventListener("message", (event) => { + const {origin,isTrusted,data}=event,browserIframe= document.getElementById('browser'); + if(!isTrusted||origin!==location.origin) { + return; + } + if(data.reload_browser && browserIframe) { + try { + browserIframe.contentWindow.jsTree.jstree('refresh') + }catch(err){ + console.warn(err); + } + } + console.log(event); +}, false); diff --git a/assets/themes/global.css b/assets/themes/global.css new file mode 100644 index 00000000..c1cb510d --- /dev/null +++ b/assets/themes/global.css @@ -0,0 +1,485 @@ +/** + * This is hte mandatory CSS file to include on top of every CSS theme file +**/ +html { + height: 100%; + margin: 0; +} +html body { + /** Browser Tree using XLoadTree 2 **/ + /** auto-complete on insert **/ + /** bottom link back to top **/ + /** FK browsing **/ + /** Syntax highlighting **/ +} +html body.sql_edit #sqlform #queryedition { + min-height: 80px; +} +html body.sql_edit #sqlform #queryedition > .CodeMirror { + min-height: 70px; +} +html + body.sql_edit + #sqlform + #queryedition + > .CodeMirror + .CodeMirror-scroll + .CodeMirror-sizer { + margin-left: 40px !important; +} +html + body.sql_edit + #sqlform + #queryedition + > .CodeMirror + .CodeMirror-scroll + .CodeMirror-sizer + .cm-m-sql.cm-keyword { + text-transform: uppercase; +} +html + body.sql_edit + #sqlform + #queryedition + > .CodeMirror + .CodeMirror-scroll + .CodeMirror-gutters + .CodeMirror-linenumbers { + min-width: 30px !important; +} +html + body.sql_edit + #sqlform + #queryedition + > .CodeMirror + .CodeMirror-scroll + .CodeMirror-gutters + .CodeMirror-foldgutter { + width: 0.7em !important; +} +html body.sql_edit #sqlform #queryedition #query { + min-height: 70px; +} +html body.detailbody { + padding-top: 90px; + margin-left: 10px !important; + padding-bottom: 20px; +} +html body.detailbody table.tabs { + position: fixed; + top: 58px; + margin-left: -10px; + z-index: 50; +} +html body.detailbody table.tabs tbody tr td { + white-space: nowrap; +} +html body.detailbody table#data td { + white-space: nowrap; +} +html body.detailbody table#data td.opbutton1, +html body.detailbody table#data td.opbutton2, +html body.detailbody table#data td.opbutton3 { + border: 0 none; + padding-left: 1px; + padding-right: 1px; +} +html body.detailbody table#data td.opbutton1 a, +html body.detailbody table#data td.opbutton2 a, +html body.detailbody table#data td.opbutton3 a { + margin-left: 2px; + margin-right: 2px; +} +html body.detailbody table.will_be_datatable td { + white-space: nowrap; +} +html body.detailbody table.will_be_datatable td.opbutton1, +html body.detailbody table.will_be_datatable td.opbutton2, +html body.detailbody table.will_be_datatable td.opbutton3 { + border: 0 none; + padding-left: 1px; + padding-right: 1px; +} +html body.detailbody table.will_be_datatable td.opbutton1 a, +html body.detailbody table.will_be_datatable td.opbutton2 a, +html body.detailbody table.will_be_datatable td.opbutton3 a { + margin-left: 2px; + margin-right: 2px; +} +html body.detailbody table.will_be_datatable td.comment { + white-space: normal; +} +html body.detailbody table tr.data1 td.opbutton1 a, +html body.detailbody table tr.data2 td.opbutton2 a, +html body.detailbody table tr.data3 td.opbutton3 a { + -webkit-background-clip: border-box; + -webkit-background-origin: padding-box; + -webkit-background-size: auto; + -webkit-user-select: none; + background-attachment: scroll; + background-clip: border-box; + background-color: #428bca; + background-image: none; + background-origin: padding-box; + background-size: auto; + border: 1px solid #999; + border-radius: 1.5px; + cursor: pointer; + display: inline-block; + font-size: 11px; + font-weight: normal; + height: 15px; + line-height: 15px; + margin-bottom: 0px; + padding-bottom: 1px; + padding-left: 5px; + padding-right: 5px; + padding-top: 1px; + text-align: center; + text-decoration: none; + vertical-align: middle; + white-space: nowrap; + color: #fff !important; +} +html body .navlink li a { + -webkit-background-clip: border-box; + -webkit-background-origin: padding-box; + -webkit-background-size: auto; + -webkit-user-select: none; + background-attachment: scroll; + background-clip: border-box; + background-color: #428bca; + background-image: none; + background-origin: padding-box; + background-size: auto; + border: 1px solid #999; + border-radius: 1.5px; + cursor: pointer; + display: inline-block; + font-size: 12px; + font-weight: normal; + height: 15px; + line-height: 15px; + margin-bottom: 0px; + padding-bottom: 1px; + padding-left: 5px; + padding-right: 5px; + padding-top: 1px; + text-align: center; + text-decoration: none; + vertical-align: middle; + white-space: nowrap; + color: #fff !important; +} +html body.sql_edit #flexbox_wrapper { + height: 100%; + margin-top: 25px; +} +html body.sql_edit table.tabs { + top: 0; +} +html body.flexbox_body { + height: 100%; + margin: 0; +} +html body.flexbox_body .flexbox_wrapper { + display: flex; + height: 100%; + margin: 0; +} +html body.flexbox_body .flexbox_wrapper .ui-resizable-helper { + border: 2px dotted #00f; +} +html body.flexbox_body .flexbox_wrapper #masking_overlay { + position: fixed; + top: 0; + width: 100%; + bottom: 0; + z-index: 80; + display: none; +} +html body.flexbox_body .flexbox_wrapper > .detail_container { + height: 100%; + width: 100%; + margin: 0px; + padding: 0px; + text-align: left; + float: left; + flex: 1 1; +} +html body.flexbox_body .flexbox_wrapper > #browser_container { + height: 100%; + margin: 0px; + padding: 0px; + text-align: left; + float: left; + flex: 0 0 300px; +} +html + body.flexbox_body + .flexbox_wrapper + > #browser_container + > .browser_container { + height: 100%; + margin: 0px; + padding: 0px; + text-align: left; + float: left; + width: 100%; +} +html body.flexbox_body .flexbox_wrapper > #browser_container.ui-resizable { + width: 300px; + flex: unset; + border-right: 8px solid #cfd8dc; +} +html + body.flexbox_body + .flexbox_wrapper + > #browser_container.ui-resizable + .ui-resizable-handle.ui-resizable-e { + width: 8px; + right: -8px; + background: #84a0ad; + top: 45%; + height: 50px; +} +html body.flexbox_body.rtl .flexbox_wrapper > .detail_container { + float: right; + flex-grow: 1; +} +html body.flexbox_body.rtl .flexbox_wrapper > #browser_container { + float: right; + flex: 0 0 300px; +} +html body.flexbox_body.rtl .flexbox_wrapper > #browser_container.ui-resizable { + flex: unset; + border-right: 0 none; + border-left: 8px solid #cfd8dc; +} +html + body.flexbox_body.rtl + .flexbox_wrapper + > #browser_container.ui-resizable + .ui-resizable-handle.ui-resizable-w { + width: 8px; + left: -8px; + background: #84a0ad; + top: 45%; + height: 50px; +} +html body.browser { + height: 100%; + margin: 0px; + padding: 0px; + text-align: left; +} +html body.browser .refreshTree { + float: right; + text-align: right; + padding: 0 3px; +} +html body.browser .webfx-tree-row { + white-space: nowrap; +} +html body.browser .webfx-tree-children { + background-repeat: repeat-y; + background-position-y: 1px !important; + /* IE only */ +} +html body.browser .webfx-tree-row img { + vertical-align: middle; +} +html body.browser .webfx-tree-item-label { + margin-left: 0.5ex; +} +html body.browser .webfx-tree-icon { + margin-left: 1px; +} +html body.browser .webfx-tree-hide-root { + display: none; +} +html body img { + border: none; +} +html body p.message { + color: blue; +} +html body p.comment { + font-style: italic; +} +html body .left { + text-align: left; +} +html body .pre { + white-space: pre; +} +html body .arg_icon { + padding-right: 5pt; + padding-left: 5pt; +} +html body .topbar { + position: fixed; + z-index: 100; + width: 100%; + top: 0; + margin-left: -10px !important; +} +html body .trail { + position: fixed; + z-index: 100; + width: 100%; + top: 27px; + margin-left: -10px !important; +} +html body #fkbg { + display: none; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 10; +} +html body #fklist { + display: none; + position: absolute; + background: #fff; + border: 1px solid #000; + overflow: auto; + z-index: 15; +} +html body #fklist table { + border-collapse: collapse; + border: 1px solid #aaa; +} +html body #fklist th { + border: 1px solid #aaa; +} +html body #fklist td, +html body #fklist th { + padding: 3px 10px; + border-right: 1px solid #aaa; + font-size: 12px; +} +html body #fklist td a { + display: block; + color: #000; +} +html body #fklist td a.fkval, +html body p.errmsg { + color: red; +} +html body .ac_values { + width: 100%; +} +html body .bottom_link { + position: fixed; + bottom: 0; + right: 0; + margin: 0; + padding: 4px; + background: #eee; + border-top: 1px dotted #999; + border-left: 1px dotted #999; + font-size: smaller; +} +html body div#root { + position: absolute; +} +html body div.fk { + margin-left: 20px; +} +html body div#fkcontainer { + margin: 0; + position: relative; + width: 100%; + background: none; + border: 0px; +} +html body div.fk_value { + display: inline-block; +} +html body .highlight { + background-color: #ffff00; +} +html body .comment { + color: #008080; +} +html body .keyword { + color: #ff8000; +} +html body .literal { + color: #808080; +} +html body .bold { + font-weight: bold; +} +html body .select2-container { + min-width: 250px; +} +html body form.sqlform { + float: left; + width: 100%; +} +html body form.sqlform .sqledit_bottom_inputs { + padding: 1%; + width: 98%; + float: left; +} +html body form.sqlform .sqledit_bottom_inputs p label { + float: left; +} +html body form.sqlform .sqledit_bottom_inputs p label #paginate { + position: relative; + top: 2px; +} +html body .searchpath { + padding: 5px; + clear: both; +} +html body .CodeMirror { + border: 1px solid #aaa; + padding: 3px; + font-size: 1.1em; + line-height: 1.5em; +} +@media print { + @page { + size: 215.9mm 279.4mm; + margin: 5mm 5mm 5mm 5mm; + orphans: 100; + widows: 0; + } + html, + body { + height: 100%; + width: 100%; + } + #browser_container { + display: none; + } + body { + margin: 0; + background: white; + background-color: #ffffff; + } + body .flexbox_wrapper > .detail_container { + height: 100%; + width: 100%; + margin: 0px; + padding: 0px; + text-align: left; + float: left; + flex: 1 1; + border: 4px red; + } + body .topbar { + display: none; + } + body .trail { + display: none; + } + body h2 { + display: none; + } +} diff --git a/assets/vendor/less.min.js b/assets/vendor/less.min.js new file mode 100644 index 00000000..6319704f --- /dev/null +++ b/assets/vendor/less.min.js @@ -0,0 +1,17 @@ +/*! + * Less - Leaner CSS v2.7.2 + * http://lesscss.org + * + * Copyright (c) 2009-2017, Alexis Sellier + * Licensed under the Apache-2.0 License. + * + */ + + /** * @license Apache-2.0 + */ + +!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.less=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g0||b.isFileProtocol?"development":"production");var c=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(a.location.hash);c&&(b.dumpLineNumbers=c[1]),void 0===b.useFileCache&&(b.useFileCache=!0),void 0===b.onReady&&(b.onReady=!0)}},{"./browser":3,"./utils":10}],2:[function(a,b,c){function d(a){a.filename&&console.warn(a),e.async||h.removeChild(i)}a("promise/polyfill.js");var e=window.less||{};a("./add-default-options")(window,e);var f=b.exports=a("./index")(window,e);window.less=f;var g,h,i;e.onReady&&(/!watch/.test(window.location.hash)&&f.watch(),e.async||(g="body { display: none !important }",h=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style"),i.type="text/css",i.styleSheet?i.styleSheet.cssText=g:i.appendChild(document.createTextNode(g)),h.appendChild(i)),f.registerStylesheetsImmediately(),f.pageLoadFinished=f.refresh("development"===f.env).then(d,d))},{"./add-default-options":1,"./index":8,"promise/polyfill.js":97}],3:[function(a,b,c){var d=a("./utils");b.exports={createCSS:function(a,b,c){var e=c.href||"",f="less:"+(c.title||d.extractId(e)),g=a.getElementById(f),h=!1,i=a.createElement("style");i.setAttribute("type","text/css"),c.media&&i.setAttribute("media",c.media),i.id=f,i.styleSheet||(i.appendChild(a.createTextNode(b)),h=null!==g&&g.childNodes.length>0&&i.childNodes.length>0&&g.firstChild.nodeValue===i.firstChild.nodeValue);var j=a.getElementsByTagName("head")[0];if(null===g||h===!1){var k=c&&c.nextSibling||null;k?k.parentNode.insertBefore(i,k):j.appendChild(i)}if(g&&h===!1&&g.parentNode.removeChild(g),i.styleSheet)try{i.styleSheet.cssText=b}catch(l){throw new Error("Couldn't reassign styleSheet.cssText.")}},currentScript:function(a){var b=a.document;return b.currentScript||function(){var a=b.getElementsByTagName("script");return a[a.length-1]}()}}},{"./utils":10}],4:[function(a,b,c){b.exports=function(a,b,c){var d=null;if("development"!==b.env)try{d="undefined"==typeof a.localStorage?null:a.localStorage}catch(e){}return{setCSS:function(a,b,e,f){if(d){c.info("saving "+a+" to cache.");try{d.setItem(a,f),d.setItem(a+":timestamp",b),e&&d.setItem(a+":vars",JSON.stringify(e))}catch(g){c.error('failed to save "'+a+'" to local storage for caching.')}}},getCSS:function(a,b,c){var e=d&&d.getItem(a),f=d&&d.getItem(a+":timestamp"),g=d&&d.getItem(a+":vars");if(c=c||{},f&&b.lastModified&&new Date(b.lastModified).valueOf()===new Date(f).valueOf()&&(!c&&!g||JSON.stringify(c)===g))return e}}}},{}],5:[function(a,b,c){var d=a("./utils"),e=a("./browser");b.exports=function(a,b,c){function f(b,f){var g,h,i="less-error-message:"+d.extractId(f||""),j='
  • {content}
  • ',k=a.document.createElement("div"),l=[],m=b.filename||f,n=m.match(/([^\/]+(\?.*)?)$/)[1];k.id=i,k.className="less-error-message",h="

    "+(b.type||"Syntax")+"Error: "+(b.message||"There is an error in your .less file")+'

    in '+n+" ";var o=function(a,b,c){void 0!==a.extract[b]&&l.push(j.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};b.extract&&(o(b,0,""),o(b,1,"line"),o(b,2,""),h+="on line "+b.line+", column "+(b.column+1)+":

      "+l.join("")+"
    "),b.stack&&(b.extract||c.logLevel>=4)&&(h+="
    Stack Trace
    "+b.stack.split("\n").slice(1).join("
    ")),k.innerHTML=h,e.createCSS(a.document,[".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),k.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),"development"===c.env&&(g=setInterval(function(){var b=a.document,c=b.body;c&&(b.getElementById(i)?c.replaceChild(k,b.getElementById(i)):c.insertBefore(k,c.firstChild),clearInterval(g))},10))}function g(b){var c=a.document.getElementById("less-error-message:"+d.extractId(b));c&&c.parentNode.removeChild(c)}function h(a){}function i(a){c.errorReporting&&"html"!==c.errorReporting?"console"===c.errorReporting?h(a):"function"==typeof c.errorReporting&&c.errorReporting("remove",a):g(a)}function j(a,d){var e="{line} {content}",f=a.filename||d,g=[],h=(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+" in "+f+" ",i=function(a,b,c){void 0!==a.extract[b]&&g.push(e.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};a.extract&&(i(a,0,""),i(a,1,"line"),i(a,2,""),h+="on line "+a.line+", column "+(a.column+1)+":\n"+g.join("\n")),a.stack&&(a.extract||c.logLevel>=4)&&(h+="\nStack Trace\n"+a.stack),b.logger.error(h)}function k(a,b){c.errorReporting&&"html"!==c.errorReporting?"console"===c.errorReporting?j(a,b):"function"==typeof c.errorReporting&&c.errorReporting("add",a,b):f(a,b)}return{add:k,remove:i}}},{"./browser":3,"./utils":10}],6:[function(a,b,c){b.exports=function(b,c){function d(){if(window.XMLHttpRequest&&!("file:"===window.location.protocol&&"ActiveXObject"in window))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){return c.error("browser doesn't support AJAX."),null}}var e=a("../less/environment/abstract-file-manager.js"),f={},g=function(){};return g.prototype=new e,g.prototype.alwaysMakePathsAbsolute=function(){return!0},g.prototype.join=function(a,b){return a?this.extractUrlParts(b,a).path:b},g.prototype.doXHR=function(a,e,f,g){function h(b,c,d){b.status>=200&&b.status<300?c(b.responseText,b.getResponseHeader("Last-Modified")):"function"==typeof d&&d(b.status,a)}var i=d(),j=!b.isFileProtocol||b.fileAsync;"function"==typeof i.overrideMimeType&&i.overrideMimeType("text/css"),c.debug("XHR: Getting '"+a+"'"),i.open("GET",a,j),i.setRequestHeader("Accept",e||"text/x-less, text/css; q=0.9, */*; q=0.5"),i.send(null),b.isFileProtocol&&!b.fileAsync?0===i.status||i.status>=200&&i.status<300?f(i.responseText):g(i.status,a):j?i.onreadystatechange=function(){4==i.readyState&&h(i,f,g)}:h(i,f,g)},g.prototype.supports=function(a,b,c,d){return!0},g.prototype.clearFileCache=function(){f={}},g.prototype.loadFile=function(a,b,c,d,e){b&&!this.isPathAbsolute(a)&&(a=b+a),c=c||{};var g=this.extractUrlParts(a,window.location.href),h=g.url;if(c.useFileCache&&f[h])try{var i=f[h];e(null,{contents:i,filename:h,webInfo:{lastModified:new Date}})}catch(j){e({filename:h,message:"Error loading file "+h+" error was "+j.message})}else this.doXHR(h,c.mime,function(a,b){f[h]=a,e(null,{contents:a,filename:h,webInfo:{lastModified:b}})},function(a,b){e({type:"File",message:"'"+b+"' wasn't found ("+a+")",href:h})})},g}},{"../less/environment/abstract-file-manager.js":15}],7:[function(a,b,c){b.exports=function(){function b(){throw{type:"Runtime",message:"Image size functions are not supported in browser version of less"}}var c=a("./../less/functions/function-registry"),d={"image-size":function(a){return b(this,a),-1},"image-width":function(a){return b(this,a),-1},"image-height":function(a){return b(this,a),-1}};c.addMultiple(d)}},{"./../less/functions/function-registry":22}],8:[function(a,b,c){var d=a("./utils").addDataAttr,e=a("./browser");b.exports=function(b,c){function f(a){return c.postProcessor&&"function"==typeof c.postProcessor&&(a=c.postProcessor.call(a,a)||a),a}function g(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function h(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){var d=c.concat(Array.prototype.slice.call(arguments,0));return a.apply(b,d)}}function i(a){for(var b,d=m.getElementsByTagName("style"),e=0;e=c&&console.log(a)},info:function(a){b.logLevel>=d&&console.log(a)},warn:function(a){b.logLevel>=e&&console.warn(a)},error:function(a){b.logLevel>=f&&console.error(a)}}]);for(var g=0;g0&&(a=a.slice(0,b)),b=a.lastIndexOf("/"),b<0&&(b=a.lastIndexOf("\\")),b<0?"":a.slice(0,b+1)},d.prototype.tryAppendExtension=function(a,b){return/(\.[a-z]*$)|([\?;].*)$/.test(a)?a:a+b},d.prototype.tryAppendLessExtension=function(a){return this.tryAppendExtension(a,".less")},d.prototype.supportsSync=function(){return!1},d.prototype.alwaysMakePathsAbsolute=function(){return!1},d.prototype.isPathAbsolute=function(a){return/^(?:[a-z-]+:|\/|\\|#)/i.test(a)},d.prototype.join=function(a,b){return a?a+b:b},d.prototype.pathDiff=function(a,b){var c,d,e,f,g=this.extractUrlParts(a),h=this.extractUrlParts(b),i="";if(g.hostPart!==h.hostPart)return"";for(d=Math.max(h.directories.length,g.directories.length),c=0;c0&&(h.splice(c-1,2),c-=2)}return g.hostPart=f[1],g.directories=h,g.path=(f[1]||"")+h.join("/"),g.fileUrl=g.path+(f[4]||""),g.url=g.fileUrl+(f[5]||""),g},b.exports=d},{}],16:[function(a,b,c){var d=a("../logger"),e=function(a,b){this.fileManagers=b||[],a=a||{};for(var c=["encodeBase64","mimeLookup","charsetLookup","getSourceMapGenerator"],d=[],e=d.concat(c),f=0;f=0;h--){var i=g[h];if(i[f?"supportsSync":"supports"](a,b,c,e))return i}return null},e.prototype.addFileManager=function(a){this.fileManagers.push(a)},e.prototype.clearFileManagers=function(){this.fileManagers=[]},b.exports=e},{"../logger":33}],17:[function(a,b,c){function d(a,b,c){var d,f,g,h,i=b.alpha,j=c.alpha,k=[];g=j+i*(1-j);for(var l=0;l<3;l++)d=b.rgb[l]/255,f=c.rgb[l]/255,h=a(d,f),g&&(h=(j*f+i*(d-j*(d+f-h)))/g),k[l]=255*h;return new e(k,g)}var e=a("../tree/color"),f=a("./function-registry"),g={multiply:function(a,b){return a*b},screen:function(a,b){return a+b-a*b},overlay:function(a,b){return a*=2,a<=1?g.multiply(a,b):g.screen(a-1,b)},softlight:function(a,b){var c=1,d=a;return b>.5&&(d=1,c=a>.25?Math.sqrt(a):((16*a-12)*a+4)*a),a-(1-2*b)*d*(c-a)},hardlight:function(a,b){return g.overlay(b,a)},difference:function(a,b){return Math.abs(a-b)},exclusion:function(a,b){return a+b-2*a*b},average:function(a,b){return(a+b)/2},negation:function(a,b){return 1-Math.abs(a+b-1)}};for(var h in g)g.hasOwnProperty(h)&&(d[h]=d.bind(null,g[h]));f.addMultiple(d)},{"../tree/color":50,"./function-registry":22}],18:[function(a,b,c){function d(a){return Math.min(1,Math.max(0,a))}function e(a){return h.hsla(a.h,a.s,a.l,a.a)}function f(a){if(a instanceof i)return parseFloat(a.unit.is("%")?a.value/100:a.value);if("number"==typeof a)return a;throw{type:"Argument",message:"color functions take numbers as parameters"}}function g(a,b){return a instanceof i&&a.unit.is("%")?parseFloat(a.value*b/100):f(a)}var h,i=a("../tree/dimension"),j=a("../tree/color"),k=a("../tree/quoted"),l=a("../tree/anonymous"),m=a("./function-registry");h={rgb:function(a,b,c){return h.rgba(a,b,c,1)},rgba:function(a,b,c,d){var e=[a,b,c].map(function(a){return g(a,255)});return d=f(d),new j(e,d)},hsl:function(a,b,c){return h.hsla(a,b,c,1)},hsla:function(a,b,c,e){function g(a){return a=a<0?a+1:a>1?a-1:a,6*a<1?i+(j-i)*a*6:2*a<1?j:3*a<2?i+(j-i)*(2/3-a)*6:i}var i,j;return a=f(a)%360/360,b=d(f(b)),c=d(f(c)),e=d(f(e)),j=c<=.5?c*(b+1):c+b-c*b,i=2*c-j,h.rgba(255*g(a+1/3),255*g(a),255*g(a-1/3),e)},hsv:function(a,b,c){return h.hsva(a,b,c,1)},hsva:function(a,b,c,d){a=f(a)%360/360*360,b=f(b),c=f(c),d=f(d);var e,g;e=Math.floor(a/60%6),g=a/60-e;var i=[c,c*(1-b),c*(1-g*b),c*(1-(1-g)*b)],j=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return h.rgba(255*i[j[e][0]],255*i[j[e][1]],255*i[j[e][2]],d)},hue:function(a){return new i(a.toHSL().h)},saturation:function(a){return new i(100*a.toHSL().s,"%")},lightness:function(a){return new i(100*a.toHSL().l,"%")},hsvhue:function(a){return new i(a.toHSV().h)},hsvsaturation:function(a){return new i(100*a.toHSV().s,"%")},hsvvalue:function(a){return new i(100*a.toHSV().v,"%")},red:function(a){return new i(a.rgb[0])},green:function(a){return new i(a.rgb[1])},blue:function(a){return new i(a.rgb[2])},alpha:function(a){return new i(a.toHSL().a)},luma:function(a){return new i(a.luma()*a.alpha*100,"%")},luminance:function(a){var b=.2126*a.rgb[0]/255+.7152*a.rgb[1]/255+.0722*a.rgb[2]/255;return new i(b*a.alpha*100,"%")},saturate:function(a,b,c){if(!a.rgb)return null;var f=a.toHSL();return f.s+="undefined"!=typeof c&&"relative"===c.value?f.s*b.value/100:b.value/100,f.s=d(f.s),e(f)},desaturate:function(a,b,c){var f=a.toHSL();return f.s-="undefined"!=typeof c&&"relative"===c.value?f.s*b.value/100:b.value/100,f.s=d(f.s),e(f)},lighten:function(a,b,c){var f=a.toHSL();return f.l+="undefined"!=typeof c&&"relative"===c.value?f.l*b.value/100:b.value/100,f.l=d(f.l),e(f)},darken:function(a,b,c){var f=a.toHSL();return f.l-="undefined"!=typeof c&&"relative"===c.value?f.l*b.value/100:b.value/100,f.l=d(f.l),e(f)},fadein:function(a,b,c){var f=a.toHSL();return f.a+="undefined"!=typeof c&&"relative"===c.value?f.a*b.value/100:b.value/100,f.a=d(f.a),e(f)},fadeout:function(a,b,c){var f=a.toHSL();return f.a-="undefined"!=typeof c&&"relative"===c.value?f.a*b.value/100:b.value/100,f.a=d(f.a),e(f)},fade:function(a,b){var c=a.toHSL();return c.a=b.value/100,c.a=d(c.a),e(c)},spin:function(a,b){var c=a.toHSL(),d=(c.h+b.value)%360;return c.h=d<0?360+d:d,e(c)},mix:function(a,b,c){a.toHSL&&b.toHSL||(console.log(b.type),console.dir(b)),c||(c=new i(50));var d=c.value/100,e=2*d-1,f=a.toHSL().a-b.toHSL().a,g=((e*f==-1?e:(e+f)/(1+e*f))+1)/2,h=1-g,k=[a.rgb[0]*g+b.rgb[0]*h,a.rgb[1]*g+b.rgb[1]*h,a.rgb[2]*g+b.rgb[2]*h],l=a.alpha*d+b.alpha*(1-d);return new j(k,l)},greyscale:function(a){return h.desaturate(a,new i(100))},contrast:function(a,b,c,d){if(!a.rgb)return null;if("undefined"==typeof c&&(c=h.rgba(255,255,255,1)),"undefined"==typeof b&&(b=h.rgba(0,0,0,1)),b.luma()>c.luma()){var e=c;c=b,b=e}return d="undefined"==typeof d?.43:f(d),a.luma()=t&&this.context.ieCompat!==!1?(g.warn("Skipped data-uri embedding of "+i+" because its size ("+s.length+" characters) exceeds IE8-safe "+t+" characters!"),f(this,e||a)):new d(new c('"'+s+'"',s,(!1),this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../logger":33,"../tree/quoted":73,"../tree/url":80,"./function-registry":22}],20:[function(a,b,c){var d=a("../tree/keyword"),e=a("./function-registry"),f={eval:function(){var a=this.value_,b=this.error_;if(b)throw b;if(null!=a)return a?d.True:d.False},value:function(a){this.value_=a},error:function(a){this.error_=a},reset:function(){this.value_=this.error_=null}};e.add("default",f.eval.bind(f)),b.exports=f},{"../tree/keyword":65,"./function-registry":22}],21:[function(a,b,c){var d=a("../tree/expression"),e=function(a,b,c,d){this.name=a.toLowerCase(),this.index=c,this.context=b,this.currentFileInfo=d,this.func=b.frames[0].functionRegistry.get(this.name)};e.prototype.isValid=function(){return Boolean(this.func)},e.prototype.call=function(a){return Array.isArray(a)&&(a=a.filter(function(a){return"Comment"!==a.type}).map(function(a){if("Expression"===a.type){var b=a.value.filter(function(a){return"Comment"!==a.type});return 1===b.length?b[0]:new d(b)}return a})),this.func.apply(this,a)},b.exports=e},{"../tree/expression":59}],22:[function(a,b,c){function d(a){return{_data:{},add:function(a,b){a=a.toLowerCase(),this._data.hasOwnProperty(a),this._data[a]=b},addMultiple:function(a){Object.keys(a).forEach(function(b){this.add(b,a[b])}.bind(this))},get:function(b){return this._data[b]||a&&a.get(b)},inherit:function(){return d(this)}}}b.exports=d(null)},{}],23:[function(a,b,c){b.exports=function(b){var c={functionRegistry:a("./function-registry"),functionCaller:a("./function-caller")};return a("./default"),a("./color"),a("./color-blending"),a("./data-uri")(b),a("./math"),a("./number"),a("./string"),a("./svg")(b),a("./types"),c}},{"./color":18,"./color-blending":17,"./data-uri":19,"./default":20,"./function-caller":21,"./function-registry":22,"./math":25,"./number":26,"./string":27,"./svg":28,"./types":29}],24:[function(a,b,c){var d=a("../tree/dimension"),e=function(){};e._math=function(a,b,c){if(!(c instanceof d))throw{type:"Argument",message:"argument must be a number"};return null==b?b=c.unit:c=c.unify(),new d(a(parseFloat(c.value)),b)},b.exports=e},{"../tree/dimension":56}],25:[function(a,b,c){var d=a("./function-registry"),e=a("./math-helper.js"),f={ceil:null,floor:null,sqrt:null,abs:null,tan:"",sin:"",cos:"",atan:"rad",asin:"rad",acos:"rad"};for(var g in f)f.hasOwnProperty(g)&&(f[g]=e._math.bind(null,Math[g],f[g]));f.round=function(a,b){var c="undefined"==typeof b?0:b.value;return e._math(function(a){return a.toFixed(c)},null,a)},d.addMultiple(f)},{"./function-registry":22,"./math-helper.js":24}],26:[function(a,b,c){var d=a("../tree/dimension"),e=a("../tree/anonymous"),f=a("./function-registry"),g=a("./math-helper.js"),h=function(a,b){switch(b=Array.prototype.slice.call(b),b.length){case 0:throw{type:"Argument",message:"one or more arguments required"}}var c,f,g,h,i,j,k,l,m=[],n={};for(c=0;ci.value)&&(m[f]=g);else{if(void 0!==k&&j!==k)throw{type:"Argument",message:"incompatible types"};n[j]=m.length,m.push(g)}else Array.isArray(b[c].value)&&Array.prototype.push.apply(b,Array.prototype.slice.call(b[c].value));return 1==m.length?m[0]:(b=m.map(function(a){return a.toCSS(this.context)}).join(this.context.compress?",":", "),new e((a?"min":"max")+"("+b+")"))};f.addMultiple({min:function(){return h(!0,arguments)},max:function(){return h(!1,arguments)},convert:function(a,b){return a.convertTo(b.value)},pi:function(){return new d(Math.PI)},mod:function(a,b){return new d(a.value%b.value,a.unit)},pow:function(a,b){if("number"==typeof a&&"number"==typeof b)a=new d(a),b=new d(b);else if(!(a instanceof d&&b instanceof d))throw{type:"Argument",message:"arguments must be numbers"};return new d(Math.pow(a.value,b.value),a.unit)},percentage:function(a){var b=g._math(function(a){return 100*a},"%",a);return b}})},{"../tree/anonymous":46,"../tree/dimension":56,"./function-registry":22,"./math-helper.js":24}],27:[function(a,b,c){var d=a("../tree/quoted"),e=a("../tree/anonymous"),f=a("../tree/javascript"),g=a("./function-registry");g.addMultiple({e:function(a){return new e(a instanceof f?a.evaluated:a.value)},escape:function(a){return new e(encodeURI(a.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},replace:function(a,b,c,e){var f=a.value;return c="Quoted"===c.type?c.value:c.toCSS(),f=f.replace(new RegExp(b.value,e?e.value:""),c),new d(a.quote||"",f,a.escaped)},"%":function(a){for(var b=Array.prototype.slice.call(arguments,1),c=a.value,e=0;e",k=0;k";return j+="',j=encodeURIComponent(j),j="data:image/svg+xml,"+j,new g(new f("'"+j+"'",j,(!1),this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../tree/color":50,"../tree/dimension":56,"../tree/expression":59,"../tree/quoted":73,"../tree/url":80,"./function-registry":22}],29:[function(a,b,c){var d=a("../tree/keyword"),e=a("../tree/detached-ruleset"),f=a("../tree/dimension"),g=a("../tree/color"),h=a("../tree/quoted"),i=a("../tree/anonymous"),j=a("../tree/url"),k=a("../tree/operation"),l=a("./function-registry"),m=function(a,b){return a instanceof b?d.True:d.False},n=function(a,b){if(void 0===b)throw{type:"Argument",message:"missing the required second argument to isunit."};if(b="string"==typeof b.value?b.value:b,"string"!=typeof b)throw{type:"Argument",message:"Second argument to isunit should be a unit or a string."};return a instanceof f&&a.unit.is(b)?d.True:d.False},o=function(a){var b=Array.isArray(a.value)?a.value:Array(a);return b};l.addMultiple({isruleset:function(a){return m(a,e)},iscolor:function(a){return m(a,g)},isnumber:function(a){return m(a,f)},isstring:function(a){return m(a,h)},iskeyword:function(a){return m(a,d)},isurl:function(a){return m(a,j)},ispixel:function(a){return n(a,"px")},ispercentage:function(a){return n(a,"%")},isem:function(a){return n(a,"em")},isunit:n,unit:function(a,b){if(!(a instanceof f))throw{type:"Argument",message:"the first argument to unit must be a number"+(a instanceof k?". Have you forgotten parenthesis?":"")};return b=b?b instanceof d?b.value:b.toCSS():"",new f(a.value,b)},"get-unit":function(a){return new i(a.unit)},extract:function(a,b){return b=b.value-1,o(a)[b]},length:function(a){return new f(o(a).length)}})},{"../tree/anonymous":46,"../tree/color":50,"../tree/detached-ruleset":55,"../tree/dimension":56,"../tree/keyword":65,"../tree/operation":71,"../tree/quoted":73,"../tree/url":80,"./function-registry":22}],30:[function(a,b,c){var d=a("./contexts"),e=a("./parser/parser"),f=a("./plugins/function-importer");b.exports=function(a){var b=function(a,b){this.rootFilename=b.filename,this.paths=a.paths||[],this.contents={},this.contentsIgnoredChars={},this.mime=a.mime,this.error=null,this.context=a,this.queue=[],this.files={}};return b.prototype.push=function(b,c,g,h,i){var j=this;this.queue.push(b);var k=function(a,c,d){j.queue.splice(j.queue.indexOf(b),1);var e=d===j.rootFilename;h.optional&&a?i(null,{rules:[]},!1,null):(j.files[d]=c,a&&!j.error&&(j.error=a),i(a,c,e,d))},l={relativeUrls:this.context.relativeUrls,entryPath:g.entryPath,rootpath:g.rootpath,rootFilename:g.rootFilename},m=a.getFileManager(b,g.currentDirectory,this.context,a);if(!m)return void k({message:"Could not find a file-manager for "+b});c&&(b=m.tryAppendExtension(b,h.plugin?".js":".less"));var n=function(a){var b=a.filename,c=a.contents.replace(/^\uFEFF/,"");l.currentDirectory=m.getPath(b),l.relativeUrls&&(l.rootpath=m.join(j.context.rootpath||"",m.pathDiff(l.currentDirectory,l.entryPath)),!m.isPathAbsolute(l.rootpath)&&m.alwaysMakePathsAbsolute()&&(l.rootpath=m.join(l.entryPath,l.rootpath))),l.filename=b;var i=new d.Parse(j.context);i.processImports=!1,j.contents[b]=c,(g.reference||h.reference)&&(l.reference=!0),h.plugin?new f(i,l).eval(c,function(a,c){k(a,c,b)}):h.inline?k(null,c,b):new e(i,j,l).parse(c,function(a,c){k(a,c,b)})},o=m.loadFile(b,g.currentDirectory,this.context,a,function(a,b){a?k(a):n(b)});o&&o.then(n,k)},b}},{"./contexts":11,"./parser/parser":38,"./plugins/function-importer":40}],31:[function(a,b,c){b.exports=function(b,c){var d,e,f,g,h,i={version:[2,7,2],data:a("./data"),tree:a("./tree"),Environment:h=a("./environment/environment"),AbstractFileManager:a("./environment/abstract-file-manager"),environment:b=new h(b,c),visitors:a("./visitors"),Parser:a("./parser/parser"),functions:a("./functions")(b),contexts:a("./contexts"),SourceMapOutput:d=a("./source-map-output")(b),SourceMapBuilder:e=a("./source-map-builder")(d,b),ParseTree:f=a("./parse-tree")(e),ImportManager:g=a("./import-manager")(b),render:a("./render")(b,f,g),parse:a("./parse")(b,f,g),LessError:a("./less-error"),transformTree:a("./transform-tree"),utils:a("./utils"),PluginManager:a("./plugin-manager"),logger:a("./logger")};return i}},{"./contexts":11,"./data":13,"./environment/abstract-file-manager":15,"./environment/environment":16,"./functions":23,"./import-manager":30,"./less-error":32,"./logger":33,"./parse":35,"./parse-tree":34,"./parser/parser":38,"./plugin-manager":39,"./render":41,"./source-map-builder":42,"./source-map-output":43,"./transform-tree":44,"./tree":62,"./utils":83,"./visitors":87}],32:[function(a,b,c){var d=a("./utils"),e=b.exports=function(a,b,c){Error.call(this);var e=a.filename||c;if(b&&e){var f=b.contents[e],g=d.getLocation(a.index,f),h=g.line,i=g.column,j=a.call&&d.getLocation(a.call,f).line,k=f.split("\n");this.type=a.type||"Syntax",this.filename=e,this.index=a.index,this.line="number"==typeof h?h+1:null,this.callLine=j+1,this.callExtract=k[j],this.column=i,this.extract=[k[h-1],k[h],k[h+1]]}this.message=a.message,this.stack=a.stack};if("undefined"==typeof Object.create){var f=function(){};f.prototype=Error.prototype,e.prototype=new f}else e.prototype=Object.create(Error.prototype);e.prototype.constructor=e},{"./utils":83}],33:[function(a,b,c){b.exports={error:function(a){this._fireEvent("error",a)},warn:function(a){this._fireEvent("warn",a)},info:function(a){this._fireEvent("info",a)},debug:function(a){this._fireEvent("debug",a)},addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var b=0;b=97&&j<=122||j<34))switch(j){case 40:o++,e=h;continue;case 41:if(--o<0)return b("missing opening `(`",h);continue;case 59:o||c();continue;case 123:n++,d=h;continue;case 125:if(--n<0)return b("missing opening `{`",h);n||o||c();continue;case 92:if(h96)){if(k==j){l=1;break}if(92==k){if(h==m-1)return b("unescaped `\\`",h);h++}}if(l)continue;return b("unmatched `"+String.fromCharCode(j)+"`",i);case 47:if(o||h==m-1)continue;if(k=a.charCodeAt(h+1),47==k)for(h+=2;hd&&g>f?b("missing closing `}` or `*/`",d):b("missing closing `}`",d):0!==o?b("missing closing `)`",e):(c(!0),p)}},{}],37:[function(a,b,c){var d=a("./chunker");b.exports=function(){function a(d){for(var e,f,j,p=k.i,q=c,s=k.i-i,t=k.i+h.length-s,u=k.i+=d,v=b;k.i=0){j={index:k.i,text:v.substr(k.i,x+2-k.i),isLineComment:!1},k.i+=j.text.length-1,k.commentStore.push(j);continue}}break}if(e!==l&&e!==n&&e!==m&&e!==o)break}if(h=h.slice(d+k.i-u+s),i=k.i,!h.length){if(ce||k.i===e&&a&&!f)&&(e=k.i,f=a);var b=j.pop();h=b.current,i=k.i=b.i,c=b.j},k.forget=function(){j.pop()},k.isWhitespace=function(a){var c=k.i+(a||0),d=b.charCodeAt(c);return d===l||d===o||d===m||d===n},k.$re=function(b){k.i>i&&(h=h.slice(k.i-i),i=k.i);var c=b.exec(h);return c?(a(c[0].length),"string"==typeof c?c:1===c.length?c[0]:c):null},k.$char=function(c){return b.charAt(k.i)!==c?null:(a(1),c)},k.$str=function(c){for(var d=c.length,e=0;es||a=b.length;return k.i=b.length-1,furthestChar:b[k.i]}},k}},{"./chunker":36}],38:[function(a,b,c){var d=a("../less-error"),e=a("../tree"),f=a("../visitors"),g=a("./parser-input"),h=a("../utils"),i=function j(a,b,c){function i(a,e){throw new d({index:o.i,filename:c.filename,type:e||"Syntax",message:a},b)}function k(a,b,c){var d=a instanceof Function?a.call(n):o.$re(a);return d?d:void i(b||("string"==typeof a?"expected '"+a+"' got '"+o.currentChar()+"'":"unexpected token"))}function l(a,b){return o.$char(a)?a:void i(b||"expected '"+a+"' got '"+o.currentChar()+"'")}function m(a){var b=c.filename;return{lineNumber:h.getLocation(a,o.getInput()).line+1,fileName:b}}var n,o=g();return{parse:function(g,h,i){var k,l,m,n,p=null,q="";if(l=i&&i.globalVars?j.serializeVars(i.globalVars)+"\n":"",m=i&&i.modifyVars?"\n"+j.serializeVars(i.modifyVars):"",a.pluginManager)for(var r=a.pluginManager.getPreProcessors(),s=0;s1&&(b=new e.Value(g)),d.push(b),g=[])}return o.forget(),a?d:f},literal:function(){return this.dimension()||this.color()||this.quoted()||this.unicodeDescriptor()},assignment:function(){var a,b;return o.save(),(a=o.$re(/^\w+(?=\s?=)/i))&&o.$char("=")&&(b=n.entity())?(o.forget(),new e.Assignment(a,b)):void o.restore()},url:function(){var a,b=o.i;return o.autoCommentAbsorb=!1,o.$str("url(")?(a=this.quoted()||this.variable()||o.$re(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/)||"",o.autoCommentAbsorb=!0,l(")"),new e.URL(null!=a.value||a instanceof e.Variable?a:new e.Anonymous(a),b,c)):void(o.autoCommentAbsorb=!0)},variable:function(){var a,b=o.i;if("@"===o.currentChar()&&(a=o.$re(/^@@?[\w-]+/)))return new e.Variable(a,b,c)},variableCurly:function(){var a,b=o.i;if("@"===o.currentChar()&&(a=o.$re(/^@\{([\w-]+)\}/)))return new e.Variable("@"+a[1],b,c)},color:function(){var a;if("#"===o.currentChar()&&(a=o.$re(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/))){var b=a.input.match(/^#([\w]+).*/);return b=b[1],b.match(/^[A-Fa-f0-9]+$/)||i("Invalid HEX color code"),new e.Color(a[1],(void 0),"#"+b)}},colorKeyword:function(){o.save();var a=o.autoCommentAbsorb;o.autoCommentAbsorb=!1;var b=o.$re(/^[_A-Za-z-][_A-Za-z0-9-]+/);if(o.autoCommentAbsorb=a,!b)return void o.forget();o.restore();var c=e.Color.fromKeyword(b);return c?(o.$str(b),c):void 0},dimension:function(){if(!o.peekNotNumeric()){var a=o.$re(/^([+-]?\d*\.?\d+)(%|[a-z_]+)?/i);return a?new e.Dimension(a[1],a[2]):void 0}},unicodeDescriptor:function(){var a;if(a=o.$re(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/))return new e.UnicodeDescriptor(a[0])},javascript:function(){var a,b=o.i;o.save();var d=o.$char("~"),f=o.$char("`");return f?(a=o.$re(/^[^`]*`/))?(o.forget(),new e.JavaScript(a.substr(0,a.length-1),Boolean(d),b,c)):void o.restore("invalid javascript definition"):void o.restore()}},variable:function(){var a;if("@"===o.currentChar()&&(a=o.$re(/^(@[\w-]+)\s*:/)))return a[1]},rulesetCall:function(){var a;if("@"===o.currentChar()&&(a=o.$re(/^(@[\w-]+)\(\s*\)\s*;/)))return new e.RulesetCall(a[1])},extend:function(a){var b,d,f,g,h,j=o.i;if(o.$str(a?"&:extend(":":extend(")){do{for(f=null,b=null;!(f=o.$re(/^(all)(?=\s*(\)|,))/))&&(d=this.element());)b?b.push(d):b=[d];f=f&&f[1],b||i("Missing target selector for :extend()."),h=new e.Extend(new e.Selector(b),f,j,c),g?g.push(h):g=[h]}while(o.$char(","));return k(/^\)/),a&&k(/^;/),g}},extendRule:function(){return this.extend(!0)},mixin:{call:function(){var a,b,d,f,g,h,i=o.currentChar(),j=!1,k=o.i;if("."===i||"#"===i){for(o.save();;){if(a=o.i,f=o.$re(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/),!f)break;d=new e.Element(g,f,a,c),b?b.push(d):b=[d],g=o.$char(">")}return b&&(o.$char("(")&&(h=this.args(!0).args,l(")")),n.important()&&(j=!0),n.end())?(o.forget(),new e.mixin.Call(b,h,k,c,j)):void o.restore()}},args:function(a){var b,c,d,f,g,h,j,k=n.entities,l={args:null,variadic:!1},m=[],p=[],q=[];for(o.save();;){if(a)h=n.detachedRuleset()||n.expression();else{if(o.commentStore.length=0,o.$str("...")){l.variadic=!0,o.$char(";")&&!b&&(b=!0),(b?p:q).push({variadic:!0});break}h=k.variable()||k.literal()||k.keyword()}if(!h)break;f=null,h.throwAwayComments&&h.throwAwayComments(),g=h;var r=null;if(a?h.value&&1==h.value.length&&(r=h.value[0]):r=h,r&&r instanceof e.Variable)if(o.$char(":")){if(m.length>0&&(b&&i("Cannot mix ; and , as delimiter types"),c=!0),g=n.detachedRuleset()||n.expression(),!g){if(!a)return o.restore(),l.args=[],l;i("could not understand value for named argument")}f=d=r.name}else if(o.$str("...")){if(!a){l.variadic=!0,o.$char(";")&&!b&&(b=!0),(b?p:q).push({name:h.name,variadic:!0});break}j=!0}else a||(d=f=r.name,g=null);g&&m.push(g),q.push({name:f,value:g,expand:j}),o.$char(",")||(o.$char(";")||b)&&(c&&i("Cannot mix ; and , as delimiter types"),b=!0,m.length>1&&(g=new e.Value(m)),p.push({name:d,value:g,expand:j}),d=null,m=[],c=!1)}return o.forget(),l.args=b?p:q,l},definition:function(){var a,b,c,d,f=[],g=!1;if(!("."!==o.currentChar()&&"#"!==o.currentChar()||o.peek(/^[^{]*\}/)))if(o.save(),b=o.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){a=b[1];var h=this.args(!1);if(f=h.args,g=h.variadic,!o.$char(")"))return void o.restore("Missing closing ')'");if(o.commentStore.length=0,o.$str("when")&&(d=k(n.conditions,"expected condition")),c=n.block())return o.forget(),new e.mixin.Definition(a,f,c,d,g);o.restore()}else o.forget()}},entity:function(){var a=this.entities;return this.comment()||a.literal()||a.variable()||a.url()||a.call()||a.keyword()||a.javascript()},end:function(){return o.$char(";")||o.peek("}")},alpha:function(){var a;if(o.$re(/^opacity=/i))return a=o.$re(/^\d+/),a||(a=k(this.entities.variable,"Could not parse alpha")),l(")"),new e.Alpha(a)},element:function(){var a,b,d,f=o.i;if(b=this.combinator(),a=o.$re(/^(?:\d+\.\d+|\d+)%/)||o.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||o.$char("*")||o.$char("&")||this.attribute()||o.$re(/^\([^&()@]+\)/)||o.$re(/^[\.#:](?=@)/)||this.entities.variableCurly(),a||(o.save(),o.$char("(")?(d=this.selector())&&o.$char(")")?(a=new e.Paren(d),o.forget()):o.restore("Missing closing ')'"):o.forget()),a)return new e.Element(b,a,f,c)},combinator:function(){var a=o.currentChar();if("/"===a){o.save();var b=o.$re(/^\/[a-z]+\//i);if(b)return o.forget(),new e.Combinator(b);o.restore()}if(">"===a||"+"===a||"~"===a||"|"===a||"^"===a){for(o.i++,"^"===a&&"^"===o.currentChar()&&(a="^^",o.i++);o.isWhitespace();)o.i++;return new e.Combinator(a)}return new e.Combinator(o.isWhitespace(-1)?" ":null)},lessSelector:function(){return this.selector(!0)},selector:function(a){for(var b,d,f,g,h,j,l,m=o.i;(a&&(d=this.extend())||a&&(j=o.$str("when"))||(g=this.element()))&&(j?l=k(this.conditions,"expected condition"):l?i("CSS guard can only be used at the end of selector"):d?h=h?h.concat(d):d:(h&&i("Extend can only be used at the end of selector"),f=o.currentChar(),b?b.push(g):b=[g],g=null),"{"!==f&&"}"!==f&&";"!==f&&","!==f&&")"!==f););return b?new e.Selector(b,h,l,m,c):void(h&&i("Extend must be used to extend a selector, it cannot be used on its own"))},attribute:function(){if(o.$char("[")){var a,b,c,d=this.entities;return(a=d.variableCurly())||(a=k(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),c=o.$re(/^[|~*$^]?=/),c&&(b=d.quoted()||o.$re(/^[0-9]+%/)||o.$re(/^[\w-]+/)||d.variableCurly()),l("]"),new e.Attribute(a,c,b)}},block:function(){var a;if(o.$char("{")&&(a=this.primary())&&o.$char("}"))return a},blockRuleset:function(){var a=this.block();return a&&(a=new e.Ruleset(null,a)),a},detachedRuleset:function(){var a=this.blockRuleset();if(a)return new e.DetachedRuleset(a)},ruleset:function(){var b,c,d,f;for(o.save(),a.dumpLineNumbers&&(f=m(o.i));;){if(c=this.lessSelector(),!c)break;if(b?b.push(c):b=[c],o.commentStore.length=0,c.condition&&b.length>1&&i("Guards are only currently allowed on a single selector."),!o.$char(","))break;c.condition&&i("Guards are only currently allowed on a single selector."),o.commentStore.length=0}if(b&&(d=this.block())){o.forget();var g=new e.Ruleset(b,d,a.strictImports);return a.dumpLineNumbers&&(g.debugInfo=f),g}o.restore()},rule:function(b){var d,f,g,h,i,j=o.i,k=o.currentChar();if("."!==k&&"#"!==k&&"&"!==k&&":"!==k)if(o.save(),d=this.variable()||this.ruleProperty()){if(i="string"==typeof d,i&&(f=this.detachedRuleset()),o.commentStore.length=0,!f){h=!i&&d.length>1&&d.pop().value;var l=!b&&(a.compress||i);if(l&&(f=this.value()),!f&&(f=this.anonymousValue()))return o.forget(),new e.Rule(d,f,(!1),h,j,c);l||f||(f=this.value()),g=this.important()}if(f&&this.end())return o.forget(),new e.Rule(d,f,g,h,j,c);if(o.restore(),f&&!b)return this.rule(!0)}else o.forget()},anonymousValue:function(){var a=o.$re(/^([^@+\/'"*`(;{}-]*);/);if(a)return new e.Anonymous(a[1])},"import":function(){var a,b,d=o.i,f=o.$re(/^@import?\s+/);if(f){var g=(f?this.importOptions():null)||{};if(a=this.entities.quoted()||this.entities.url())return b=this.mediaFeatures(),o.$char(";")||(o.i=d,i("missing semi-colon or unrecognised media features on import")),b=b&&new e.Value(b),new e.Import(a,b,g,d,c);o.i=d,i("malformed import statement")}},importOptions:function(){var a,b,c,d={};if(!o.$char("("))return null;do if(a=this.importOption()){switch(b=a,c=!0,b){case"css":b="less",c=!1;break;case"once":b="multiple",c=!1}if(d[b]=c,!o.$char(","))break}while(a);return l(")"),d},importOption:function(){var a=o.$re(/^(less|css|multiple|once|inline|reference|optional)/);if(a)return a[1]},mediaFeature:function(){var a,b,d=this.entities,f=[];o.save();do a=d.keyword()||d.variable(),a?f.push(a):o.$char("(")&&(b=this.property(),a=this.value(),o.$char(")")?b&&a?f.push(new e.Paren(new e.Rule(b,a,null,null,o.i,c,(!0)))):a?f.push(new e.Paren(a)):i("badly formed media feature definition"):i("Missing closing ')'","Parse"));while(a);if(o.forget(),f.length>0)return new e.Expression(f)},mediaFeatures:function(){var a,b=this.entities,c=[];do if(a=this.mediaFeature()){if(c.push(a),!o.$char(","))break}else if(a=b.variable(),a&&(c.push(a),!o.$char(",")))break;while(a);return c.length>0?c:null},media:function(){var b,d,f,g,h=o.i;return a.dumpLineNumbers&&(g=m(h)),o.save(),o.$str("@media")?(b=this.mediaFeatures(),d=this.block(),d||i("media definitions require block statements after any features"),o.forget(),f=new e.Media(d,b,h,c),a.dumpLineNumbers&&(f.debugInfo=g),f):void o.restore()},plugin:function(){var a,b=o.i,d=o.$re(/^@plugin?\s+/);if(d){var f={plugin:!0};if(a=this.entities.quoted()||this.entities.url())return o.$char(";")||(o.i=b,i("missing semi-colon on plugin")),new e.Import(a,null,f,b,c);o.i=b,i("malformed plugin statement")}},directive:function(){var b,d,f,g,h,j,k,l=o.i,n=!0,p=!0;if("@"===o.currentChar()){if(d=this["import"]()||this.plugin()||this.media())return d;if(o.save(),b=o.$re(/^@[a-z-]+/)){switch(g=b,"-"==b.charAt(1)&&b.indexOf("-",2)>0&&(g="@"+b.slice(b.indexOf("-",2)+1)),g){case"@charset":h=!0,n=!1;break;case"@namespace":j=!0,n=!1;break;case"@keyframes":case"@counter-style":h=!0;break;case"@document":case"@supports":k=!0,p=!1;break;default:k=!0}return o.commentStore.length=0,h?(d=this.entity(),d||i("expected "+b+" identifier")):j?(d=this.expression(),d||i("expected "+b+" expression")):k&&(d=(o.$re(/^[^{;]+/)||"").trim(),n="{"==o.currentChar(),d&&(d=new e.Anonymous(d))),n&&(f=this.blockRuleset()),f||!n&&d&&o.$char(";")?(o.forget(),new e.Directive(b,d,f,l,c,a.dumpLineNumbers?m(l):null,p)):void o.restore("directive options not recognised")}}},value:function(){var a,b=[];do if(a=this.expression(),a&&(b.push(a),!o.$char(",")))break;while(a);if(b.length>0)return new e.Value(b)},important:function(){if("!"===o.currentChar())return o.$re(/^! *important/)},sub:function(){var a,b;return o.save(),o.$char("(")?(a=this.addition(),a&&o.$char(")")?(o.forget(),b=new e.Expression([a]),b.parens=!0,b):void o.restore("Expected ')'")):void o.restore()},multiplication:function(){var a,b,c,d,f;if(a=this.operand()){for(f=o.isWhitespace(-1);;){if(o.peek(/^\/[*\/]/))break;if(o.save(),c=o.$char("/")||o.$char("*"),!c){o.forget();break}if(b=this.operand(),!b){o.restore();break}o.forget(),a.parensInOp=!0,b.parensInOp=!0,d=new e.Operation(c,[d||a,b],f),f=o.isWhitespace(-1)}return d||a}},addition:function(){var a,b,c,d,f;if(a=this.multiplication()){for(f=o.isWhitespace(-1);;){if(c=o.$re(/^[-+]\s+/)||!f&&(o.$char("+")||o.$char("-")),!c)break;if(b=this.multiplication(),!b)break;a.parensInOp=!0,b.parensInOp=!0,d=new e.Operation(c,[d||a,b],f),f=o.isWhitespace(-1)}return d||a}},conditions:function(){var a,b,c,d=o.i;if(a=this.condition()){for(;;){if(!o.peek(/^,\s*(not\s*)?\(/)||!o.$char(","))break;if(b=this.condition(),!b)break;c=new e.Condition("or",c||a,b,d)}return c||a}},condition:function(){function a(){return o.$str("or")}var b,c,d;if(b=this.conditionAnd(this)){if(c=a()){if(d=this.condition(),!d)return;b=new e.Condition(c,b,d)}return b}},conditionAnd:function(){function a(a){return a.negatedCondition()||a.parenthesisCondition()}function b(){return o.$str("and")}var c,d,f;if(c=a(this)){if(d=b()){if(f=this.conditionAnd(),!f)return;c=new e.Condition(d,c,f)}return c}},negatedCondition:function(){if(o.$str("not")){var a=this.parenthesisCondition();return a&&(a.negate=!a.negate),a}},parenthesisCondition:function(){function a(a){var b;return o.save(),(b=a.condition())&&o.$char(")")?(o.forget(),b):void o.restore()}var b;return o.save(),o.$str("(")?(b=a(this))?(o.forget(),b):(b=this.atomicCondition())?o.$char(")")?(o.forget(),b):void o.restore("expected ')' got '"+o.currentChar()+"'"):void o.restore():void o.restore()},atomicCondition:function(){var a,b,c,d,f=this.entities,g=o.i;if(a=this.addition()||f.keyword()||f.quoted())return o.$char(">")?d=o.$char("=")?">=":">":o.$char("<")?d=o.$char("=")?"<=":"<":o.$char("=")&&(d=o.$char(">")?"=>":o.$char("<")?"=<":"="),d?(b=this.addition()||f.keyword()||f.quoted(),b?c=new e.Condition(d,a,b,g,(!1)):i("expected expression")):c=new e.Condition("=",a,new e.Keyword("true"),g,(!1)),c},operand:function(){var a,b=this.entities;o.peek(/^-[@\(]/)&&(a=o.$char("-"));var c=this.sub()||b.dimension()||b.color()||b.variable()||b.call()||b.colorKeyword();return a&&(c.parensInOp=!0,c=new e.Negative(c)),c},expression:function(){var a,b,c=[];do a=this.comment(),a?c.push(a):(a=this.addition()||this.entity(),a&&(c.push(a),o.peek(/^\/[\/*]/)||(b=o.$char("/"),b&&c.push(new e.Anonymous(b)))));while(a);if(c.length>0)return new e.Expression(c)},property:function(){var a=o.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);if(a)return a[1]},ruleProperty:function(){function a(a){var b=o.i,c=o.$re(a);if(c)return g.push(b),f.push(c[1])}var b,d,f=[],g=[];o.save();var h=o.$re(/^([_a-zA-Z0-9-]+)\s*:/);if(h)return f=[new e.Keyword(h[1])],o.forget(),f;for(a(/^(\*?)/);;)if(!a(/^((?:[\w-]+)|(?:@\{[\w-]+\}))/))break;if(f.length>1&&a(/^((?:\+_|\+)?)\s*:/)){for(o.forget(),""===f[0]&&(f.shift(),g.shift()),d=0;d=b);c++);this.preProcessors.splice(c,0,{preProcessor:a,priority:b})},d.prototype.addPostProcessor=function(a,b){var c;for(c=0;c=b);c++);this.postProcessors.splice(c,0,{postProcessor:a,priority:b})},d.prototype.addFileManager=function(a){this.fileManagers.push(a)},d.prototype.getPreProcessors=function(){for(var a=[],b=0;b0){var d,e=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?d=this.sourceMapURL:this._sourceMapFilename&&(d=this._sourceMapFilename),this.sourceMapURL=d,this.sourceMap=e}return this._css.join("")},b}},{}],44:[function(a,b,c){var d=a("./contexts"),e=a("./visitors"),f=a("./tree");b.exports=function(a,b){b=b||{};var c,g=b.variables,h=new d.Eval(b);"object"!=typeof g||Array.isArray(g)||(g=Object.keys(g).map(function(a){var b=g[a];return b instanceof f.Value||(b instanceof f.Expression||(b=new f.Expression([b])),b=new f.Value([b])),new f.Rule("@"+a,b,(!1),null,0)}),h.frames=[new f.Ruleset(null,g)]);var i,j=[],k=[new e.JoinSelectorVisitor,new e.MarkVisibleSelectorsVisitor((!0)),new e.ExtendVisitor,new e.ToCSSVisitor({compress:Boolean(b.compress)})];if(b.pluginManager){var l=b.pluginManager.getVisitors();for(i=0;i.5?j/(2-g-h):j/(g+h),g){case c:a=(d-e)/j+(d="===a||"=<"===a||"<="===a;case 1:return">"===a||">="===a;default:return!1}}}(this.op,this.lvalue.eval(a),this.rvalue.eval(a));return this.negate?!b:b},b.exports=e},{"./node":70}],54:[function(a,b,c){var d=function(a,b,c){var e="";if(a.dumpLineNumbers&&!a.compress)switch(a.dumpLineNumbers){case"comments":e=d.asComment(b);break;case"mediaquery":e=d.asMediaQuery(b);break;case"all":e=d.asComment(b)+(c||"")+d.asMediaQuery(b)}return e};d.asComment=function(a){return"/* line "+a.debugInfo.lineNumber+", "+a.debugInfo.fileName+" */\n"},d.asMediaQuery=function(a){var b=a.debugInfo.fileName;return/^[a-z]+:\/\//i.test(b)||(b="file://"+b),"@media -sass-debug-info{filename{font-family:"+b.replace(/([.:\/\\])/g,function(a){return"\\"==a&&(a="/"),"\\"+a})+"}line{font-family:\\00003"+a.debugInfo.lineNumber+"}}\n"},b.exports=d},{}],55:[function(a,b,c){var d=a("./node"),e=a("../contexts"),f=function(a,b){this.ruleset=a,this.frames=b};f.prototype=new d,f.prototype.type="DetachedRuleset",f.prototype.evalFirst=!0,f.prototype.accept=function(a){this.ruleset=a.visit(this.ruleset)},f.prototype.eval=function(a){var b=this.frames||a.frames.slice(0);return new f(this.ruleset,b)},f.prototype.callEval=function(a){return this.ruleset.eval(this.frames?new e.Eval(a,this.frames.concat(a.frames)):a)},b.exports=f},{"../contexts":11,"./node":70}],56:[function(a,b,c){var d=a("./node"),e=a("../data/unit-conversions"),f=a("./unit"),g=a("./color"),h=function(a,b){this.value=parseFloat(a),this.unit=b&&b instanceof f?b:new f(b?[b]:void 0)};h.prototype=new d,h.prototype.type="Dimension",h.prototype.accept=function(a){this.unit=a.visit(this.unit)},h.prototype.eval=function(a){return this},h.prototype.toColor=function(){return new g([this.value,this.value,this.value])},h.prototype.genCSS=function(a,b){if(a&&a.strictUnits&&!this.unit.isSingular())throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "+this.unit.toString());var c=this.fround(a,this.value),d=String(c);if(0!==c&&c<1e-6&&c>-1e-6&&(d=c.toFixed(20).replace(/0+$/,"")),a&&a.compress){if(0===c&&this.unit.isLength())return void b.add(d);c>0&&c<1&&(d=d.substr(1))}b.add(d),this.unit.genCSS(a,b)},h.prototype.operate=function(a,b,c){var d=this._operate(a,b,this.value,c.value),e=this.unit.clone();if("+"===b||"-"===b)if(0===e.numerator.length&&0===e.denominator.length)e=c.unit.clone(),this.unit.backupUnit&&(e.backupUnit=this.unit.backupUnit);else if(0===c.unit.numerator.length&&0===e.denominator.length);else{if(c=c.convertTo(this.unit.usedUnits()),a.strictUnits&&c.unit.toString()!==e.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+e.toString()+"' and '"+c.unit.toString()+"'.");d=this._operate(a,b,this.value,c.value)}else"*"===b?(e.numerator=e.numerator.concat(c.unit.numerator).sort(),e.denominator=e.denominator.concat(c.unit.denominator).sort(),e.cancel()):"/"===b&&(e.numerator=e.numerator.concat(c.unit.denominator).sort(),e.denominator=e.denominator.concat(c.unit.numerator).sort(),e.cancel());return new h(d,e)},h.prototype.compare=function(a){var b,c;if(a instanceof h){if(this.unit.isEmpty()||a.unit.isEmpty())b=this,c=a;else if(b=this.unify(),c=a.unify(),0!==b.unit.compare(c.unit))return;return d.numericCompare(b.value,c.value)}},h.prototype.unify=function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},h.prototype.convertTo=function(a){var b,c,d,f,g,i=this.value,j=this.unit.clone(),k={};if("string"==typeof a){for(b in e)e[b].hasOwnProperty(a)&&(k={},k[b]=a);a=k}g=function(a,b){return d.hasOwnProperty(a)?(b?i/=d[a]/d[f]:i*=d[a]/d[f],f):a};for(c in a)a.hasOwnProperty(c)&&(f=a[c],d=e[c],j.map(g));return j.cancel(),new h(i,j)},b.exports=h},{"../data/unit-conversions":14,"./color":50,"./node":70,"./unit":79}],57:[function(a,b,c){var d=a("./node"),e=a("./selector"),f=a("./ruleset"),g=function(a,b,c,d,f,g,h,i){var j;if(this.name=a,this.value=b,c)for(Array.isArray(c)?this.rules=c:(this.rules=[c],this.rules[0].selectors=new e([],null,null,this.index,f).createEmptySelectors()),j=0;j1?b=new g(this.value.map(function(b){return b.eval(a)})):1===this.value.length?(this.value[0].parens&&!this.value[0].parensInOp&&(d=!0),b=this.value[0].eval(a)):b=this,c&&a.outOfParenthesis(),this.parens&&this.parensInOp&&!a.isMathOn()&&!d&&(b=new e(b)),b},g.prototype.genCSS=function(a,b){for(var c=0;c0&&c.length&&""===c[0].combinator.value&&(c[0].combinator.value=" "),d=d.concat(a[b].elements);this.selfSelectors=[new e(d)],this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo())},b.exports=f},{"./node":70,"./selector":77}],61:[function(a,b,c){var d=a("./node"),e=a("./media"),f=a("./url"),g=a("./quoted"),h=a("./ruleset"),i=a("./anonymous"),j=function(a,b,c,d,e,f){if(this.options=c,this.index=d,this.path=a,this.features=b,this.currentFileInfo=e,this.allowRoot=!0,void 0!==this.options.less||this.options.inline)this.css=!this.options.less||this.options.inline;else{var g=this.getPath();g&&/[#\.\&\?\/]css([\?;].*)?$/.test(g)&&(this.css=!0)}this.copyVisibilityInfo(f)};j.prototype=new d,j.prototype.type="Import",j.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.path=a.visit(this.path),this.options.plugin||this.options.inline||!this.root||(this.root=a.visit(this.root))},j.prototype.genCSS=function(a,b){this.css&&void 0===this.path.currentFileInfo.reference&&(b.add("@import ",this.currentFileInfo,this.index),this.path.genCSS(a,b),this.features&&(b.add(" "),this.features.genCSS(a,b)),b.add(";"))},j.prototype.getPath=function(){return this.path instanceof f?this.path.value.value:this.path.value},j.prototype.isVariableImport=function(){var a=this.path;return a instanceof f&&(a=a.value),!(a instanceof g)||a.containsVariables()},j.prototype.evalForImport=function(a){var b=this.path;return b instanceof f&&(b=b.value),new j(b.eval(a),this.features,this.options,this.index,this.currentFileInfo,this.visibilityInfo())},j.prototype.evalPath=function(a){var b=this.path.eval(a),c=this.currentFileInfo&&this.currentFileInfo.rootpath;if(!(b instanceof f)){if(c){var d=b.value;d&&a.isPathRelative(d)&&(b.value=c+d)}b.value=a.normalizePath(b.value)}return b},j.prototype.eval=function(a){var b=this.doEval(a);return(this.options.reference||this.blocksVisibility())&&(b.length||0===b.length?b.forEach(function(a){a.addVisibilityBlock()}):b.addVisibilityBlock()),b},j.prototype.doEval=function(a){var b,c,d=this.features&&this.features.eval(a);if(this.options.plugin)return c=a.frames[0]&&a.frames[0].functionRegistry,c&&this.root&&this.root.functions&&c.addMultiple(this.root.functions),[];if(this.skip&&("function"==typeof this.skip&&(this.skip=this.skip()),this.skip))return[];if(this.options.inline){var f=new i(this.root,0,{filename:this.importedFilename,reference:this.path.currentFileInfo&&this.path.currentFileInfo.reference},(!0),(!0));return this.features?new e([f],this.features.value):[f]}if(this.css){var g=new j(this.evalPath(a),d,this.options,this.index);if(!g.css&&this.error)throw this.error;return g}return b=new h(null,this.root.rules.slice(0)),b.evalImports(a),this.features?new e(b.rules,this.features.value):b.rules},b.exports=j},{"./anonymous":46,"./media":66,"./node":70,"./quoted":73,"./ruleset":76,"./url":80}],62:[function(a,b,c){var d={};d.Node=a("./node"),d.Alpha=a("./alpha"),d.Color=a("./color"),d.Directive=a("./directive"),d.DetachedRuleset=a("./detached-ruleset"),d.Operation=a("./operation"),d.Dimension=a("./dimension"),d.Unit=a("./unit"),d.Keyword=a("./keyword"),d.Variable=a("./variable"),d.Ruleset=a("./ruleset"),d.Element=a("./element"),d.Attribute=a("./attribute"),d.Combinator=a("./combinator"),d.Selector=a("./selector"),d.Quoted=a("./quoted"),d.Expression=a("./expression"),d.Rule=a("./rule"),d.Call=a("./call"),d.URL=a("./url"),d.Import=a("./import"),d.mixin={Call:a("./mixin-call"),Definition:a("./mixin-definition")},d.Comment=a("./comment"),d.Anonymous=a("./anonymous"),d.Value=a("./value"),d.JavaScript=a("./javascript"),d.Assignment=a("./assignment"),d.Condition=a("./condition"),d.Paren=a("./paren"),d.Media=a("./media"),d.UnicodeDescriptor=a("./unicode-descriptor"),d.Negative=a("./negative"),d.Extend=a("./extend"),d.RulesetCall=a("./ruleset-call"),b.exports=d},{"./alpha":45,"./anonymous":46,"./assignment":47,"./attribute":48,"./call":49,"./color":50,"./combinator":51,"./comment":52,"./condition":53,"./detached-ruleset":55,"./dimension":56,"./directive":57,"./element":58,"./expression":59,"./extend":60,"./import":61,"./javascript":63,"./keyword":65,"./media":66,"./mixin-call":67,"./mixin-definition":68,"./negative":69,"./node":70,"./operation":71,"./paren":72,"./quoted":73,"./rule":74,"./ruleset":76,"./ruleset-call":75,"./selector":77,"./unicode-descriptor":78,"./unit":79,"./url":80,"./value":81,"./variable":82}],63:[function(a,b,c){var d=a("./js-eval-node"),e=a("./dimension"),f=a("./quoted"),g=a("./anonymous"),h=function(a,b,c,d){this.escaped=b,this.expression=a,this.index=c,this.currentFileInfo=d};h.prototype=new d,h.prototype.type="JavaScript",h.prototype.eval=function(a){var b=this.evaluateJavaScript(this.expression,a);return"number"==typeof b?new e(b):"string"==typeof b?new f('"'+b+'"',b,this.escaped,this.index):new g(Array.isArray(b)?b.join(", "):b)},b.exports=h},{"./anonymous":46,"./dimension":56,"./js-eval-node":64,"./quoted":73}],64:[function(a,b,c){var d=a("./node"),e=a("./variable"),f=function(){};f.prototype=new d,f.prototype.evaluateJavaScript=function(a,b){var c,d=this,f={};if(void 0!==b.javascriptEnabled&&!b.javascriptEnabled)throw{message:"You are using JavaScript, which has been disabled.",filename:this.currentFileInfo.filename,index:this.index};a=a.replace(/@\{([\w-]+)\}/g,function(a,c){return d.jsify(new e("@"+c,d.index,d.currentFileInfo).eval(b))});try{a=new Function("return ("+a+")")}catch(g){throw{message:"JavaScript evaluation error: "+g.message+" from `"+a+"`",filename:this.currentFileInfo.filename,index:this.index}}var h=b.frames[0].variables();for(var i in h)h.hasOwnProperty(i)&&(f[i.slice(1)]={value:h[i].value,toJS:function(){return this.value.eval(b).toCSS()}});try{c=a.call(f)}catch(g){throw{message:"JavaScript evaluation error: '"+g.name+": "+g.message.replace(/["]/g,"'")+"'",filename:this.currentFileInfo.filename,index:this.index}}return c},f.prototype.jsify=function(a){return Array.isArray(a.value)&&a.value.length>1?"["+a.value.map(function(a){return a.toCSS()}).join(", ")+"]":a.toCSS()},b.exports=f},{"./node":70,"./variable":82}],65:[function(a,b,c){var d=a("./node"),e=function(a){this.value=a};e.prototype=new d,e.prototype.type="Keyword",e.prototype.genCSS=function(a,b){if("%"===this.value)throw{type:"Syntax",message:"Invalid % without number"};b.add(this.value)},e.True=new e("true"),e.False=new e("false"),b.exports=e},{"./node":70}],66:[function(a,b,c){var d=a("./ruleset"),e=a("./value"),f=a("./selector"),g=a("./anonymous"),h=a("./expression"),i=a("./directive"),j=function(a,b,c,g,h){this.index=c,this.currentFileInfo=g;var i=new f([],null,null,this.index,this.currentFileInfo).createEmptySelectors();this.features=new e(b),this.rules=[new d(i,a)],this.rules[0].allowImports=!0,this.copyVisibilityInfo(h),this.allowRoot=!0};j.prototype=new i,j.prototype.type="Media",j.prototype.isRulesetLike=!0,j.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.rules&&(this.rules=a.visitArray(this.rules))},j.prototype.genCSS=function(a,b){b.add("@media ",this.currentFileInfo,this.index),this.features.genCSS(a,b),this.outputRuleset(a,b,this.rules)},j.prototype.eval=function(a){a.mediaBlocks||(a.mediaBlocks=[],a.mediaPath=[]);var b=new j(null,[],this.index,this.currentFileInfo,this.visibilityInfo());this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,b.debugInfo=this.debugInfo);var c=!1;a.strictMath||(c=!0,a.strictMath=!0);try{b.features=this.features.eval(a)}finally{c&&(a.strictMath=!1)}return a.mediaPath.push(b),a.mediaBlocks.push(b),this.rules[0].functionRegistry=a.frames[0].functionRegistry.inherit(),a.frames.unshift(this.rules[0]),b.rules=[this.rules[0].eval(a)],a.frames.shift(),a.mediaPath.pop(),0===a.mediaPath.length?b.evalTop(a):b.evalNested(a)},j.prototype.evalTop=function(a){var b=this;if(a.mediaBlocks.length>1){var c=new f([],null,null,this.index,this.currentFileInfo).createEmptySelectors();b=new d(c,a.mediaBlocks),b.multiMedia=!0,b.copyVisibilityInfo(this.visibilityInfo())}return delete a.mediaBlocks,delete a.mediaPath,b},j.prototype.evalNested=function(a){var b,c,f=a.mediaPath.concat([this]);for(b=0;b0;b--)a.splice(b,0,new g("and"));return new h(a)})),new d([],[])},j.prototype.permute=function(a){if(0===a.length)return[];if(1===a.length)return a[0];for(var b=[],c=this.permute(a.slice(1)),d=0;d0){for(n=!0,k=0;k0)p=B;else if(p=A,q[A]+q[B]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(t)+"`",index:this.index,filename:this.currentFileInfo.filename};for(k=0;kthis.params.length)return!1}c=Math.min(f,this.arity);for(var g=0;gb?1:void 0},d.prototype.blocksVisibility=function(){return null==this.visibilityBlocks&&(this.visibilityBlocks=0),0!==this.visibilityBlocks},d.prototype.addVisibilityBlock=function(){null==this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks+1},d.prototype.removeVisibilityBlock=function(){null==this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks-1},d.prototype.ensureVisibility=function(){this.nodeVisible=!0},d.prototype.ensureInvisibility=function(){this.nodeVisible=!1},d.prototype.isVisible=function(){return this.nodeVisible},d.prototype.visibilityInfo=function(){return{visibilityBlocks:this.visibilityBlocks,nodeVisible:this.nodeVisible}},d.prototype.copyVisibilityInfo=function(a){a&&(this.visibilityBlocks=a.visibilityBlocks,this.nodeVisible=a.nodeVisible)},b.exports=d},{}],71:[function(a,b,c){var d=a("./node"),e=a("./color"),f=a("./dimension"),g=function(a,b,c){this.op=a.trim(),this.operands=b,this.isSpaced=c};g.prototype=new d,g.prototype.type="Operation",g.prototype.accept=function(a){this.operands=a.visit(this.operands)},g.prototype.eval=function(a){var b=this.operands[0].eval(a),c=this.operands[1].eval(a);if(a.isMathOn()){if(b instanceof f&&c instanceof e&&(b=b.toColor()),c instanceof f&&b instanceof e&&(c=c.toColor()),!b.operate)throw{type:"Operation",message:"Operation on an invalid type"};return b.operate(a,this.op,c)}return new g(this.op,[b,c],this.isSpaced)},g.prototype.genCSS=function(a,b){this.operands[0].genCSS(a,b),this.isSpaced&&b.add(" "),b.add(this.op),this.isSpaced&&b.add(" "),this.operands[1].genCSS(a,b)},b.exports=g},{"./color":50,"./dimension":56,"./node":70}],72:[function(a,b,c){var d=a("./node"),e=function(a){this.value=a};e.prototype=new d,e.prototype.type="Paren",e.prototype.genCSS=function(a,b){b.add("("),this.value.genCSS(a,b),b.add(")")},e.prototype.eval=function(a){return new e(this.value.eval(a))},b.exports=e},{"./node":70}],73:[function(a,b,c){var d=a("./node"),e=a("./js-eval-node"),f=a("./variable"),g=function(a,b,c,d,e){this.escaped=null==c||c,this.value=b||"",this.quote=a.charAt(0),this.index=d,this.currentFileInfo=e};g.prototype=new e,g.prototype.type="Quoted",g.prototype.genCSS=function(a,b){this.escaped||b.add(this.quote,this.currentFileInfo,this.index),b.add(this.value),this.escaped||b.add(this.quote)},g.prototype.containsVariables=function(){return this.value.match(/(`([^`]+)`)|@\{([\w-]+)\}/)},g.prototype.eval=function(a){function b(a,b,c){var d=a;do a=d,d=a.replace(b,c);while(a!==d);return d}var c=this,d=this.value,e=function(b,d){return String(c.evaluateJavaScript(d,a))},h=function(b,d){var e=new f("@"+d,c.index,c.currentFileInfo).eval(a,!0);return e instanceof g?e.value:e.toCSS()};return d=b(d,/`([^`]+)`/g,e),d=b(d,/@\{([\w-]+)\}/g,h),new g(this.quote+d+this.quote,d,this.escaped,this.index,this.currentFileInfo)},g.prototype.compare=function(a){return"Quoted"!==a.type||this.escaped||a.escaped?a.toCSS&&this.toCSS()===a.toCSS()?0:void 0:d.numericCompare(this.value,a.value)},b.exports=g},{"./js-eval-node":64,"./node":70,"./variable":82}],74:[function(a,b,c){function d(a,b){var c,d="",e=b.length,f={add:function(a){d+=a}};for(c=0;cd){if(!c||c(h)){e=h.find(new f(a.elements.slice(d)),b,c);for(var j=0;j0&&b.add(k),a.firstSelector=!0,h[0].genCSS(a,b),a.firstSelector=!1,e=1;e0?(e=a.slice(0),f=e.pop(),h=d.createDerived(f.elements.slice(0))):h=d.createDerived([]),b.length>0){var i=c.combinator,j=b[0].elements[0];i.emptyOrWhitespace&&!j.combinator.emptyOrWhitespace&&(i=j.combinator),h.elements.push(new g(i,j.value,c.index,c.currentFileInfo)),h.elements=h.elements.concat(b[0].elements.slice(1))}if(0!==h.elements.length&&e.push(h),b.length>1){var k=b.slice(1);k=k.map(function(a){return a.createDerived(a.elements,[])}),e=e.concat(k)}return e}function j(a,b,c,d,e){var f;for(f=0;f0?d[d.length-1]=d[d.length-1].createDerived(d[d.length-1].elements.concat(a)):d.push(new f(a))}}function l(a,b,c){function f(a){var b;return"Paren"!==a.value.type?null:(b=a.value.value,"Selector"!==b.type?null:b)}var h,m,n,o,p,q,r,s,t,u,v=!1;for(o=[],p=[[]],h=0;h0&&r[0].elements.push(new g(s.combinator,"",s.index,s.currentFileInfo)),q.push(r);else for(n=0;n0&&(a.push(p[h]),u=p[h][t-1],p[h][t-1]=u.createDerived(u.elements,c.extendList));return v}function m(a,b){var c=b.createDerived(b.elements,b.extendList,b.evaldCondition);return c.copyVisibilityInfo(a),c}var n,o,p;if(o=[],p=l(o,b,c),!p)if(b.length>0)for(o=[],n=0;n0)for(b=0;b=0&&"\n"!==b.charAt(c);)e++;return"number"==typeof a&&(d=(b.slice(0,a).match(/\n/g)||"").length),{line:d,column:e}}}},{}],84:[function(a,b,c){var d=a("../tree"),e=a("./visitor"),f=a("../logger"),g=function(){this._visitor=new e(this),this.contexts=[],this.allExtendsStack=[[]]};g.prototype={run:function(a){return a=this._visitor.visit(a),a.allExtends=this.allExtendsStack[0],a},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitRuleset:function(a,b){if(!a.root){var c,e,f,g,h=[],i=a.rules,j=i?i.length:0;for(c=0;c=0||(i=[k.selfSelectors[0]],g=n.findMatch(j,i),g.length&&(j.hasFoundMatches=!0,j.selfSelectors.forEach(function(a){var b=k.visibilityInfo();h=n.extendSelector(g,i,a,j.isVisible()),l=new d.Extend(k.selector,k.option,0,k.currentFileInfo,b),l.selfSelectors=h,h[h.length-1].extendList=[l],m.push(l),l.ruleset=k.ruleset,l.parent_ids=l.parent_ids.concat(k.parent_ids,j.parent_ids),k.firstExtendOnThisSelectorPath&&(l.firstExtendOnThisSelectorPath=!0,k.ruleset.paths.push(h))})));if(m.length){if(this.extendChainCount++,c>100){var o="{unable to calculate}",p="{unable to calculate}";try{o=m[0].selfSelectors[0].toCSS(),p=m[0].selector.toCSS()}catch(q){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+o+":extend("+p+")"}}return m.concat(n.doExtendChaining(m,b,c+1))}return m},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitSelector:function(a,b){b.visitDeeper=!1},visitRuleset:function(a,b){if(!a.root){var c,d,e,f,g=this.allExtendsStack[this.allExtendsStack.length-1],h=[],i=this;for(e=0;e0&&k[i.matched].combinator.value!==g?i=null:i.matched++,i&&(i.finished=i.matched===k.length,i.finished&&!a.allowAfter&&(e+1k&&l>0&&(m[m.length-1].elements=m[m.length-1].elements.concat(b[k].elements.slice(l)),l=0,k++),j=g.elements.slice(l,i.index).concat([h]).concat(c.elements.slice(1)),k===i.pathIndex&&f>0?m[m.length-1].elements=m[m.length-1].elements.concat(j):(m=m.concat(b.slice(k,i.pathIndex)),m.push(new d.Selector(j))),k=i.endPathIndex,l=i.endPathElementIndex,l>=b[k].elements.length&&(l=0,k++);return k0&&(m[m.length-1].elements=m[m.length-1].elements.concat(b[k].elements.slice(l)),k++),m=m.concat(b.slice(k,b.length)),m=m.map(function(a){var b=a.createDerived(a.elements);return e?b.ensureVisibility():b.ensureInvisibility(),b})},visitMedia:function(a,b){var c=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);c=c.concat(this.doExtendChaining(c,a.allExtends)),this.allExtendsStack.push(c)},visitMediaOut:function(a){var b=this.allExtendsStack.length-1;this.allExtendsStack.length=b},visitDirective:function(a,b){var c=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);c=c.concat(this.doExtendChaining(c,a.allExtends)),this.allExtendsStack.push(c)},visitDirectiveOut:function(a){var b=this.allExtendsStack.length-1;this.allExtendsStack.length=b}},b.exports=h},{"../logger":33,"../tree":62,"./visitor":91}],85:[function(a,b,c){function d(a){this.imports=[],this.variableImports=[],this._onSequencerEmpty=a,this._currentDepth=0}d.prototype.addImport=function(a){var b=this,c={callback:a,args:null,isReady:!1};return this.imports.push(c),function(){c.args=Array.prototype.slice.call(arguments,0),c.isReady=!0,b.tryRun()}},d.prototype.addVariableImport=function(a){this.variableImports.push(a)},d.prototype.tryRun=function(){this._currentDepth++;try{for(;;){for(;this.imports.length>0;){var a=this.imports[0];if(!a.isReady)return; +this.imports=this.imports.slice(1),a.callback.apply(null,a.args)}if(0===this.variableImports.length)break;var b=this.variableImports[0];this.variableImports=this.variableImports.slice(1),b()}}finally{this._currentDepth--}0===this._currentDepth&&this._onSequencerEmpty&&this._onSequencerEmpty()},b.exports=d},{}],86:[function(a,b,c){var d=a("../contexts"),e=a("./visitor"),f=a("./import-sequencer"),g=function(a,b){this._visitor=new e(this),this._importer=a,this._finish=b,this.context=new d.Eval,this.importCount=0,this.onceFileDetectionMap={},this.recursionDetector={},this._sequencer=new f(this._onSequencerEmpty.bind(this))};g.prototype={isReplacing:!1,run:function(a){try{this._visitor.visit(a)}catch(b){this.error=b}this.isFinished=!0,this._sequencer.tryRun()},_onSequencerEmpty:function(){this.isFinished&&this._finish(this.error)},visitImport:function(a,b){var c=a.options.inline;if(!a.css||c){var e=new d.Eval(this.context,this.context.frames.slice(0)),f=e.frames[0];this.importCount++,a.isVariableImport()?this._sequencer.addVariableImport(this.processImportNode.bind(this,a,e,f)):this.processImportNode(a,e,f)}b.visitDeeper=!1},processImportNode:function(a,b,c){var d,e=a.options.inline;try{d=a.evalForImport(b)}catch(f){f.filename||(f.index=a.index,f.filename=a.currentFileInfo.filename),a.css=!0,a.error=f}if(!d||d.css&&!e)this.importCount--,this.isFinished&&this._sequencer.tryRun();else{d.options.multiple&&(b.importMultiple=!0);for(var g=void 0===d.css,h=0;h0},resolveVisibility:function(a,b){if(!a.blocksVisibility()){if(this.isEmpty(a)&&!this.containsSilentNonBlockedChild(b))return;return a}var c=a.rules[0];if(this.keepOnlyVisibleChilds(c),!this.isEmpty(c))return a.ensureVisibility(),a.removeVisibilityBlock(),a},isVisibleRuleset:function(a){return!!a.firstRoot||!this.isEmpty(a)&&!(!a.root&&!this.hasVisibleSelector(a))}};var g=function(a){this._visitor=new e(this),this._context=a,this.utils=new f(a)};g.prototype={isReplacing:!0,run:function(a){return this._visitor.visit(a)},visitRule:function(a,b){if(!a.blocksVisibility()&&!a.variable)return a},visitMixinDefinition:function(a,b){a.frames=[]},visitExtend:function(a,b){},visitComment:function(a,b){if(!a.blocksVisibility()&&!a.isSilent(this._context))return a},visitMedia:function(a,b){var c=a.rules[0].rules;return a.accept(this._visitor),b.visitDeeper=!1,this.utils.resolveVisibility(a,c)},visitImport:function(a,b){if(!a.blocksVisibility())return a},visitDirective:function(a,b){return a.rules&&a.rules.length?this.visitDirectiveWithBody(a,b):this.visitDirectiveWithoutBody(a,b)},visitDirectiveWithBody:function(a,b){function c(a){var b=a.rules;return 1===b.length&&(!b[0].paths||0===b[0].paths.length)}function d(a){var b=a.rules;return c(a)?b[0].rules:b}var e=d(a);return a.accept(this._visitor),b.visitDeeper=!1,this.utils.isEmpty(a)||this._mergeRules(a.rules[0].rules),this.utils.resolveVisibility(a,e)},visitDirectiveWithoutBody:function(a,b){if(!a.blocksVisibility()){if("@charset"===a.name){if(this.charset){if(a.debugInfo){var c=new d.Comment("/* "+a.toCSS(this._context).replace(/\n/g,"")+" */\n");return c.debugInfo=a.debugInfo,this._visitor.visit(c)}return}this.charset=!0}return a}},checkValidNodes:function(a,b){if(a)for(var c=0;c0?a.accept(this._visitor):a.rules=null,b.visitDeeper=!1}return a.rules&&(this._mergeRules(a.rules),this._removeDuplicateRules(a.rules)),this.utils.isVisibleRuleset(a)&&(a.ensureVisibility(),d.splice(0,0,a)),1===d.length?d[0]:d},_compileRulesetPaths:function(a){a.paths&&(a.paths=a.paths.filter(function(a){var b;for(" "===a[0].elements[0].combinator.value&&(a[0].elements[0].combinator=new d.Combinator("")),b=0;b=0;e--)if(c=a[e],c instanceof d.Rule)if(f[c.name]){b=f[c.name],b instanceof d.Rule&&(b=f[c.name]=[f[c.name].toCSS(this._context)]);var g=c.toCSS(this._context);b.indexOf(g)!==-1?a.splice(e,1):b.push(g)}else f[c.name]=c}},_mergeRules:function(a){if(a){for(var b,c,e,f={},g=0;g1){c=b[0];var h=[],i=[];b.map(function(a){"+"===a.merge&&(i.length>0&&h.push(e(i)),i=[]),i.push(a)}),h.push(e(i)),c.value=g(h)}})}},visitAnonymous:function(a,b){if(!a.blocksVisibility())return a.accept(this._visitor),a}},b.exports=g},{"../tree":62,"./visitor":91}],91:[function(a,b,c){function d(a){return a}function e(a,b){var c,d;for(c in a)if(a.hasOwnProperty(c))switch(d=a[c],typeof d){case"function":d.prototype&&d.prototype.type&&(d.prototype.typeIndex=b++);break;case"object":b=e(d,b)}return b}var f=a("../tree"),g={visitDeeper:!0},h=!1,i=function(a){this._implementation=a,this._visitFnCache=[],h||(e(f,1),h=!0)};i.prototype={visit:function(a){if(!a)return a;var b=a.typeIndex;if(!b)return a;var c,e=this._visitFnCache,f=this._implementation,h=b<<1,i=1|h,j=e[h],k=e[i],l=g;if(l.visitDeeper=!0,j||(c="visit"+a.type,j=f[c]||d,k=f[c+"Out"]||d,e[h]=j,e[i]=k),j!==d){var m=j.call(f,a,l);f.isReplacing&&(a=m)}return l.visitDeeper&&a&&a.accept&&a.accept(this),k!=d&&k.call(f,a),a},visitArray:function(a,b){if(!a)return a;var c,d=a.length;if(b||!this._implementation.isReplacing){for(c=0;ck){for(var b=0,c=h.length-j;b=7.1", - "ext-pgsql": "*", - "adodb/adodb-php": "^5.20", - "slim/flash": "^0.4.0", - "slim/slim": "^3.6", - "slim/twig-view": "~2.5.1", - "symfony/yaml": "^5.0", - "twig/twig": "~1.42.4" - }, - "require-dev": { - "codeception/codeception": "*", - "codeception/module-asserts": "^1.1", - "ergebnis/composer-normalize": "^2.2", - "ergebnis/php-cs-fixer-config": "^2.0", - "filp/whoops": "^2.7", - "friendsofphp/php-cs-fixer": "^2.16", - "kint-php/kint": "~3.3", - "ocramius/package-versions": "~1.4.0", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan": "^0.12.14", - "simpletest/simpletest": "^1.1", - "vimeo/psalm": "~3.9.3" - }, - "extra": { - "version": "6.0.0" - }, - "autoload": { - "psr-4": { - "PHPPgAdmin\\": "src/classes", - "PHPPgAdmin\\Controller\\": "src/controllers", - "PHPPgAdmin\\Middleware\\": "src/middleware", - "PHPPgAdmin\\Database\\": "src/database", - "PHPPgAdmin\\XHtml\\": "src/xhtml", - "PHPPgAdmin\\Decorators\\": "src/decorators", - "PHPPgAdmin\\Traits\\": "src/traits", - "PHPPgAdmin\\Database\\Traits\\": "src/database/databasetraits", - "PHPPgAdmin\\Help\\": "src/help", - "PHPPgAdmin\\Translations\\": "src/translations" - }, - "files": [ - "vendor/adodb/adodb-php/drivers/adodb-postgres9.inc.php", -"vendor/adodb/adodb-php/drivers/adodb-pdo.inc.php", -"vendor/adodb/adodb-php/drivers/adodb-pdo_pgsql.inc.php" - ] - }, - "scripts": { - "post-install-cmd": "@clear_twig_cache", - "post-create-project-cmd": "@clear_twig_cache", - "clear_twig_cache": [ - "make fix_permissions", - "php -r \"array_map( 'unlink', array_filter((array) glob('temp/twigcache/**/*.php', GLOB_BRACE)));\"", - "php -r \"array_map( 'rmdir', array_filter((array) glob('temp/twigcache/*', GLOB_BRACE)));\"" - ], - "phpstan": "phpstan analyse src " + "name": "huasofoundries/phppgadmin6", + "type": "project", + "description": "Like phpmyadmin but for postgres", + "license": [ + "MIT", + "GPL-2.0-OR-LATER", + "BSD-3-Clause" + ], + "authors": [ + { + "name": "FFFlabs", + "email": "amenadiel@gmail.com" } + ], + "require": { + "php": ">=7.2", + "ext-json": "*", + "ext-mbstring": "*", + "ext-pgsql": "*", + "ext-xml": "*", + "adodb/adodb-php": "^5.20", + "slim/flash": "^0.4.0", + "slim/slim": "^3.6", + "slim/twig-view": "~2.5.1", + "symfony/yaml": "^5.1", + "twig/twig": "~3" + }, + "require-dev": { + "codeception/codeception": "*", + "codeception/module-asserts": "^1.1", + "ergebnis/composer-normalize": "^2.2", + "ergebnis/php-cs-fixer-config": "^2.0", + "filp/whoops": "^2.7", + "friendsofphp/php-cs-fixer": "^2.16", + "kint-php/kint": "~3.3", + "ocramius/package-versions": "~1.4.0", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan": "^0.12.14", + "rector/rector-prefixed": "^0.8.29", + "staabm/annotate-pull-request-from-checkstyle": "^1.4", + "vimeo/psalm": "~3.9.3" + }, + "extra": { + "version": "6.0.0" + }, + "autoload": { + "psr-4": { + "PHPPgAdmin\\": "src/classes", + "PHPPgAdmin\\Controller\\": "src/controllers", + "PHPPgAdmin\\Middleware\\": "src/middleware", + "PHPPgAdmin\\Database\\": "src/database", + "PHPPgAdmin\\XHtml\\": "src/xhtml", + "PHPPgAdmin\\Decorators\\": "src/decorators", + "PHPPgAdmin\\Traits\\": "src/traits", + "PHPPgAdmin\\Database\\Traits\\": "src/database/databasetraits", + "PHPPgAdmin\\Help\\": "src/help", + "PHPPgAdmin\\Translations\\": "src/translations" + }, + "files": [ + "vendor/adodb/adodb-php/drivers/adodb-postgres9.inc.php", + "vendor/adodb/adodb-php/drivers/adodb-pdo.inc.php", + "vendor/adodb/adodb-php/drivers/adodb-pdo_pgsql.inc.php" + ] + }, + "scripts": { + "post-install-cmd": "@clear_twig_cache", + "post-autoload-dump": "@composer normalize", + "post-create-project-cmd": "@clear_twig_cache", + "clear_twig_cache": [ + "make fix_permissions", + "php -r \"array_map( 'unlink', array_filter((array) glob('temp/twigcache/**/*.php', GLOB_BRACE)));\"", + "php -r \"array_map( 'rmdir', array_filter((array) glob('temp/twigcache/*', GLOB_BRACE)));\"" + ], + "phpstan": "phpstan analyse src " + } } diff --git a/composer.lock b/composer.lock index f2b9b40b..f781e0ca 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fba1ba7f899357b0d4f2c8001a47fa9f", + "content-hash": "7cc086a62801adc7300f58ecdbdc9ad1", "packages": [ { "name": "adodb/adodb-php", - "version": "v5.20.17", + "version": "v5.20.18", "source": { "type": "git", "url": "https://github.com/ADOdb/ADOdb.git", - "reference": "c47e5c272e98a06e1c92248b5d9d1ae0afe71c97" + "reference": "0363eca78eed8bd02d1456072c729da302655241" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ADOdb/ADOdb/zipball/c47e5c272e98a06e1c92248b5d9d1ae0afe71c97", - "reference": "c47e5c272e98a06e1c92248b5d9d1ae0afe71c97", + "url": "https://api.github.com/repos/ADOdb/ADOdb/zipball/0363eca78eed8bd02d1456072c729da302655241", + "reference": "0363eca78eed8bd02d1456072c729da302655241", "shasum": "" }, "require": { @@ -58,7 +58,7 @@ "library", "php" ], - "time": "2020-03-31T17:32:58+00:00" + "time": "2020-06-28T17:52:20+00:00" }, { "name": "nikic/fast-route", @@ -427,18 +427,68 @@ ], "time": "2019-11-28T18:03:50+00:00" }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665", + "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "time": "2020-09-07T11:33:47+00:00" + }, { "name": "symfony/polyfill-ctype", - "version": "v1.17.0", + "version": "v1.18.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9" + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e94c8b1bbe2bc77507a1056cdb06451c75b427f9", - "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", "shasum": "" }, "require": { @@ -450,7 +500,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -483,24 +537,88 @@ "polyfill", "portable" ], - "time": "2020-05-12T16:14:59+00:00" + "time": "2020-07-14T12:35:20+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.18.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/yaml", - "version": "v5.0.8", + "version": "v5.1.7", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "482fb4e710e5af3e0e78015f19aa716ad953392f" + "reference": "e147a68cb66a8b510f4b7481fe4da5b2ab65ec6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/482fb4e710e5af3e0e78015f19aa716ad953392f", - "reference": "482fb4e710e5af3e0e78015f19aa716ad953392f", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e147a68cb66a8b510f4b7481fe4da5b2ab65ec6a", + "reference": "e147a68cb66a8b510f4b7481fe4da5b2ab65ec6a", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-ctype": "~1.8" }, "conflict": { @@ -512,10 +630,13 @@ "suggest": { "symfony/console": "For validating YAML files using the lint command" }, + "bin": [ + "Resources/bin/yaml-lint" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -542,40 +663,52 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2020-04-28T17:58:55+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-27T03:44:28+00:00" }, { "name": "twig/twig", - "version": "v1.42.5", + "version": "v3.0.5", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e" + "reference": "9b76b1535483cdf4edf01bb787b0217b62bd68a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e", - "reference": "87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/9b76b1535483cdf4edf01bb787b0217b62bd68a5", + "reference": "9b76b1535483cdf4edf01bb787b0217b62bd68a5", "shasum": "" }, "require": { - "php": ">=5.5.0", - "symfony/polyfill-ctype": "^1.8" + "php": ">=7.2.5", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { "psr/container": "^1.0", - "symfony/phpunit-bridge": "^4.4|^5.0" + "symfony/phpunit-bridge": "^4.4.9|^5.0.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.42-dev" + "dev-master": "3.0-dev" } }, "autoload": { - "psr-0": { - "Twig_": "lib/" - }, "psr-4": { "Twig\\": "src/" } @@ -606,22 +739,32 @@ "keywords": [ "templating" ], - "time": "2020-02-11T05:59:23+00:00" + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } + ], + "time": "2020-08-05T15:13:19+00:00" } ], "packages-dev": [ { "name": "amphp/amp", - "version": "v2.4.4", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/amphp/amp.git", - "reference": "1e58d53e4af390efc7813e36cd215bd82cba4b06" + "reference": "f220a51458bf4dd0dedebb171ac3457813c72bbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/1e58d53e4af390efc7813e36cd215bd82cba4b06", - "reference": "1e58d53e4af390efc7813e36cd215bd82cba4b06", + "url": "https://api.github.com/repos/amphp/amp/zipball/f220a51458bf4dd0dedebb171ac3457813c72bbc", + "reference": "f220a51458bf4dd0dedebb171ac3457813c72bbc", "shasum": "" }, "require": { @@ -633,8 +776,8 @@ "ext-json": "*", "jetbrains/phpstorm-stubs": "^2019.3", "phpunit/phpunit": "^6.0.9 | ^7", - "react/promise": "^2", - "vimeo/psalm": "^3.11@dev" + "psalm/phar": "^3.11@dev", + "react/promise": "^2" }, "type": "library", "extra": { @@ -686,32 +829,33 @@ "non-blocking", "promise" ], - "time": "2020-04-30T04:54:50+00:00" + "time": "2020-07-14T21:47:18+00:00" }, { "name": "amphp/byte-stream", - "version": "v1.7.3", + "version": "v1.8.0", "source": { "type": "git", "url": "https://github.com/amphp/byte-stream.git", - "reference": "b867505edb79dda8f253ca3c3a2bbadae4b16592" + "reference": "f0c20cf598a958ba2aa8c6e5a71c697d652c7088" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/byte-stream/zipball/b867505edb79dda8f253ca3c3a2bbadae4b16592", - "reference": "b867505edb79dda8f253ca3c3a2bbadae4b16592", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/f0c20cf598a958ba2aa8c6e5a71c697d652c7088", + "reference": "f0c20cf598a958ba2aa8c6e5a71c697d652c7088", "shasum": "" }, "require": { - "amphp/amp": "^2" + "amphp/amp": "^2", + "php": ">=7.1" }, "require-dev": { "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1", + "amphp/phpunit-util": "^1.4", "friendsofphp/php-cs-fixer": "^2.3", "jetbrains/phpstorm-stubs": "^2019.3", "phpunit/phpunit": "^6 || ^7 || ^8", - "vimeo/psalm": "^3.9@dev" + "psalm/phar": "^3.11.4" }, "type": "library", "extra": { @@ -751,7 +895,7 @@ "non-blocking", "stream" ], - "time": "2020-04-04T16:56:54+00:00" + "time": "2020-06-29T18:35:05+00:00" }, { "name": "behat/gherkin", @@ -814,16 +958,16 @@ }, { "name": "codeception/codeception", - "version": "4.1.5", + "version": "4.1.8", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "24f2345329b1059f1208f65581fc632a4a6e5a55" + "reference": "41036e8af66e727c4587012f0366b7f0576a99da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/24f2345329b1059f1208f65581fc632a4a6e5a55", - "reference": "24f2345329b1059f1208f65581fc632a4a6e5a55", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/41036e8af66e727c4587012f0366b7f0576a99da", + "reference": "41036e8af66e727c4587012f0366b7f0576a99da", "shasum": "" }, "require": { @@ -895,24 +1039,31 @@ "functional testing", "unit testing" ], - "time": "2020-05-24T13:58:47+00:00" + "funding": [ + { + "url": "https://opencollective.com/codeception", + "type": "open_collective" + } + ], + "time": "2020-10-11T17:54:58+00:00" }, { "name": "codeception/lib-asserts", - "version": "1.12.0", + "version": "1.13.1", "source": { "type": "git", "url": "https://github.com/Codeception/lib-asserts.git", - "reference": "acd0dc8b394595a74b58dcc889f72569ff7d8e71" + "reference": "263ef0b7eff80643e82f4cf55351eca553a09a10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/lib-asserts/zipball/acd0dc8b394595a74b58dcc889f72569ff7d8e71", - "reference": "acd0dc8b394595a74b58dcc889f72569ff7d8e71", + "url": "https://api.github.com/repos/Codeception/lib-asserts/zipball/263ef0b7eff80643e82f4cf55351eca553a09a10", + "reference": "263ef0b7eff80643e82f4cf55351eca553a09a10", "shasum": "" }, "require": { "codeception/phpunit-wrapper": ">6.0.15 <6.1.0 | ^6.6.1 | ^7.7.1 | ^8.0.3 | ^9.0", + "ext-dom": "*", "php": ">=5.6.0 <8.0" }, "type": "library", @@ -933,32 +1084,36 @@ }, { "name": "Gintautas Miselis" + }, + { + "name": "Gustavo Nieves", + "homepage": "https://medium.com/@ganieves" } ], "description": "Assertion methods used by Codeception core and Asserts module", - "homepage": "http://codeception.com/", + "homepage": "https://codeception.com/", "keywords": [ "codeception" ], - "time": "2020-04-17T18:20:46+00:00" + "time": "2020-08-28T07:49:36+00:00" }, { "name": "codeception/module-asserts", - "version": "1.2.1", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/Codeception/module-asserts.git", - "reference": "79f13d05b63f2fceba4d0e78044bab668c9b2a6b" + "reference": "32e5be519faaeb60ed3692383dcd1b3390ec2667" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-asserts/zipball/79f13d05b63f2fceba4d0e78044bab668c9b2a6b", - "reference": "79f13d05b63f2fceba4d0e78044bab668c9b2a6b", + "url": "https://api.github.com/repos/Codeception/module-asserts/zipball/32e5be519faaeb60ed3692383dcd1b3390ec2667", + "reference": "32e5be519faaeb60ed3692383dcd1b3390ec2667", "shasum": "" }, "require": { "codeception/codeception": "*@dev", - "codeception/lib-asserts": "^1.12.0", + "codeception/lib-asserts": "^1.13.1", "php": ">=5.6.0 <8.0" }, "conflict": { @@ -983,29 +1138,33 @@ }, { "name": "Gintautas Miselis" + }, + { + "name": "Gustavo Nieves", + "homepage": "https://medium.com/@ganieves" } ], "description": "Codeception module containing various assertions", - "homepage": "http://codeception.com/", + "homepage": "https://codeception.com/", "keywords": [ "assertions", "asserts", "codeception" ], - "time": "2020-04-20T07:26:11+00:00" + "time": "2020-08-28T08:06:29+00:00" }, { "name": "codeception/phpunit-wrapper", - "version": "9.0.2", + "version": "9.0.5", "source": { "type": "git", "url": "https://github.com/Codeception/phpunit-wrapper.git", - "reference": "eb27243d8edde68593bf8d9ef5e9074734777931" + "reference": "72bac7770866799e23a7dda1ac6bec2f8baccf45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/eb27243d8edde68593bf8d9ef5e9074734777931", - "reference": "eb27243d8edde68593bf8d9ef5e9074734777931", + "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/72bac7770866799e23a7dda1ac6bec2f8baccf45", + "reference": "72bac7770866799e23a7dda1ac6bec2f8baccf45", "shasum": "" }, "require": { @@ -1036,20 +1195,20 @@ } ], "description": "PHPUnit classes used by Codeception", - "time": "2020-04-17T18:16:31+00:00" + "time": "2020-10-11T18:14:42+00:00" }, { "name": "codeception/stub", - "version": "3.6.1", + "version": "3.7.0", "source": { "type": "git", "url": "https://github.com/Codeception/Stub.git", - "reference": "a3ba01414cbee76a1bced9f9b6b169cc8d203880" + "reference": "468dd5fe659f131fc997f5196aad87512f9b1304" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Stub/zipball/a3ba01414cbee76a1bced9f9b6b169cc8d203880", - "reference": "a3ba01414cbee76a1bced9f9b6b169cc8d203880", + "url": "https://api.github.com/repos/Codeception/Stub/zipball/468dd5fe659f131fc997f5196aad87512f9b1304", + "reference": "468dd5fe659f131fc997f5196aad87512f9b1304", "shasum": "" }, "require": { @@ -1066,20 +1225,20 @@ "MIT" ], "description": "Flexible Stub wrapper for PHPUnit's Mock Builder", - "time": "2020-02-07T18:42:28+00:00" + "time": "2020-07-03T15:54:43+00:00" }, { "name": "composer/semver", - "version": "1.5.1", + "version": "1.7.1", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de" + "reference": "38276325bd896f90dfcfe30029aa5db40df387a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c6bea70230ef4dd483e6bbcab6005f682ed3a8de", - "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de", + "url": "https://api.github.com/repos/composer/semver/zipball/38276325bd896f90dfcfe30029aa5db40df387a7", + "reference": "38276325bd896f90dfcfe30029aa5db40df387a7", "shasum": "" }, "require": { @@ -1127,20 +1286,20 @@ "validation", "versioning" ], - "time": "2020-01-13T12:06:48+00:00" + "time": "2020-09-27T13:13:07+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.4.1", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7" + "reference": "ebd27a9866ae8254e873866f795491f02418c5a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/1ab9842d69e64fb3a01be6b656501032d1b78cb7", - "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ebd27a9866ae8254e873866f795491f02418c5a5", + "reference": "ebd27a9866ae8254e873866f795491f02418c5a5", "shasum": "" }, "require": { @@ -1171,30 +1330,31 @@ "Xdebug", "performance" ], - "time": "2020-03-01T12:26:26+00:00" + "time": "2020-08-19T10:27:58+00:00" }, { "name": "doctrine/annotations", - "version": "1.10.2", + "version": "1.10.4", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "b9d758e831c70751155c698c2f7df4665314a1cb" + "reference": "bfe91e31984e2ba76df1c1339681770401ec262f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/b9d758e831c70751155c698c2f7df4665314a1cb", - "reference": "b9d758e831c70751155c698c2f7df4665314a1cb", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/bfe91e31984e2ba76df1c1339681770401ec262f", + "reference": "bfe91e31984e2ba76df1c1339681770401ec262f", "shasum": "" }, "require": { "doctrine/lexer": "1.*", "ext-tokenizer": "*", - "php": "^7.1" + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "^7.5" + "phpstan/phpstan": "^0.12.20", + "phpunit/phpunit": "^7.5 || ^9.1.5" }, "type": "library", "extra": { @@ -1240,24 +1400,24 @@ "docblock", "parser" ], - "time": "2020-04-20T09:18:32+00:00" + "time": "2020-08-10T19:35:50+00:00" }, { "name": "doctrine/instantiator", - "version": "1.3.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" + "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", + "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^6.0", @@ -1296,24 +1456,24 @@ "constructor", "instantiate" ], - "time": "2019-10-21T16:45:58+00:00" + "time": "2020-05-29T17:27:14+00:00" }, { "name": "doctrine/lexer", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6" + "reference": "e864bbf5904cb8f5bb334f99209b48018522f042" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", - "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/e864bbf5904cb8f5bb334f99209b48018522f042", + "reference": "e864bbf5904cb8f5bb334f99209b48018522f042", "shasum": "" }, "require": { - "php": "^7.2" + "php": "^7.2 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^6.0", @@ -1358,42 +1518,43 @@ "parser", "php" ], - "time": "2019-10-30T14:39:59+00:00" + "time": "2020-05-25T17:44:05+00:00" }, { "name": "ergebnis/composer-normalize", - "version": "2.5.1", + "version": "2.8.2", "source": { "type": "git", "url": "https://github.com/ergebnis/composer-normalize.git", - "reference": "d0faf549e565757a7ffbf1f306a4293080e43bdd" + "reference": "0a25a226c5503659179c8ea440d1c76599e434fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/composer-normalize/zipball/d0faf549e565757a7ffbf1f306a4293080e43bdd", - "reference": "d0faf549e565757a7ffbf1f306a4293080e43bdd", + "url": "https://api.github.com/repos/ergebnis/composer-normalize/zipball/0a25a226c5503659179c8ea440d1c76599e434fd", + "reference": "0a25a226c5503659179c8ea440d1c76599e434fd", "shasum": "" }, "require": { "composer-plugin-api": "^1.1.0 || ^2.0.0", - "ergebnis/json-normalizer": "~0.12.0", - "ergebnis/json-printer": "^3.0.2", - "localheinz/diff": "^1.0.1", - "php": "^7.1" + "ergebnis/json-normalizer": "~0.13.1", + "ergebnis/json-printer": "^3.1.1", + "justinrainbow/json-schema": "^5.2.10", + "localheinz/diff": "^1.1.1", + "php": "^7.2 || ^8.0" }, "require-dev": { - "composer/composer": "^1.10.5 || ^2.0.0", - "composer/package-versions-deprecated": "^1.8.0", - "ergebnis/phpstan-rules": "~0.14.4", - "ergebnis/test-util": "~1.0.0", - "jangregor/phpstan-prophecy": "~0.6.2", - "phpstan/extension-installer": "^1.0.4", - "phpstan/phpstan": "~0.12.19", - "phpstan/phpstan-deprecation-rules": "~0.12.2", - "phpstan/phpstan-phpunit": "~0.12.8", - "phpstan/phpstan-strict-rules": "~0.12.2", - "phpunit/phpunit": "^7.5.20", - "symfony/filesystem": "^4.4.8" + "composer/composer": "^1.10.13 || ^2.0.0", + "composer/package-versions-deprecated": "^1.11.99", + "ergebnis/phpstan-rules": "~0.15.2", + "ergebnis/test-util": "^1.1.0", + "jangregor/phpstan-prophecy": "~0.8.0", + "phpstan/extension-installer": "^1.0.5", + "phpstan/phpstan": "~0.12.43", + "phpstan/phpstan-deprecation-rules": "~0.12.5", + "phpstan/phpstan-phpunit": "~0.12.16", + "phpstan/phpstan-strict-rules": "~0.12.5", + "phpunit/phpunit": "^8.5.8", + "symfony/filesystem": "^5.1.5" }, "type": "composer-plugin", "extra": { @@ -1422,43 +1583,43 @@ "normalizer", "plugin" ], - "time": "2020-05-01T12:02:09+00:00" + "time": "2020-09-22T09:55:49+00:00" }, { "name": "ergebnis/json-normalizer", - "version": "0.12.0", + "version": "0.13.1", "source": { "type": "git", "url": "https://github.com/ergebnis/json-normalizer.git", - "reference": "0197447cd5d8f7e82116e904196a3e9f470655db" + "reference": "82897f7a0b6a896462a08ac02bee33ccf4ece0bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/json-normalizer/zipball/0197447cd5d8f7e82116e904196a3e9f470655db", - "reference": "0197447cd5d8f7e82116e904196a3e9f470655db", + "url": "https://api.github.com/repos/ergebnis/json-normalizer/zipball/82897f7a0b6a896462a08ac02bee33ccf4ece0bb", + "reference": "82897f7a0b6a896462a08ac02bee33ccf4ece0bb", "shasum": "" }, "require": { - "ergebnis/json-printer": "^3.0.2", + "ergebnis/json-printer": "^3.1.0", "ext-json": "*", - "justinrainbow/json-schema": "^4.0.0 || ^5.0.0", - "php": "^7.1" + "justinrainbow/json-schema": "^5.2.10", + "php": "^7.2 || ^8.0" }, "require-dev": { - "ergebnis/license": "~0.1.0", - "ergebnis/php-cs-fixer-config": "^2.1.2", - "ergebnis/phpstan-rules": "~0.14.4", - "ergebnis/test-util": "~1.0.0", - "infection/infection": "~0.13.6", - "jangregor/phpstan-prophecy": "~0.6.2", + "ergebnis/license": "^1.0.0", + "ergebnis/php-cs-fixer-config": "^2.2.1", + "ergebnis/phpstan-rules": "~0.15.2", + "ergebnis/test-util": "^1.1.0", + "infection/infection": "~0.15.3", + "jangregor/phpstan-prophecy": "~0.8.0", "phpstan/extension-installer": "^1.0.4", - "phpstan/phpstan": "~0.12.18", - "phpstan/phpstan-deprecation-rules": "~0.12.2", - "phpstan/phpstan-phpunit": "~0.12.8", - "phpstan/phpstan-strict-rules": "~0.12.2", - "phpunit/phpunit": "^7.5.20", - "psalm/plugin-phpunit": "~0.10.0", - "vimeo/psalm": "^3.11.2" + "phpstan/phpstan": "~0.12.40", + "phpstan/phpstan-deprecation-rules": "~0.12.5", + "phpstan/phpstan-phpunit": "~0.12.16", + "phpstan/phpstan-strict-rules": "~0.12.4", + "phpunit/phpunit": "^8.5.8", + "psalm/plugin-phpunit": "~0.11.0", + "vimeo/psalm": "^3.14.2" }, "type": "library", "autoload": { @@ -1482,38 +1643,41 @@ "json", "normalizer" ], - "time": "2020-04-19T12:30:41+00:00" + "time": "2020-08-30T12:00:06+00:00" }, { "name": "ergebnis/json-printer", - "version": "3.0.2", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/ergebnis/json-printer.git", - "reference": "c7985dc4879777f2e4ab689da25bdd49f59dd2cb" + "reference": "e4190dadd9937a77d8afcaf2b6c42a528ab367d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/json-printer/zipball/c7985dc4879777f2e4ab689da25bdd49f59dd2cb", - "reference": "c7985dc4879777f2e4ab689da25bdd49f59dd2cb", + "url": "https://api.github.com/repos/ergebnis/json-printer/zipball/e4190dadd9937a77d8afcaf2b6c42a528ab367d6", + "reference": "e4190dadd9937a77d8afcaf2b6c42a528ab367d6", "shasum": "" }, "require": { "ext-json": "*", "ext-mbstring": "*", - "php": "^7.1" + "php": "^7.2 || ^8.0" }, "require-dev": { - "ergebnis/php-cs-fixer-config": "~1.1.1", - "ergebnis/phpstan-rules": "~0.14.1", - "ergebnis/test-util": "~0.9.0", - "infection/infection": "~0.13.6", - "phpbench/phpbench": "~0.16.10", - "phpstan/extension-installer": "^1.0.3", - "phpstan/phpstan": "~0.11.19", - "phpstan/phpstan-deprecation-rules": "~0.11.2", - "phpstan/phpstan-strict-rules": "~0.11.1", - "phpunit/phpunit": "^7.5.18" + "ergebnis/license": "^1.0.0", + "ergebnis/php-cs-fixer-config": "^2.2.1", + "ergebnis/phpstan-rules": "~0.15.2", + "ergebnis/test-util": "^1.1.0", + "infection/infection": "~0.15.3", + "phpstan/extension-installer": "^1.0.4", + "phpstan/phpstan": "~0.12.40", + "phpstan/phpstan-deprecation-rules": "~0.12.5", + "phpstan/phpstan-phpunit": "~0.12.16", + "phpstan/phpstan-strict-rules": "~0.12.4", + "phpunit/phpunit": "^8.5.8", + "psalm/plugin-phpunit": "~0.11.0", + "vimeo/psalm": "^3.14.2" }, "type": "library", "autoload": { @@ -1538,43 +1702,43 @@ "json", "printer" ], - "time": "2019-12-19T14:42:54+00:00" + "time": "2020-08-30T12:17:03+00:00" }, { "name": "ergebnis/php-cs-fixer-config", - "version": "2.1.2", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/ergebnis/php-cs-fixer-config.git", - "reference": "c811e48e106a6decc20b3e305629e11c515a772c" + "reference": "0bcde3f7cd0c4f01f6135f80ddd9cadcbf341879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/php-cs-fixer-config/zipball/c811e48e106a6decc20b3e305629e11c515a772c", - "reference": "c811e48e106a6decc20b3e305629e11c515a772c", + "url": "https://api.github.com/repos/ergebnis/php-cs-fixer-config/zipball/0bcde3f7cd0c4f01f6135f80ddd9cadcbf341879", + "reference": "0bcde3f7cd0c4f01f6135f80ddd9cadcbf341879", "shasum": "" }, "require": { "ext-filter": "*", - "friendsofphp/php-cs-fixer": "~2.16.3", - "php": "^7.1" + "friendsofphp/php-cs-fixer": "~2.16.4", + "php": "^7.2" }, "require-dev": { - "ergebnis/composer-normalize": "^2.3.2", - "ergebnis/license": "~0.1.0", - "ergebnis/phpstan-rules": "~0.14.4", - "ergebnis/test-util": "~1.0.0", - "infection/infection": "~0.13.6", - "jangregor/phpstan-prophecy": "~0.6.2", - "phpstan/extension-installer": "^1.0.4", - "phpstan/phpstan": "~0.12.18", - "phpstan/phpstan-deprecation-rules": "~0.12.2", - "phpstan/phpstan-phpunit": "~0.12.7", - "phpstan/phpstan-strict-rules": "~0.12.2", - "phpunit/phpunit": "^7.5.20", - "psalm/plugin-phpunit": "~0.10.0", + "ergebnis/composer-normalize": "^2.8.2", + "ergebnis/license": "^1.1.0", + "ergebnis/phpstan-rules": "~0.15.2", + "ergebnis/test-util": "^1.3.0", + "infection/infection": "~0.15.3", + "jangregor/phpstan-prophecy": "~0.8.0", + "phpstan/extension-installer": "^1.0.5", + "phpstan/phpstan": "~0.12.48", + "phpstan/phpstan-deprecation-rules": "~0.12.5", + "phpstan/phpstan-phpunit": "~0.12.16", + "phpstan/phpstan-strict-rules": "~0.12.5", + "phpunit/phpunit": "^8.5.8", + "psalm/plugin-phpunit": "~0.12.2", "symfony/filesystem": "^4.4.0", - "vimeo/psalm": "^3.11.2" + "vimeo/psalm": "^3.16" }, "type": "library", "autoload": { @@ -1594,7 +1758,13 @@ ], "description": "Provides a configuration factory and multiple rule sets for friendsofphp/php-cs-fixer.", "homepage": "https://github.com/ergebnis/php-cs-fixer-config", - "time": "2020-04-16T08:02:53+00:00" + "funding": [ + { + "url": "https://github.com/localheinz", + "type": "github" + } + ], + "time": "2020-10-08T18:03:06+00:00" }, { "name": "felixfbecker/advanced-json-rpc", @@ -1686,25 +1856,25 @@ }, { "name": "filp/whoops", - "version": "2.7.2", + "version": "2.8.0", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "17d0d3f266c8f925ebd035cd36f83cf802b47d4a" + "reference": "fa50d9db1c0c2fae99cf988d27023effda5524a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/17d0d3f266c8f925ebd035cd36f83cf802b47d4a", - "reference": "17d0d3f266c8f925ebd035cd36f83cf802b47d4a", + "url": "https://api.github.com/repos/filp/whoops/zipball/fa50d9db1c0c2fae99cf988d27023effda5524a3", + "reference": "fa50d9db1c0c2fae99cf988d27023effda5524a3", "shasum": "" }, "require": { - "php": "^5.5.9 || ^7.0", + "php": "^5.5.9 || ^7.0 || ^8.0", "psr/log": "^1.0.1" }, "require-dev": { "mockery/mockery": "^0.9 || ^1.0", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0", + "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.3", "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0" }, "suggest": { @@ -1714,7 +1884,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "2.7-dev" } }, "autoload": { @@ -1743,20 +1913,20 @@ "throwable", "whoops" ], - "time": "2020-05-05T12:28:07+00:00" + "time": "2020-10-17T09:00:00+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.16.3", + "version": "v2.16.4", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "83baf823a33a1cbd5416c8626935cf3f843c10b0" + "reference": "1023c3458137ab052f6ff1e09621a721bfdeca13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/83baf823a33a1cbd5416c8626935cf3f843c10b0", - "reference": "83baf823a33a1cbd5416c8626935cf3f843c10b0", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/1023c3458137ab052f6ff1e09621a721bfdeca13", + "reference": "1023c3458137ab052f6ff1e09621a721bfdeca13", "shasum": "" }, "require": { @@ -1788,12 +1958,12 @@ "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.1", "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.1", "phpunitgoodpractices/traits": "^1.8", - "symfony/phpunit-bridge": "^4.3 || ^5.0", + "symfony/phpunit-bridge": "^5.1", "symfony/yaml": "^3.0 || ^4.0 || ^5.0" }, "suggest": { "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters in cache signature.", + "ext-mbstring": "For handling non-UTF8 characters.", "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." @@ -1834,20 +2004,20 @@ } ], "description": "A tool to automatically fix PHP code style", - "time": "2020-04-15T18:51:10+00:00" + "time": "2020-06-27T23:57:46+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.6.1", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "239400de7a173fe9901b9ac7c06497751f00727a" + "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", - "reference": "239400de7a173fe9901b9ac7c06497751f00727a", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3", + "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3", "shasum": "" }, "require": { @@ -1860,15 +2030,15 @@ }, "require-dev": { "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" }, "suggest": { - "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev" + "dev-master": "1.7-dev" } }, "autoload": { @@ -1905,20 +2075,20 @@ "uri", "url" ], - "time": "2019-07-01T23:21:34+00:00" + "time": "2020-09-30T07:37:11+00:00" }, { "name": "justinrainbow/json-schema", - "version": "5.2.9", + "version": "5.2.10", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "44c6787311242a979fa15c704327c20e7221a0e4" + "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/44c6787311242a979fa15c704327c20e7221a0e4", - "reference": "44c6787311242a979fa15c704327c20e7221a0e4", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", + "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", "shasum": "" }, "require": { @@ -1971,7 +2141,7 @@ "json", "schema" ], - "time": "2019-09-25T14:49:45+00:00" + "time": "2020-05-27T16:41:55+00:00" }, { "name": "kint-php/kint", @@ -2045,24 +2215,24 @@ }, { "name": "localheinz/diff", - "version": "1.0.1", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/localheinz/diff.git", - "reference": "bd5661db4bbed26c6f25df8851fd9f4b424a356e" + "reference": "851bb20ea8358c86f677f5f111c4ab031b1c764c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/localheinz/diff/zipball/bd5661db4bbed26c6f25df8851fd9f4b424a356e", - "reference": "bd5661db4bbed26c6f25df8851fd9f4b424a356e", + "url": "https://api.github.com/repos/localheinz/diff/zipball/851bb20ea8358c86f677f5f111c4ab031b1c764c", + "reference": "851bb20ea8358c86f677f5f111c4ab031b1c764c", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1 || ^8.0" }, "require-dev": { "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" + "symfony/process": "^4.2 || ^5" }, "type": "library", "autoload": { @@ -2085,31 +2255,31 @@ } ], "description": "Fork of sebastian/diff for use with ergebnis/composer-normalize", - "homepage": "https://github.com/sebastianbergmann/diff", + "homepage": "https://github.com/localheinz/diff", "keywords": [ "diff", "udiff", "unidiff", "unified diff" ], - "time": "2019-12-17T07:42:37+00:00" + "time": "2020-07-06T04:49:32+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.9.5", + "version": "1.10.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" + "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", - "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", + "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1 || ^8.0" }, "replace": { "myclabs/deep-copy": "self.version" @@ -2140,7 +2310,7 @@ "object", "object graph" ], - "time": "2020-01-17T21:11:47+00:00" + "time": "2020-06-29T13:22:24+00:00" }, { "name": "netresearch/jsonmapper", @@ -2190,16 +2360,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.4.0", + "version": "v4.10.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120" + "reference": "658f1be311a230e0907f5dfe0213742aff0596de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120", - "reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/658f1be311a230e0907f5dfe0213742aff0596de", + "reference": "658f1be311a230e0907f5dfe0213742aff0596de", "shasum": "" }, "require": { @@ -2207,8 +2377,8 @@ "php": ">=7.0" }, "require-dev": { - "ircmaxell/php-yacc": "0.0.5", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -2216,7 +2386,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.9-dev" } }, "autoload": { @@ -2238,7 +2408,7 @@ "parser", "php" ], - "time": "2020-04-10T16:34:50+00:00" + "time": "2020-09-26T10:30:38+00:00" }, { "name": "ocramius/package-versions", @@ -2341,20 +2511,20 @@ }, { "name": "paragonie/random_compat", - "version": "v9.99.99", + "version": "v9.99.100", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", - "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", "shasum": "" }, "require": { - "php": "^7" + "php": ">= 7" }, "require-dev": { "phpunit/phpunit": "4.*|5.*", @@ -2382,32 +2552,33 @@ "pseudorandom", "random" ], - "time": "2018-07-02T15:55:56+00:00" + "time": "2020-10-15T08:29:30+00:00" }, { "name": "phar-io/manifest", - "version": "1.0.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", + "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", - "phar-io/version": "^2.0", - "php": "^5.6 || ^7.0" + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -2437,24 +2608,24 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2018-07-08T19:23:20+00:00" + "time": "2020-06-27T14:33:11+00:00" }, { "name": "phar-io/version", - "version": "2.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" + "reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "url": "https://api.github.com/repos/phar-io/version/zipball/c6bb6825def89e0a32220f88337f8ceaf1975fa0", + "reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { @@ -2484,27 +2655,27 @@ } ], "description": "Library for handling version information and constraints", - "time": "2018-07-08T19:19:57+00:00" + "time": "2020-06-27T14:39:04+00:00" }, { "name": "php-cs-fixer/diff", - "version": "v1.3.0", + "version": "v1.3.1", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756" + "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/78bb099e9c16361126c86ce82ec4405ebab8e756", - "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", + "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^5.6 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3", + "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", "symfony/process": "^3.3" }, "type": "library", @@ -2518,14 +2689,14 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, { "name": "SpacePossum" } @@ -2535,7 +2706,7 @@ "keywords": [ "diff" ], - "time": "2018-02-15T16:58:55+00:00" + "time": "2020-10-14T08:39:05+00:00" }, { "name": "php-parallel-lint/php-parallel-lint", @@ -2592,25 +2763,25 @@ }, { "name": "phpdocumentor/reflection-common", - "version": "2.1.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b" + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/6568f4687e5b41b054365f9ae03fcb1ed5f2069b", - "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", "shasum": "" }, "require": { - "php": ">=7.1" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-2.x": "2.x-dev" } }, "autoload": { @@ -2637,32 +2808,31 @@ "reflection", "static analysis" ], - "time": "2020-04-27T09:25:28+00:00" + "time": "2020-06-27T09:03:43+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.1.0", + "version": "5.2.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e" + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", - "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", "shasum": "" }, "require": { - "ext-filter": "^7.1", - "php": "^7.2", - "phpdocumentor/reflection-common": "^2.0", - "phpdocumentor/type-resolver": "^1.0", - "webmozart/assert": "^1" + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" }, "require-dev": { - "doctrine/instantiator": "^1", - "mockery/mockery": "^1" + "mockery/mockery": "~1.3.2" }, "type": "library", "extra": { @@ -2690,34 +2860,33 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2020-02-22T12:28:44+00:00" + "time": "2020-09-03T19:13:55+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.1.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "7462d5f123dfc080dfdf26897032a6513644fc95" + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95", - "reference": "7462d5f123dfc080dfdf26897032a6513644fc95", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", "shasum": "" }, "require": { - "php": "^7.2", + "php": "^7.2 || ^8.0", "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "^7.2", - "mockery/mockery": "~1" + "ext-tokenizer": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-1.x": "1.x-dev" } }, "autoload": { @@ -2736,37 +2905,37 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2020-02-18T18:59:58+00:00" + "time": "2020-09-17T18:55:26+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.10.3", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "451c3cd1418cf640de218914901e51b064abb093" + "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", - "reference": "451c3cd1418cf640de218914901e51b064abb093", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/8ce87516be71aae9b956f81906aaf0338e0d8a2d", + "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.1", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" }, "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + "phpspec/phpspec": "^6.0", + "phpunit/phpunit": "^8.0 || ^9.0 <9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.10.x-dev" + "dev-master": "1.11.x-dev" } }, "autoload": { @@ -2799,24 +2968,24 @@ "spy", "stub" ], - "time": "2020-03-05T15:02:03+00:00" + "time": "2020-09-29T09:10:42+00:00" }, { "name": "phpstan/phpstan", - "version": "0.12.25", + "version": "0.12.50", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "9619551d68b2d4c0d681a8df73f3c847c798ee64" + "reference": "b8248f9c81265af75d6d969ca3252aaf3e998f3a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9619551d68b2d4c0d681a8df73f3c847c798ee64", - "reference": "9619551d68b2d4c0d681a8df73f3c847c798ee64", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b8248f9c81265af75d6d969ca3252aaf3e998f3a", + "reference": "b8248f9c81265af75d6d969ca3252aaf3e998f3a", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -2841,36 +3010,53 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", - "time": "2020-05-10T20:36:16+00:00" + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpstan", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2020-10-16T12:22:23+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "8.0.2", + "version": "9.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ca6647ffddd2add025ab3f21644a441d7c146cdc" + "reference": "53a4b737e83be724efd2bc4e7b929b9a30c48972" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ca6647ffddd2add025ab3f21644a441d7c146cdc", - "reference": "ca6647ffddd2add025ab3f21644a441d7c146cdc", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/53a4b737e83be724efd2bc4e7b929b9a30c48972", + "reference": "53a4b737e83be724efd2bc4e7b929b9a30c48972", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-xmlwriter": "*", - "php": "^7.3", - "phpunit/php-file-iterator": "^3.0", - "phpunit/php-text-template": "^2.0", - "phpunit/php-token-stream": "^4.0", - "sebastian/code-unit-reverse-lookup": "^2.0", - "sebastian/environment": "^5.0", - "sebastian/version": "^3.0", - "theseer/tokenizer": "^1.1.3" + "nikic/php-parser": "^4.8", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-pcov": "*", @@ -2879,7 +3065,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "8.0-dev" + "dev-master": "9.2-dev" } }, "autoload": { @@ -2905,27 +3091,33 @@ "testing", "xunit" ], - "time": "2020-05-23T08:02:54+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-02T03:37:32+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.1", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "4ac5b3e13df14829daa60a2eb4fdd2f2b7d33cf4" + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/4ac5b3e13df14829daa60a2eb4fdd2f2b7d33cf4", - "reference": "4ac5b3e13df14829daa60a2eb4fdd2f2b7d33cf4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", "shasum": "" }, "require": { - "php": "^7.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -2955,28 +3147,28 @@ "filesystem", "iterator" ], - "time": "2020-04-18T05:02:12+00:00" + "time": "2020-09-28T05:57:25+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.0.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "7579d5a1ba7f3ac11c80004d205877911315ae7a" + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/7579d5a1ba7f3ac11c80004d205877911315ae7a", - "reference": "7579d5a1ba7f3ac11c80004d205877911315ae7a", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", "shasum": "" }, "require": { - "php": "^7.3" + "php": ">=7.3" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-pcntl": "*" @@ -2984,7 +3176,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -3008,24 +3200,27 @@ "keywords": [ "process" ], - "time": "2020-02-07T06:06:11+00:00" + "time": "2020-09-28T05:58:55+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.0", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "526dc996cc0ebdfa428cd2dfccd79b7b53fee346" + "reference": "18c887016e60e52477e54534956d7b47bc52cd84" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/526dc996cc0ebdfa428cd2dfccd79b7b53fee346", - "reference": "526dc996cc0ebdfa428cd2dfccd79b7b53fee346", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/18c887016e60e52477e54534956d7b47bc52cd84", + "reference": "18c887016e60e52477e54534956d7b47bc52cd84", "shasum": "" }, "require": { - "php": "^7.3" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -3054,32 +3249,32 @@ "keywords": [ "template" ], - "time": "2020-02-01T07:43:44+00:00" + "time": "2020-09-28T06:03:05+00:00" }, { "name": "phpunit/php-timer", - "version": "3.1.4", + "version": "5.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "dc9368fae6ef2ffa57eba80a7410bcef81df6258" + "reference": "c9ff14f493699e2f6adee9fd06a0245b276643b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/dc9368fae6ef2ffa57eba80a7410bcef81df6258", - "reference": "dc9368fae6ef2ffa57eba80a7410bcef81df6258", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/c9ff14f493699e2f6adee9fd06a0245b276643b7", + "reference": "c9ff14f493699e2f6adee9fd06a0245b276643b7", "shasum": "" }, "require": { - "php": "^7.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -3103,103 +3298,55 @@ "keywords": [ "timer" ], - "time": "2020-04-20T06:00:37+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "4.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "cdc0db5aed8fbfaf475fbd95bfd7bab83c7a779c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/cdc0db5aed8fbfaf475fbd95bfd7bab83c7a779c", - "reference": "cdc0db5aed8fbfaf475fbd95bfd7bab83c7a779c", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2020-05-06T09:56:31+00:00" + "time": "2020-09-28T06:00:25+00:00" }, { "name": "phpunit/phpunit", - "version": "9.1.5", + "version": "9.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "1b570cd7edbe136055bf5f651857dc8af6b829d2" + "reference": "1f09a12726593737e8a228ebb1c8647305d07c41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1b570cd7edbe136055bf5f651857dc8af6b829d2", - "reference": "1b570cd7edbe136055bf5f651857dc8af6b829d2", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1f09a12726593737e8a228ebb1c8647305d07c41", + "reference": "1f09a12726593737e8a228ebb1c8647305d07c41", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.2.0", + "doctrine/instantiator": "^1.3.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.9.1", - "phar-io/manifest": "^1.0.3", - "phar-io/version": "^2.0.1", - "php": "^7.3", - "phpspec/prophecy": "^1.8.1", - "phpunit/php-code-coverage": "^8.0.1", - "phpunit/php-file-iterator": "^3.0", - "phpunit/php-invoker": "^3.0", - "phpunit/php-text-template": "^2.0", - "phpunit/php-timer": "^3.1.4", - "sebastian/code-unit": "^1.0.2", - "sebastian/comparator": "^4.0", - "sebastian/diff": "^4.0", - "sebastian/environment": "^5.0.1", - "sebastian/exporter": "^4.0", - "sebastian/global-state": "^4.0", - "sebastian/object-enumerator": "^4.0", - "sebastian/resource-operations": "^3.0", - "sebastian/type": "^2.0", - "sebastian/version": "^3.0" + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.1", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^2.3", + "sebastian/version": "^3.0.2" }, "require-dev": { "ext-pdo": "*", - "phpspec/prophecy-phpunit": "^2.0" + "phpspec/prophecy-phpunit": "^2.0.1" }, "suggest": { "ext-soap": "*", @@ -3211,7 +3358,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.1-dev" + "dev-master": "9.4-dev" } }, "autoload": { @@ -3240,7 +3387,17 @@ "testing", "xunit" ], - "time": "2020-05-22T13:54:05+00:00" + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-11T07:41:19+00:00" }, { "name": "psr/event-dispatcher", @@ -3376,70 +3533,161 @@ "time": "2019-03-08T08:55:37+00:00" }, { - "name": "sebastian/code-unit", - "version": "1.0.2", + "name": "rector/rector-prefixed", + "version": "0.8.30", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "ac958085bc19fcd1d36425c781ef4cbb5b06e2a5" + "url": "https://github.com/rectorphp/rector-prefixed.git", + "reference": "90910ccc8c97daefa16d2501e35843cfcd395919" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/ac958085bc19fcd1d36425c781ef4cbb5b06e2a5", - "reference": "ac958085bc19fcd1d36425c781ef4cbb5b06e2a5", + "url": "https://api.github.com/repos/rectorphp/rector-prefixed/zipball/90910ccc8c97daefa16d2501e35843cfcd395919", + "reference": "90910ccc8c97daefa16d2501e35843cfcd395919", "shasum": "" }, "require": { - "php": "^7.3" + "php": "^7.2" }, - "require-dev": { - "phpunit/phpunit": "^9.0" + "conflict": { + "nikic/php-parser": "<4.7", + "phpstan/phpstan": "<0.12" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } + "replace": { + "rector/rector": "self.version" }, - "autoload": { - "classmap": [ - "src/" - ] + "require-dev": { + "doctrine/orm": "^2.7" }, + "bin": [ + "rector", + "rector.phar" + ], + "type": "library", "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "description": "Prefixed version of Rector compiled in PHAR", + "time": "2020-10-18T09:05:00+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "59236be62b1bb9919e6d7f60b0b832dc05cef9ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/59236be62b1bb9919e6d7f60b0b832dc05cef9ab", + "reference": "59236be62b1bb9919e6d7f60b0b832dc05cef9ab", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], "description": "Collection of value objects that represent the PHP code units", "homepage": "https://github.com/sebastianbergmann/code-unit", - "time": "2020-04-30T05:58:10+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-02T14:47:54+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.0", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "5b5dbe0044085ac41df47e79d34911a15b96d82e" + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5b5dbe0044085ac41df47e79d34911a15b96d82e", - "reference": "5b5dbe0044085ac41df47e79d34911a15b96d82e", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", "shasum": "" }, "require": { - "php": "^7.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -3464,29 +3712,29 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2020-02-07T06:20:13+00:00" + "time": "2020-09-28T05:30:19+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.0", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "85b3435da967696ed618ff745f32be3ff4a2b8e8" + "reference": "7a8ff306445707539c1a6397372a982a1ec55120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/85b3435da967696ed618ff745f32be3ff4a2b8e8", - "reference": "85b3435da967696ed618ff745f32be3ff4a2b8e8", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/7a8ff306445707539c1a6397372a982a1ec55120", + "reference": "7a8ff306445707539c1a6397372a982a1ec55120", "shasum": "" }, "require": { - "php": "^7.3", + "php": ">=7.3", "sebastian/diff": "^4.0", "sebastian/exporter": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -3528,27 +3776,80 @@ "compare", "equality" ], - "time": "2020-02-07T06:08:51+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-30T06:47:25+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "ba8cc2da0c0bfbc813d03b56406734030c7f1eff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/ba8cc2da0c0bfbc813d03b56406734030c7f1eff", + "reference": "ba8cc2da0c0bfbc813d03b56406734030c7f1eff", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "time": "2020-09-28T06:05:03+00:00" }, { "name": "sebastian/diff", - "version": "4.0.1", + "version": "4.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3e523c576f29dacecff309f35e4cc5a5c168e78a" + "reference": "ffc949a1a2aae270ea064453d7535b82e4c32092" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3e523c576f29dacecff309f35e4cc5a5c168e78a", - "reference": "3e523c576f29dacecff309f35e4cc5a5c168e78a", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ffc949a1a2aae270ea064453d7535b82e4c32092", + "reference": "ffc949a1a2aae270ea064453d7535b82e4c32092", "shasum": "" }, "require": { - "php": "^7.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0", + "phpunit/phpunit": "^9.3", "symfony/process": "^4.2 || ^5" }, "type": "library", @@ -3584,27 +3885,27 @@ "unidiff", "unified diff" ], - "time": "2020-05-08T05:01:12+00:00" + "time": "2020-09-28T05:32:55+00:00" }, { "name": "sebastian/environment", - "version": "5.1.0", + "version": "5.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "c753f04d68cd489b6973cf9b4e505e191af3b05c" + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/c753f04d68cd489b6973cf9b4e505e191af3b05c", - "reference": "c753f04d68cd489b6973cf9b4e505e191af3b05c", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", "shasum": "" }, "require": { - "php": "^7.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-posix": "*" @@ -3612,7 +3913,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -3637,29 +3938,29 @@ "environment", "hhvm" ], - "time": "2020-04-14T13:36:52+00:00" + "time": "2020-09-28T05:52:38+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.0", + "version": "4.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "80c26562e964016538f832f305b2286e1ec29566" + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/80c26562e964016538f832f305b2286e1ec29566", - "reference": "80c26562e964016538f832f305b2286e1ec29566", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65", "shasum": "" }, "require": { - "php": "^7.3", + "php": ">=7.3", "sebastian/recursion-context": "^4.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -3704,30 +4005,30 @@ "export", "exporter" ], - "time": "2020-02-07T06:10:52+00:00" + "time": "2020-09-28T05:24:23+00:00" }, { "name": "sebastian/global-state", - "version": "4.0.0", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bdb1e7c79e592b8c82cb1699be3c8743119b8a72" + "reference": "ea779cb749a478b22a2564ac41cd7bda79c78dc7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bdb1e7c79e592b8c82cb1699be3c8743119b8a72", - "reference": "bdb1e7c79e592b8c82cb1699be3c8743119b8a72", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/ea779cb749a478b22a2564ac41cd7bda79c78dc7", + "reference": "ea779cb749a478b22a2564ac41cd7bda79c78dc7", "shasum": "" }, "require": { - "php": "^7.3", + "php": ">=7.3", "sebastian/object-reflector": "^2.0", "sebastian/recursion-context": "^4.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-uopz": "*" @@ -3735,7 +4036,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -3758,29 +4059,76 @@ "keywords": [ "global state" ], - "time": "2020-02-07T06:11:37+00:00" + "time": "2020-09-28T05:54:06+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "6514b8f21906b8b46f520d1fbd17a4523fa59a54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/6514b8f21906b8b46f520d1fbd17a4523fa59a54", + "reference": "6514b8f21906b8b46f520d1fbd17a4523fa59a54", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "time": "2020-09-28T06:07:27+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.0", + "version": "4.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "e67516b175550abad905dc952f43285957ef4363" + "reference": "f6f5957013d84725427d361507e13513702888a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67516b175550abad905dc952f43285957ef4363", - "reference": "e67516b175550abad905dc952f43285957ef4363", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f6f5957013d84725427d361507e13513702888a4", + "reference": "f6f5957013d84725427d361507e13513702888a4", "shasum": "" }, "require": { - "php": "^7.3", + "php": ">=7.3", "sebastian/object-reflector": "^2.0", "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -3805,27 +4153,27 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2020-02-07T06:12:23+00:00" + "time": "2020-09-28T05:55:06+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.0", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "f4fd0835cabb0d4a6546d9fe291e5740037aa1e7" + "reference": "d9d0ab3b12acb1768bc1e0a89b23c90d2043cbe5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/f4fd0835cabb0d4a6546d9fe291e5740037aa1e7", - "reference": "f4fd0835cabb0d4a6546d9fe291e5740037aa1e7", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/d9d0ab3b12acb1768bc1e0a89b23c90d2043cbe5", + "reference": "d9d0ab3b12acb1768bc1e0a89b23c90d2043cbe5", "shasum": "" }, "require": { - "php": "^7.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -3850,27 +4198,27 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2020-02-07T06:19:40+00:00" + "time": "2020-09-28T05:56:16+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.0", + "version": "4.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cdd86616411fc3062368b720b0425de10bd3d579" + "reference": "ed8c9cd355089134bc9cba421b5cfdd58f0eaef7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cdd86616411fc3062368b720b0425de10bd3d579", - "reference": "cdd86616411fc3062368b720b0425de10bd3d579", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/ed8c9cd355089134bc9cba421b5cfdd58f0eaef7", + "reference": "ed8c9cd355089134bc9cba421b5cfdd58f0eaef7", "shasum": "" }, "require": { - "php": "^7.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -3903,24 +4251,24 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2020-02-07T06:18:20+00:00" + "time": "2020-09-28T05:17:32+00:00" }, { "name": "sebastian/resource-operations", - "version": "3.0.0", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "8c98bf0dfa1f9256d0468b9803a1e1df31b6fa98" + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/8c98bf0dfa1f9256d0468b9803a1e1df31b6fa98", - "reference": "8c98bf0dfa1f9256d0468b9803a1e1df31b6fa98", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", "shasum": "" }, "require": { - "php": "^7.3" + "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.0" @@ -3948,32 +4296,32 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2020-02-07T06:13:02+00:00" + "time": "2020-09-28T06:45:17+00:00" }, { "name": "sebastian/type", - "version": "2.0.0", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "9e8f42f740afdea51f5f4e8cec2035580e797ee1" + "reference": "fa592377f3923946cb90bf1f6a71ba2e5f229909" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/9e8f42f740afdea51f5f4e8cec2035580e797ee1", - "reference": "9e8f42f740afdea51f5f4e8cec2035580e797ee1", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fa592377f3923946cb90bf1f6a71ba2e5f229909", + "reference": "fa592377f3923946cb90bf1f6a71ba2e5f229909", "shasum": "" }, "require": { - "php": "^7.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.3-dev" } }, "autoload": { @@ -3994,24 +4342,30 @@ ], "description": "Collection of value objects that represent the types of the PHP type system", "homepage": "https://github.com/sebastianbergmann/type", - "time": "2020-02-07T06:13:43+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-06T08:41:03+00:00" }, { "name": "sebastian/version", - "version": "3.0.0", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "0411bde656dce64202b39c2f4473993a9081d39e" + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/0411bde656dce64202b39c2f4473993a9081d39e", - "reference": "0411bde656dce64202b39c2f4473993a9081d39e", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "php": "^7.3" + "php": ">=7.3" }, "type": "library", "extra": { @@ -4037,102 +4391,75 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2020-01-21T06:36:37+00:00" + "time": "2020-09-28T06:39:44+00:00" }, { - "name": "simpletest/simpletest", - "version": "v1.2.0", + "name": "staabm/annotate-pull-request-from-checkstyle", + "version": "1.4.0", "source": { "type": "git", - "url": "https://github.com/simpletest/simpletest.git", - "reference": "4fb6006517a1428785a0ea704fbedcc675421ec4" + "url": "https://github.com/staabm/annotate-pull-request-from-checkstyle.git", + "reference": "88a16cf5fae6d31ae38a4518ec1bf10e71137e04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simpletest/simpletest/zipball/4fb6006517a1428785a0ea704fbedcc675421ec4", - "reference": "4fb6006517a1428785a0ea704fbedcc675421ec4", + "url": "https://api.github.com/repos/staabm/annotate-pull-request-from-checkstyle/zipball/88a16cf5fae6d31ae38a4518ec1bf10e71137e04", + "reference": "88a16cf5fae6d31ae38a4518ec1bf10e71137e04", "shasum": "" }, "require": { - "php": "^7.1" + "ext-simplexml": "*", + "php": "^7.0 || ^8.0" }, - "type": "library", - "autoload": { - "classmap": [ - "." - ] + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.16.1" }, + "bin": [ + "cs2pr" + ], + "type": "library", "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-2.0+" + "MIT" ], "authors": [ { - "name": "Marcus Baker", - "email": "marcus@lastcraft.com", - "role": "Original project lead" - }, - { - "name": "Jason Sweat", - "role": "Original developer" - }, - { - "name": "Travis Swicegood", - "role": "Original developer" - }, - { - "name": "Perrick Penet", - "role": "Original developer" - }, - { - "name": "Edward Z. Yang", - "role": "Original developer" - }, - { - "name": "Lachlan Donald", - "email": "lachlan@ljd.cc" - }, - { - "name": "Lars Vierbergen", - "email": "vierbergenlars@gmail.com" - }, - { - "name": "Jens A. Koch" + "name": "Markus Staab" } ], - "description": "Unit testing, mock objects and web testing framework for PHP built around test cases.", - "homepage": "http://simpletest.org/", - "keywords": [ - "SimpleTest", - "code-coverage", - "selenium", - "testing", - "unit-test" + "funding": [ + { + "url": "https://github.com/staabm", + "type": "github" + } ], - "time": "2019-09-17T15:08:22+00:00" + "time": "2020-09-26T11:36:44+00:00" }, { "name": "symfony/console", - "version": "v5.0.8", + "version": "v5.1.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "5fa1caadc8cdaa17bcfb25219f3b53fe294a9935" + "reference": "ae789a8a2ad189ce7e8216942cdb9b77319f5eb8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/5fa1caadc8cdaa17bcfb25219f3b53fe294a9935", - "reference": "5fa1caadc8cdaa17bcfb25219f3b53fe294a9935", + "url": "https://api.github.com/repos/symfony/console/zipball/ae789a8a2ad189ce7e8216942cdb9b77319f5eb8", + "reference": "ae789a8a2ad189ce7e8216942cdb9b77319f5eb8", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", - "symfony/service-contracts": "^1.1|^2" + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.1|^2", + "symfony/string": "^5.1" }, "conflict": { "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", "symfony/event-dispatcher": "<4.4", "symfony/lock": "<4.4", "symfony/process": "<4.4" @@ -4158,7 +4485,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -4185,29 +4512,43 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2020-03-30T11:42:42+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-07T15:23:00+00:00" }, { "name": "symfony/css-selector", - "version": "v5.0.8", + "version": "v5.1.7", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "5f8d5271303dad260692ba73dfa21777d38e124e" + "reference": "e544e24472d4c97b2d11ade7caacd446727c6bf9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/5f8d5271303dad260692ba73dfa21777d38e124e", - "reference": "5f8d5271303dad260692ba73dfa21777d38e124e", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/e544e24472d4c97b2d11ade7caacd446727c6bf9", + "reference": "e544e24472d4c97b2d11ade7caacd446727c6bf9", "shasum": "" }, "require": { - "php": "^7.2.5" + "php": ">=7.2.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -4238,25 +4579,41 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2020-03-27T16:56:45+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-05-20T17:43:50+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.0.8", + "version": "v5.1.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "24f40d95385774ed5c71dbf014edd047e2f2f3dc" + "reference": "d5de97d6af175a9e8131c546db054ca32842dd0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/24f40d95385774ed5c71dbf014edd047e2f2f3dc", - "reference": "24f40d95385774ed5c71dbf014edd047e2f2f3dc", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d5de97d6af175a9e8131c546db054ca32842dd0f", + "reference": "d5de97d6af175a9e8131c546db054ca32842dd0f", "shasum": "" }, "require": { - "php": "^7.2.5", - "symfony/event-dispatcher-contracts": "^2" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/event-dispatcher-contracts": "^2", + "symfony/polyfill-php80": "^1.15" }, "conflict": { "symfony/dependency-injection": "<4.4" @@ -4269,6 +4626,7 @@ "psr/log": "~1.0", "symfony/config": "^4.4|^5.0", "symfony/dependency-injection": "^4.4|^5.0", + "symfony/error-handler": "^4.4|^5.0", "symfony/expression-language": "^4.4|^5.0", "symfony/http-foundation": "^4.4|^5.0", "symfony/service-contracts": "^1.1|^2", @@ -4281,7 +4639,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -4308,24 +4666,38 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2020-03-27T16:56:45+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-18T14:27:32+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.0.1", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "af23c2584d4577d54661c434446fb8fbed6025dd" + "reference": "0ba7d54483095a198fa51781bc608d17e84dffa2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/af23c2584d4577d54661c434446fb8fbed6025dd", - "reference": "af23c2584d4577d54661c434446fb8fbed6025dd", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ba7d54483095a198fa51781bc608d17e84dffa2", + "reference": "0ba7d54483095a198fa51781bc608d17e84dffa2", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", "psr/event-dispatcher": "^1" }, "suggest": { @@ -4334,7 +4706,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -4366,30 +4742,30 @@ "interoperability", "standards" ], - "time": "2019-11-18T17:27:11+00:00" + "time": "2020-09-07T11:33:47+00:00" }, { "name": "symfony/filesystem", - "version": "v5.0.8", + "version": "v5.1.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "7cd0dafc4353a0f62e307df90b48466379c8cc91" + "reference": "1a8697545a8d87b9f2f6b1d32414199cc5e20aae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/7cd0dafc4353a0f62e307df90b48466379c8cc91", - "reference": "7cd0dafc4353a0f62e307df90b48466379c8cc91", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/1a8697545a8d87b9f2f6b1d32414199cc5e20aae", + "reference": "1a8697545a8d87b9f2f6b1d32414199cc5e20aae", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -4416,29 +4792,43 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2020-04-12T14:40:17+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-27T14:02:37+00:00" }, { "name": "symfony/finder", - "version": "v5.0.8", + "version": "v5.1.7", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "600a52c29afc0d1caa74acbec8d3095ca7e9910d" + "reference": "2c3ba7ad6884e6c4451ce2340e2dc23f6fa3e0d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/600a52c29afc0d1caa74acbec8d3095ca7e9910d", - "reference": "600a52c29afc0d1caa74acbec8d3095ca7e9910d", + "url": "https://api.github.com/repos/symfony/finder/zipball/2c3ba7ad6884e6c4451ce2340e2dc23f6fa3e0d8", + "reference": "2c3ba7ad6884e6c4451ce2340e2dc23f6fa3e0d8", "shasum": "" }, "require": { - "php": "^7.2.5" + "php": ">=7.2.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -4465,29 +4855,45 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2020-03-27T16:56:45+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-02T16:23:27+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.0.8", + "version": "v5.1.7", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "3707e3caeff2b797c0bfaadd5eba723dd44e6bf1" + "reference": "4c7e155bf7d93ea4ba3824d5a14476694a5278dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/3707e3caeff2b797c0bfaadd5eba723dd44e6bf1", - "reference": "3707e3caeff2b797c0bfaadd5eba723dd44e6bf1", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/4c7e155bf7d93ea4ba3824d5a14476694a5278dd", + "reference": "4c7e155bf7d93ea4ba3824d5a14476694a5278dd", "shasum": "" }, "require": { - "php": "^7.2.5" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-php80": "^1.15" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -4519,37 +4925,55 @@ "configuration", "options" ], - "time": "2020-04-06T10:40:56+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-27T03:44:28+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.17.0", + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.18.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "fa79b11539418b02fc5e1897267673ba2c19419c" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "b740103edbdcc39602239ee8860f0f45a8eb9aa5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fa79b11539418b02fc5e1897267673ba2c19419c", - "reference": "fa79b11539418b02fc5e1897267673ba2c19419c", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b740103edbdcc39602239ee8860f0f45a8eb9aa5", + "reference": "b740103edbdcc39602239ee8860f0f45a8eb9aa5", "shasum": "" }, "require": { "php": ">=5.3.3" }, "suggest": { - "ext-mbstring": "For best performance" + "ext-intl": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" }, "files": [ "bootstrap.php" @@ -4569,29 +4993,97 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Symfony polyfill for intl's grapheme_* functions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "mbstring", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "time": "2020-07-14T12:35:20+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.18.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", + "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", "polyfill", "portable", "shim" ], - "time": "2020-05-12T16:47:27+00:00" + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.17.0", + "version": "v1.18.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "82225c2d7d23d7e70515496d249c0152679b468e" + "reference": "0dd93f2c578bdc9c72697eaa5f1dd25644e618d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/82225c2d7d23d7e70515496d249c0152679b468e", - "reference": "82225c2d7d23d7e70515496d249c0152679b468e", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/0dd93f2c578bdc9c72697eaa5f1dd25644e618d3", + "reference": "0dd93f2c578bdc9c72697eaa5f1dd25644e618d3", "shasum": "" }, "require": { @@ -4601,7 +5093,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -4637,20 +5133,20 @@ "portable", "shim" ], - "time": "2020-05-12T16:47:27+00:00" + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.17.0", + "version": "v1.18.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "f048e612a3905f34931127360bdd2def19a5e582" + "reference": "639447d008615574653fb3bc60d1986d7172eaae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/f048e612a3905f34931127360bdd2def19a5e582", - "reference": "f048e612a3905f34931127360bdd2def19a5e582", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/639447d008615574653fb3bc60d1986d7172eaae", + "reference": "639447d008615574653fb3bc60d1986d7172eaae", "shasum": "" }, "require": { @@ -4659,7 +5155,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -4692,20 +5192,20 @@ "portable", "shim" ], - "time": "2020-05-12T16:47:27+00:00" + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.17.0", + "version": "v1.18.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc" + "reference": "fffa1a52a023e782cdcc221d781fe1ec8f87fcca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a760d8964ff79ab9bf057613a5808284ec852ccc", - "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fffa1a52a023e782cdcc221d781fe1ec8f87fcca", + "reference": "fffa1a52a023e782cdcc221d781fe1ec8f87fcca", "shasum": "" }, "require": { @@ -4714,7 +5214,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -4750,29 +5254,96 @@ "portable", "shim" ], - "time": "2020-05-12T16:47:27+00:00" + "time": "2020-07-14T12:35:20+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.18.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/d87d5766cbf48d72388a9f6b85f280c8ad51f981", + "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981", + "shasum": "" + }, + "require": { + "php": ">=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/process", - "version": "v5.0.8", + "version": "v5.1.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "3179f68dff5bad14d38c4114a1dab98030801fd7" + "reference": "d3a2e64866169586502f0cd9cab69135ad12cee9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/3179f68dff5bad14d38c4114a1dab98030801fd7", - "reference": "3179f68dff5bad14d38c4114a1dab98030801fd7", + "url": "https://api.github.com/repos/symfony/process/zipball/d3a2e64866169586502f0cd9cab69135ad12cee9", + "reference": "d3a2e64866169586502f0cd9cab69135ad12cee9", "shasum": "" }, "require": { - "php": "^7.2.5" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.15" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -4799,24 +5370,38 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2020-04-15T15:59:10+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-02T16:23:27+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.0.1", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "144c5e51266b281231e947b51223ba14acf1a749" + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", - "reference": "144c5e51266b281231e947b51223ba14acf1a749", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", "psr/container": "^1.0" }, "suggest": { @@ -4825,7 +5410,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -4857,30 +5446,30 @@ "interoperability", "standards" ], - "time": "2019-11-18T17:27:11+00:00" + "time": "2020-09-07T11:33:47+00:00" }, { "name": "symfony/stopwatch", - "version": "v5.0.8", + "version": "v5.1.7", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "a1d86d30d4522423afc998f32404efa34fcf5a73" + "reference": "0f7c58cf81dbb5dd67d423a89d577524a2ec0323" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/a1d86d30d4522423afc998f32404efa34fcf5a73", - "reference": "a1d86d30d4522423afc998f32404efa34fcf5a73", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/0f7c58cf81dbb5dd67d423a89d577524a2ec0323", + "reference": "0f7c58cf81dbb5dd67d423a89d577524a2ec0323", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", "symfony/service-contracts": "^1.0|^2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -4907,27 +5496,126 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2020-03-27T16:56:45+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-05-20T17:43:50+00:00" + }, + { + "name": "symfony/string", + "version": "v5.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "4a9afe9d07bac506f75bcee8ed3ce76da5a9343e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/4a9afe9d07bac506f75bcee8ed3ce76da5a9343e", + "reference": "4a9afe9d07bac506f75bcee8ed3ce76da5a9343e", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0", + "symfony/http-client": "^4.4|^5.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "files": [ + "Resources/functions.php" + ], + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony String component", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-15T12:23:47+00:00" }, { "name": "theseer/tokenizer", - "version": "1.1.3", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" + "reference": "75a63c33a8577608444246075ea0af0d052e452a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", + "reference": "75a63c33a8577608444246075ea0af0d052e452a", "shasum": "" }, "require": { "ext-dom": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", - "php": "^7.0" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { @@ -4947,7 +5635,7 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2019-06-13T22:48:21+00:00" + "time": "2020-07-12T23:59:07+00:00" }, { "name": "vimeo/psalm", @@ -5047,23 +5735,24 @@ }, { "name": "webmozart/assert", - "version": "1.8.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6" + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6", - "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6", + "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0", + "php": "^5.3.3 || ^7.0 || ^8.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { + "phpstan/phpstan": "<0.12.20", "vimeo/psalm": "<3.9.1" }, "require-dev": { @@ -5091,7 +5780,7 @@ "check", "validate" ], - "time": "2020-04-18T12:12:48+00:00" + "time": "2020-07-08T17:02:28+00:00" }, { "name": "webmozart/glob", @@ -5193,8 +5882,12 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.1", - "ext-pgsql": "*" + "php": ">=7.2", + "ext-json": "*", + "ext-mbstring": "*", + "ext-pgsql": "*", + "ext-xml": "*" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "1.1.0" } diff --git a/config.inc.php-dist b/config.inc.php-dist index 76e089af..1991083b 100644 --- a/config.inc.php-dist +++ b/config.inc.php-dist @@ -1,80 +1,46 @@ '', - - /** - * enable this to calculate schema and table sizes. This will have a performance impact - * e.g. $conf['display_sizes'] = true - * - * you can also enable it specifically for tables and or schemas: - * $conf['display_sizes'] = ['schemas'=>false,'tables'=>true]; - */ - 'display_sizes' => false, + 'subfolder' => '', - /** - * Set to true if you want to enable debugging output - */ - 'debugmode' => false, + /** + * enable this to calculate schema and table sizes. This will have a performance impact + * e.g. $conf['display_sizes'] = true. + * + * you can also enable it specifically for tables and or schemas: + * $conf['display_sizes'] = ['schemas'=>false,'tables'=>true]; + */ + 'display_sizes' => false, /** - * Don't touch this value. It's used to inform the config structure has a breaking change - * + * Set to true if you want to enable debugging output. */ - 'version'=> 61 + 'debugmode' => false, + /** + * Don't touch this value. It's used to inform the config structure has a breaking change. + */ + 'version' => 61, ]; -$conf['register_debuggers'] = function () { - // If debugmode is active, and $conf['register_debuggers'] - // is a function (or a callable), it will be invoked before - // instancing the app's container - define('THIS_WAS_PRODUCTION', false); - // e.g. register Whoops as exception handler - if (THIS_WAS_PRODUCTION - && class_exists('Whoops\Run')) { - $whoops = new Whoops\Run(); - $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler()); - $whoops->register(); - } - - // Using PHP-Console - // PHP_CONSOLE doesn't work on PHP 7.4 yet - // https://github.com/barbushin/php-console - // (Only in Chrome) - if (THIS_WAS_PRODUCTION && - version_compare(PHP_VERSION, 7.4, '<') && - class_exists('PhpConsole\Handler')) { - $phpConsoleHandler = \PhpConsole\Handler::getInstance(); - $connector = $phpConsoleHandler->getConnector(); - $connector->setPassword('yohoho123', true); - $connector->enableSslOnlyMode(); - $phpConsoleHandler->start(); - } - - // Example with Kint - if (THIS_WAS_PRODUCTION && - class_exists('Kint')) { - \Kint::$enabled_mode = true; - \Kint\Renderer\RichRenderer::$folder = false; - function ddd(...$v) - { - \Kint::dump(...$v); - exit; - } - - \Kint::$aliases[] = 'ddd'; - } +// Two debug library examples. Pick one of course. +$conf['register_debuggers'] = static function (): void { + //require_once __DIR__ . '/.configs/debug.kint.php'; + //require_once __DIR__ . '/.configs/debug.var_dumper.php'; }; // optionally, set a path for your error log, relative to this project root @@ -86,36 +52,40 @@ $server_index = 0; /** * $conf['servers'] is an array that holds (at least) one server block. + * * @see https://github.com/HuasoFoundries/phpPgAdmin6/wiki/Config:-servers - * */ $conf['servers'][$server_index] = [ // Display name for the server on the login screen - 'desc' => 'PostgreSQL', + 'desc' => 'PostgreSQL', // Hostname or IP address for server. Use '' for UNIX domain socket. // use 'localhost' for TCP/IP connection on this computer - 'host' => '', + 'host' => '', // Database port on server (5432 is the PostgreSQL default) - 'port' => 5432, + 'port' => 5432, // Database SSL mode // Possible options: disable, allow, prefer, require // To require SSL on older servers use option: legacy // To ignore the SSL mode, use option: unspecified - 'sslmode' => 'allow', + 'sslmode' => 'allow', // Change the default database only if you cannot connect to template1. // For a PostgreSQL 8.1+ server, you can set this to 'postgres'. - 'defaultdb' => 'template1', + 'defaultdb' => 'template1', // Specify the path to the database dump utilities for this server. // You can set these to '' if no dumper is available. - 'pg_dump_path' => '/usr/bin/pg_dump', - 'pg_dumpall_path' => '/usr/bin/pg_dumpall' + 'pg_dump_path' => '/usr/bin/pg_dump', + 'pg_dumpall_path' => '/usr/bin/pg_dumpall', ]; +// Server group 0 will show up with an alias +$conf['srv_groups'][0]['desc'] = 'dev1 and prod2'; +// Add here servers indexes belonging to the group '0' seperated by comma +$conf['srv_groups'][0]['servers'] = '1,3'; // Default language. E.g.: 'english', 'polish', etc. See lang/ directory // for all possibilities. If you specify 'auto' (the default) it will use @@ -188,30 +158,33 @@ $conf['ajax_refresh'] = 3; // If there's a config.yml in the root folder, parse it and merge its contents with $conf array // see config.example.yml -$yamlConfigPath = implode(DIRECTORY_SEPARATOR, [__DIR__, 'config.yml']); +$yamlConfigPath = \implode(\DIRECTORY_SEPARATOR, [__DIR__, 'config.yml']); + if (\is_readable($yamlConfigPath) && \class_exists('Symfony\Component\Yaml\Yaml')) { try { - $yamlConfig = Symfony\Component\Yaml\Yaml::parseFile($yamlConfigPath); + $yamlConfig = Yaml::parseFile($yamlConfigPath); // Servers and srv_groups must be merged beforehand $servers = $conf['servers'] ?? []; + foreach ($yamlConfig['servers'] ?? [] as $index => $srv) { $servers[] = $srv; } $srv_groups = $conf['srv_groups'] ?? []; + foreach ($yamlConfig['srv_groups'] ?? [] as $index => $srv_group) { $srv_groups[] = $srv; } - $yamlConfig['srv_groups'] = array_merge([ + $yamlConfig['srv_groups'] = \array_merge([ $conf['srv_groups'] ?? [], $yamlConfig['srv_groups'] ?? [], ]); $conf = \array_merge($conf, $yamlConfig); - $conf['servers'] = $servers ?? []; + $conf['servers'] = $servers ?? []; $conf['srv_groups'] = $srv_groups ?? []; } catch (\Exception $e) { die($e->getMessage()); \error_log($e->getTraceAsString()); } -} \ No newline at end of file +} diff --git a/globals.d.ts b/globals.d.ts new file mode 100644 index 00000000..1059108a --- /dev/null +++ b/globals.d.ts @@ -0,0 +1,8 @@ +import * as jQuery from 'jquery'; + +declare global { + interface Window { + jQuery: typeof jQuery; + $: typeof jQuery; + } +} \ No newline at end of file diff --git a/mk_linters.mk b/mk_linters.mk new file mode 100644 index 00000000..3e9abfe0 --- /dev/null +++ b/mk_linters.mk @@ -0,0 +1,189 @@ +VERSION = $(shell cat composer.json | sed -n 's/.*"version": "\([^"]*\)"/\1/p') + +SHELL = /usr/bin/env bash + +HAS_PSALM := $(shell ls ./vendor/bin/xpsalm 2> /dev/null) +XDSWI := $(shell command -v xd_swi 2> /dev/null) +HAS_PHPMD := $(shell command -v phpmd 2> /dev/null) +HAS_CSFIXER:= $(shell command -v php-cs-fixer 2> /dev/null) +XDSWI_STATUS:=$(shell command xd_swi stat 2> /dev/null) +HAS_PHIVE:=$(shell command phive --version 2> /dev/null) +CURRENT_BRANCH:=$(shell command git rev-parse --abbrev-ref HEAD 2> /dev/null) +DATENOW:=`date +'%Y-%m-%d'` +YELLOW=\033[0;33m +RED=\033[0;31m +WHITE=\033[0m +GREEN=\u001B[32m + + + + +disable_xdebug: + @if [[ "$(XDSWI)" != "" ]]; then \ + xd_swi off ;\ + fi + +enable_xdebug: + @if [[ "$(XDSWI)" != "" ]]; then \ + xd_swi $(new_status) ;\ + fi + +abort_suggesting_composer: + @if [ "0" != "$(XDSWI_STATUS)" ]; then \ + $(YELLOW)Warn: $(GREEN)xdebug$(WHITE) is enabled. Just saying... ;\ + fi + @if [ ! -f "$(executable)" ]; then \ + echo -e "$(GREEN)$(package_name)$(WHITE) $(RED)NOT FOUND$(WHITE) on $(CYAN)$(executable)$(WHITE). " ;\ + echo -e "Install it with $(GREEN)composer require --dev $(package_name)$(WHITE)" ;\ + echo ;\ + exit 1 ;\ + fi + +check_executable_or_exit_with_phive: + @if [ ! -f "$(executable)" ]; then \ + echo -e "$(GREEN)$(package_name)$(WHITE) $(RED)NOT FOUND$(WHITE) on $(CYAN)$(executable)$(WHITE). " ;\ + echo -e "Install it with $(GREEN)phive install $(package_name)$(WHITE)" ;\ + echo ;\ + exit 1 ;\ + fi + @if [ "0" != "$(XDSWI_STATUS)" ]; then \ + $(YELLOW)Warn: $(GREEN)xdebug$(WHITE) is enabled. Just saying... ;\ + fi + + +update_baselines: + @${MAKE} disable_xdebug --no-print-directory ;\ + find .build/phpstan -mtime +5 -type f -name "*.php" -exec rm -rf {} \; + @vendor/bin/phpstan analyze --configuration phpstan.neon --generate-baseline ;\ + find .build/psalm -mtime +5 -type f -exec rm -rf {} \; + @vendor/bin/psalm --config=psalm.xml --update-baseline --ignore-baseline --set-baseline=psalm-baseline.xml ;\ + ${MAKE} enable_xdebug new_status=$(XDSWI_STATUS) --no-print-directory + +.PHONY:abort_suggesting_composer check_executable_or_exit_with_phive update_baselines + +phpmd: package_name:=phpmd +phpmd: executable:= $(shell command -v phpmd 2> /dev/null) +phpmd: + @${MAKE} check_executable_or_exit_with_phive executable=$(executable) package_name=$(package_name) --no-print-directory + @phpmd src text .phpmd.xml --exclude=src/help/*,src/translations/* + +phpmd_checkstyle: + @${MAKE} phpmd > temp/phpmd.report.json ;\ + echo -e "$(GREEN)Finished PHPMD$(WHITE): waiting 1s" + @sleep 1 ;\ + php tools/phpmd_checkstyle.php ;\ + echo -e "$(GREEN)Formatted PHPMD$(WHITE): as checkStyle" + cat temp/phpmd.checkstyle.xml | vendor/bin/cs2pr + +csfixer: package_name:=friendsofphp/php-cs-fixer +csfixer: executable:=vendor/bin/php-cs-fixer +csfixer: +ifeq (,$(reportformat)) + $(eval reportformat='txt') +endif + @${MAKE} abort_suggesting_composer executable=$(executable) package_name=$(package_name) --no-print-directory + @mkdir -p .build/phpcs && touch .build/phpcs/csfixer.cache ;\ + vendor/bin/php-cs-fixer fix --config=.php_cs.php --cache-file=.build/phpcs/csfixer.cache --format=$(reportformat) $(dry_run) --diff + +csfixer_checkstyle: + @${MAKE} csfixer reportformat=checkstyle dry_run='--dry-run' --no-print-directory > temp/csfixer.checkstyle.xml ;\ + cat temp/csfixer.checkstyle.xml | vendor/bin/cs2pr ;\ + echo "" + +csfixer_dry: + @${MAKE} csfixer dry_run='--dry-run' --no-print-directory + + +phpcs: package_name=phpcs +phpcs: executable:= $(shell command -v phpcs 2> /dev/null) +phpcs: +ifeq (,$(reportformat)) + $(eval reportformat='diff') +endif + @${MAKE} check_executable_or_exit_with_phive executable=$(executable) package_name=$(package_name) --no-print-directory + @mkdir -p .build/phpcs && touch .build/phpcs/php-cs.cache ;\ + phpcs --standard=.phpcs.xml --parallel=2 --cache=.build/phpcs/php-cs.cache --report=$(reportformat) src/* + + + +phpcs_checkstyle: + @${MAKE} phpcs reportformat=checkstyle --no-print-directory > temp/phpcs.checkstyle.xml ;\ + echo -e "Finished $(GREEN)phpcs$(WHITE): waiting 1s" + @sleep 1 ;\ + cat temp/phpcs.checkstyle.xml | vendor/bin/cs2pr + + +psalm: + $(eval executable:=vendor/bin/psalm) + $(eval package_name:=vimeo/psalm) + @${MAKE} abort_suggesting_composer executable=$(executable) package_name=$(package_name) --no-print-directory + @mkdir -p .build/psalm ;\ + echo -e "Running:" ;\ + echo -e "$(GREEN)vendor/bin/psalm$(WHITE) --show-info=false --long-progress --threads=2 --config=psalm.xml " + @vendor/bin/psalm --show-info=false --long-progress --threads=2 --config=psalm.xml + + + +phpstan: + $(eval executable:=vendor/bin/phpstan) + $(eval package_name:=phpstan/phpstan) + @${MAKE} abort_suggesting_composer executable=$(executable) package_name=$(package_name) --no-print-directory + @mkdir -p .build/phpstan ;\ + echo -e "Running:" ;\ + echo -e "$(GREEN)vendor/bin/phpstan$(WHITE) analyse --memory-limit=2G --configuration phpstan.neon " + + @vendor/bin/phpstan analyse --memory-limit=2G --configuration phpstan.neon + +phpstan_checkstyle: + @${MAKE} phpstan error-format=checkstyle > temp/phpstan.checkstyle.xml ;\ + cat temp/phpstan.checkstyle.xml | vendor/bin/cs2pr ;\ + echo "" + +lint: + $(eval executable:=vendor/bin/parallel-lint ) + $(eval package_name:=php-parallel-lint/php-parallel-lint ) + @${MAKE} abort_suggesting_composer executable=$(executable) package_name=$(package_name) --no-print-directory + mkdir -p .build/parallel ;\ + $(executable) --ignore-fails --exclude vendor src + + +fixers: dependency_analysis lint csfixer_dry psalm phpstan phpcs + + + +install_dev_deps: + @if [ "$(HAS_PHIVE)" == "" ]; then \ + echo -e "$(GREEN)phive$(WHITE) is $(RED)NOT$(WHITE) installed. " ;\ + echo -e "Visit $(GREEN)https://github.com/phar-io/phive$(WHITE) and follow install procedure" ;\ + else \ + phive install phpmd ;\ + phive install phpcpd ;\ + phive install phpcs ;\ + phive install composer-unused ;\ + phive install composer-require-checker ;\ + curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b tools ;\ + fi ;\ + echo "" + + +.PHONY: dependency_analysis +dependency_analysis: vendor ## Runs a dependency analysis with maglnet/composer-require-checker + $(eval executable:=tools/composer-require-checker) + $(eval package_name:=composer-require-checker ) + @${MAKE} check_executable_or_exit_with_phive executable=$(executable) package_name=$(package_name) --no-print-directory + @$(executable) check --config-file=$(shell pwd)/composer-require-checker.json + tools/composer-unused --excludePackage=adodb/adodb-php + + + + +reviewdog: + $(eval executable:=tools/reviewdog) + $(eval package_name:=reviewdog ) + @if [ ! -f "$(executable)" ]; then \ + echo -e "$(GREEN)$(package_name)$(WHITE) $(RED)NOT FOUND$(WHITE) on $(CYAN)$(executable)$(WHITE). " ;\ + echo -e "Install it with " ;\ + echo -e "curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b tools " ;\ + exit 1 ;\ + fi + @tools/reviewdog -diff="git diff develop" \ No newline at end of file diff --git a/package.json b/package.json index 92f92bd6..e2f6991b 100644 --- a/package.json +++ b/package.json @@ -5,11 +5,26 @@ "repository": "git@github.com:HuasoFoundries/phpPgAdmin6.git", "author": "ffflabs ", "license": "MIT", + "scripts": { + "build": "npm run compile_less && workbox injectManifest workbox-config.js && yarn disable_development_mode", + "disable_development_mode":"sed -i 's/development_assets=true/development_assets=false/' assets/templates/components/common_head.twig ", + "compile_less": "lessc assets/themes/global.less assets/themes/global.css", + "eslint": "eslint --fix --ext js --ignore-path .eslintignore assets", + "prettier": "prettier -c --config .prettierrc assets/{js,themes}/*" + }, "devDependencies": { + "@types/jquery": "^3.5.1", "babel-eslint": "^10.1.0", "eslint": "^7.8.1", "eslint-config-prettier": "^6.11.0", "eslint-plugin-prettier": "^3.1.4", - "prettier": "^2.1.1" - } + "lessc": "^1.0.2", + "melody-idom": "^1.7.5", + "melody-runtime": "^1.7.5", + "prettier": "^2.1.1", + "prettier-plugin-twig-melody": "^0.4.6", + "tslib": "^2.0.1", + "typescript": "^4.0.3" + }, + "dependencies": {} } diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 00000000..14526e88 --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,492 @@ +parameters: + ignoreErrors: + - + message: "#^Call to method setFetchMode\\(\\) on an unknown class the\\.$#" + count: 2 + path: src/classes/Connection.php + + - + message: "#^Call to method connect\\(\\) on an unknown class the\\.$#" + count: 2 + path: src/classes/Connection.php + + - + message: "#^PHPDoc tag @property has invalid value \\(\\)\\: Unexpected token \"\\\\n \", expected type at offset 540$#" + count: 1 + path: src/classes/ContainerUtils.php + + - + message: "#^Method PHPPgAdmin\\\\ContainerUtils\\:\\:getRedirectUrl\\(\\) invoked with 1 parameter, 0 required\\.$#" + count: 1 + path: src/classes/ContainerUtils.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\ContainerUtils\\:\\:\\$debug\\.$#" + count: 1 + path: src/classes/ContainerUtils.php + + - + message: "#^PHPDoc tag @var contains unresolvable type\\.$#" + count: 1 + path: src/classes/Misc.php + + - + message: "#^Result of method PHPPgAdmin\\\\Misc\\:\\:halt\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/classes/Misc.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\AggregatesController\\:\\:doCreate\\(\\) \\(void\\) is used\\.$#" + count: 4 + path: src/controllers/AggregatesController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\AlldbController\\:\\:doDefault\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/AlldbController.php + + - + message: "#^PHPDoc tag @param references unknown parameter\\: \\$no_db_connection$#" + count: 1 + path: src/controllers/BaseController.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Controller\\\\BaseController\\:\\:\\$postgresqlMinVer\\.$#" + count: 1 + path: src/controllers/BaseController.php + + - + message: "#^Call to an undefined method PHPPgAdmin\\\\Controller\\\\ConstraintsController\\:\\:doTree\\(\\)\\.$#" + count: 1 + path: src/controllers/ConstraintsController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\ConstraintsController\\:\\:doDefault\\(\\) \\(void\\) is used\\.$#" + count: 7 + path: src/controllers/ConstraintsController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\ConstraintsController\\:\\:formPrimaryOrUniqueKey\\(\\) \\(void\\) is used\\.$#" + count: 2 + path: src/controllers/ConstraintsController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\ConstraintsController\\:\\:formAddForeignKey\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/ConstraintsController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\DatabaseController\\:\\:currentLocks\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/DatabaseController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\DatabaseController\\:\\:currentProcesses\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/DatabaseController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\DatabaseController\\:\\:doFind\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/DatabaseController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\DatabaseController\\:\\:doAdmin\\(\\) \\(void\\) is used\\.$#" + count: 2 + path: src/controllers/DatabaseController.php + + - + message: "#^PHPDoc tag @param references unknown parameter\\: \\$confirm$#" + count: 1 + path: src/controllers/DatabaseController.php + + - + message: "#^PHPDoc tag @param references unknown parameter\\: \\$msg$#" + count: 1 + path: src/controllers/DatabaseController.php + + - + message: "#^Cannot unset offset 'vars' on array\\('content' \\=\\> mixed, 'attr' \\=\\> array\\('href' \\=\\> array\\('url' \\=\\> mixed, 'urlvars' \\=\\> array\\('subject' \\=\\> mixed, 'action' \\=\\> 'confeditautovac', 'schema' \\=\\> mixed, 'table' \\=\\> mixed\\)\\)\\)\\)\\.$#" + count: 1 + path: src/controllers/DatabaseController.php + + - + message: "#^Cannot unset offset 'vars' on array\\('content' \\=\\> mixed, 'attr' \\=\\> array\\('href' \\=\\> array\\('url' \\=\\> mixed, 'urlvars' \\=\\> array\\('subject' \\=\\> mixed, 'action' \\=\\> 'confdelautovac', 'schema' \\=\\> mixed, 'table' \\=\\> mixed\\)\\)\\)\\)\\.$#" + count: 1 + path: src/controllers/DatabaseController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\DataexportController\\:\\:doDefault\\(\\) \\(void\\) is used\\.$#" + count: 2 + path: src/controllers/DataexportController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\DisplayController\\:\\:doBrowseFK\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/DisplayController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\BaseController\\:\\:halt\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/DisplayController.php + + - + message: "#^Variable \\$subject in isset\\(\\) always exists and is not nullable\\.$#" + count: 1 + path: src/controllers/DisplayController.php + + - + message: "#^Access to property \\$name on an unknown class the\\.$#" + count: 2 + path: src/controllers/DisplayController.php + + - + message: "#^Access to property \\$type on an unknown class the\\.$#" + count: 1 + path: src/controllers/DisplayController.php + + - + message: "#^Parameter \\#1 \\(void\\) of echo cannot be converted to string\\.$#" + count: 1 + path: src/controllers/DisplayController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Database\\\\Postgres\\:\\:printField\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/DisplayController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\DisplayController\\:\\:formEditRow\\(\\) \\(void\\) is used\\.$#" + count: 2 + path: src/controllers/DisplayController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\FulltextController\\:\\:doCreateConfig\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/FulltextController.php + + - + message: "#^Variable \\$mapping might not be defined\\.$#" + count: 1 + path: src/controllers/FulltextController.php + + - + message: "#^Method PHPPgAdmin\\\\Controller\\\\FunctionsController\\:\\:showDefinition\\(\\) invoked with 0 parameters, 2 required\\.$#" + count: 1 + path: src/controllers/FunctionsController.php + + - + message: "#^Undefined variable\\: \\$f$#" + count: 1 + path: src/controllers/FunctionsController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\FunctionsController\\:\\:_printNavLinks\\(\\) \\(void\\) is used\\.$#" + count: 4 + path: src/controllers/FunctionsController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\FunctionsController\\:\\:doDefault\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/FunctionsController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\HistoryController\\:\\:doDownloadHistory\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/HistoryController.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Controller\\\\InfoController\\:\\:\\$shownull\\.$#" + count: 21 + path: src/controllers/InfoController.php + + - + message: "#^Comparison operation \"\\<\" between 0 and \\(array\\|float\\|int\\) results in an error\\.$#" + count: 5 + path: src/controllers/InfoController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\MaterializedviewpropertiesController\\:\\:doDefault\\(\\) \\(void\\) is used\\.$#" + count: 2 + path: src/controllers/MaterializedviewpropertiesController.php + + - + message: "#^Cannot call method alterMatView\\(\\) on PHPPgAdmin\\\\Database\\\\Postgres\\|void\\.$#" + count: 1 + path: src/controllers/MaterializedviewpropertiesController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\MaterializedviewsController\\:\\:doDefault\\(\\) \\(void\\) is used\\.$#" + count: 2 + path: src/controllers/MaterializedviewsController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\MaterializedviewsController\\:\\:doWizardCreate\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/MaterializedviewsController.php + + - + message: "#^Parameter \\#1 \\(void\\) of echo cannot be converted to string\\.$#" + count: 1 + path: src/controllers/MaterializedviewsController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Database\\\\Postgres\\:\\:printField\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/MaterializedviewsController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\BaseController\\:\\:halt\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/MaterializedviewsController.php + + - + message: "#^PHPDoc tag @param references unknown parameter\\: \\$msg$#" + count: 1 + path: src/controllers/SchemasController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\SchemasController\\:\\:doDefault\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/SchemasController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\SequencesController\\:\\:doDefault\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/SequencesController.php + + - + message: "#^Access to property \\$name on an unknown class the\\.$#" + count: 1 + path: src/controllers/SqlController.php + + - + message: "#^Access to property \\$type on an unknown class the\\.$#" + count: 1 + path: src/controllers/SqlController.php + + - + message: "#^Parameter \\#2 \\(void\\) of echo cannot be converted to string\\.$#" + count: 1 + path: src/controllers/TablesController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Database\\\\Postgres\\:\\:printField\\(\\) \\(void\\) is used\\.$#" + count: 3 + path: src/controllers/TablesController.php + + - + message: "#^Parameter \\#1 \\(void\\) of echo cannot be converted to string\\.$#" + count: 2 + path: src/controllers/TablesController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\TablesController\\:\\:formInsertRow\\(\\) \\(void\\) is used\\.$#" + count: 3 + path: src/controllers/TablesController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\TablesController\\:\\:doDefault\\(\\) \\(void\\) is used\\.$#" + count: 2 + path: src/controllers/TablesController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\TablesController\\:\\:doAdmin\\(\\) \\(void\\) is used\\.$#" + count: 2 + path: src/controllers/TablesController.php + + - + message: "#^PHPDoc tag @param references unknown parameter\\: \\$confirm$#" + count: 1 + path: src/controllers/TablesController.php + + - + message: "#^PHPDoc tag @param references unknown parameter\\: \\$msg$#" + count: 1 + path: src/controllers/TablesController.php + + - + message: "#^Cannot unset offset 'vars' on array\\('content' \\=\\> mixed, 'attr' \\=\\> array\\('href' \\=\\> array\\('url' \\=\\> mixed, 'urlvars' \\=\\> array\\('subject' \\=\\> mixed, 'action' \\=\\> 'confeditautovac', 'schema' \\=\\> mixed, 'table' \\=\\> mixed\\)\\)\\)\\)\\.$#" + count: 1 + path: src/controllers/TablesController.php + + - + message: "#^Cannot unset offset 'vars' on array\\('content' \\=\\> mixed, 'attr' \\=\\> array\\('href' \\=\\> array\\('url' \\=\\> mixed, 'urlvars' \\=\\> array\\('subject' \\=\\> mixed, 'action' \\=\\> 'confdelautovac', 'schema' \\=\\> mixed, 'table' \\=\\> mixed\\)\\)\\)\\)\\.$#" + count: 1 + path: src/controllers/TablesController.php + + - + message: "#^Variable \\$icon might not be defined\\.$#" + count: 1 + path: src/controllers/TblpropertiesController.php + + - + message: "#^Variable \\$type might not be defined\\.$#" + count: 1 + path: src/controllers/TblpropertiesController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\ViewsController\\:\\:doDefault\\(\\) \\(void\\) is used\\.$#" + count: 2 + path: src/controllers/ViewsController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\ViewsController\\:\\:doWizardCreate\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/ViewsController.php + + - + message: "#^Parameter \\#1 \\(void\\) of echo cannot be converted to string\\.$#" + count: 1 + path: src/controllers/ViewsController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Database\\\\Postgres\\:\\:printField\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/ViewsController.php + + - + message: "#^Result of method PHPPgAdmin\\\\Controller\\\\BaseController\\:\\:halt\\(\\) \\(void\\) is used\\.$#" + count: 1 + path: src/controllers/ViewsController.php + + - + message: "#^Call to method recordCount\\(\\) on an unknown class RecordSet\\.$#" + count: 1 + path: src/database/ADOdbBase.php + + - + message: "#^Access to property \\$fields on an unknown class RecordSet\\.$#" + count: 1 + path: src/database/ADOdbBase.php + + - + message: "#^Access to an undefined property ADODB_postgres9\\:\\:\\$platform\\.$#" + count: 1 + path: src/database/ADOdbBase.php + + - + message: "#^Method PHPPgAdmin\\\\Database\\\\Postgres\\:\\:_alterTable\\(\\) invoked with 8 parameters, 6\\-7 required\\.$#" + count: 1 + path: src/database/Postgres.php + + - + message: "#^PHPDoc tag @param references unknown parameter\\: \\$owner$#" + count: 1 + path: src/database/Postgres.php + + - + message: "#^PHPDoc tag @param references unknown parameter\\: \\$fields$#" + count: 1 + path: src/database/Postgres.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\ActionUrlDecorator\\:\\:\\$base\\.$#" + count: 2 + path: src/decorators/ActionUrlDecorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\ActionUrlDecorator\\:\\:\\$queryVars\\.$#" + count: 1 + path: src/decorators/ActionUrlDecorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\ArrayMergeDecorator\\:\\:\\$m\\.$#" + count: 2 + path: src/decorators/ArrayMergeDecorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\BranchUrlDecorator\\:\\:\\$base\\.$#" + count: 2 + path: src/decorators/BranchUrlDecorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\BranchUrlDecorator\\:\\:\\$queryVars\\.$#" + count: 1 + path: src/decorators/BranchUrlDecorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\CallbackDecorator\\:\\:\\$fn\\.$#" + count: 2 + path: src/decorators/CallbackDecorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\CallbackDecorator\\:\\:\\$p\\.$#" + count: 2 + path: src/decorators/CallbackDecorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\ConcatDecorator\\:\\:\\$c\\.$#" + count: 2 + path: src/decorators/ConcatDecorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\Decorator\\:\\:\\$val\\.$#" + count: 2 + path: src/decorators/Decorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\FieldDecorator\\:\\:\\$f\\.$#" + count: 3 + path: src/decorators/FieldDecorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\FieldDecorator\\:\\:\\$d\\.$#" + count: 2 + path: src/decorators/FieldDecorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\IfEmptyDecorator\\:\\:\\$val\\.$#" + count: 2 + path: src/decorators/IfEmptyDecorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\IfEmptyDecorator\\:\\:\\$empty\\.$#" + count: 2 + path: src/decorators/IfEmptyDecorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\IfEmptyDecorator\\:\\:\\$full\\.$#" + count: 1 + path: src/decorators/IfEmptyDecorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\RedirectUrlDecorator\\:\\:\\$base\\.$#" + count: 2 + path: src/decorators/RedirectUrlDecorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\RedirectUrlDecorator\\:\\:\\$queryVars\\.$#" + count: 1 + path: src/decorators/RedirectUrlDecorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\ReplaceDecorator\\:\\:\\$s\\.$#" + count: 2 + path: src/decorators/ReplaceDecorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\ReplaceDecorator\\:\\:\\$p\\.$#" + count: 2 + path: src/decorators/ReplaceDecorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\UrlDecorator\\:\\:\\$base\\.$#" + count: 2 + path: src/decorators/UrlDecorator.php + + - + message: "#^Access to an undefined property PHPPgAdmin\\\\Decorators\\\\UrlDecorator\\:\\:\\$queryVars\\.$#" + count: 1 + path: src/decorators/UrlDecorator.php + + - + message: "#^Constructor of class PHPPgAdmin\\\\XHtml\\\\XHtmlOption has an unused parameter \\$value\\.$#" + count: 1 + path: src/xhtml/XHtmlOption.php + + - + message: "#^Constructor of class PHPPgAdmin\\\\XHtml\\\\XHtmlSimpleElement has an unused parameter \\$element\\.$#" + count: 1 + path: src/xhtml/XHtmlSimpleElement.php + diff --git a/phpstan.neon b/phpstan.neon index 8f96d6e8..12731493 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,3 +1,5 @@ +includes: + - phpstan-baseline.neon parameters: @@ -8,9 +10,9 @@ parameters: tmpDir: ./.build/phpstan # The level 8 is the highest level - level: 3 - - autoload_files: + level: 2 + + scanFiles: - vendor/adodb/adodb-php/adodb.inc.php - .configs/debug.kint.php - src/lib.inc.php @@ -27,37 +29,3 @@ parameters: - src/router.php treatPhpDocTypesAsCertain: false - - - - - ignoreErrors: - -# - -# message: "#^Offset '[a-zA-Z0-9_]+' does not exist on array[.*].$#" -# path: src/* - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$[a-zA-Z0-9_]+$#" - path: src/* - - - message: "#^Access to an undefined property Psr\\\\[a-zA-Z0-9_]+\\\\[a-zA-Z0-9_]+\\:\\:\\$[a-zA-Z0-9_]+\\.$#" - path: src/* - - - - message: "#^Access to an undefined property PHPPgAdmin\\\\[a-zA-Z0-9_]+\\\\[a-zA-Z0-9_]+\\:\\:\\$[a-zA-Z0-9_]+\\.$#" - path: src/* - - - message: "#^Result of method PHPPgAdmin\\\\[a-zA-Z0-9_]+\\\\[a-zA-Z0-9_]+\\:\\:[a-zA-Z0-9_]+\\(\\) \\(void\\) is used\\.$#" - path: src/* - - - - message: "#^Call to static method br2ln\\(\\) on trait PHPPgAdmin\\Traits\\HelperTrait\\.#" - path: src/* - - - - message: "#^Constructor of class [a-zA-Z0-9_]+\\\\[a-zA-Z0-9_]+\\\\[a-zA-Z0-9_]+ has an unused parameter \\$[a-zA-Z0-9_]+\\.$#" - path: src/* - #- '#Property [^\s] has no typehint specified#' - #- '#Call to an undefined method [a-zA-Z0-9\\_]+::expects\(\)#' - #- '#Access to an undefined property PHPPgAdmin::\$[a-zA-Z0-9_]+#' - #- '#Call to an undefined method PHPUnit_Framework_MockObject_MockObject::[a-zA-Z0-9_]+\(\)#' diff --git a/psalm-baseline.xml b/psalm-baseline.xml new file mode 100644 index 00000000..030d4cf4 --- /dev/null +++ b/psalm-baseline.xml @@ -0,0 +1,599 @@ + + + + + VarCloner + CliDumper + HtmlDumper + ServerDumper + + + + + parent::fetchField() + + + \ADOFieldObject + + + parent::fetchField() + + + + + null + null + + + $this->conn + $this->conn + + + + + $container->BASE_PATH + $container->subFolder + $container->debug + $container->THEME_PATH + $container->IN_TEST + $container->subFolder + + + + + string + + + $this->_server_id + + + + + $_REQUEST + + + + + $_POST + $_POST + $_POST + + + + + $this->postgresqlMinVer + + + + + $casts + + + + + null + + + $_REQUEST + + + + + $_POST + $_POST + $_POST + $_POST + $_POST + + + doTree + + + + + $_REQUEST + + + + + $version[1] + + + + + $urlvars['search_path'] + + + $resultset->recordCount() + + + $_gets['subject'] + $fields['schema'] + + + $_REQUEST + $_REQUEST + $_REQUEST + $_REQUEST + $_POST + + + $resultset->recordCount() + $resultset->recordCount() + $resultset->fetchField($index) + $finfo->name + $finfo->name + $resultset->fetchField($j++) + $finfo->type + + + + + $_POST + $_POST + $_POST + + + + + $items + + + $_POST + $_POST + $_POST + $_POST + $_POST + $_POST + + + $ftscfg->recordCount() + $ftsdict->recordCount() + $ftsdicts->recordCount() + $ftsdicts->recordCount() + + + + + $_POST['formFunction'] + $_POST['formObjectFile'] + $_POST['formLinkSymbol'] + $_POST['formLinkSymbol'] + $_POST['formDefinition'] + $_POST['formComment'] + $_POST['formObjectFile'] + $_POST['formLinkSymbol'] + $_POST['formLinkSymbol'] + $_POST['formDefinition'] + $_POST['formComment'] + $_POST['formCost'] + $_POST['formRows'] + + + string + + + $this->_printNavLinks('functions-properties', $func_full) + $this->_printNavLinks('functions-properties', $func_full) + + + showDefinition + + + $f + + + + + $_POST + $_POST + $_POST + + + + + $formIndexName + $formWhere + $this->getPostParam('formIndexName', '') + $this->getPostParam('formIndexType') + $this->getPostParam('formUnique') + $formWhere + $formSpc + $this->getPostParam('formConcur') + $this->getPostParam('index') + $this->getPostParam('cascade') + + + $_REQUEST + $_REQUEST + $_REQUEST + $_POST + + + + + $this->shownull + + + $this->shownull + $this->shownull + $this->shownull + $this->shownull + + + + + $_REQUEST + $_POST + + + + + $_REQUEST + $_REQUEST + + + + + $_REQUEST + $_REQUEST + + + + + $_POST + $_POST + $_POST + $_POST + + + + + $_POST + + + + + $_POST + $_POST + + + + + $sequences + + + $_POST + $_POST + $_POST + + + $sequence->recordCount() + $sequence->recordCount() + $sequence->recordCount() + + + + + $rs->recordCount() + + + $data->conn->Execute($this->query) + $rs->recordCount() + $rs->fetchField($k) + $finfo->name + $rs->fetchField($k) + $finfo->type + $rs->recordCount() + + + + + $_REQUEST + $_REQUEST + + + + + $_REQUEST + $_POST + $_POST + + + $tables->recordCount() + + + + + $_POST + $_POST + + + + + $_POST + $_POST + $_REQUEST + $_POST + + + + + $this->printTreeJSON($treedata, $attrs, $print) + + + \Slim\Http\Response|string + + + $_treedata + + + + + $_POST + + + + + $types + $vals + + + $_REQUEST + $_REQUEST + $_POST + + + $typedata->recordCount() + $vals->getArray() + $vals + $vals + + + + + $_POST + $_POST + + + + + $_REQUEST + $_POST + + + + + $_REQUEST + $_REQUEST + + + + + $e->getCode() + $this->conn->Execute($sql) + $e->getCode() + $this->conn->ErrorNo() + $this->conn->ErrorMsg() + + + int|\PHPPgAdmin\ADORecordSet + int|\PHPPgAdmin\ADORecordSet + int + string + + + $this->conn->Execute($sql) + $this->conn->Execute($sql) + $this->conn->ErrorNo() + $this->conn->ErrorMsg() + $this->conn->Execute($sql) + $rs + $this->conn->Execute($sql) + $this->conn->Execute($sql) + $this->conn->Execute($setClause . $whereClause) + + + + + $i + + + + + $template['schema'] + $template['name'] + $template['schema'] + $template['name'] + + + + + else { + + + \PHPPgAdmin\ADORecordSet + + + null + + + + + int + + + + + $seq->recordCount() + $data->recordCount() + + + + + $privs + + + \PHPPgAdmin\ADORecordSet + bool + + + + + int + + + + + $this->base + $this->queryVars + $this->base + $this->queryVars + + + $this->base + + + + + $this->m + + + $this->m + + + + + $this->base + $this->queryVars + $this->base + $this->queryVars + + + $this->base + + + + + $this->fn + $this->p + + + $this->fn + $this->p + + + + + $this->c + + + $this->c + + + + + $this->val + + + $this->val + + + + + $this->f + $this->d + + + $this->f + $this->d + + + + + $this->val + $this->empty + $this->full + $this->val + $this->empty + $this->full + + + $this->val + $this->empty + + + + + $this->base + $this->queryVars + $this->base + $this->queryVars + + + $this->base + + + + + $this->s + $this->p + + + $this->s + $this->p + + + + + $this->base + $this->queryVars + $this->base + $this->queryVars + + + $this->base + + + + + $this + $this + $this + $this + $this + $this + $this + + + + + $actions['edit']['vars'] + $actions['delete']['vars'] + + + empty($_REQUEST['table']) + + + $autovac->recordCount() + + + + + $set->recordCount() + + + + + $formLink[$i]['operator'] + + + $_POST + + + + + else { + + + diff --git a/psalm.xml b/psalm.xml index 03fcae93..d2938f69 100644 --- a/psalm.xml +++ b/psalm.xml @@ -3,6 +3,7 @@ totallyTyped="false" errorLevel="3" resolveFromConfigFile="true" + autoloader="src/lib.inc.php" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" @@ -13,7 +14,7 @@ - + diff --git a/rector.php b/rector.php new file mode 100644 index 00000000..b8f25bcb --- /dev/null +++ b/rector.php @@ -0,0 +1,48 @@ +parameters(); + + $parameters->set(Option::AUTO_IMPORT_NAMES, true); + + $parameters->set(Option::SETS, [ + SetList::ACTION_INJECTION_TO_CONSTRUCTOR_INJECTION, + SetList::ARRAY_STR_FUNCTIONS_TO_STATIC_CALL, + SetList::CODE_QUALITY, + SetList::PHP_53, + SetList::PHP_54, + SetList::PHP_56, + SetList::PHP_70, + SetList::PHP_71, + SetList::PHP_72, + SetList::PHPSTAN, + SetList::PHPUNIT_CODE_QUALITY, + SetList::SOLID, + ]); + $parameters->set(Option::SKIP, [ + Rector\SOLID\Rector\Property\AddFalseDefaultToBoolPropertyRector::class => [ + // single file + __DIR__ . '/src/classes/Connection.php', + // or directory + __DIR__ . '/src/database/databasetraits/HasTrait.php' + + ] + ]); + $parameters->set(Option::PHP_VERSION_FEATURES, '7.2'); + $parameters->set(Option::ENABLE_CACHE, true); + $parameters->set(Option::CACHE_DIR, __DIR__ . '/.build/rector'); + $parameters->set(Option::PATHS, [ + __DIR__ . '/src', + //__DIR__ . '/tests' + ]); + $parameters->set(Option::EXCLUDE_RECTORS, [ + StaticCallOnNonStaticToInstanceCallRector::class, + ]); +}; \ No newline at end of file diff --git a/src/classes/ADONewConnection.php b/src/classes/ADONewConnection.php index 8f998c3b..5ee2b239 100644 --- a/src/classes/ADONewConnection.php +++ b/src/classes/ADONewConnection.php @@ -6,11 +6,6 @@ namespace PHPPgAdmin; -/** - * @file - * Extends \ADODB_postgres9 to let correct inference on PHPDoc params - */ - /** * Extends \ADODB_postgres9 to let correct inference on PHPDoc params. */ diff --git a/src/classes/ADORecordSet.php b/src/classes/ADORecordSet.php index 74c3f989..2d0e9ec0 100644 --- a/src/classes/ADORecordSet.php +++ b/src/classes/ADORecordSet.php @@ -6,11 +6,6 @@ namespace PHPPgAdmin; -/** - * @file - * Extends ADORecordSet to let correct inference on PHPDoc params - */ - /** * Extends ADORecordSet to let correct inference on PHPDoc params. */ diff --git a/src/classes/ADOdbException.php b/src/classes/ADOdbException.php index 59456343..8211297c 100644 --- a/src/classes/ADOdbException.php +++ b/src/classes/ADOdbException.php @@ -31,20 +31,42 @@ class ADOdbException extends \Exception public $fn; + /** + * Undocumented variable. + * + * @var string + */ public $sql = ''; + /** + * Undocumented variable. + * + * @var string + */ public $params = ''; + /** + * Undocumented variable. + * + * @var string + */ public $host = ''; public $database = ''; + /** + * Undocumented variable. + * + * @var string + */ + public $msg = ''; + /** * Default Error Handler. This will be called with the following params. * * @param string $dbms the RDBMS you are connecting to * @param string $fn the name of the calling function (in uppercase) - * @param number $errno the native error number from the database + * @param int $errno the native error number from the database * @param string $errmsg the native error msg from the database * @param string $p1 $fn specific parameter - see below * @param string $p2 parameter 2 @@ -95,7 +117,7 @@ class ADOdbException extends \Exception * * @param string $dbms the RDBMS you are connecting to * @param string $fn the name of the calling function (in uppercase) - * @param number $errno the native error number from the database + * @param int $errno the native error number from the database * @param string $errmsg the native error msg from the database * @param string $p1 $fn specific parameter - see below * @param string $p2 parameter 2 @@ -121,49 +143,18 @@ class ADOdbException extends \Exception 'spacer' => ' ', 'line' => $backtrace[0]['line'], ]; - - $errmsg = \htmlentities(\PHPPgAdmin\Traits\HelperTrait::br2ln($errmsg), \ENT_NOQUOTES); - $p1 = \htmlentities(\PHPPgAdmin\Traits\HelperTrait::br2ln($p1), \ENT_NOQUOTES); - $p2 = \htmlentities(\PHPPgAdmin\Traits\HelperTrait::br2ln($p2), \ENT_NOQUOTES); - - switch ($fn) { - case 'EXECUTE': - $sql = \str_replace( - [ - 'SELECT', - 'WHERE', - 'GROUP BY', - 'FROM', - 'HAVING', - 'LIMIT', - ], - ["\nSELECT", "\nWHERE", "\nGROUP BY", "\nFROM", "\nHAVING", "\nLIMIT"], - $p1 - ); - - $inputparams = $p2; - - $error_msg = '

    strsqlerror
    ' . \nl2br($errmsg) . '

    SQL:
    ' . \nl2br($sql) . '

    '; - - echo '
     
    ' . \nl2br($error_msg) . '

    ' . "\n"; - - break; - case 'PCONNECT': - case 'CONNECT': - // do nothing; - break; - - default: - $s = "{$dbms} error: [{$errno}: {$errmsg}] in {$fn}({$p1}, {$p2})\n"; - echo "
    {$s}

    \n"; - - break; - } + $errmsg = \htmlentities(\PHPPgAdmin\ContainerUtils::br2ln($errmsg), \ENT_NOQUOTES); + $p1 = \htmlentities(\PHPPgAdmin\ContainerUtils::br2ln($p1), \ENT_NOQUOTES); + $p2 = \htmlentities(\PHPPgAdmin\ContainerUtils::br2ln($p2), \ENT_NOQUOTES); $tag = \implode('', $btarray0); //\PC::debug(['errno' => $errno, 'fn' => $fn, 'errmsg' => $errmsg], $tag); - throw new self($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection); + $adoException = new self($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection); + echo "
    {$adoException->msg}

    \n"; + + // adodb_backtrace($adoException->getTrace()); + throw $adoException; } } diff --git a/src/classes/Connection.php b/src/classes/Connection.php index c63ffe21..7654d503 100644 --- a/src/classes/Connection.php +++ b/src/classes/Connection.php @@ -49,19 +49,23 @@ class Connection */ private $pgVersion; + /** + * @var string + */ + private $_captured_error; + private $adodb_driver = 'postgres9'; - // or pdo // The backend platform. Set to UNKNOWN by default. private $_connection_result; /** * Creates a new connection. Will actually make a database connection. * - * @param array $server_info - * @param string $database database name - * @param \Slim\Container $container - * @param int $fetchMode Defaults to associative. Override for different behaviour + * @param array $server_info + * @param string $database database name + * @param \PHPPgAdmin\ContainerUtils $container + * @param int $fetchMode Defaults to associative. Override for different behaviour */ public function __construct($server_info, $database, $container, $fetchMode = ADODB_FETCH_ASSOC) { @@ -75,37 +79,15 @@ class Connection $this->container = $container; - // ADODB_Postgres9 Approach - //$driver='postgres9'; - $this->conn = \ADONewConnection($this->adodb_driver); + $this->conn = 'pdo' === $this->adodb_driver ? + $this->getPDOConnection($host, $port, $sslmode, $database, $user, $password, $fetchMode) : + $this->getPG9Connection($host, $port, $sslmode, $database, $user, $password, $fetchMode); $this->conn->setFetchMode($fetchMode); - // PDO Approach - - /*try { - $this->_connection_result = $this->conn->connect($pghost, $user, $password, $database); - $this->prtrace(['_connection_result' => $this->_connection_result, 'conn' => $this->conn]); - } catch (\PHPPgAdmin\ADOdbException $e) { - $this->prtrace(['message' => $e->getMessage(), 'trace' => $e->getTraceAsString()]); - */ - try { - $connectionResult = 'pdo' === $this->adodb_driver ? - $this->getPDOConnection($host, $port, $sslmode, $database, $user, $password, $fetchMode) : - $this->getPG9Connection($host, $port, $sslmode, $database, $user, $password, $fetchMode); - - //$this->prtrace($this->conn); - } catch (\Exception $e) { - //dump($dsnString, $this->adodb_driver); - $this->prtrace($e->getMessage(), \array_slice($e->getTrace(), 0, 10)); - } + //$this->prtrace($this->conn); } - public function getConnectionResult() - { - return $this->_connection_result; - } - - public function getVersion() + public function getVersion(): string { return $this->pgVersion; } @@ -124,6 +106,7 @@ class Connection return null; } $serverInfo = $this->conn->ServerInfo(); + $this->dump($serverInfo); $this->pgVersion = $serverInfo['version']; $description = "PostgreSQL {$this->pgVersion}"; @@ -171,8 +154,7 @@ class Connection ?string $user, ?string $password, int $fetchMode = \ADODB_FETCH_ASSOC - ): \ADODB_postgres9 - { + ): \ADODB_postgres9 { $this->conn = ADONewConnection('postgres9'); $this->conn->setFetchMode($fetchMode); // Ignore host if null @@ -192,8 +174,10 @@ class Connection } elseif ('legacy' === $sslmode) { $pghost .= ' requiressl=1'; } + \ob_start(); + $this->_connection_result = $this->conn->connect($pghost, $user, $password, $database); - $this->conn->connect($pghost, $user, $password, $database); + $this->_captured_error = \ob_get_clean(); return $this->conn; } @@ -206,8 +190,7 @@ class Connection ?string $user, ?string $password, int $fetchMode = \ADODB_FETCH_ASSOC - ): \ADODB_pdo - { + ): \ADODB_pdo { $this->conn = ADONewConnection('pdo'); $this->conn->setFetchMode($fetchMode); $dsnString = \sprintf('pgsql:host=%s;port=%d;dbname=%s;sslmode=%s;application_name=PHPPgAdmin6', $host, $port, $database, $sslmode); diff --git a/src/classes/ContainerHandlers.php b/src/classes/ContainerHandlers.php new file mode 100644 index 00000000..fc5e716c --- /dev/null +++ b/src/classes/ContainerHandlers.php @@ -0,0 +1,146 @@ +container = $container; + } + + public function storeMainRequestParams(): self + { + $this->container['action'] = $_REQUEST['action'] ?? ''; + // This should be deprecated once we're sure no php scripts are required directly + $this->container->offsetSet('server', $_REQUEST['server'] ?? null); + $this->container->offsetSet('database', $_REQUEST['database'] ?? null); + $this->container->offsetSet('schema', $_REQUEST['schema'] ?? null); + + return $this; + } + + /** + * Sets the views. + * + * @return self ( description_of_the_return_value ) + */ + public function setViews(): self + { + $container = $this->container; + + /** + * @return \PHPPgAdmin\ViewManager + */ + $container['view'] = static function (\PHPPgAdmin\ContainerUtils $c): \PHPPgAdmin\ViewManager { + $misc = $c->misc; + $view = new ViewManager(BASE_PATH . '/assets/templates', [ + 'cache' => BASE_PATH . '/temp/twigcache', + 'auto_reload' => $c->get('settings')['debug'], + 'debug' => $c->get('settings')['debug'], + ], $c); + + $misc->setView($view); + + return $view; + }; + + return $this; + } + + /** + * Sets the instance of Misc class. + * + * @return self ( description_of_the_return_value ) + */ + public function setMisc(): self + { + $container = $this->container; + /** + * @return \PHPPgAdmin\Misc + */ + $container['misc'] = static function (\PHPPgAdmin\ContainerUtils $c): \PHPPgAdmin\Misc { + $misc = new \PHPPgAdmin\Misc($c); + + $conf = $c->get('conf'); + + // 4. Check for theme by server/db/user + $_server_info = $misc->getServerInfo(); + + /* starting with PostgreSQL 9.0, we can set the application name */ + if (isset($_server_info['pgVersion']) && 9 <= $_server_info['pgVersion']) { + \putenv('PGAPPNAME=' . $c->get('settings')['appName'] . '_' . $c->get('settings')['appVersion']); + } + + return $misc; + }; + + return $this; + } + + public function setExtra(): self + { + $container = $this->container; + $container['flash'] = static function (): \Slim\Flash\Messages { + return new \Slim\Flash\Messages(); + }; + + $container['lang'] = static function (\PHPPgAdmin\ContainerUtils $c): array { + $translations = new \PHPPgAdmin\Translations($c); + + return $translations->lang; + }; + + return $this; + } + + public function setHaltHandler(): self + { + $this->container['haltHandler'] = static function (\PHPPgAdmin\ContainerUtils $c) { + return static function ($request, $response, $exits, $status = 500) { + $title = 'PHPPgAdmin Error'; + + $html = '

    The application could not run because of the following error:

    '; + + $output = \sprintf( + "" . + '%s

    %s

    %s

    %s', + $title, + $title, + $html, + \implode('
    ', $exits) + ); + + $body = $response->getBody(); //new \Slim\Http\Body(fopen('php://temp', 'r+')); + $body->write($output); + + return $response + ->withStatus($status) + ->withHeader('Content-type', 'text/html') + ->withBody($body); + }; + }; + + return $this; + } +} diff --git a/src/classes/ContainerUtils.php b/src/classes/ContainerUtils.php index 008214ff..dffc30e0 100644 --- a/src/classes/ContainerUtils.php +++ b/src/classes/ContainerUtils.php @@ -6,169 +6,144 @@ namespace PHPPgAdmin; -use Slim\App; -use Slim\Container; - -\defined('BASE_PATH') || \define('BASE_PATH', \dirname(__DIR__, 2)); -\defined('THEME_PATH') || \define('THEME_PATH', BASE_PATH . '/assets/themes'); - -\defined('DEBUGMODE') || \define('DEBUGMODE', false); -\defined('IN_TEST') || \define('IN_TEST', false); +use Psr\Container\ContainerInterface; +use Slim\Collection; +use Slim\DefaultServicesProvider; /** - * A class that adds convenience methods to the container. + * @property array $deploy_info + * @property \Slim\Flash\Messages $flash + * @property \GuzzleHttp\Client $fcIntranetClient + * @property \PHPPgAdmin\Misc $misc + * @property \PHPPgAdmin\ViewManager $view + * @property \Slim\Http\Request $request + * @property \Slim\Http\Response $response + * @property string $BASE_PATH + * @property string $THEME_PATH + * @property string $subFolder + * @property bool $DEBUGMODE + * @property bool $IN_TEST + * @property string $server + * @property string $database + * @property string $schema + * @property */ -class ContainerUtils +class ContainerUtils extends \Slim\Container implements ContainerInterface { use \PHPPgAdmin\Traits\HelperTrait; - /** - * @var string - */ - const BASE_PATH = BASE_PATH; - /** - * @var string - */ - const SUBFOLDER = PHPPGA_SUBFOLDER; - /** - * @var string - */ - const DEBUGMODE = DEBUGMODE; - - /** - * @var string - */ - const THEME_PATH = THEME_PATH; /** - * @var \Slim\Container + * @var null|self */ - protected $container; + private static $instance; /** - * @var App + * $appInstance. + * + * @var null|\Slim\App */ - protected $_app; + private static $appInstance; /** + * Default settings. + * * @var array */ - protected $conf; + private $defaultSettings = [ + 'httpVersion' => '1.1', + 'responseChunkSize' => 4096, + 'outputBuffering' => 'append', + 'determineRouteBeforeAppMiddleware' => false, + 'displayErrorDetails' => false, + 'addContentLengthHeader' => true, + 'routerCacheFile' => false, + ]; /** - * @var self + * Undocumented variable. + * + * @var array */ - protected static $_instance; + private static $envConfig = [ + 'BASE_PATH' => '', + 'subFolder' => '', + 'DEBUGMODE' => false, + 'THEME_PATH' => '', + ]; /** - * Constructor of the ContainerUtils class. + * @param array $values the parameters or objects */ - public function __construct() + final public function __construct(array $values = []) { - $composerinfo = \json_decode(\file_get_contents(BASE_PATH . '/composer.json')); - $appVersion = $composerinfo->extra->version; - - $phpMinVer = (\str_replace(['<', '>', '='], '', $composerinfo->require->php)); - //$this->prtrace($appVersion); - //$this->dump($composerinfo); - $settings = [ - 'determineRouteBeforeAppMiddleware' => true, - 'base_path' => self::BASE_PATH, - 'subfolder' => self::SUBFOLDER, - 'debug' => self::DEBUGMODE, - - // Configuration file version. If this is greater than that in config.inc.php, then - // the app will refuse to run. This and $conf['version'] should be incremented whenever - // backwards incompatible changes are made to config.inc.php-dist. - 'base_version' => 61, - // Application version - 'appVersion' => 'v' . $appVersion, - // Application name - 'appName' => 'phpPgAdmin6', - - // PostgreSQL and PHP minimum version - 'postgresqlMinVer' => '9.3', - 'phpMinVer' => $phpMinVer, - 'displayErrorDetails' => self::DEBUGMODE, - 'addContentLengthHeader' => false, - ]; - - if (!self::DEBUGMODE && !IN_TEST) { - $settings['routerCacheFile'] = self::BASE_PATH . '/temp/route.cache.php'; - } - $config = [ - 'msg' => '', - 'appThemes' => [ - 'default' => 'Default', - 'cappuccino' => 'Cappuccino', - 'gotar' => 'Blue/Green', - 'bootstrap' => 'Bootstrap3', - ], - 'settings' => $settings, - ]; + parent::__construct($values); - $this->_app = new App($config); + $userSettings = $values['settings'] ?? []; + $this->registerDefaultServices($userSettings); - // Fetch DI Container - $container = $this->_app->getContainer(); - $container['utils'] = $this; - $container['version'] = 'v' . $appVersion; - $container['errors'] = []; - $container['requestobj'] = $container['request']; - $container['responseobj'] = $container['response']; - - $this->container = $container; + self::$instance = $this; } /** - * Gets the container instance. + * Gets the subfolder. * - * @throws \Exception (description) + * @param string $path The path * - * @return \Slim\Container the container instance + * @return string the subfolder */ - public static function getContainerInstance() + public function getSubfolder(string $path = ''): string { - $_instance = self::getInstance(); - - if (!$container = $_instance->container) { - throw new \Exception('Could not get a container'); - } - - return $container; + return \implode(\DIRECTORY_SEPARATOR, [$this->subFolder, $path]); } - /** - * Gets the instance. - */ - public static function getInstance(): self + public static function getAppInstance(array $config = []): \Slim\App { - if (!$_instance = self::$_instance) { - self::$_instance = new self(); - $_instance = self::$_instance; + $config = \array_merge(self::getDefaultConfig($config['debugmode'] ?? false), $config); + + $container = self::getContainerInstance($config); + + if (!self::$appInstance) { + self::$appInstance = new \Slim\App($container); } - return $_instance; + return self::$appInstance; } - /** - * Creates a container. - * - * @param array $conf The conf - * - * @return \Slim\App ( description_of_the_return_value ) - */ - public static function createApp($conf) + public static function getContainerInstance(array $config = []): self { - $_instance = self::getInstance(); + self::$envConfig = [ + 'msg' => '', + 'appThemes' => [ + 'default' => 'Default', + 'cappuccino' => 'Cappuccino', + 'gotar' => 'Blue/Green', + 'bootstrap' => 'Bootstrap3', + ], + 'BASE_PATH' => $config['BASE_PATH'] ?? \dirname(__DIR__, 2), + 'subFolder' => $config['subfolder'] ?? '', + 'debug' => $config['debugmode'] ?? false, + 'THEME_PATH' => $config['theme_path'] ?? \dirname(__DIR__, 2) . '/assets/themes', + 'IN_TEST' => $config['IN_TEST'] ?? false, + 'webdbLastTab' => [], + ]; - $_instance - ->withConf($conf) - ->setExtra() - ->setMisc() - ->setViews(); + self::$envConfig = \array_merge(self::$envConfig, $config); + if (!self::$instance) { + self::$instance = new static(self::$envConfig); + + self::$instance + ->withConf(self::$envConfig); + + $handlers = new ContainerHandlers(self::$instance); + $handlers->setExtra() + ->setMisc() + ->setViews() + ->storeMainRequestParams() + ->setHaltHandler(); + } //ddd($container->subfolder); - return $_instance->_app; + return self::$instance; } /** @@ -178,14 +153,15 @@ class ContainerUtils */ public function getRedirectUrl() { - $query_string = $this->container->requestobj->getUri()->getQuery(); + $container = self::getContainerInstance(); + $query_string = $container->request->getUri()->getQuery(); // if server_id isn't set, then you will be redirected to intro - if (null === $this->container->requestobj->getQueryParam('server')) { - $destinationurl = self::SUBFOLDER . '/src/views/intro'; + if (null === $container->request->getQueryParam('server')) { + $destinationurl = self::$envConfig['subFolder'] . '/src/views/intro'; } else { // otherwise, you'll be redirected to the login page for that server; - $destinationurl = self::SUBFOLDER . '/src/views/login' . ($query_string ? '?' . $query_string : ''); + $destinationurl = self::$envConfig['subFolder'] . '/src/views/login' . ($query_string ? '?' . $query_string : ''); } return $destinationurl; @@ -203,9 +179,10 @@ class ContainerUtils if ('' === $key) { $key = self::getBackTrace(); } + $container = self::getContainerInstance(); // $this->dump(__METHOD__ . ': addMessage ' . $key . ' ' . json_encode($content)); - if ($this->container->flash) { - $this->container->flash->addMessage($key, $content); + if ($container->flash) { + $container->flash->addMessage($key, $content); } } @@ -219,11 +196,12 @@ class ContainerUtils */ public function getDestinationWithLastTab($subject) { - $_server_info = $this->container->misc->getServerInfo(); + $container = self::getContainerInstance(); + $_server_info = $container->misc->getServerInfo(); $this->addFlash($subject, 'getDestinationWithLastTab'); //$this->prtrace('$_server_info', $_server_info); // If username isn't set in server_info, you should login - $url = $this->container->misc->getLastTabURL($subject) ?? ['url' => 'alldb', 'urlvars' => ['subject' => 'server']]; + $url = $container->misc->getLastTabURL($subject) ?? ['url' => 'alldb', 'urlvars' => ['subject' => 'server']]; $destinationurl = $this->getRedirectUrl(); if (!isset($_server_info['username'])) { @@ -260,12 +238,39 @@ class ContainerUtils */ public function addError(string $errormsg): \Slim\Container { - //dump($errormsg); - $errors = $this->container->get('errors'); + $container = self::getContainerInstance(); + $errors = $container->get('errors'); $errors[] = $errormsg; - $this->container->offsetSet('errors', $errors); + $container->offsetSet('errors', $errors); + + return $container; + } + + /** + * Returns a string with html
    variant replaced with a new line. + * + * @param string $msg message to parse (
    separated) + * + * @return string parsed message (linebreak separated) + */ + public static function br2ln($msg) + { + return \str_replace(['
    ', '
    ', '
    '], \PHP_EOL, $msg); + } - return $this->container; + public static function getDefaultConfig(bool $debug = false): array + { + return [ + 'settings' => [ + 'displayErrorDetails' => $debug, + 'determineRouteBeforeAppMiddleware' => true, + 'base_path' => \dirname(__DIR__, 2), + 'debug' => $debug, + 'phpMinVer' => '7.2', // PHP minimum version + 'addContentLengthHeader' => false, + 'appName' => 'PHPPgAdmin6', + ], + ]; } /** @@ -276,6 +281,12 @@ class ContainerUtils $container = self::getContainerInstance(); $conf['plugins'] = []; + $container->BASE_PATH = $conf['BASE_PATH']; + $container->subFolder = $conf['subfolder']; + $container->debug = $conf['debugmode']; + $container->THEME_PATH = $conf['theme_path']; + $container->IN_TEST = $conf['IN_TEST']; + $container['errors'] = []; $container['conf'] = static function (\Slim\Container $c) use ($conf): array { $display_sizes = $conf['display_sizes']; @@ -307,82 +318,34 @@ class ContainerUtils return $conf; }; - $container->subfolder = self::SUBFOLDER; - return $this; - } - - /** - * Sets the views. - * - * @return self ( description_of_the_return_value ) - */ - private function setViews() - { - $container = self::getContainerInstance(); - - /** - * @return \PHPPgAdmin\ViewManager - */ - $container['view'] = static function (\Slim\Container $c): \PHPPgAdmin\ViewManager { - $misc = $c->misc; - $view = new ViewManager(BASE_PATH . '/assets/templates', [ - 'cache' => BASE_PATH . '/temp/twigcache', - 'auto_reload' => $c->get('settings')['debug'], - 'debug' => $c->get('settings')['debug'], - ], $c); - - $misc->setView($view); - - return $view; - }; + $container->subFolder = $conf['subfolder']; return $this; } /** - * Sets the instance of Misc class. + * This function registers the default services that Slim needs to work. + * + * All services are shared, they are registered such that the + * same instance is returned on subsequent calls. * - * @return self ( description_of_the_return_value ) + * @param array $userSettings Associative array of application settings */ - private function setMisc() + private function registerDefaultServices($userSettings): void { - $container = self::getContainerInstance(); + $defaultSettings = $this->defaultSettings; + /** - * @return \PHPPgAdmin\Misc + * This service MUST return an array or an instance of ArrayAccess. + * + * @return array|ArrayAccess */ - $container['misc'] = static function (\Slim\Container $c): \PHPPgAdmin\Misc { - $misc = new \PHPPgAdmin\Misc($c); - - $conf = $c->get('conf'); - - // 4. Check for theme by server/db/user - $_server_info = $misc->getServerInfo(); - - /* starting with PostgreSQL 9.0, we can set the application name */ - if (isset($_server_info['pgVersion']) && 9 <= $_server_info['pgVersion']) { - \putenv('PGAPPNAME=' . $c->get('settings')['appName'] . '_' . $c->get('settings')['appVersion']); - } - - return $misc; - }; - - return $this; - } - - private function setExtra() - { - $container = self::getContainerInstance(); - $container['flash'] = static function (): \Slim\Flash\Messages { - return new \Slim\Flash\Messages(); - }; - - $container['lang'] = static function (\Slim\Container $c): array { - $translations = new \PHPPgAdmin\Translations($c); - - return $translations->lang; + $this['settings'] = static function () use ($userSettings, $defaultSettings): \Slim\Collection { + return new Collection(\array_merge($defaultSettings, $userSettings)); }; - return $this; + $defaultProvider = new DefaultServicesProvider(); + $defaultProvider->register($this); } } diff --git a/src/classes/Misc.php b/src/classes/Misc.php index fbb4b161..841a0ace 100644 --- a/src/classes/Misc.php +++ b/src/classes/Misc.php @@ -25,19 +25,6 @@ class Misc use \PHPPgAdmin\Traits\HelperTrait; use \PHPPgAdmin\Traits\MiscTrait; - /** - * @var string - */ - const BASE_PATH = ContainerUtils::BASE_PATH; - /** - * @var string - */ - const SUBFOLDER = ContainerUtils::SUBFOLDER; - /** - * @var string - */ - const DEBUGMODE = ContainerUtils::DEBUGMODE; - /** * @var array */ @@ -81,12 +68,12 @@ class Misc public $postgresqlMinVer; /** - * @var \Slim\Views\Twig + * @var \PHPPgAdmin\ViewManager */ public $view; /** - * @var \Slim\Container + * @var \PHPPgAdmin\ContainerUtils */ protected $container; @@ -100,11 +87,6 @@ class Misc */ private $_no_db_connection = false; - /** - * @var bool - */ - private $_reload_browser = false; - /** * @var null|Postgres */ @@ -131,9 +113,9 @@ class Misc private $_error_msg = ''; /** - * @param \Slim\Container $container The container + * @param \PHPPgAdmin\ContainerUtils $container The container */ - public function __construct(\Slim\Container $container) + public function __construct(\PHPPgAdmin\ContainerUtils $container) { $this->container = $container; @@ -153,17 +135,17 @@ class Misc // Check for config file version mismatch if (!isset($this->conf['version']) || $base_version > $this->conf['version']) { - $container->get('utils')->addError($this->lang['strbadconfig']); + $container->addError($this->lang['strbadconfig']); } // Check database support is properly compiled in if (!\function_exists('pg_connect')) { - $container->get('utils')->addError($this->lang['strnotloaded']); + $container->addError($this->lang['strnotloaded']); } // Check the version of PHP if (\version_compare(\PHP_VERSION, $this->phpMinVer, '<')) { - $container->get('utils')->addError(\sprintf('Version of PHP not supported. Please upgrade to version %s or later.', $this->phpMinVer)); + $container->addError(\sprintf('Version of PHP not supported. Please upgrade to version %s or later.', $this->phpMinVer)); } //$this->dumpAndDie($this); @@ -210,7 +192,7 @@ class Misc */ public function serverToSha() { - $request_server = $this->container->requestobj->getParam('server'); + $request_server = $this->container->request->getParam('server'); if (null === $request_server) { return null; @@ -250,39 +232,17 @@ class Misc /** * Sets the view instance property of this class. * - * @param \Slim\Views\Twig $view view instance + * @param \PHPPgAdmin\ViewManager $view view instance * * @return \PHPPgAdmin\Misc this class instance */ - public function setView(\Slim\Views\Twig $view) + public function setView(\PHPPgAdmin\ViewManager $view) { $this->view = $view; return $this; } - /** - * Internally sets the reload browser property. - * - * @param bool $flag sets internal $_reload_browser var which will be passed to the footer methods - * - * @return \PHPPgAdmin\Misc this class instance - */ - public function setReloadBrowser($flag) - { - $this->_reload_browser = (bool) $flag; - - return $this; - } - - /** - * @return bool - */ - public function getReloadBrowser() - { - return $this->_reload_browser; - } - public function getContainer() { return $this->container; @@ -344,9 +304,9 @@ class Misc * * @internal mixed $plaform placeholder that will receive the value of the platform * - * @return null|\PHPPgAdmin\Database\Postgres the database accessor instance + * @return null|\PHPPgAdmin\Database\Postgres|void the database accessor instance */ - public function getDatabaseAccessor($database = '', $server_id = null): ?\PHPPgAdmin\Database\Postgres + public function getDatabaseAccessor($database = '', $server_id = null) { $lang = $this->lang; @@ -356,7 +316,7 @@ class Misc $server_info = $this->getServerInfo($this->_server_id); - if ($this->_no_db_connection || !isset($server_info['username'])) { + if ($this->getNoDBConnection() || !isset($server_info['username'])) { return null; } @@ -372,7 +332,7 @@ class Misc } if (!$_connection) { - $this->container->utils->addError($lang['strloginfailed']); + $this->container->addError($lang['strloginfailed']); $this->setErrorMsg($lang['strloginfailed']); return null; @@ -382,14 +342,17 @@ class Misc // The description of the server is returned in $platform. $_type = $_connection->getDriver($platform); - if (null === $_type) { + if (null === $_type ?? null) { $errormsg = \sprintf($lang['strpostgresqlversionnotsupported'], $this->postgresqlMinVer); - $this->container->utils->addError($errormsg); + $this->container->addError($errormsg); $this->setErrorMsg($errormsg); return null; } - $_type = '\PHPPgAdmin\Database\\' . $_type; + /** + * @var \class-string<\PHPPgAdmin\Database\Postgres> + */ + $_type = '\\PHPPgAdmin\\Database\\' . $_type; $this->setServerInfo('platform', $platform, $this->_server_id); $this->setServerInfo('pgVersion', $_connection->getVersion(), $this->_server_id); @@ -410,19 +373,18 @@ class Misc } } - if ( - false === $this->_no_db_connection && - null !== $this->getDatabase() && - isset($_REQUEST['schema']) + if (false !== $this->getNoDBConnection() || + null === $this->getDatabase() || + !isset($_REQUEST['schema']) ) { - $status = $this->_data->setSchema($_REQUEST['schema']); + return $this->_data; + } - if (0 !== $status) { - $this->container->utils->addError($this->lang['strbadschema']); - $this->setErrorMsg($this->lang['strbadschema']); + $status = $this->_data->setSchema($_REQUEST['schema']); - return null; - } + if (0 !== $status) { + $this->container->addError($this->lang['strbadschema']); + $this->setErrorMsg($this->lang['strbadschema']); } return $this->_data; @@ -434,9 +396,9 @@ class Misc * @param string $database * @param string $server_id * - * @return \PHPPgAdmin\Connection + * @return null|\PHPPgAdmin\Connection */ - public function getConnection(string $database = '', $server_id = null): \PHPPgAdmin\Connection + public function getConnection(string $database = '', $server_id = null): ?\PHPPgAdmin\Connection { $lang = $this->lang; @@ -458,8 +420,7 @@ class Misc 'administrator' => 'administrator', ]; - if ( - isset($server_info['username']) && + if (isset($server_info['username']) && \array_key_exists(\mb_strtolower($server_info['username']), $bad_usernames) ) { $msg = $lang['strlogindisallowed']; @@ -467,8 +428,7 @@ class Misc throw new \Exception($msg); } - if ( - !isset($server_info['password']) || + if (!isset($server_info['password']) || '' === $server_info['password'] ) { $msg = $lang['strlogindisallowed']; @@ -520,8 +480,7 @@ class Misc $server_string = $info['host'] . ':' . $info['port'] . ':' . $info['sslmode']; $server_sha = \sha1($server_string); - if ( - $this->_server_id === $server_string || + if ($this->_server_id === $server_string || $this->_server_id === $server_sha ) { if (isset($info['username'])) { @@ -529,7 +488,7 @@ class Misc } elseif (isset($_SESSION['sharedUsername'])) { $info['username'] = $_SESSION['sharedUsername']; $info['password'] = $_SESSION['sharedPassword']; - $this->setReloadBrowser(true); + $this->container->get('view')->setReloadBrowser(true); $this->setServerInfo(null, $info, $this->_server_id); } $this->_server_info = $info; @@ -563,7 +522,7 @@ class Misc public function setServerInfo($key, $value, $server_id = null): void { if (null === $server_id) { - $server_id = $this->container->requestobj->getParam('server'); + $server_id = $this->container->request->getParam('server'); } if (null === $key) { @@ -589,8 +548,7 @@ class Misc $server_info = $this->getServerInfo($this->_server_id); - if ( - null !== $this->_server_id && + if (null !== $this->_server_id && isset($server_info['useonlydefaultdb']) && true === $server_info['useonlydefaultdb'] && isset($server_info['defaultdb']) diff --git a/src/classes/ViewManager.php b/src/classes/ViewManager.php index 246448b8..1e79f53d 100644 --- a/src/classes/ViewManager.php +++ b/src/classes/ViewManager.php @@ -6,8 +6,6 @@ namespace PHPPgAdmin; -use Psr\Http\Message\ResponseInterface; - /** * @file * Class to hold various commonly used functions @@ -24,24 +22,6 @@ class ViewManager extends \Slim\Views\Twig { use \PHPPgAdmin\Traits\HelperTrait; - /** - * @var string - */ - const BASE_PATH = ContainerUtils::BASE_PATH; - - /** - * @var string - */ - const THEME_PATH = ContainerUtils::THEME_PATH; - /** - * @var string - */ - const SUBFOLDER = ContainerUtils::SUBFOLDER; - /** - * @var string - */ - const DEBUGMODE = ContainerUtils::DEBUGMODE; - /** * @var array */ @@ -95,10 +75,17 @@ class ViewManager extends \Slim\Views\Twig public $misc; /** - * @var \Slim\Container + * @var \PHPPgAdmin\ContainerUtils */ protected $container; + /** + * Undocumented variable. + * + * @var array + */ + private static $themeFolders = []; + private $_connection; /** @@ -135,12 +122,11 @@ class ViewManager extends \Slim\Views\Twig private static $instance; /** - * @param \Slim\Container $container The container - * @param mixed $path - * @param mixed $settings - * @param \Slim\Container $c + * @param mixed $path + * @param mixed $settings + * @param \PHPPgAdmin\ContainerUtils $c */ - public function __construct($path, $settings, \Slim\Container $c) + public function __construct($path, $settings, \PHPPgAdmin\ContainerUtils $c) { $this->lang = $c->get('lang'); $this->conf = $c->get('conf'); @@ -155,7 +141,7 @@ class ViewManager extends \Slim\Views\Twig $this->addExtension(new \Slim\Views\TwigExtension($c['router'], $basePath)); - $this->offsetSet('subfolder', self::SUBFOLDER); + $this->offsetSet('subfolder', \containerInstance()->subFolder); $this->offsetSet('theme', $this->misc->getConf('theme')); $this->offsetSet('Favicon', $this->icon('Favicon')); $this->offsetSet('Introduction', $this->icon('Introduction')); @@ -167,15 +153,46 @@ class ViewManager extends \Slim\Views\Twig $_theme = $this->getTheme($this->conf, $this->misc->getServerInfo()); - if (isset($_SESSION) && !isset($_SESSION['ppaTheme'])) { + // If a theme comes in the request, overwrite whatever theme was set to cookie and settion store + if ($_request_theme = $this->getRequestTheme()) { + $this->setCookieTheme($_request_theme); + $this->setSessionTheme($_request_theme); + $_theme = $_request_theme; + } + + if (!$this->getSessionTheme() || !$this->getCookieTheme()) { + // If there's no session theme, or cookie theme, + // store the latest one we determined from request, session,cookie, conf or default /* save the selected theme in cookie for a year */ \setcookie('ppaTheme', $_theme, \time() + 31536000, '/'); $_SESSION['ppaTheme'] = $_theme; - $this->misc->setConf('theme', $_theme); } + $this->misc->setConf('theme', $_theme); } - public function maybeRenderIframes(ResponseInterface $response, string $subject, string $query_string): ResponseInterface + /** + * Internally sets the reload browser property. + * + * @param bool $flag sets internal $_reload_browser var which will be passed to the footer methods + * + * @return \PHPPgAdmin\ViewManager this class instance + */ + public function setReloadBrowser($flag): self + { + $this->_reload_browser = (bool) $flag; + + return $this; + } + + /** + * @return bool + */ + public function getReloadBrowser(): bool + { + return $this->_reload_browser; + } + + public function maybeRenderIframes(\Slim\Http\Response $response, string $subject, string $query_string): \Slim\Http\Response { $c = $this->getContainer(); @@ -212,29 +229,35 @@ class ViewManager extends \Slim\Views\Twig $_theme = 'default'; // List of themes $themefolders = $this->getThemeFolders(); + // Check if theme is in $_REQUEST, $_SESSION or $_COOKIE // 1.- First priority: $_REQUEST, this happens when you use the selector if (\array_key_exists('theme', $_REQUEST) && - \array_key_exists($_REQUEST['theme'], $themefolders)) { + \array_key_exists($_REQUEST['theme'], $themefolders) + ) { $_theme = $_REQUEST['theme']; } elseif ( // otherwise, see if there's a theme associated with this particular server null !== $_server_info && \array_key_exists('theme', $_server_info) && \is_string($_server_info['theme']) && - \array_key_exists($_COOKIE['ppaTheme'], $themefolders)) { + \array_key_exists($_COOKIE['ppaTheme'], $themefolders) + ) { $_theme = $_server_info['theme']; } elseif (isset($_SESSION) && \array_key_exists('ppaTheme', $_SESSION) && - \array_key_exists($_SESSION['ppaTheme'], $themefolders)) { + \array_key_exists($_SESSION['ppaTheme'], $themefolders) + ) { // otherwise check $_SESSION $_theme = $_SESSION['ppaTheme']; } elseif (\array_key_exists('ppaTheme', $_COOKIE) && - \array_key_exists($_COOKIE['ppaTheme'], $themefolders)) { + \array_key_exists($_COOKIE['ppaTheme'], $themefolders) + ) { // oterwise check $_COOKIE $_theme = $_COOKIE['ppaTheme']; } elseif ( // see if there's a valid theme set in config file \array_key_exists('theme', $conf) && \is_string($conf['theme']) && - \array_key_exists($conf['theme'], $themefolders)) { + \array_key_exists($conf['theme'], $themefolders) + ) { $_theme = $conf['theme']; } @@ -310,10 +333,10 @@ class ViewManager extends \Slim\Views\Twig public function getHelpLink($help) { return \htmlspecialchars( - $this->getSubfolder('help?help=') . - \urlencode($help) . - '&server=' . - \urlencode($this->misc->getServerId()) + $this->container->getSubfolder('help?help=') . + \urlencode($help) . + '&server=' . + \urlencode($this->misc->getServerId()) ); } @@ -328,35 +351,75 @@ class ViewManager extends \Slim\Views\Twig $theme = $this->conf['theme']; $path = 'assets/images/themes'; - $default_icon = \sprintf('%s/%s/default/DisconnectedServer.png', self::SUBFOLDER, $path); + $default_icon = \sprintf('%s/%s/default/DisconnectedServer.png', \containerInstance()->subFolder, $path); - if (\is_readable(\sprintf('%s/%s/%s/%s.png', self::BASE_PATH, $path, $theme, $icon))) { - return \sprintf('%s/%s/%s/%s.png', self::SUBFOLDER, $path, $theme, $icon); + if (\is_readable(\sprintf('%s/%s/%s/%s.png', \containerInstance()->BASE_PATH, $path, $theme, $icon))) { + return \sprintf('%s/%s/%s/%s.png', \containerInstance()->subFolder, $path, $theme, $icon); } - if (\is_readable(\sprintf('%s/%s/%s/%s.gif', self::BASE_PATH, $path, $theme, $icon))) { - return \sprintf('%s/%s/%s/%s.gif', self::SUBFOLDER, $path, $theme, $icon); + if (\is_readable(\sprintf('%s/%s/%s/%s.gif', \containerInstance()->BASE_PATH, $path, $theme, $icon))) { + return \sprintf('%s/%s/%s/%s.gif', \containerInstance()->subFolder, $path, $theme, $icon); } - if (\is_readable(\sprintf('%s/%s/%s/%s.ico', self::BASE_PATH, $path, $theme, $icon))) { - return \sprintf('%s/%s/%s/%s.ico', self::SUBFOLDER, $path, $theme, $icon); + if (\is_readable(\sprintf('%s/%s/%s/%s.ico', \containerInstance()->BASE_PATH, $path, $theme, $icon))) { + return \sprintf('%s/%s/%s/%s.ico', \containerInstance()->subFolder, $path, $theme, $icon); } - if (\is_readable(\sprintf('%s/%s/default/%s.png', self::BASE_PATH, $path, $icon))) { - return \sprintf('%s/%s/default/%s.png', self::SUBFOLDER, $path, $icon); + if (\is_readable(\sprintf('%s/%s/default/%s.png', \containerInstance()->BASE_PATH, $path, $icon))) { + return \sprintf('%s/%s/default/%s.png', \containerInstance()->subFolder, $path, $icon); } - if (\is_readable(\sprintf('%s/%s/default/%s.gif', self::BASE_PATH, $path, $icon))) { - return \sprintf('%s/%s/default/%s.gif', self::SUBFOLDER, $path, $icon); + if (\is_readable(\sprintf('%s/%s/default/%s.gif', \containerInstance()->BASE_PATH, $path, $icon))) { + return \sprintf('%s/%s/default/%s.gif', \containerInstance()->subFolder, $path, $icon); } - if (\is_readable(\sprintf('%s/%s/default/%s.ico', self::BASE_PATH, $path, $icon))) { - return \sprintf('%s/%s/default/%s.ico', self::SUBFOLDER, $path, $icon); + if (\is_readable(\sprintf('%s/%s/default/%s.ico', \containerInstance()->BASE_PATH, $path, $icon))) { + return \sprintf('%s/%s/default/%s.ico', \containerInstance()->subFolder, $path, $icon); } return $default_icon; } + private function getCookieTheme(): ?string + { + $cookie_theme = $_COOKIE['ppaTheme'] ?? null; + + return $this->isThemeAvailable($cookie_theme) ? $cookie_theme : null; + } + + private function getSessionTheme(): ?string + { + $session_theme = $_SESSION['ppaTheme'] ?? null; + + return $this->isThemeAvailable($session_theme) ? $session_theme : null; + } + + private function getRequestTheme(): ?string + { + $request_theme = $_REQUEST['theme'] ?? null; + + return $this->isThemeAvailable($request_theme) ? $request_theme : null; + } + + private function isThemeAvailable(?string $_theme = null): bool + { + return \array_key_exists($_theme, $this->getThemeFolders()); + } + + private function setCookieTheme(string $_theme): void + { + if ($this->isThemeAvailable($_theme)) { + \setcookie('ppaTheme', $_theme, \time() + 31536000, '/'); + } + } + + private function setSessionTheme(string $_theme): void + { + if ($this->isThemeAvailable($_theme)) { + $_SESSION['ppaTheme'] = $_theme; + } + } + /** * Undocumented function. * @@ -371,7 +434,7 @@ class ViewManager extends \Slim\Views\Twig return '\PHPPgAdmin\Controller\\' . \ucfirst($subject) . 'Controller'; } - private function getContainer(): \Slim\Container + private function getContainer(): \PHPPgAdmin\ContainerUtils { return $this->container; } @@ -384,8 +447,11 @@ class ViewManager extends \Slim\Views\Twig */ private function getThemeFolders(): array { + if (!empty(self::$themeFolders)) { + return self::$themeFolders; + } // no THEME_PATH (how?) then return empty array - if (!$gestor = \opendir(self::THEME_PATH)) { + if (!$gestor = \opendir(containerInstance()->THEME_PATH)) { \closedir($gestor); return []; @@ -398,16 +464,18 @@ class ViewManager extends \Slim\Views\Twig continue; } - $folderpath = \sprintf('%s%s%s', self::THEME_PATH, \DIRECTORY_SEPARATOR, $foldername); + $folderpath = \sprintf('%s%s%s', \containerInstance()->THEME_PATH, \DIRECTORY_SEPARATOR, $foldername); $stylesheet = \sprintf('%s%s%s', $folderpath, \DIRECTORY_SEPARATOR, 'global.css'); // if $folderpath if indeed a folder and contains a global.css file, then it's a theme if (\is_dir($folderpath) && - \is_file($stylesheet)) { + \is_file($stylesheet) + ) { $themefolders[$foldername] = $folderpath; } } \closedir($gestor); + self::$themeFolders = $themefolders; return $themefolders; } diff --git a/src/controllers/AggregatesController.php b/src/controllers/AggregatesController.php index 2fa97293..c8be5ca6 100644 --- a/src/controllers/AggregatesController.php +++ b/src/controllers/AggregatesController.php @@ -240,7 +240,7 @@ class AggregatesController extends BaseController ); if (0 === $status) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doDefault($this->lang['straggrcreated']); } else { $this->doCreate($this->lang['straggrcreatedbad']); @@ -276,7 +276,7 @@ class AggregatesController extends BaseController $this->printTitle($this->lang['strcreateaggregate'], 'pg.aggregate.create'); $this->printMsg($msg); - echo '
    ' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo "\t\n\t\t" . \PHP_EOL; echo "\t\t
    {$this->lang['strname']}data->_maxNameLen}\" value=\"", @@ -359,7 +359,7 @@ class AggregatesController extends BaseController $this->printTitle($this->lang['stralter'], 'pg.aggregate.alter'); $this->printMsg($msg); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; $aggrdata = $this->data->getAggregate($_REQUEST['aggrname'], $_REQUEST['aggrtype']); if (0 < $aggrdata->recordCount()) { @@ -408,7 +408,7 @@ class AggregatesController extends BaseController echo '

    ', \sprintf($this->lang['strconfdropaggregate'], \htmlspecialchars($_REQUEST['aggrname'])), '

    ' . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo "

    " . \PHP_EOL; echo '

    ' . \PHP_EOL; echo '' . \PHP_EOL; @@ -421,7 +421,7 @@ class AggregatesController extends BaseController $status = $this->data->dropAggregate($_POST['aggrname'], $_POST['aggrtype'], isset($_POST['cascade'])); if (0 === $status) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doDefault($this->lang['straggregatedropped']); } else { $this->doDefault($this->lang['straggregatedroppedbad']); diff --git a/src/controllers/AlldbController.php b/src/controllers/AlldbController.php index a940a35c..f4fa9d3b 100644 --- a/src/controllers/AlldbController.php +++ b/src/controllers/AlldbController.php @@ -103,16 +103,16 @@ class AlldbController extends BaseController $databases = $data->getDatabases(); - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $href = $this->misc->getHREF(); - $redirecturl = $this->container->utils->getDestinationWithLastTab('database'); + $redirecturl = $this->container->getDestinationWithLastTab('database'); $columns = [ 'database' => [ 'title' => $this->lang['strdatabase'], 'field' => Decorator::field('datname'), - 'url' => self::SUBFOLDER . $redirecturl . '&', + 'url' => \containerInstance()->subFolder . $redirecturl . '&', 'vars' => ['database' => 'datname'], ], 'owner' => [ @@ -267,7 +267,7 @@ class AlldbController extends BaseController $this->printTrail('database'); $this->printTitle($this->lang['stralter'], 'pg.database.alter'); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo "" . \PHP_EOL; echo '
    {$this->lang['strname']}'; @@ -315,7 +315,7 @@ class AlldbController extends BaseController $this->coalesceArr($_POST, 'dbcomment', ''); if (0 === $data->alterDatabase($_POST['oldname'], $_POST['newname'], $_POST['owner'], $_POST['dbcomment'])) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doDefault($this->lang['strdatabasealtered']); } else { $this->doDefault($this->lang['strdatabasealteredbad']); @@ -340,7 +340,7 @@ class AlldbController extends BaseController $this->printTrail('database'); $this->printTitle($this->lang['strdrop'], 'pg.database.drop'); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; //If multi drop if (isset($_REQUEST['ma'])) { foreach ($_REQUEST['ma'] as $v) { @@ -369,9 +369,18 @@ class AlldbController extends BaseController $status = $data->dropDatabase($d); if (0 === $status) { - $msg .= \sprintf('%s: %s
    ', \htmlentities($d, \ENT_QUOTES, 'UTF-8'), $this->lang['strdatabasedropped']); + $msg .= \sprintf( + '%s: %s
    ', + \htmlentities($d, \ENT_QUOTES, 'UTF-8'), + $this->lang['strdatabasedropped'] + ); } else { - $this->doDefault(\sprintf('%s%s: %s
    ', $msg, \htmlentities($d, \ENT_QUOTES, 'UTF-8'), $this->lang['strdatabasedroppedbad'])); + $this->doDefault(\sprintf( + '%s%s: %s
    ', + $msg, + \htmlentities($d, \ENT_QUOTES, 'UTF-8'), + $this->lang['strdatabasedroppedbad'] + )); return; } @@ -427,7 +436,7 @@ class AlldbController extends BaseController $tablespaces = $data->getTablespaces(); } - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo "\t\n\t\t" . \PHP_EOL; echo "\t\t
    {$this->lang['strname']}_maxNameLen}\" value=\"", @@ -553,7 +562,7 @@ class AlldbController extends BaseController ); if (0 === $status) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doDefault($this->lang['strdatabasecreated']); } else { $this->doCreate($this->lang['strdatabasecreatedbad']); diff --git a/src/controllers/BaseController.php b/src/controllers/BaseController.php index 5eec5f66..4db575d8 100644 --- a/src/controllers/BaseController.php +++ b/src/controllers/BaseController.php @@ -6,28 +6,14 @@ namespace PHPPgAdmin\Controller; -use PHPPgAdmin\ContainerUtils; use PHPPgAdmin\XHtml; -\ini_set('display_errors', ContainerUtils::DEBUGMODE); /** * Base controller class. */ class BaseController { use \PHPPgAdmin\Traits\HelperTrait; - /** - * @var string - */ - const BASE_PATH = ContainerUtils::BASE_PATH; - /** - * @var string - */ - const SUBFOLDER = ContainerUtils::SUBFOLDER; - /** - * @var string - */ - const DEBUGMODE = ContainerUtils::DEBUGMODE; public $appLangFiles = []; @@ -77,13 +63,13 @@ class BaseController public $phpMinVer; - protected $script; - /** - * @var \Slim\Container + * @var \PHPPgAdmin\ContainerUtils */ protected $container; + protected $script; + protected $data; protected $database; @@ -127,10 +113,10 @@ class BaseController /** * Constructs the base controller (common for almost all controllers). * - * @param \Slim\Container $container the $app container - * @param bool $no_db_connection [optional] if true, sets $this->misc->setNoDBConnection(true); + * @param \PHPPgAdmin\ContainerUtils $container the $app container + * @param bool $no_db_connection [optional] if true, sets $this->misc->setNoDBConnection(true); */ - public function __construct(\Slim\Container $container) + public function __construct(\PHPPgAdmin\ContainerUtils $container) { $this->container = $container; $this->lang = $container->get('lang'); @@ -165,16 +151,17 @@ class BaseController if (null === $this->misc->getServerId()) { $servers_controller = new \PHPPgAdmin\Controller\ServersController($container); - return $servers_controller->render(); - } - $_server_info = $this->misc->getServerInfo(); - // Redirect to the login form if not logged in - if (!isset($_server_info['username'])) { - $msg = \sprintf($this->lang['strlogoutmsg'], $_server_info['desc']); + $servers_controller->render(); + } else { + $_server_info = $this->misc->getServerInfo(); + // Redirect to the login form if not logged in + if (!isset($_server_info['username'])) { + $msg = \sprintf($this->lang['strlogoutmsg'], $_server_info['desc']); - $servers_controller = new \PHPPgAdmin\Controller\ServersController($container); + $servers_controller = new \PHPPgAdmin\Controller\ServersController($container); - return $servers_controller->render(); + $servers_controller->render(); + } } } } @@ -257,7 +244,7 @@ class BaseController * * @param array $tabs The tabs * - * @return \PHPPgAdmin\ArrayRecordSet filtered tabs in the form of an ArrayRecordSet + * @return \PHPPgAdmin\ADORecordSet|\PHPPgAdmin\ArrayRecordSet filtered tabs in the form of an ArrayRecordSet */ public function adjustTabsForTree(&$tabs) { @@ -269,10 +256,10 @@ class BaseController /** * Produce JSON data for the browser tree. * - * @param \PHPPgAdmin\ArrayRecordSet $_treedata a set of records to populate the tree - * @param array $attrs Attributes for tree items - * @param string $section The section where the branch is linked in the tree - * @param bool $print either to return or echo the result + * @param \PHPPgAdmin\ADORecordSet|\PHPPgAdmin\ArrayRecordSet $_treedata a set of records to populate the tree + * @param array $attrs Attributes for tree items + * @param string $section The section where the branch is linked in the tree + * @param bool $print either to return or echo the result * * @return \Slim\Http\Response|string the json rendered tree */ @@ -461,16 +448,27 @@ class BaseController } /** - * @param string $key + * @param string $key * @param null|array|float|int|string $default * * @return null|array|float|int|string */ - public function getQueryParamstring($key, $default = null) + public function getQueryStrinParam($key, $default = null) { return \requestInstance()->getQueryParam($key, $default); } + /** + * @return array + */ + public function getAllParams(): array + { + return \array_merge( + \requestInstance()->getQueryParams() ?? [], + \requestInstance()->getParsedBody() ?? [] + ); + } + /** * Print out a message. * @@ -482,7 +480,7 @@ class BaseController public function printMsg($msg, $do_print = true) { $html = ''; - $msg = \htmlspecialchars(\PHPPgAdmin\Traits\HelperTrait::br2ln($msg)); + $msg = \htmlspecialchars(\PHPPgAdmin\ContainerUtils::br2ln($msg)); if ('' !== $msg) { $html .= '

    ' . \nl2br($msg) . '

    ' . \PHP_EOL; diff --git a/src/controllers/ColpropertiesController.php b/src/controllers/ColpropertiesController.php index 2bd3bc4d..915e10d6 100644 --- a/src/controllers/ColpropertiesController.php +++ b/src/controllers/ColpropertiesController.php @@ -89,7 +89,6 @@ class ColpropertiesController extends BaseController if (!empty($_REQUEST['column'])) { // Get table $tdata = $data->getTable($this->tableName); - //\Kint::dump($tdata); // Get columns $attrs = $data->getTableAttributes($this->tableName, $_REQUEST['column']); @@ -238,8 +237,8 @@ class ColpropertiesController extends BaseController $this->printTitle($this->lang['stralter'], 'pg.column.alter'); $this->printMsg($msg); - echo ''; - echo '' . \PHP_EOL; + echo ''; + echo '' . \PHP_EOL; // Output table header echo '' . \PHP_EOL; @@ -293,6 +292,7 @@ class ColpropertiesController extends BaseController // Column type $escaped_predef_types = []; // the JS escaped array elements + if ($data->hasAlterColumnType()) { // Fetch all available types $types = $data->getTypes(true, false, true); @@ -386,7 +386,7 @@ class ColpropertiesController extends BaseController if (0 === $status) { if ($_REQUEST['column'] !== $_REQUEST['field']) { $_REQUEST['column'] = $_REQUEST['field']; - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); } $this->doDefault($sql . "
    {$this->lang['strcolumnaltered']}"); } else { diff --git a/src/controllers/ConstraintsController.php b/src/controllers/ConstraintsController.php index edbbaf4a..f3c016cb 100644 --- a/src/controllers/ConstraintsController.php +++ b/src/controllers/ConstraintsController.php @@ -26,7 +26,7 @@ class ConstraintsController extends BaseController $this->printHeader( $this->lang['strtables'] . ' - ' . $_REQUEST['table'] . ' - ' . $this->lang['strconstraints'], - '', + '', true, 'header_select2.twig' ); @@ -540,7 +540,7 @@ class ConstraintsController extends BaseController $this->printTitle($this->lang['straddcheck'], 'pg.constraint.check'); $this->printMsg($msg); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '
    ' . \PHP_EOL; echo "" . \PHP_EOL; echo "" . \PHP_EOL; diff --git a/src/controllers/DatabaseController.php b/src/controllers/DatabaseController.php index 02a30949..4da3d561 100644 --- a/src/controllers/DatabaseController.php +++ b/src/controllers/DatabaseController.php @@ -41,7 +41,7 @@ class DatabaseController extends BaseController $scripts = ''; // normal flow if ('locks' === $this->action || 'processes' === $this->action) { - $scripts .= ''; + $scripts .= ''; $refreshTime = $this->conf['ajax_refresh'] * 1500; @@ -184,7 +184,7 @@ class DatabaseController extends BaseController $this->printTabs('database', 'find'); $this->printMsg($msg); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '

    _maxNameLen}\" />" . \PHP_EOL; // Output list of filters. This is complex due to all the 'has' and 'conf' feature possibilities @@ -546,7 +546,7 @@ class DatabaseController extends BaseController $this->printTrail('database'); $this->printTabs('database', 'sql'); echo "

    {$this->lang['strentersql']}

    " . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo "

    {$this->lang['strsql']}
    " . \PHP_EOL; echo '

    ' . \PHP_EOL; @@ -642,8 +642,8 @@ class DatabaseController extends BaseController switch ($curr) { case 'SCHEMA': - $destination = $this->container->utils->getDestinationWithLastTab('schema'); - echo '
  • container->getDestinationWithLastTab('schema'); + echo '
  • misc->printVal($rs->fields['name']), '">'; echo $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']); echo '
  • ' . \PHP_EOL; @@ -652,16 +652,16 @@ class DatabaseController extends BaseController case 'TABLE': echo '
  • '; echo "misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '.'; - $destination = $this->container->utils->getDestinationWithLastTab('table'); - echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '&table=', + $destination = $this->container->getDestinationWithLastTab('table'); + echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '&table=', \urlencode($rs->fields['name']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '
  • ' . \PHP_EOL; break; case 'VIEW': echo '
  • '; echo "misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '.'; - $destination = $this->container->utils->getDestinationWithLastTab('view'); - echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '&view=', + $destination = $this->container->getDestinationWithLastTab('view'); + echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '&view=', \urlencode($rs->fields['name']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '
  • ' . \PHP_EOL; break; @@ -674,8 +674,8 @@ class DatabaseController extends BaseController break; case 'COLUMNTABLE': echo '
  • '; - $destination = $this->container->utils->getDestinationWithLastTab('schema'); - echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '.'; + $destination = $this->container->getDestinationWithLastTab('schema'); + echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '.'; echo "misc->href}&table=", \urlencode($rs->fields['relname']), '&schema=', \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '.'; echo "misc->href}&schema=", \urlencode($rs->fields['schemaname']), '&table=', \urlencode($rs->fields['relname']), '&column=', \urlencode($rs->fields['name']), '">', @@ -684,8 +684,8 @@ class DatabaseController extends BaseController break; case 'COLUMNVIEW': echo '
  • '; - $destination = $this->container->utils->getDestinationWithLastTab('schema'); - echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '.'; + $destination = $this->container->getDestinationWithLastTab('schema'); + echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '.'; echo "misc->href}&view=", \urlencode($rs->fields['relname']), '&schema=', \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '.'; echo "misc->href}&schema=", \urlencode($rs->fields['schemaname']), '&view=', \urlencode($rs->fields['relname']), '&column=', \urlencode($rs->fields['name']), '">', @@ -694,19 +694,19 @@ class DatabaseController extends BaseController break; case 'INDEX': echo '
  • '; - $destination = $this->container->utils->getDestinationWithLastTab('schema'); - echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '.'; - $destination = $this->container->utils->getDestinationWithLastTab('table'); - echo 'misc->href}&table=", \urlencode($rs->fields['relname']), '&schema=', \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '.'; + $destination = $this->container->getDestinationWithLastTab('schema'); + echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '.'; + $destination = $this->container->getDestinationWithLastTab('table'); + echo 'misc->href}&table=", \urlencode($rs->fields['relname']), '&schema=', \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '.'; echo "misc->href}&schema=", \urlencode($rs->fields['schemaname']), '&table=', \urlencode($rs->fields['relname']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '
  • ' . \PHP_EOL; break; case 'CONSTRAINTTABLE': echo '
  • '; - $destination = $this->container->utils->getDestinationWithLastTab('schema'); - echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '.'; - $destination = $this->container->utils->getDestinationWithLastTab('table'); - echo 'misc->href}&table=", \urlencode($rs->fields['relname']), '&schema=', \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '.'; + $destination = $this->container->getDestinationWithLastTab('schema'); + echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '.'; + $destination = $this->container->getDestinationWithLastTab('table'); + echo 'misc->href}&table=", \urlencode($rs->fields['relname']), '&schema=', \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '.'; echo "misc->href}&schema=", \urlencode($rs->fields['schemaname']), '&table=', \urlencode($rs->fields['relname']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '
  • ' . \PHP_EOL; @@ -720,30 +720,30 @@ class DatabaseController extends BaseController break; case 'TRIGGER': echo '
  • '; - $destination = $this->container->utils->getDestinationWithLastTab('schema'); - echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '.'; - $destination = $this->container->utils->getDestinationWithLastTab('table'); - echo 'misc->href}&table=", \urlencode($rs->fields['relname']), '&schema=', \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '.'; + $destination = $this->container->getDestinationWithLastTab('schema'); + echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '.'; + $destination = $this->container->getDestinationWithLastTab('table'); + echo 'misc->href}&table=", \urlencode($rs->fields['relname']), '&schema=', \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '.'; echo "misc->href}&schema=", \urlencode($rs->fields['schemaname']), '&table=', \urlencode($rs->fields['relname']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '
  • ' . \PHP_EOL; break; case 'RULETABLE': echo '
  • '; - $destination = $this->container->utils->getDestinationWithLastTab('schema'); - echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '.'; - $destination = $this->container->utils->getDestinationWithLastTab('table'); - echo 'misc->href}&table=", \urlencode($rs->fields['relname']), '&schema=', \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '.'; + $destination = $this->container->getDestinationWithLastTab('schema'); + echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '.'; + $destination = $this->container->getDestinationWithLastTab('table'); + echo 'misc->href}&table=", \urlencode($rs->fields['relname']), '&schema=', \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '.'; echo "misc->href}&schema=", \urlencode($rs->fields['schemaname']), '&reltype=table&table=', \urlencode($rs->fields['relname']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '
  • ' . \PHP_EOL; break; case 'RULEVIEW': echo '
  • '; - $destination = $this->container->utils->getDestinationWithLastTab('schema'); - echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '.'; - $destination = $this->container->utils->getDestinationWithLastTab('view'); - echo 'misc->href}&view=", \urlencode($rs->fields['relname']), '&schema=', \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '.'; + $destination = $this->container->getDestinationWithLastTab('schema'); + echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '.'; + $destination = $this->container->getDestinationWithLastTab('view'); + echo 'misc->href}&view=", \urlencode($rs->fields['relname']), '&schema=', \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '.'; echo "misc->href}&schema=", \urlencode($rs->fields['schemaname']), '&reltype=view&view=', \urlencode($rs->fields['relname']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '
  • ' . \PHP_EOL; @@ -797,8 +797,8 @@ class DatabaseController extends BaseController break; case 'OPCLASS': echo '
  • '; - $destination = $this->container->utils->getDestinationWithLastTab('schema'); - echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '.'; + $destination = $this->container->getDestinationWithLastTab('schema'); + echo 'misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '.'; echo "misc->href}&schema=", \urlencode($rs->fields['schemaname']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '
  • ' . \PHP_EOL; diff --git a/src/controllers/DataexportController.php b/src/controllers/DataexportController.php index 01fafcb0..e205d562 100644 --- a/src/controllers/DataexportController.php +++ b/src/controllers/DataexportController.php @@ -109,7 +109,7 @@ class DataexportController extends BaseController $this->printMsg($msg); } - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '
    {$this->lang['strname']}{$this->lang['strdefinition']}
    ' . \PHP_EOL; echo "
    {$this->lang['strformat']}:' . \PHP_EOL; echo "" . \PHP_EOL; echo '' . \PHP_EOL; @@ -336,7 +336,7 @@ class DomainsController extends BaseController $this->printTitle($this->lang['straddcheck'], 'pg.constraint.check'); $this->printMsg($msg); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '
    {$this->lang['strname']}', $this->misc->printVal($domaindata->fields['domname']), '
    ' . \PHP_EOL; echo "" . \PHP_EOL; echo "" . \PHP_EOL; @@ -393,7 +393,7 @@ class DomainsController extends BaseController $this->misc->printVal($_REQUEST['constraint']), $this->misc->printVal($_REQUEST['domain']) ), '

    ' . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo '' . \PHP_EOL; @@ -560,7 +560,7 @@ class DomainsController extends BaseController $this->printTitle($this->lang['strdrop'], 'pg.domain.drop'); echo '

    ', \sprintf($this->lang['strconfdropdomain'], $this->misc->printVal($_REQUEST['domain'])), '

    ' . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo "

    " . \PHP_EOL; echo '

    ' . \PHP_EOL; echo '' . \PHP_EOL; @@ -606,7 +606,7 @@ class DomainsController extends BaseController $this->printTitle($this->lang['strcreatedomain'], 'pg.domain.create'); $this->printMsg($msg); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '

    {$this->lang['strname']}{$this->lang['strdefinition']}
    ' . \PHP_EOL; echo "" . \PHP_EOL; echo "
    {$this->lang['strname']}_maxNameLen}\" value=\"", diff --git a/src/controllers/FulltextController.php b/src/controllers/FulltextController.php index 3760dd0f..0f13a5ac 100644 --- a/src/controllers/FulltextController.php +++ b/src/controllers/FulltextController.php @@ -308,7 +308,7 @@ class FulltextController extends BaseController echo '

    ', \sprintf($this->lang['strconfdropftsconfig'], $this->misc->printVal($_REQUEST['ftscfg'])), '

    ' . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo "

    " . \PHP_EOL; echo '

    ' . \PHP_EOL; echo '' . \PHP_EOL; @@ -321,7 +321,7 @@ class FulltextController extends BaseController $status = $data->dropFtsConfiguration($_POST['ftscfg'], isset($_POST['cascade'])); if (0 === $status) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doDefault($this->lang['strftsconfigdropped']); } else { $this->doDefault($this->lang['strftsconfigdroppedbad']); @@ -339,7 +339,7 @@ class FulltextController extends BaseController echo '

    ', \sprintf($this->lang['strconfdropftsdict'], $this->misc->printVal($_REQUEST['ftsdict'])), '

    ' . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo "

    " . \PHP_EOL; echo '

    ' . \PHP_EOL; echo '' . \PHP_EOL; @@ -354,7 +354,7 @@ class FulltextController extends BaseController $status = $data->dropFtsDictionary($_POST['ftsdict'], isset($_POST['cascade'])); if (0 === $status) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doViewDicts($this->lang['strftsdictdropped']); } else { $this->doViewDicts($this->lang['strftsdictdroppedbad']); @@ -390,7 +390,7 @@ class FulltextController extends BaseController $this->printTitle($this->lang['strftscreateconfig'], 'pg.ftscfg.create'); $this->printMsg($msg); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; // conf name echo "\t\n\t\t" . \PHP_EOL; @@ -497,7 +497,7 @@ class FulltextController extends BaseController $status = $data->createFtsConfiguration($_POST['formName'], $formParser, $formTemplate, $_POST['formComment']); if (0 === $status) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doDefault($this->lang['strftsconfigcreated']); } else { $this->doCreateConfig($this->lang['strftsconfigcreatedbad']); @@ -531,7 +531,7 @@ class FulltextController extends BaseController // Fetch all FTS parsers from the database $ftsparsers = $data->getFtsParsers(); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '
    {$this->lang['strname']}
    ' . \PHP_EOL; echo "\t" . \PHP_EOL; @@ -822,7 +822,7 @@ class FulltextController extends BaseController $this->printTitle($this->lang['strftscreatedict'], 'pg.ftsdict.create'); $this->printMsg($msg); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '
    ' . \PHP_EOL; echo "\t\n\t\t" . \PHP_EOL; echo "\t\t\n" . \PHP_EOL; - echo ' + echo ' "; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '
    {$this->lang['strname']}_maxNameLen}\" value=\"", @@ -936,7 +936,7 @@ class FulltextController extends BaseController ); if (0 === $status) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doViewDicts($this->lang['strftsdictcreated']); } else { $this->doCreateDict($this->lang['strftsdictcreatedbad']); @@ -966,7 +966,7 @@ class FulltextController extends BaseController $this->coalesceArr($_POST, 'formName', $_REQUEST['ftsdict']); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo "\t" . \PHP_EOL; @@ -1036,7 +1036,7 @@ class FulltextController extends BaseController $this->printTrail('ftscfg'); // TODO: proper breadcrumbs $this->printTitle($this->lang['strdrop'], 'pg.ftscfg.alter'); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; // Case of multiaction drop if (isset($_REQUEST['ma'])) { @@ -1096,7 +1096,7 @@ class FulltextController extends BaseController $this->coalesceArr($_POST, 'ftscfg', $_REQUEST['ftscfg']); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '
    ' . \PHP_EOL; echo "\t" . \PHP_EOL; @@ -1199,7 +1199,7 @@ class FulltextController extends BaseController $mappings = $data->getFtsMappings($_POST['ftscfg']); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '
    ' . \PHP_EOL; echo "\t" . \PHP_EOL; echo "\t\t" . \PHP_EOL; diff --git a/src/controllers/FunctionsController.php b/src/controllers/FunctionsController.php index b5ef9820..bc740da2 100644 --- a/src/controllers/FunctionsController.php +++ b/src/controllers/FunctionsController.php @@ -117,7 +117,7 @@ class FunctionsController extends BaseController 'function' => [ 'title' => $this->lang['strfunction'], 'field' => Decorator::field('proproto'), - 'url' => self::SUBFOLDER . "/redirect/function?action=properties&{$this->misc->href}&", + 'url' => \containerInstance()->subFolder . "/redirect/function?action=properties&{$this->misc->href}&", 'vars' => ['function' => 'proproto', 'function_oid' => 'prooid'], ], 'returns' => [ @@ -270,7 +270,7 @@ class FunctionsController extends BaseController // Jump them to the new function schema $this->misc->setCurrentSchema($_POST['formFuncSchema']); // Force a browser reload - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); } $this->doProperties($this->lang['strfunctionupdated']); } else { @@ -331,7 +331,7 @@ class FunctionsController extends BaseController $args = $fndata->fields['proarguments']; } - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '
    {$this->lang['strftsmapping']}
    ' . \PHP_EOL; echo '' . \PHP_EOL; echo "" . \PHP_EOL; @@ -643,7 +643,7 @@ class FunctionsController extends BaseController $this->printTabs('function', 'definition'); $this->printTitle($this->lang['strdrop'], 'pg.function.drop'); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; //If multi drop if (isset($_REQUEST['ma'])) { @@ -676,10 +676,19 @@ class FunctionsController extends BaseController $status = $data->dropFunction($s, isset($_POST['cascade'])); if (0 === $status) { - $msg .= \sprintf('%s: %s
    ', \htmlentities($_POST['function'][$k], \ENT_QUOTES, 'UTF-8'), $this->lang['strfunctiondropped']); + $msg .= \sprintf( + '%s: %s
    ', + \htmlentities($_POST['function'][$k], \ENT_QUOTES, 'UTF-8'), + $this->lang['strfunctiondropped'] + ); } else { $data->endTransaction(); - $this->doDefault(\sprintf('%s%s: %s
    ', $msg, \htmlentities($_POST['function'][$k], \ENT_QUOTES, 'UTF-8'), $this->lang['strfunctiondroppedbad'])); + $this->doDefault(\sprintf( + '%s%s: %s
    ', + $msg, + \htmlentities($_POST['function'][$k], \ENT_QUOTES, 'UTF-8'), + $this->lang['strfunctiondroppedbad'] + )); return; } @@ -688,7 +697,7 @@ class FunctionsController extends BaseController if (0 === $data->endTransaction()) { // Everything went fine, back to the Default page.... - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doDefault($msg); } else { $this->doDefault($this->lang['strfunctiondroppedbad']); @@ -697,7 +706,7 @@ class FunctionsController extends BaseController $status = $data->dropFunction($_POST['function_oid'], isset($_POST['cascade'])); if (0 === $status) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doDefault($this->lang['strfunctiondropped']); } else { $this->doDefault($this->lang['strfunctiondroppedbad']); @@ -856,12 +865,12 @@ class FunctionsController extends BaseController $szArgReturns .= ''; $szArgReturns .= ''; $szArgReturns .= ''; - $subfolder = self::SUBFOLDER; + $subfolder = \containerInstance()->subFolder; if (!empty($this->conf['theme'])) { - $szImgPath = self::SUBFOLDER . "/assets/images/themes/{$this->conf['theme']}"; + $szImgPath = \containerInstance()->subFolder . "/assets/images/themes/{$this->conf['theme']}"; } else { - $szImgPath = self::SUBFOLDER . '/assets/images/themes/default'; + $szImgPath = \containerInstance()->subFolder . '/assets/images/themes/default'; } if (empty($msg)) { @@ -874,7 +883,7 @@ class FunctionsController extends BaseController $szJSAddTR .= "\"Add"; $szJSAddTR .= "
    {$this->lang['strschema']}{$this->lang['strargadd']}
    ' . \PHP_EOL; echo "" . \PHP_EOL; echo "" . \PHP_EOL; @@ -990,14 +999,14 @@ class FunctionsController extends BaseController $szJS = ''; - echo ''; + echo ''; echo ''; if (!empty($_POST['formArgName'])) { $szJS = $this->_buildJSRows($this->_buildFunctionArguments($_POST)); } else { - $subfolder = self::SUBFOLDER; - $szJS = ''; + $subfolder = \containerInstance()->subFolder; + $szJS = ''; } $cost = (isset($_POST['formCost'])) ? $_POST['formCost'] : null; @@ -1250,7 +1259,7 @@ class FunctionsController extends BaseController $bArgIsArray = 'true'; } $arrayProperArgs[] = [$szMode, $szArgName, $szArgType, $bArgIsArray]; - $subfolder = self::SUBFOLDER; + $subfolder = \containerInstance()->subFolder; $szReturn .= ';'; diff --git a/src/controllers/GroupsController.php b/src/controllers/GroupsController.php index f748d162..0f88d4b8 100644 --- a/src/controllers/GroupsController.php +++ b/src/controllers/GroupsController.php @@ -180,7 +180,7 @@ class GroupsController extends BaseController echo '

    ', \sprintf($this->lang['strconfdropmember'], $this->misc->printVal($_REQUEST['user']), $this->misc->printVal($_REQUEST['group'])), '

    ' . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo $this->view->form; echo '' . \PHP_EOL; echo '' . \PHP_EOL; @@ -248,7 +248,7 @@ class GroupsController extends BaseController } // Display form for adding a user to the group - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo '' . \PHP_EOL; diff --git a/src/controllers/HistoryController.php b/src/controllers/HistoryController.php index f26d08b5..d985f3e4 100644 --- a/src/controllers/HistoryController.php +++ b/src/controllers/HistoryController.php @@ -75,7 +75,7 @@ class HistoryController extends BaseController // Bring to the front always echo '' . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; $this->printConnection('history'); echo '
    '; @@ -88,7 +88,6 @@ class HistoryController extends BaseController if (isset($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']])) { $history = new \PHPPgAdmin\ArrayRecordSet($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']]); - //Kint::dump($history); $columns = [ 'query' => [ 'title' => $this->lang['strsql'], @@ -200,7 +199,7 @@ class HistoryController extends BaseController echo "

    {$this->lang['strconfdelhistory']}

    " . \PHP_EOL; echo '
    ', \htmlentities($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']][$qid]['query'], \ENT_QUOTES, 'UTF-8'), '
    '; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo "" . \PHP_EOL; echo $this->view->form; @@ -223,7 +222,7 @@ class HistoryController extends BaseController echo "

    {$this->lang['strclearhistory']}

    " . \PHP_EOL; echo "

    {$this->lang['strconfclearhistory']}

    " . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo $this->view->form; echo "lang['stryes']}\" />" . \PHP_EOL; diff --git a/src/controllers/IndexesController.php b/src/controllers/IndexesController.php index c7134d6e..2bdfd9b8 100644 --- a/src/controllers/IndexesController.php +++ b/src/controllers/IndexesController.php @@ -15,7 +15,7 @@ class IndexesController extends BaseController { public $controller_title = 'strindexes'; - public $scripts = ''; + public $scripts = ''; /** * Default method to render the controller according to the action parameter. @@ -25,7 +25,7 @@ class IndexesController extends BaseController if ('tree' === $this->action) { return $this->doTree(); } - + $this->scripts = ''; $this->printHeader($this->headerTitle(), $this->scripts); $onloadInit = false; @@ -144,7 +144,7 @@ class IndexesController extends BaseController ], ]; - $url = self::SUBFOLDER . '/src/views/indexes'; + $url = \containerInstance()->subFolder . '/src/views/indexes'; $actions = [ 'cluster' => [ @@ -268,7 +268,7 @@ class IndexesController extends BaseController echo '

    ', \sprintf($this->lang['strconfcluster'], $this->misc->printVal($_REQUEST['index'])), '

    ' . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '

    '; echo "

    " . \PHP_EOL; echo '' . \PHP_EOL; @@ -503,7 +503,7 @@ class IndexesController extends BaseController $this->printTitle($this->lang['strdrop'], 'pg.index.drop'); echo '

    ', \sprintf($this->lang['strconfdropindex'], $this->misc->printVal($this->getRequestParam('index'))), '

    ' . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo '' . \PHP_EOL; diff --git a/src/controllers/IntroController.php b/src/controllers/IntroController.php index 3f30a3ee..31d28215 100644 --- a/src/controllers/IntroController.php +++ b/src/controllers/IntroController.php @@ -18,14 +18,10 @@ class IntroController extends BaseController */ public function render() { - if (null === \requestInstance()->getAttribute('route')) { - echo $this->doDefault(); - } else { - $body = \responseInstance()->getBody(); - $body->write($this->doDefault()); + $body = \responseInstance()->getBody(); + $body->write($this->doDefault()); - return \responseInstance(); - } + return \responseInstance(); } /** @@ -89,7 +85,7 @@ class IntroController extends BaseController $intro_html .= ''; if (\requestInstance()->getQueryParam('language')) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); } $intro_html .= $this->printFooter(false); diff --git a/src/controllers/LoginController.php b/src/controllers/LoginController.php index fe7e40ec..770be030 100644 --- a/src/controllers/LoginController.php +++ b/src/controllers/LoginController.php @@ -96,7 +96,7 @@ class LoginController extends BaseController $login_html .= $this->printMsg($msg, false); } - $login_html .= ''; + $login_html .= ''; $md5_server = \md5($server_id); // Pass request vars through form (is this a security risk???) diff --git a/src/controllers/MaterializedviewpropertiesController.php b/src/controllers/MaterializedviewpropertiesController.php index 2a4429dd..d3a4126d 100644 --- a/src/controllers/MaterializedviewpropertiesController.php +++ b/src/controllers/MaterializedviewpropertiesController.php @@ -150,7 +150,7 @@ class MaterializedviewpropertiesController extends BaseController $_POST['formComment'] = $viewdata->fields['relcomment']; } - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '
    {$this->lang['strname']}{$this->lang['strreturns']}
    ' . \PHP_EOL; echo "\t\n\t\t" . \PHP_EOL; echo "\t\t' . \PHP_EOL; + \htmlspecialchars($_POST['comment']), + '' . \PHP_EOL; if ($data->hasAlterSequenceStart()) { echo "" . \PHP_EOL; echo '' . \PHP_EOL; + \htmlspecialchars($sequence->fields['start_value']), + '" />' . \PHP_EOL; } echo "" . \PHP_EOL; echo '' . \PHP_EOL; + \htmlspecialchars($sequence->fields['last_value']), + '" />' . \PHP_EOL; echo "" . \PHP_EOL; echo '' . \PHP_EOL; + \htmlspecialchars($sequence->fields['increment_by']), + '" /> ' . \PHP_EOL; echo "" . \PHP_EOL; echo '' . \PHP_EOL; + \htmlspecialchars($sequence->fields['max_value']), + '" />' . \PHP_EOL; echo "" . \PHP_EOL; echo '' . \PHP_EOL; + \htmlspecialchars($sequence->fields['min_value']), + '" />' . \PHP_EOL; echo "" . \PHP_EOL; echo '' . \PHP_EOL; + \htmlspecialchars($sequence->fields['cache_value']), + '" />' . \PHP_EOL; echo "" . \PHP_EOL; echo '' . \PHP_EOL; + (isset($_POST['formCycledValue']) ? ' checked="checked"' : ''), + ' />' . \PHP_EOL; echo '
    {$this->lang['strdefinition']}
    {$this->lang['strstartvalue']}
    {$this->lang['strrestartvalue']}
    {$this->lang['strincrementby']}
    {$this->lang['strmaxvalue']}
    {$this->lang['strminvalue']}
    {$this->lang['strcachevalue']}
    ' . \PHP_EOL; echo '

    ' . \PHP_EOL; diff --git a/src/controllers/ServersController.php b/src/controllers/ServersController.php index a2f32301..c02645d3 100644 --- a/src/controllers/ServersController.php +++ b/src/controllers/ServersController.php @@ -105,7 +105,7 @@ class ServersController extends BaseController 'server' => [ 'title' => $this->lang['strserver'], 'field' => Decorator::field('desc'), - 'url' => self::SUBFOLDER . '/redirect/server?', + 'url' => \containerInstance()->subFolder . '/redirect/server?', 'vars' => ['server' => 'sha'], ], 'host' => [ @@ -133,13 +133,13 @@ class ServersController extends BaseController 'url' => 'servers', 'urlvars' => [ 'action' => 'logout', - 'logoutServer' => Decorator::field('id'), + 'logoutServer' => Decorator::field('sha'), ], ], ], ], ]; - + //\sha1("{$server_info['host']}:{$server_info['port']}:{$server_info['sslmode']}") $svPre = static function (&$rowdata) use ($actions) { $actions['logout']['disable'] = empty($rowdata->fields['username']); @@ -200,7 +200,7 @@ class ServersController extends BaseController unset($_SESSION['sharedUsername'], $_SESSION['sharedPassword']); - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); echo \sprintf($this->lang['strlogoutmsg'], $server_info['desc']); } diff --git a/src/controllers/SqlController.php b/src/controllers/SqlController.php index 59168e44..ca691edd 100644 --- a/src/controllers/SqlController.php +++ b/src/controllers/SqlController.php @@ -186,6 +186,9 @@ class SqlController extends BaseController $data->conn->setFetchMode(\ADODB_FETCH_NUM); \set_time_limit(25000); + /** + * @var \ADORecordSet + */ $rs = $data->conn->Execute($this->query); echo ''; @@ -260,7 +263,7 @@ class SqlController extends BaseController } // Reload the browser as we may have made schema changes - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); // Display duration if we know it if (null !== $this->duration) { diff --git a/src/controllers/SqleditController.php b/src/controllers/SqleditController.php index 9b4b2085..3a6a62c9 100644 --- a/src/controllers/SqleditController.php +++ b/src/controllers/SqleditController.php @@ -68,7 +68,7 @@ class SqleditController extends BaseController $default_html = $this->printTabs('popup', 'sql', false); - $default_html .= ''; + $default_html .= ''; $default_html .= \PHP_EOL; $default_html .= $this->printConnection('sql', false); diff --git a/src/controllers/TablesController.php b/src/controllers/TablesController.php index 7888b709..3acc3853 100644 --- a/src/controllers/TablesController.php +++ b/src/controllers/TablesController.php @@ -157,8 +157,6 @@ class TablesController extends BaseController $actions = $this->_getActions(); - //\Kint::dump($tables); - echo $this->printTable($tables, $columns, $actions, $this->table_place, $this->lang['strnotables']); $attr = [ 'href' => [ @@ -197,7 +195,7 @@ class TablesController extends BaseController return $this ->container - ->responseobj + ->response ->withStatus(200) ->withJson($all_tables); } @@ -262,7 +260,7 @@ class TablesController extends BaseController * * @param mixed $msg */ - public function doCreate($msg = '') + public function doCreate($msg = ''): void { $data = $this->misc->getDatabaseAccessor(); @@ -296,7 +294,7 @@ class TablesController extends BaseController $this->printTitle($this->lang['strcreatetable'], 'pg.table.create'); $this->printMsg($msg); - echo ''; + echo ''; echo \PHP_EOL; echo '' . \PHP_EOL; echo "\t\n\t\t" . \PHP_EOL; @@ -368,8 +366,8 @@ class TablesController extends BaseController $this->printTitle($this->lang['strcreatetable'], 'pg.table.create'); $this->printMsg($msg); - echo ''; - echo '' . \PHP_EOL; + echo ''; + echo '' . \PHP_EOL; // Output table header echo '
    {$this->lang['strname']}
    ' . \PHP_EOL; @@ -427,6 +425,7 @@ class TablesController extends BaseController // only define js types array once $predefined_size_types = \array_intersect($data->predefined_size_types, \array_keys($types_for_js)); $escaped_predef_types = []; // the JS escaped array elements + foreach ($predefined_size_types as $value) { $escaped_predef_types[] = "'{$value}'"; } @@ -524,9 +523,11 @@ class TablesController extends BaseController ); if (0 === $status) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); + + $this->doDefault($this->lang['strtablecreated']); - return $this->doDefault($this->lang['strtablecreated']); + return; } if (-1 === $status) { @@ -555,7 +556,7 @@ class TablesController extends BaseController * @param mixed $confirm * @param mixed $msg */ - public function doCreateLike($confirm, $msg = '') + public function doCreateLike($confirm, $msg = ''): void { $data = $this->misc->getDatabaseAccessor(); @@ -588,7 +589,7 @@ class TablesController extends BaseController unset($tbltmp); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo "
    \n\t\n\t\t" . \PHP_EOL; echo "\t\t\n\t" . \PHP_EOL; echo "\t\n\t\t" . \PHP_EOL; @@ -662,9 +663,11 @@ class TablesController extends BaseController ); if (0 === $status) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); + + $this->doDefault($this->lang['strtablecreated']); - return $this->doDefault($this->lang['strtablecreated']); + return; } $this->doCreateLike(false, $this->lang['strtablecreatedbad']); @@ -689,7 +692,7 @@ class TablesController extends BaseController $attrs = $data->getTableAttributes($_REQUEST['table']); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; if (0 < $attrs->recordCount()) { // JavaScript for select all feature @@ -827,7 +830,7 @@ class TablesController extends BaseController $this->coalesceArr($_REQUEST, 'nulls', []); $this->coalesceArr($_REQUEST, 'format', []); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; if (0 < $attrs->recordCount()) { echo '
    {$this->lang['strname']}_maxNameLen}\" value=\"", \htmlspecialchars($_REQUEST['name']), "\" />
    {$this->lang['strcreatetablelikeparent']}
    ' . \PHP_EOL; @@ -937,7 +940,6 @@ class TablesController extends BaseController echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); echo "

    lang['strinsert']}\" />" . \PHP_EOL; echo "lang['strinsertandrepeat']}\" />" . \PHP_EOL; - echo "lang['strcancel']}\" />" . \PHP_EOL; if (false !== $fksprops) { if ('default off' !== $this->conf['autocomplete']) { @@ -949,11 +951,11 @@ class TablesController extends BaseController echo '

    ' . \PHP_EOL; } else { echo "

    {$this->lang['strnofieldsforinsert']}

    " . \PHP_EOL; - echo "lang['strcancel']}\" />" . \PHP_EOL; } echo $this->view->form; echo '' . \PHP_EOL; - echo ''; + echo \sprintf('%s', $this->lang['strcancel'], \PHP_EOL); + echo ''; } /** @@ -974,7 +976,9 @@ class TablesController extends BaseController if (0 === $status) { if (isset($_POST['insert'])) { - return $this->doDefault($this->lang['strrowinserted']); + $this->doDefault($this->lang['strrowinserted']); + + return; } $_REQUEST['values'] = []; $_REQUEST['nulls'] = []; @@ -993,12 +997,14 @@ class TablesController extends BaseController * * @param mixed $confirm */ - public function doEmpty($confirm) + public function doEmpty($confirm): void { $data = $this->misc->getDatabaseAccessor(); if (empty($_REQUEST['table']) && empty($_REQUEST['ma'])) { - return $this->doDefault($this->lang['strspecifytabletoempty']); + $this->doDefault($this->lang['strspecifytabletoempty']); + + return; } if ($confirm) { @@ -1006,7 +1012,7 @@ class TablesController extends BaseController $this->printTrail('schema'); $this->printTitle($this->lang['strempty'], 'pg.table.empty'); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; foreach ($_REQUEST['ma'] as $v) { $a = \unserialize(\htmlspecialchars_decode($v, \ENT_QUOTES)); @@ -1021,7 +1027,7 @@ class TablesController extends BaseController echo '

    ', \sprintf($this->lang['strconfemptytable'], $this->misc->printVal($_REQUEST['table'])), '

    ' . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); // END not mutli empty @@ -1041,9 +1047,18 @@ class TablesController extends BaseController if (0 === $status) { $msg .= \sprintf('%s
    ', $sql); - $msg .= \sprintf('%s: %s
    ', \htmlentities($t, \ENT_QUOTES, 'UTF-8'), $this->lang['strtableemptied']); + $msg .= \sprintf( + '%s: %s
    ', + \htmlentities($t, \ENT_QUOTES, 'UTF-8'), + $this->lang['strtableemptied'] + ); } else { - $this->doDefault(\sprintf('%s%s: %s
    ', $msg, \htmlentities($t, \ENT_QUOTES, 'UTF-8'), $this->lang['strtableemptiedbad'])); + $this->doDefault(\sprintf( + '%s%s: %s
    ', + $msg, + \htmlentities($t, \ENT_QUOTES, 'UTF-8'), + $this->lang['strtableemptiedbad'] + )); return; } @@ -1054,12 +1069,16 @@ class TablesController extends BaseController if (0 === $status) { $msg .= \sprintf('%s
    ', $sql); - $msg .= \sprintf('%s: %s
    ', \htmlentities($_POST['table'], \ENT_QUOTES, 'UTF-8'), $this->lang['strtableemptied']); + $msg .= \sprintf( + '%s: %s
    ', + \htmlentities($_POST['table'], \ENT_QUOTES, 'UTF-8'), + $this->lang['strtableemptied'] + ); - return $this->doDefault($msg); + $this->doDefault($msg); } - return $this->doDefault($sql . '
    ' . $this->lang['strtableemptiedbad']); + $this->doDefault($sql . '
    ' . $this->lang['strtableemptiedbad']); // END not mutli empty } // END do Empty @@ -1071,12 +1090,14 @@ class TablesController extends BaseController * * @param mixed $confirm */ - public function doDrop($confirm) + public function doDrop($confirm): void { $data = $this->misc->getDatabaseAccessor(); if (empty($_REQUEST['table']) && empty($_REQUEST['ma'])) { - return $this->doDefault($this->lang['strspecifytabletodrop']); + $this->doDefault($this->lang['strspecifytabletodrop']); + + return; } if ($confirm) { @@ -1085,7 +1106,7 @@ class TablesController extends BaseController $this->printTrail('schema'); $this->printTitle($this->lang['strdrop'], 'pg.table.drop'); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; foreach ($_REQUEST['ma'] as $v) { $a = \unserialize(\htmlspecialchars_decode($v, \ENT_QUOTES)); @@ -1098,7 +1119,7 @@ class TablesController extends BaseController echo '

    ', \sprintf($this->lang['strconfdroptable'], $this->misc->printVal($_REQUEST['table'])), '

    ' . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); // END if multi drop } @@ -1120,33 +1141,52 @@ class TablesController extends BaseController $status = $data->dropTable($t, isset($_POST['cascade'])); if (0 === $status) { - $msg .= \sprintf('%s: %s
    ', \htmlentities($t, \ENT_QUOTES, 'UTF-8'), $this->lang['strtabledropped']); + $msg .= \sprintf( + '%s: %s
    ', + \htmlentities($t, \ENT_QUOTES, 'UTF-8'), + $this->lang['strtabledropped'] + ); } else { $data->endTransaction(); - return $this->doDefault(\sprintf('%s%s: %s
    ', $msg, \htmlentities($t, \ENT_QUOTES, 'UTF-8'), $this->lang['strtabledroppedbad'])); + $this->doDefault(\sprintf( + '%s%s: %s
    ', + $msg, + \htmlentities($t, \ENT_QUOTES, 'UTF-8'), + $this->lang['strtabledroppedbad'] + )); + + return; } } } if (0 === $data->endTransaction()) { // Everything went fine, back to the Default page.... - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); + + $this->doDefault($msg); - return $this->doDefault($msg); + return; } - return $this->doDefault($this->lang['strtabledroppedbad']); + $this->doDefault($this->lang['strtabledroppedbad']); + + return; } $status = $data->dropTable($_POST['table'], isset($_POST['cascade'])); if (0 === $status) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); + + $this->doDefault($this->lang['strtabledropped']); - return $this->doDefault($this->lang['strtabledropped']); + return; } - return $this->doDefault($this->lang['strtabledroppedbad']); + $this->doDefault($this->lang['strtabledroppedbad']); + + return; // END DROP } } @@ -1157,7 +1197,7 @@ class TablesController extends BaseController 'table' => [ 'title' => $this->lang['strtable'], 'field' => Decorator::field('relname'), - 'url' => self::SUBFOLDER . "/redirect/table?{$this->misc->href}&", + 'url' => \containerInstance()->subFolder . "/redirect/table?{$this->misc->href}&", 'vars' => ['table' => 'relname'], ], 'owner' => [ diff --git a/src/controllers/TablespacesController.php b/src/controllers/TablespacesController.php index d14ad956..85a0cfbb 100644 --- a/src/controllers/TablespacesController.php +++ b/src/controllers/TablespacesController.php @@ -188,7 +188,7 @@ class TablespacesController extends BaseController $this->coalesceArr($_POST, 'comment', ($data->hasSharedComments()) ? $tablespace->fields['spccomment'] : ''); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo $this->view->form; echo '
    ' . \PHP_EOL; echo "" . \PHP_EOL; @@ -264,7 +264,7 @@ class TablespacesController extends BaseController echo '

    ', \sprintf($this->lang['strconfdroptablespace'], $this->misc->printVal($_REQUEST['tablespace'])), '

    ' . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo $this->view->form; echo '' . \PHP_EOL; echo '' . \PHP_EOL; @@ -308,7 +308,7 @@ class TablespacesController extends BaseController $this->printTitle($this->lang['strcreatetablespace'], 'pg.tablespace.create'); $this->printMsg($msg); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo $this->view->form; echo '
    {$this->lang['strname']}
    ' . \PHP_EOL; echo "\t\n\t\t" . \PHP_EOL; diff --git a/src/controllers/TblpropertiesController.php b/src/controllers/TblpropertiesController.php index 81f0db2b..254c09d3 100644 --- a/src/controllers/TblpropertiesController.php +++ b/src/controllers/TblpropertiesController.php @@ -306,13 +306,13 @@ class TblpropertiesController extends BaseController // Jump them to the new table name $_REQUEST['table'] = $_POST['name']; // Force a browser reload - $misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); } // If schema has changed, need to change to the new schema and reload the browser if (!empty($_POST['newschema']) && ($_POST['newschema'] !== $data->_schema)) { // Jump them to the new sequence schema $misc->setCurrentSchema($_POST['newschema']); - $misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); } $this->doDefault($this->lang['strtablealtered']); } else { @@ -357,7 +357,7 @@ class TblpropertiesController extends BaseController $_POST['tablespace'] = $table->fields['tablespace']; } - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '
    {$this->lang['strname']}
    ' . \PHP_EOL; echo "" . \PHP_EOL; echo '
    {$this->lang['strname']}'; @@ -482,7 +482,7 @@ class TblpropertiesController extends BaseController $max_size = $misc->inisizeToBytes(\ini_get('upload_max_filesize')); if (\is_float($max_size) && 0 < $max_size) { - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo "\t\n\t\t" . \PHP_EOL; echo "\t\t
    {$this->lang['strformat']}' . \PHP_EOL; @@ -592,6 +592,7 @@ class TblpropertiesController extends BaseController echo '' . \PHP_EOL; $predefined_size_types = \array_intersect($data->predefined_size_types, $types_for_js); $escaped_predef_types = []; // the JS escaped array elements + foreach ($predefined_size_types as $value) { $escaped_predef_types[] = "'{$value}'"; } @@ -648,7 +649,7 @@ class TblpropertiesController extends BaseController ); if (0 === $status) { - $misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doDefault(\sprintf('%s %s %s', $sql, \PHP_EOL, $this->lang['strcolumnadded'])); } else { $_REQUEST['stage'] = 1; @@ -680,7 +681,7 @@ class TblpropertiesController extends BaseController echo '

    ' . \sprintf($this->lang['strconfdropcolumn'], $misc->printVal($_REQUEST['column']), $misc->printVal($_REQUEST['table'])) . '

    ' . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); echo '' . \PHP_EOL; @@ -693,7 +694,7 @@ class TblpropertiesController extends BaseController [$status, $sql] = $data->dropColumn($_POST['table'], $_POST['column'], isset($_POST['cascade'])); if (0 === $status) { - $misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doDefault(\sprintf('%s %s %s', $sql, \PHP_EOL, $this->lang['strcolumndropped'])); } else { $this->doDefault($this->lang['strcolumndroppedbad']); diff --git a/src/controllers/TreeController.php b/src/controllers/TreeController.php index 29360a23..03ec4af6 100644 --- a/src/controllers/TreeController.php +++ b/src/controllers/TreeController.php @@ -42,7 +42,7 @@ class TreeController extends BaseController protected $container; // Constructor - public function __construct(\Slim\Container $container, $controller_name = null) + public function __construct(\PHPPgAdmin\ContainerUtils $container, $controller_name = null) { $this->container = $container; $this->lang = $container->get('lang'); @@ -145,10 +145,10 @@ class TreeController extends BaseController $parent = [ 'id' => 'root', 'children' => true, - 'icon' => self::SUBFOLDER . '/assets/images/themes/default/Servers.png', + 'icon' => \containerInstance()->subFolder . '/assets/images/themes/default/Servers.png', 'state' => ['opened' => true], - 'a_attr' => ['href' => \str_replace('//', '/', self::SUBFOLDER . '/src/views/servers')], - 'url' => \str_replace('//', '/', self::SUBFOLDER . '/src/views/servers?action=tree'), + 'a_attr' => ['href' => \str_replace('//', '/', \containerInstance()->subFolder . '/src/views/servers')], + 'url' => \str_replace('//', '/', \containerInstance()->subFolder . '/src/views/servers?action=tree'), 'text' => 'Servers', ]; } elseif (0 < \count($treedata)) { @@ -172,7 +172,7 @@ class TreeController extends BaseController $url = Decorator::get_sanitized_value($attrs['branch'], $rec); if ($url && false === \mb_strpos($url, '/src/views')) { - $url = \str_replace('//', '/', self::SUBFOLDER . '/src/views/' . $url); + $url = \str_replace('//', '/', \containerInstance()->subFolder . '/src/views/' . $url); } if ($url) { @@ -196,7 +196,7 @@ class TreeController extends BaseController return $this ->container - ->responseobj + ->response ->withStatus(200) ->withJson($parent); } diff --git a/src/controllers/TriggersController.php b/src/controllers/TriggersController.php index 83faeb49..2c1eab77 100644 --- a/src/controllers/TriggersController.php +++ b/src/controllers/TriggersController.php @@ -273,7 +273,7 @@ class TriggersController extends BaseController if (0 < $triggerdata->recordCount()) { $this->coalesceArr($_POST, 'name', $triggerdata->fields['tgname']); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '
    ' . \PHP_EOL; echo "" . \PHP_EOL; echo '
    {$this->lang['strname']}'; @@ -311,7 +311,7 @@ class TriggersController extends BaseController $this->misc->printVal($_REQUEST['table']) ), '

    ' . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); echo '' . \PHP_EOL; @@ -350,7 +350,7 @@ class TriggersController extends BaseController $this->misc->printVal($_REQUEST['table']) ), '

    ' . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); echo '' . \PHP_EOL; @@ -388,7 +388,7 @@ class TriggersController extends BaseController $this->misc->printVal($_REQUEST['table']) ), '

    ' . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); echo '' . \PHP_EOL; @@ -449,7 +449,7 @@ class TriggersController extends BaseController $sel3 = new \PHPPgAdmin\XHtml\XHtmlSelect('formFrequency'); $sel3->set_data($data->triggerFrequency); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo " " . \PHP_EOL; diff --git a/src/controllers/TypesController.php b/src/controllers/TypesController.php index 7c866657..7fb8289b 100644 --- a/src/controllers/TypesController.php +++ b/src/controllers/TypesController.php @@ -198,9 +198,7 @@ class TypesController extends BaseController ], ]; - if (!$data->hasEnumTypes()) { - unset($navlinks['enum']); - } + //if (!$data->hasEnumTypes()) { unset($navlinks['enum']); } $this->printNavLinks($navlinks, 'types-types', \get_defined_vars()); } @@ -344,7 +342,7 @@ class TypesController extends BaseController echo '

    ', \sprintf($this->lang['strconfdroptype'], $this->misc->printVal($_REQUEST['type'])), '

    ' . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo "

    " . \PHP_EOL; echo '

    ' . \PHP_EOL; echo '' . \PHP_EOL; @@ -386,7 +384,7 @@ class TypesController extends BaseController $this->printTitle($this->lang['strcreatecomptype'], 'pg.type.create'); $this->printMsg($msg); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '

    {$this->lang['strname']}
    ' . \PHP_EOL; echo "\t\n\t\t" . \PHP_EOL; echo "\t\t
    {$this->lang['strname']}_maxNameLen}\" value=\"", @@ -432,7 +430,7 @@ class TypesController extends BaseController $this->printTitle($this->lang['strcreatecomptype'], 'pg.type.create'); $this->printMsg($msg); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; // Output table header echo '' . \PHP_EOL; @@ -563,7 +561,7 @@ class TypesController extends BaseController $this->printTitle($this->lang['strcreateenumtype'], 'pg.type.create'); $this->printMsg($msg); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '
    ' . \PHP_EOL; echo "\t\n\t\t" . \PHP_EOL; echo "\t\t
    {$this->lang['strname']}_maxNameLen}\" value=\"", @@ -607,7 +605,7 @@ class TypesController extends BaseController $this->printTitle($this->lang['strcreateenumtype'], 'pg.type.create'); $this->printMsg($msg); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; // Output table header echo '' . \PHP_EOL; @@ -710,7 +708,7 @@ class TypesController extends BaseController $this->printTitle($this->lang['strcreatetype'], 'pg.type.create'); $this->printMsg($msg); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '
    ' . \PHP_EOL; echo "" . \PHP_EOL; echo "
    {$this->lang['strname']}_maxNameLen}\" value=\"", diff --git a/src/controllers/UsersController.php b/src/controllers/UsersController.php index 54034dfe..54dcf344 100644 --- a/src/controllers/UsersController.php +++ b/src/controllers/UsersController.php @@ -257,7 +257,7 @@ class UsersController extends BaseController $this->coalesceArr($_POST, 'confirm', ''); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo "\t\n\t\t" . \PHP_EOL; echo "\t\t
    {$this->lang['strpassword']}' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo "\t\n\t\t" . \PHP_EOL; echo "\t\t\n\t" . \PHP_EOL; @@ -400,7 +400,7 @@ class UsersController extends BaseController echo '

    ', \sprintf($this->lang['strconfdropuser'], $this->misc->printVal($_REQUEST['username'])), '

    ' . \PHP_EOL; - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '

    ' . \PHP_EOL; echo '' . \PHP_EOL; echo $this->view->form; @@ -439,7 +439,7 @@ class UsersController extends BaseController $this->printTitle($this->lang['strcreateuser'], 'pg.user.create'); $this->printMsg($msg); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '

    {$this->lang['strusername']}", ($canRename ? "_maxNameLen}\" value=\"" . \htmlspecialchars($_POST['newname']) . '" />' : $this->misc->printVal($userdata->fields['usename'])), "
    ' . \PHP_EOL; echo "\t\n\t\t" . \PHP_EOL; echo "\t\t\n\t" . \PHP_EOL; diff --git a/src/controllers/ViewpropertiesController.php b/src/controllers/ViewpropertiesController.php index 523d5c47..26d5b208 100644 --- a/src/controllers/ViewpropertiesController.php +++ b/src/controllers/ViewpropertiesController.php @@ -141,7 +141,7 @@ class ViewpropertiesController extends BaseController } $variables = (object) [ - 'subfolder' => self::SUBFOLDER . '/src/views/viewproperties', + 'subfolder' => \containerInstance()->subFolder . '/src/views/viewproperties', 'formDefinition' => \htmlspecialchars($_POST['formDefinition']), @@ -201,7 +201,7 @@ EOT; $this->printTitle($this->lang['stralter'], 'pg.column.alter'); $this->printMsg($msg); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; // Output view header echo '
    {$this->lang['strusername']}_maxNameLen}\" name=\"formUsername\" value=\"", \htmlspecialchars($_POST['formUsername']), "\" />
    ' . \PHP_EOL; @@ -299,7 +299,7 @@ EOT; $this->coalesceArr($_POST, 'comment', $view->fields['relcomment']); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '
    ' . \PHP_EOL; echo "" . \PHP_EOL; echo '
    {$this->lang['strname']}'; @@ -365,13 +365,13 @@ EOT; // Jump them to the new view name $_REQUEST[$this->subject] = $_POST['name']; // Force a browser reload - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); } // If schema has changed, need to change to the new schema and reload the browser if (!empty($_POST['newschema']) && ($_POST['newschema'] !== $data->_schema)) { // Jump them to the new sequence schema $this->misc->setCurrentSchema($_POST['newschema']); - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); } $this->doDefault($this->lang['strviewaltered']); } else { diff --git a/src/controllers/ViewsController.php b/src/controllers/ViewsController.php index 84feea4d..28a44422 100644 --- a/src/controllers/ViewsController.php +++ b/src/controllers/ViewsController.php @@ -124,7 +124,7 @@ class ViewsController extends BaseController $this->keystring => [ 'title' => $this->lang['strview'], 'field' => Decorator::field('relname'), - 'url' => self::SUBFOLDER . "/redirect/view?{$this->misc->href}&", + 'url' => \containerInstance()->subFolder . "/redirect/view?{$this->misc->href}&", 'vars' => [$this->keystring => 'relname'], ], 'owner' => [ @@ -281,7 +281,7 @@ class ViewsController extends BaseController $this->printTrail('view'); $this->printTitle($this->lang['strdrop'], 'pg.view.drop'); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; //If multi drop if (isset($_REQUEST['ma'])) { @@ -312,10 +312,19 @@ class ViewsController extends BaseController $status = $data->dropView($s, isset($_POST['cascade'])); if (0 === $status) { - $msg .= \sprintf('%s: %s
    ', \htmlentities($s, \ENT_QUOTES, 'UTF-8'), $this->lang['strviewdropped']); + $msg .= \sprintf( + '%s: %s
    ', + \htmlentities($s, \ENT_QUOTES, 'UTF-8'), + $this->lang['strviewdropped'] + ); } else { $data->endTransaction(); - $this->doDefault(\sprintf('%s%s: %s
    ', $msg, \htmlentities($s, \ENT_QUOTES, 'UTF-8'), $this->lang['strviewdroppedbad'])); + $this->doDefault(\sprintf( + '%s%s: %s
    ', + $msg, + \htmlentities($s, \ENT_QUOTES, 'UTF-8'), + $this->lang['strviewdroppedbad'] + )); return; } @@ -324,7 +333,7 @@ class ViewsController extends BaseController if (0 === $data->endTransaction()) { // Everything went fine, back to the Default page.... - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doDefault($msg); } else { $this->doDefault($this->lang['strviewdroppedbad']); @@ -333,7 +342,7 @@ class ViewsController extends BaseController $status = $data->dropView($_POST['view'], isset($_POST['cascade'])); if (0 === $status) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doDefault($this->lang['strviewdropped']); } else { $this->doDefault($this->lang['strviewdroppedbad']); @@ -403,7 +412,7 @@ class ViewsController extends BaseController $this->printTitle($this->lang['strcreateview'], 'pg.view.create'); $this->printMsg($msg); - echo 'view_name}\" method=\"post\">" . \PHP_EOL; + echo 'view_name}\" method=\"post\">" . \PHP_EOL; echo '' . \PHP_EOL; echo "\t\n\t\t" . \PHP_EOL; echo "\t' . \PHP_EOL; echo '', $this->view->printHelp($this->lang['strclusterindex'], 'pg.index.cluster', false)); + $recluster_help = \sprintf( + '', + $this->view->printHelp($this->lang['strclusterindex'], 'pg.index.cluster', false) + ); $disabled = ''; $reclusterconf = '' . \PHP_EOL; - echo ''; - echo '' . \PHP_EOL; + ); + echo '' . \PHP_EOL; ++$i; $attrs->moveNext(); } @@ -184,7 +185,7 @@ trait ViewsMatviewsTrait $tables = $data->getAllTables(); - echo 'script}\" method=\"post\">" . \PHP_EOL; + echo 'script}\" method=\"post\">" . \PHP_EOL; echo '
    {$this->lang['strname']}_maxNameLen}\" value=\"", @@ -438,7 +447,7 @@ class ViewsController extends BaseController $status = $data->createView($_POST['formView'], $_POST['formDefinition'], false, $_POST['formComment']); if (0 === $status) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doDefault($this->lang['strviewcreated']); } else { $this->doCreate($this->lang['strviewcreatedbad']); diff --git a/src/database/ADOdbBase.php b/src/database/ADOdbBase.php index abd225b6..9cca6b76 100644 --- a/src/database/ADOdbBase.php +++ b/src/database/ADOdbBase.php @@ -16,6 +16,7 @@ class ADOdbBase { use \PHPPgAdmin\Traits\HelperTrait; use \PHPPgAdmin\Database\Traits\HasTrait; + use \PHPPgAdmin\Database\Traits\DatabaseTrait; /** * @var array @@ -33,7 +34,7 @@ class ADOdbBase public $conn; /** - * @var \Slim\Container + * @var \PHPPgAdmin\ContainerUtils */ protected $container; @@ -67,6 +68,53 @@ class ADOdbBase $this->conn = $conn; } + /** + * Given an array of attnums and a relation, returns an array mapping + * attribute number to attribute name. + * + * @param string $table The table to get attributes for + * @param array $atts An array of attribute numbers + * + * @return array|int An array mapping attnum to attname or error code + * - -1 $atts must be an array + * - -2 wrong number of attributes found + */ + public function getAttributeNames($table, $atts) + { + $c_schema = $this->_schema; + $this->clean($c_schema); + $this->clean($table); + $this->arrayClean($atts); + + if (!\is_array($atts)) { + return -1; + } + + if (0 === \count($atts)) { + return []; + } + + $sql = "SELECT attnum, attname FROM pg_catalog.pg_attribute WHERE + attrelid=(SELECT oid FROM pg_catalog.pg_class WHERE relname='{$table}' AND + relnamespace=(SELECT oid FROM pg_catalog.pg_namespace WHERE nspname='{$c_schema}')) + AND attnum IN ('" . \implode("','", $atts) . "')"; + + $rs = $this->selectSet($sql); + + if ($rs->recordCount() !== \count($atts)) { + return -2; + } + + $temp = []; + + while (!$rs->EOF) { + $temp[$rs->fields['attnum']] = $rs->fields['attname']; + $rs->moveNext(); + } + + return $temp; + } + /** * Sets the comment for an object in the database. * diff --git a/src/database/Connection.php b/src/database/Connection.php deleted file mode 100644 index db541416..00000000 --- a/src/database/Connection.php +++ /dev/null @@ -1,177 +0,0 @@ - 'Postgres13', - '12' => 'Postgres12', - '11' => 'Postgres11', - '10' => 'Postgres10', - '9.7' => 'Postgres96', - '9.6' => 'Postgres96', - '9.5' => 'Postgres95', - '9.4' => 'Postgres94', - '9.3' => 'Postgres93', - '9.2' => 'Postgres92', - '9.1' => 'Postgres91', - '9.0' => 'Postgres90', - ]; - - // The backend platform. Set to UNKNOWN by default. - private $_connection_result; - - /** - * Creates a new connection. Will actually make a database connection. - * - * @param array $server_info - * @param string $database database name - * @param \Slim\Container $container - * @param int $fetchMode Defaults to associative. Override for different behaviour - */ - public function __construct($server_info, $database, $container, $fetchMode = \ADODB_FETCH_ASSOC) - { - $host = $server_info['host']; - $port = $server_info['port']; - $sslmode = $server_info['sslmode']; - $user = $server_info['username']; - $password = $server_info['password']; - - $this->server_info = $server_info; - - $this->container = $container; - - $this->conn = \ADONewConnection('postgres9'); - //$this->conn->debug = true; - $this->conn->setFetchMode($fetchMode); - - // Ignore host if null - if (null === $host || '' === $host) { - if (null !== $port && '' !== $port) { - $pghost = ':' . $port; - } else { - $pghost = ''; - } - } else { - $pghost = "{$host}:{$port}"; - } - - // Add sslmode to $pghost as needed - if (('disable' === $sslmode) || ('allow' === $sslmode) || ('prefer' === $sslmode) || ('require' === $sslmode)) { - $pghost .= ':' . $sslmode; - } elseif ('legacy' === $sslmode) { - $pghost .= ' requiressl=1'; - } - - try { - $this->conn->connect($pghost, $user, $password, $database); - //$this->prtrace($this->conn); - } catch (\Exception $e) { - dump($e); - $this->prtrace($e->getMessage(), $e->getTrace()); - } - } - - public function getConnectionResult() - { - return $this->_connection_result; - } - - /** - * Gets the name of the correct database driver to use. As a side effect, - * sets the platform. - * - * @param string $description A description of the database and version (returns by reference) - * - * @return string The driver. e.g. Postgres96 - */ - public function getDriver(&$description) - { - $version = null; - - if ($this->conn->_connectionID) { - $v = \pg_version($this->conn->_connectionID); - - //\PhpConsole\Handler::getInstance()->debug($v, 'pg_version'); - - if (isset($v['server'])) { - $version = $v['server']; - } - } - // If we didn't manage to get the version without a query, query... - if (!isset($version)) { - $adodb = new ADOdbBase($this->conn, $this->container, $this->server_info); - - $sql = 'SELECT VERSION() AS version'; - $field = $adodb->selectField($sql, 'version'); - - // Check the platform, if it's mingw, set it - if (\preg_match('/ mingw /i', $field)) { - $this->platform = 'MINGW'; - } - - $params = \explode(' ', $field); - - if (!isset($params[1])) { - return null; - } - - $version = $params[1]; // eg. 8.4.4 - } - - $description = "PostgreSQL {$version}"; - - $version_parts = \explode('.', $version); - - if ((int) (10 <= $version_parts[0])) { - $major_version = $version_parts[0]; - } else { - $major_version = \implode('.', [$version_parts[0], $version_parts[1]]); - } - - //$this->prtrace(['pg_version' => pg_version($this->conn->_connectionID), 'version' => $version, 'major_version' => $major_version]); - // Detect version and choose appropriate database driver - if (\array_key_exists($major_version, $this->version_dictionary)) { - return $this->version_dictionary[$major_version]; - } - - // if major version is less than 9 return null, we don't support it - if (9 > (int) \mb_substr($version, 0, 1)) { - return null; - } - - // If unknown version, then default to latest driver - return 'Postgres'; - } - - /** - * Get the last error in the connection. - * - * @return string Error string - */ - public function getLastError() - { - return \pg_last_error($this->conn->_connectionID); - } -} diff --git a/src/database/Postgres.php b/src/database/Postgres.php index 3d2d8449..35807c19 100644 --- a/src/database/Postgres.php +++ b/src/database/Postgres.php @@ -101,8 +101,10 @@ class Postgres extends ADOdbBase * Gets the help pages. * get help page by instancing the corresponding help class * if $this->help_page and $this->help_base are set, this function is a noop. + * + * @return array|null|string */ - public function getHelpPages(): array + public function getHelpPages() { return $this->help_class->getHelpTopics(); } @@ -292,8 +294,6 @@ class Postgres extends ADOdbBase WHERE c.relkind='v' AND r.rulename != '_RETURN' AND r.rulename ILIKE {$term} {$where} "; - //\Kint::dump($sql); - // Add advanced objects if show_advanced is set if ($conf['show_advanced']) { $sql .= " @@ -343,53 +343,6 @@ class Postgres extends ADOdbBase return $this->selectSet($sql); } - /** - * Given an array of attnums and a relation, returns an array mapping - * attribute number to attribute name. - * - * @param string $table The table to get attributes for - * @param array $atts An array of attribute numbers - * - * @return array|int An array mapping attnum to attname or error code - * - -1 $atts must be an array - * - -2 wrong number of attributes found - */ - public function getAttributeNames($table, $atts) - { - $c_schema = $this->_schema; - $this->clean($c_schema); - $this->clean($table); - $this->arrayClean($atts); - - if (!\is_array($atts)) { - return -1; - } - - if (0 === \count($atts)) { - return []; - } - - $sql = "SELECT attnum, attname FROM pg_catalog.pg_attribute WHERE - attrelid=(SELECT oid FROM pg_catalog.pg_class WHERE relname='{$table}' AND - relnamespace=(SELECT oid FROM pg_catalog.pg_namespace WHERE nspname='{$c_schema}')) - AND attnum IN ('" . \implode("','", $atts) . "')"; - - $rs = $this->selectSet($sql); - - if ($rs->recordCount() !== \count($atts)) { - return -2; - } - - $temp = []; - - while (!$rs->EOF) { - $temp[$rs->fields['attnum']] = $rs->fields['attname']; - $rs->moveNext(); - } - - return $temp; - } - /** * Gets all languages. * @@ -505,8 +458,7 @@ class Postgres extends ADOdbBase * end of quote if matching non-backslashed character. * backslashes don't count for double quotes, though. */ - if ( - \mb_substr($line, $i, 1) === $in_quote && + if (\mb_substr($line, $i, 1) === $in_quote && (0 === $bslash_count % 2 || '"' === $in_quote) ) { $in_quote = 0; @@ -532,6 +484,7 @@ class Postgres extends ADOdbBase if (false === $finishpos) { $line = \mb_substr($line, 0, $i); /* remove comment */ + break; } $pre = \mb_substr($line, 0, $i); @@ -580,6 +533,7 @@ class Postgres extends ADOdbBase } else { if ('--' === \mb_substr($line, $i, 2)) { $line = \mb_substr($line, 0, $i); /* remove comment */ + break; } /* count nested parentheses */ diff --git a/src/database/databasetraits/RoleTrait.php b/src/database/databasetraits/RoleTrait.php index 015248d4..d540f899 100644 --- a/src/database/databasetraits/RoleTrait.php +++ b/src/database/databasetraits/RoleTrait.php @@ -132,7 +132,7 @@ trait RoleTrait * @param bool $createrole Boolean whether or not the role can create other roles * @param bool $inherits Boolean whether or not the role inherits the privileges from parent roles * @param bool $login Boolean whether or not the role will be allowed to login - * @param number $connlimit Number of concurrent connections the role can make + * @param int $connlimit Number of concurrent connections the role can make * @param string $expiry String Format 'YYYY-MM-DD HH:MM:SS'. '' means never expire * @param array $new_roles_to_add (array) Roles to which the new role will be immediately added as a new member * @param array $new_members_of_role (array) Roles which are automatically added as members of the new role @@ -225,7 +225,7 @@ trait RoleTrait * @param bool $createrole Boolean whether or not the role can create other roles * @param bool $inherits Boolean whether or not the role inherits the privileges from parent roles * @param bool $login Boolean whether or not the role will be allowed to login - * @param number $connlimit Number of concurrent connections the role can make + * @param int $connlimit Number of concurrent connections the role can make * @param string $expiry string Format 'YYYY-MM-DD HH:MM:SS'. '' means never expire * @param array $new_roles_to_add (array) Roles to which the role will be immediately added as a new member * @param array $new_members_of_role (array) Roles which are automatically added as members of the role @@ -327,7 +327,7 @@ trait RoleTrait * @param bool $createrole Boolean whether or not the role can create other roles * @param bool $inherits Boolean whether or not the role inherits the privileges from parent roles * @param bool $login Boolean whether or not the role will be allowed to login - * @param number $connlimit Number of concurrent connections the role can make + * @param int $connlimit Number of concurrent connections the role can make * @param string $expiry string Format 'YYYY-MM-DD HH:MM:SS'. '' means never expire * @param array $new_roles_to_add (array) Roles to which the role will be immediately added as a new member * @param array $new_members_of_role (array) Roles which are automatically added as members of the role diff --git a/src/database/databasetraits/SequenceTrait.php b/src/database/databasetraits/SequenceTrait.php index 644337ef..ba6dafbf 100644 --- a/src/database/databasetraits/SequenceTrait.php +++ b/src/database/databasetraits/SequenceTrait.php @@ -66,7 +66,7 @@ trait SequenceTrait * Execute setval on a given sequence. * * @param string $sequence Sequence name - * @param number $nextvalue The next value + * @param int $nextvalue The next value * * @return \ADORecordSet|int */ @@ -163,11 +163,11 @@ trait SequenceTrait * Creates a new sequence. * * @param string $sequence Sequence name - * @param number $increment The increment - * @param number $minvalue The min value - * @param number $maxvalue The max value - * @param number $startvalue The starting value - * @param number $cachevalue The cache value + * @param int $increment The increment + * @param int $minvalue The min value + * @param int $maxvalue The max value + * @param int $startvalue The starting value + * @param int $cachevalue The cache value * @param bool $cycledvalue True if cycled, false otherwise * * @return \ADORecordSet|int @@ -228,12 +228,12 @@ trait SequenceTrait * @param string $owner The new owner for the sequence * @param string $schema The new schema for the sequence * @param string $increment The increment - * @param number $minvalue The min value - * @param number $maxvalue The max value - * @param number $restartvalue The starting value - * @param number $cachevalue The cache value + * @param int $minvalue The min value + * @param int $maxvalue The max value + * @param int $restartvalue The starting value + * @param int $cachevalue The cache value * @param null|bool $cycledvalue True if cycled, false otherwise - * @param number $startvalue The sequence start value when issueing a restart + * @param int $startvalue The sequence start value when issueing a restart * * @return bool|int 0 success */ @@ -324,13 +324,13 @@ trait SequenceTrait * Alter a sequence's properties. * * @param \ADORecordSet $seqrs The sequence RecordSet returned by getSequence() - * @param number $increment The sequence incremental value - * @param number $minvalue The sequence minimum value - * @param number $maxvalue The sequence maximum value - * @param number $restartvalue The sequence current value - * @param number $cachevalue The sequence cache value + * @param int $increment The sequence incremental value + * @param int $minvalue The sequence minimum value + * @param int $maxvalue The sequence maximum value + * @param int $restartvalue The sequence current value + * @param int $cachevalue The sequence cache value * @param null|bool $cycledvalue Sequence can cycle ? - * @param number $startvalue The sequence start value when issueing a restart + * @param int $startvalue The sequence start value when issueing a restart * * @return \ADORecordSet|int */ diff --git a/src/database/databasetraits/TableTrait.php b/src/database/databasetraits/TableTrait.php index 6df728fe..eec71a9e 100644 --- a/src/database/databasetraits/TableTrait.php +++ b/src/database/databasetraits/TableTrait.php @@ -1422,8 +1422,7 @@ trait TableTrait $this->fieldClean($atts->fields['attname']); $sql .= " \"{$atts->fields['attname']}\""; // Dump SERIAL and BIGSERIAL columns correctly - if ( - $this->phpBool($atts->fields['attisserial']) && + if ($this->phpBool($atts->fields['attisserial']) && ('integer' === $atts->fields['type'] || 'bigint' === $atts->fields['type']) ) { if ('integer' === $atts->fields['type']) { diff --git a/src/decorators/ActionUrlDecorator.php b/src/decorators/ActionUrlDecorator.php index 31c1e3e2..26ecfc3c 100644 --- a/src/decorators/ActionUrlDecorator.php +++ b/src/decorators/ActionUrlDecorator.php @@ -41,6 +41,6 @@ class ActionUrlDecorator extends Decorator } } - return self::SUBFOLDER . '/src/views/' . \str_replace('.php', '', $url); + return \containerInstance()->subFolder . '/src/views/' . \str_replace('.php', '', $url); } } diff --git a/src/decorators/BranchUrlDecorator.php b/src/decorators/BranchUrlDecorator.php index 869162f1..0b3cb1ac 100644 --- a/src/decorators/BranchUrlDecorator.php +++ b/src/decorators/BranchUrlDecorator.php @@ -43,8 +43,8 @@ class BranchUrlDecorator extends Decorator $url = \str_replace('//', '/', '/src/views/' . $url); } - if (self::SUBFOLDER !== '' && (0 === \mb_strpos($url, '/')) && (0 !== \mb_strpos($url, self::SUBFOLDER))) { - $url = \str_replace('//', '/', self::SUBFOLDER . '/' . $url); + if ('' !== containerInstance()->subFolder && (0 === \mb_strpos($url, '/')) && (0 !== \mb_strpos($url, \containerInstance()->subFolder))) { + $url = \str_replace('//', '/', \containerInstance()->subFolder . '/' . $url); } return \str_replace('.php', '', $url); diff --git a/src/decorators/Decorator.php b/src/decorators/Decorator.php index 07947bdc..5609e5e9 100644 --- a/src/decorators/Decorator.php +++ b/src/decorators/Decorator.php @@ -6,25 +6,10 @@ namespace PHPPgAdmin\Decorators; -use PHPPgAdmin\ContainerUtils; - class Decorator { use \PHPPgAdmin\Traits\HelperTrait; - /** - * @var string - */ - const BASE_PATH = ContainerUtils::BASE_PATH; - /** - * @var string - */ - const SUBFOLDER = ContainerUtils::SUBFOLDER; - /** - * @var string - */ - const DEBUGMODE = ContainerUtils::DEBUGMODE; - public $container; public function __construct($value) diff --git a/src/decorators/RedirectUrlDecorator.php b/src/decorators/RedirectUrlDecorator.php index 90921e0b..9aebb881 100644 --- a/src/decorators/RedirectUrlDecorator.php +++ b/src/decorators/RedirectUrlDecorator.php @@ -45,8 +45,8 @@ class RedirectUrlDecorator extends Decorator } } - if (self::SUBFOLDER !== '' && (0 === \mb_strpos($url, '/')) && (false === \mb_strpos($url, self::SUBFOLDER))) { - $url = \str_replace('//', '/', self::SUBFOLDER . '/' . $url); + if ('' !== containerInstance()->subFolder && (0 === \mb_strpos($url, '/')) && (false === \mb_strpos($url, \containerInstance()->subFolder))) { + $url = \str_replace('//', '/', \containerInstance()->subFolder . '/' . $url); } return \str_replace('.php', '', $url); diff --git a/src/decorators/UrlDecorator.php b/src/decorators/UrlDecorator.php index 1a7d76ed..fabfb542 100644 --- a/src/decorators/UrlDecorator.php +++ b/src/decorators/UrlDecorator.php @@ -37,8 +37,8 @@ class UrlDecorator extends Decorator } } - if (self::SUBFOLDER !== '' && (0 === \mb_strpos($url, '/')) && (false === \mb_strpos($url, self::SUBFOLDER))) { - $url = \str_replace('//', '/', self::SUBFOLDER . '/' . $url); + if ('' !== containerInstance()->subFolder && (0 === \mb_strpos($url, '/')) && (false === \mb_strpos($url, \containerInstance()->subFolder))) { + $url = \str_replace('//', '/', \containerInstance()->subFolder . '/' . $url); } return $url; diff --git a/src/help/PostgresDoc.php b/src/help/PostgresDoc.php index c25c3938..b82f1102 100644 --- a/src/help/PostgresDoc.php +++ b/src/help/PostgresDoc.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Help; /** * Help links for PostgreSQL 7.4 documentation. + * + * @SuppressWarnings(PHPMD) */ class PostgresDoc { @@ -188,7 +190,7 @@ class PostgresDoc * * @return null|string|string[] */ - public function getHelpTopics(?string $topic = null): array + public function getHelpTopics(?string $topic = null) { return $topic ? $this->help_topics[$topic] ?? null : $this->help_topics; } diff --git a/src/help/PostgresDoc10.php b/src/help/PostgresDoc10.php index 47fcf9cd..6e5e9ec1 100644 --- a/src/help/PostgresDoc10.php +++ b/src/help/PostgresDoc10.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Help; /** * Help links for PostgreSQL 10.x documentation. + * + * @SuppressWarnings(PHPMD) */ class PostgresDoc10 extends PostgresDoc96 { diff --git a/src/help/PostgresDoc11.php b/src/help/PostgresDoc11.php index 103f3ed9..19b24e97 100644 --- a/src/help/PostgresDoc11.php +++ b/src/help/PostgresDoc11.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Help; /** * Help links for PostgreSQL 11.x documentation. + * + * @SuppressWarnings(PHPMD) */ class PostgresDoc11 extends PostgresDoc10 { diff --git a/src/help/PostgresDoc12.php b/src/help/PostgresDoc12.php index 0d360c70..0bc63c25 100644 --- a/src/help/PostgresDoc12.php +++ b/src/help/PostgresDoc12.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Help; /** * Help links for PostgreSQL 12.x documentation. + * + * @SuppressWarnings(PHPMD) */ class PostgresDoc12 extends PostgresDoc11 { diff --git a/src/help/PostgresDoc90.php b/src/help/PostgresDoc90.php index eb94e437..fb1493f6 100644 --- a/src/help/PostgresDoc90.php +++ b/src/help/PostgresDoc90.php @@ -10,6 +10,8 @@ namespace PHPPgAdmin\Help; * Help links for PostgreSQL 9.0 documentation. * * Release: PostgresDoc84.php,v 1.3 2008/11/18 21:35:48 ioguix Exp $ + * + * @SuppressWarnings(PHPMD) */ class PostgresDoc90 extends PostgresDoc { diff --git a/src/help/PostgresDoc91.php b/src/help/PostgresDoc91.php index 0b824106..66c2230c 100644 --- a/src/help/PostgresDoc91.php +++ b/src/help/PostgresDoc91.php @@ -10,6 +10,8 @@ namespace PHPPgAdmin\Help; * Help links for PostgreSQL 9.1 documentation. * * Release: PostgresDoc84.php,v 1.3 2008/11/18 21:35:48 ioguix Exp $ + * + * @SuppressWarnings(PHPMD) */ class PostgresDoc91 extends PostgresDoc90 { diff --git a/src/help/PostgresDoc92.php b/src/help/PostgresDoc92.php index 722f41db..e86f7f00 100644 --- a/src/help/PostgresDoc92.php +++ b/src/help/PostgresDoc92.php @@ -10,6 +10,8 @@ namespace PHPPgAdmin\Help; * Help links for PostgreSQL 9.2 documentation. * * Release: PostgresDoc84.php,v 1.3 2008/11/18 21:35:48 ioguix Exp $ + * + * @SuppressWarnings(PHPMD) */ class PostgresDoc92 extends PostgresDoc91 { diff --git a/src/help/PostgresDoc93.php b/src/help/PostgresDoc93.php index cad85288..6a9b0626 100644 --- a/src/help/PostgresDoc93.php +++ b/src/help/PostgresDoc93.php @@ -10,6 +10,8 @@ namespace PHPPgAdmin\Help; * Help links for PostgreSQL 9.3 documentation. * * Release: PostgresDoc84.php,v 1.3 2008/11/18 21:35:48 ioguix Exp $ + * + * @SuppressWarnings(PHPMD) */ class PostgresDoc93 extends PostgresDoc92 { diff --git a/src/help/PostgresDoc94.php b/src/help/PostgresDoc94.php index d1e8b024..fe8d2677 100644 --- a/src/help/PostgresDoc94.php +++ b/src/help/PostgresDoc94.php @@ -10,6 +10,8 @@ namespace PHPPgAdmin\Help; * Help links for PostgreSQL 9.4 documentation. * * Release: PostgresDoc84.php,v 1.3 2008/11/18 21:35:48 ioguix Exp $ + * + * @SuppressWarnings(PHPMD) */ class PostgresDoc94 extends PostgresDoc93 { diff --git a/src/help/PostgresDoc95.php b/src/help/PostgresDoc95.php index ca816526..7759ce44 100644 --- a/src/help/PostgresDoc95.php +++ b/src/help/PostgresDoc95.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Help; /** * Help links for PostgreSQL 9.5 documentation. + * + * @SuppressWarnings(PHPMD) */ class PostgresDoc95 extends PostgresDoc94 { diff --git a/src/help/PostgresDoc96.php b/src/help/PostgresDoc96.php index f7b7238b..7e43a998 100644 --- a/src/help/PostgresDoc96.php +++ b/src/help/PostgresDoc96.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Help; /** * Help links for PostgreSQL 9.6 documentation. + * + * @SuppressWarnings(PHPMD) */ class PostgresDoc96 extends PostgresDoc95 { diff --git a/src/lib.inc.php b/src/lib.inc.php index a2417192..139b6f05 100644 --- a/src/lib.inc.php +++ b/src/lib.inc.php @@ -4,6 +4,8 @@ * PHPPgAdmin 6.0.0 */ +use Slim\App; + \defined('BASE_PATH') || \define('BASE_PATH', \dirname(__DIR__)); \defined('THEME_PATH') || \define('THEME_PATH', \dirname(__DIR__) . '/assets/themes'); @@ -15,14 +17,30 @@ if (!\is_writable(\dirname(__DIR__) . '/temp')) { } require_once \dirname(__DIR__) . '/vendor/autoload.php'; -$subfolder = ''; -// Check to see if the configuration file exists, if not, explain -if (!\file_exists(\dirname(__DIR__) . '/config.inc.php')) { - die('Configuration error: Copy config.inc.php-dist to config.inc.php and edit appropriately.'); + +$shouldSetSession = (\defined('PHP_SESSION_ACTIVE') ? \PHP_SESSION_ACTIVE !== \session_status() : !\session_id()) + && !\headers_sent() + && !\ini_get('session.auto_start'); + +if ($shouldSetSession && \PHP_SAPI !== 'cli') { + \session_set_cookie_params(0, '/', $_SERVER['HTTP_HOST'], isset($_SERVER['HTTPS'])); + \session_name('PPA_ID'); + \session_start(); } + +\defined('ADODB_ERROR_HANDLER_TYPE') || \define('ADODB_ERROR_HANDLER_TYPE', \E_USER_ERROR); +\defined('ADODB_ERROR_HANDLER') || \define('ADODB_ERROR_HANDLER', '\PHPPgAdmin\ADOdbException::adodb_throw'); + +function getAppInstance(): \Slim\App +{ + $subfolder = ''; + // Check to see if the configuration file exists, if not, explain + if (!\file_exists(\dirname(__DIR__) . '/config.inc.php')) { + die('Configuration error: Copy config.inc.php-dist to config.inc.php and edit appropriately.'); + } $conf = []; - include \dirname(__DIR__) . '/config.inc.php'; + include_once \dirname(__DIR__) . '/config.inc.php'; if (isset($conf['subfolder']) && \is_string($conf['subfolder'])) { $subfolder = $conf['subfolder']; @@ -36,105 +54,50 @@ if (!\file_exists(\dirname(__DIR__) . '/config.inc.php')) { ); } -\defined('PHPPGA_SUBFOLDER') || \define('PHPPGA_SUBFOLDER', $subfolder); -$shouldSetSession = (\defined('PHP_SESSION_ACTIVE') ? \PHP_SESSION_ACTIVE !== \session_status() : !\session_id()) -&& !\headers_sent() -&& !\ini_get('session.auto_start'); + $conf['subfolder'] = $subfolder; -if ($shouldSetSession && \PHP_SAPI !== 'cli') { - \session_set_cookie_params(0, '/', $_SERVER['HTTP_HOST'], isset($_SERVER['HTTPS'])); - \session_name('PPA_ID'); - \session_start(); -} + $conf['debugmode'] = (!isset($conf['debugmode'])) ? false : (bool) ($conf['debugmode']); -$debugmode = (!isset($conf['debugmode'])) ? false : (bool) ($conf['debugmode']); -\defined('DEBUGMODE') || \define('DEBUGMODE', $debugmode); + if ($conf['debugmode']) { + \ini_set('display_startup_errors', 'On'); + \ini_set('opcache.revalidate_freq', '0'); + \error_reporting(\E_ALL); -if (!\defined('ADODB_ERROR_HANDLER_TYPE')) { - \define('ADODB_ERROR_HANDLER_TYPE', \E_USER_ERROR); -} - -if (!\defined('ADODB_ERROR_HANDLER')) { - \define('ADODB_ERROR_HANDLER', '\PHPPgAdmin\ADOdbException::adodb_throw'); -} + if (\array_key_exists('register_debuggers', $conf) && \is_callable($conf['register_debuggers'])) { + $conf['register_debuggers'](); + } + } -if (DEBUGMODE) { - \ini_set('display_errors', 'On'); + $conf['BASE_PATH'] = BASE_PATH; + $conf['theme_path'] = BASE_PATH . '/assets/themes'; + \defined('IN_TEST') || \define('IN_TEST', false); + $conf['IN_TEST'] = IN_TEST; + \defined('ADODB_ASSOC_CASE') || \define('ADODB_ASSOC_CASE', ADODB_ASSOC_CASE_NATIVE); - \ini_set('display_startup_errors', 'On'); - \ini_set('opcache.revalidate_freq', '0'); - \error_reporting(\E_ALL); + // Fetch App and DI Container + $app = \PHPPgAdmin\ContainerUtils::getAppInstance($conf); - if (\array_key_exists('register_debuggers', $conf) && \is_callable($conf['register_debuggers'])) { - $conf['register_debuggers'](); - } + return $app; } -\define('ADODB_ASSOC_CASE', ADODB_ASSOC_CASE_NATIVE); -// Fetch App and DI Container -$app = \PHPPgAdmin\ContainerUtils::createApp($conf); -$container = $app->getContainer(); -if (!$container instanceof \Slim\Container) { - \trigger_error('App Container must be an instance of \\Slim\\Container', \E_USER_ERROR); -} -function containerInstance(): \Slim\Container +function containerInstance(): \PHPPgAdmin\ContainerUtils { - return \PHPPgAdmin\ContainerUtils::getContainerInstance(); + $app = getAppInstance(); + $container = $app->getContainer(); + + if (!$container instanceof \PHPPgAdmin\ContainerUtils) { + \trigger_error('App Container must be an instance of \\Slim\\Container', \E_USER_ERROR); + } + + return $container; } function requestInstance(): \Slim\Http\Request { - return containerInstance()->request; + return \containerInstance()->request; } - function responseInstance(): \Slim\Http\Response - { - return containerInstance()->response; - } - -// This should be deprecated once we're sure no php scripts are required directly -$container->offsetSet('server', $_REQUEST['server'] ?? null); -$container->offsetSet('database', $_REQUEST['database'] ?? null); -$container->offsetSet('schema', $_REQUEST['schema'] ?? null); - -$container['haltHandler'] = static function (\Slim\Container $c) { - return static function ($request, $response, $exits, $status = 500) use ($c) { - $title = 'PHPPgAdmin Error'; - - $html = '

    The application could not run because of the following error:

    '; - - $output = \sprintf( - "" . - '%s

    %s

    %s

    %s', - $title, - $title, - $html, - \implode('
    ', $exits) - ); - - $body = $response->getBody(); //new \Slim\Http\Body(fopen('php://temp', 'r+')); - $body->write($output); - - return $response - ->withStatus($status) - ->withHeader('Content-type', 'text/html') - ->withBody($body); - }; -}; - -// Set the requestobj and responseobj properties of the container -// as the value of $request and $response, which already contain the route -$app->add(new \PHPPgAdmin\Middleware\PopulateRequestResponse($container)); - -$container['action'] = $_REQUEST['action'] ?? ''; - -if (!isset($msg)) { - $msg = ''; +function responseInstance(): \Slim\Http\Response +{ + return \containerInstance()->response; } - -$container['msg'] = $msg; -//ddd($container->misc); diff --git a/src/middleware/PopulateRequestResponse.php b/src/middleware/PopulateRequestResponse.php index 8a3828cc..e453d666 100644 --- a/src/middleware/PopulateRequestResponse.php +++ b/src/middleware/PopulateRequestResponse.php @@ -20,16 +20,16 @@ class PopulateRequestResponse extends Middleware $next ) { $container = $this->container; - $subfolder = $this->getSubfolder(); - $container['requestobj'] = $request; - $container['responseobj'] = $response; + $subfolder = $this->container->getSubfolder(); + $route = $request->getAttribute('route'); $container['server'] = $request->getParam('server'); $container['database'] = $request->getParam('database'); $container['schema'] = $request->getParam('schema'); $misc = $container->get('misc'); - $view = $container->get('view'); + + $view = $this->getViewManager($container); $misc->setHREF(); $view->setForm(); @@ -41,10 +41,13 @@ class PopulateRequestResponse extends Middleware $container['server'] = $route->getArgument('server', $request->getParam('server')); } - $query_string = $request->getUri()->getQuery(); + $request = $request->withUri($this->getUri($request)->withBasePath($subfolder)); + $uri = $request->getUri(); + $query_string = $uri->getQuery(); + $requestPath = $uri->getPath(); + $view->offsetSet('query_string', $query_string); - $path = ($subfolder ? ($subfolder . '/') : '') - . $request->getUri()->getPath() . ($query_string ? '?' . $query_string : ''); + $path = $requestPath . ($query_string ? '?' . $query_string : ''); $view->offsetSet('path', $path); $params = $request->getParams(); @@ -71,13 +74,27 @@ class PopulateRequestResponse extends Middleware $view->offsetSet('in_test', $in_test); if (0 < \count($container['errors'])) { - return ($container->haltHandler)($container->requestobj, $container->responseobj, $container['errors'], 412); + return ($container->haltHandler)($request, $response, $container['errors'], 412); } + $enqueued_reload_browser = ($container->flash->getFirstMessage('reload_browser') ?? false); + if ($enqueued_reload_browser) { + $view->setReloadBrowser($enqueued_reload_browser); + } // First execute anything else $response = $next($request, $response); // Any other request, pass on current response return $response; } + + private function getUri(\Slim\Http\Request $request): \Slim\Http\Uri + { + return $request->getUri(); + } + + private function getViewManager(\PHPPgAdmin\ContainerUtils $container): \PHPPgAdmin\ViewManager + { + return $container->get('view'); + } } diff --git a/src/router.php b/src/router.php index c3d707c1..b7bf4df4 100644 --- a/src/router.php +++ b/src/router.php @@ -5,31 +5,34 @@ */ require_once __DIR__ . '/lib.inc.php'; +$app = getAppInstance(); +$container = containerInstance(); + +// Set the requestobj and responseobj properties of the container +// as the value of $request and $response, which already contain the route +$app->add(new \PHPPgAdmin\Middleware\PopulateRequestResponse($container)); + +if (!isset($msg)) { + $msg = ''; +} +$container['msg'] = $msg; +//ddd($container->misc); + $app->get('/status', function ( - /* @scrutinizer ignore-unused */ \Slim\Http\Request $request, - /* @scrutinizer ignore-unused */ \Slim\Http\Response $response, - /* @scrutinizer ignore-unused */ array $args ) { - \phpinfo(); - - return; - //dump($this->get('settings')->all()); return $response ->withHeader('Content-type', 'application/json') ->withJson( - DEBUGMODE ? $this->get('settings')->all() : ['version' => $this->version] + $this->get('settings')['debug'] ? $this->get('settings')->all() : ['version' => $this->version] ); }); $app->post('/redirect/server', function ( - /* @scrutinizer ignore-unused */ \Slim\Http\Request $request, - /* @scrutinizer ignore-unused */ \Slim\Http\Response $response, - /* @scrutinizer ignore-unused */ array $args ) { $body = $response->getBody(); @@ -52,6 +55,7 @@ $app->post('/redirect/server', function ( $data = $misc->getDatabaseAccessor(); if (null === $data) { + //ddd($misc->getErrorMsg()); $login_controller = new \PHPPgAdmin\Controller\LoginController($this, true); $body->write($login_controller->doLoginForm($misc->getErrorMsg())); @@ -63,41 +67,36 @@ $app->post('/redirect/server', function ( $_SESSION['sharedPassword'] = $loginPassword; } - $misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); + $this->addFlash(true, 'reload_browser'); - $destinationurl = $this->utils->getDestinationWithLastTab('alldb'); + $destinationurl = $this->getDestinationWithLastTab('alldb'); return $response->withStatus(302)->withHeader('Location', $destinationurl); } $_server_info = $this->misc->getServerInfo(); if (!isset($_server_info['username'])) { - $destinationurl = $this->utils->getDestinationWithLastTab('server'); + $destinationurl = $this->getDestinationWithLastTab('server'); return $response->withStatus(302)->withHeader('Location', $destinationurl); } }); $app->get('/redirect[/{subject}]', function ( - /* @scrutinizer ignore-unused */ \Slim\Http\Request $request, - /* @scrutinizer ignore-unused */ \Slim\Http\Response $response, - /* @scrutinizer ignore-unused */ array $args ) { $subject = (isset($args['subject'])) ? $args['subject'] : 'root'; - $destinationurl = $this->utils->getDestinationWithLastTab($subject); + $destinationurl = $this->getDestinationWithLastTab($subject); return $response->withStatus(302)->withHeader('Location', $destinationurl); }); $app->map(['GET', 'POST'], '/src/views/{subject}', function ( - /* @scrutinizer ignore-unused */ \Slim\Http\Request $request, - /* @scrutinizer ignore-unused */ \Slim\Http\Response $response, - /* @scrutinizer ignore-unused */ array $args ) { $subject = $args['subject']; @@ -110,11 +109,11 @@ $app->map(['GET', 'POST'], '/src/views/{subject}', function ( $safe_subjects = ('servers' === $subject || 'intro' === $subject || 'browser' === $subject); if (null === $this->misc->getServerId() && !$safe_subjects) { - return $response->withStatus(302)->withHeader('Location', SUBFOLDER . '/src/views/servers'); + return $response->withStatus(302)->withHeader('Location', $this->subFolder . '/src/views/servers'); } if (!isset($_server_info['username']) && 'login' !== $subject && !$safe_subjects) { - $destinationurl = SUBFOLDER . '/src/views/login?server=' . $this->misc->getServerId(); + $destinationurl = $this->subFolder . '/src/views/login?server=' . $this->misc->getServerId(); return $response->withStatus(302)->withHeader('Location', $destinationurl); } @@ -126,11 +125,8 @@ $app->map(['GET', 'POST'], '/src/views/{subject}', function ( }); $app->get('/{subject:\w+}[/{server_id}]', function ( - /* @scrutinizer ignore-unused */ \Slim\Http\Request $request, - /* @scrutinizer ignore-unused */ \Slim\Http\Response $response, - /* @scrutinizer ignore-unused */ array $args ) { $subject = $args['subject'] ?? 'intro'; @@ -153,11 +149,8 @@ $app->get('/{subject:\w+}[/{server_id}]', function ( }); $app->get('/', function ( - /* @scrutinizer ignore-unused */ \Slim\Http\Request $request, - /* @scrutinizer ignore-unused */ \Slim\Http\Response $response, - /* @scrutinizer ignore-unused */ array $args ) { $subject = 'intro'; @@ -168,11 +161,8 @@ $app->get('/', function ( }); $app->get('[/{path:.*}]', function ( - /* @scrutinizer ignore-unused */ \Slim\Http\Request $request, - /* @scrutinizer ignore-unused */ \Slim\Http\Response $response, - /* @scrutinizer ignore-unused */ array $args ) { $filepath = \dirname(__DIR__) . '/' . $args['path']; @@ -180,7 +170,7 @@ $app->get('[/{path:.*}]', function ( //d($this->subfolder, $args, $query_string, $filepath); - $this->utils->prtrace($request->getAttribute('route')); + $this->prtrace($request->getAttribute('route')); return $response->write($args['path'] ? $args['path'] : 'index'); }); diff --git a/src/traits/AdminTrait.php b/src/traits/AdminTrait.php index 8460eaa3..be95a1b2 100644 --- a/src/traits/AdminTrait.php +++ b/src/traits/AdminTrait.php @@ -34,7 +34,7 @@ trait AdminTrait $this->printTrail('schema'); $this->printTitle($this->lang['strclusterindex'], 'pg.index.cluster'); - echo '" . \PHP_EOL; + echo '" . \PHP_EOL; foreach ($_REQUEST['ma'] as $v) { $a = \unserialize(\htmlspecialchars_decode($v, \ENT_QUOTES)); @@ -45,7 +45,7 @@ trait AdminTrait $this->printTrail($type); $this->printTitle($this->lang['strclusterindex'], 'pg.index.cluster'); - echo '" . \PHP_EOL; + echo '" . \PHP_EOL; if ('table' === $type) { echo '

    ', \sprintf($this->lang['strconfclustertable'], $this->misc->printVal($_REQUEST['object'])), '

    ' . \PHP_EOL; @@ -86,7 +86,7 @@ trait AdminTrait $this->printTrail('schema'); $this->printTitle($this->lang['strreindex'], 'pg.reindex'); - echo '" . \PHP_EOL; + echo '" . \PHP_EOL; foreach ($_REQUEST['ma'] as $v) { $a = \unserialize(\htmlspecialchars_decode($v, \ENT_QUOTES)); @@ -97,7 +97,7 @@ trait AdminTrait $this->printTrail($type); $this->printTitle($this->lang['strreindex'], 'pg.reindex'); - echo '" . \PHP_EOL; + echo '" . \PHP_EOL; if ('table' === $type) { echo '

    ', \sprintf($this->lang['strconfreindextable'], $this->misc->printVal($_REQUEST['object'])), '

    ' . \PHP_EOL; @@ -141,11 +141,10 @@ trait AdminTrait $this->printTrail('schema'); $this->printTitle($this->lang['stranalyze'], 'pg.analyze'); - echo '" . \PHP_EOL; + echo '" . \PHP_EOL; foreach ($_REQUEST['ma'] as $v) { $a = \unserialize(\htmlspecialchars_decode($v, \ENT_QUOTES)); - //\Kint::dump($a); echo '

    ', \sprintf($this->lang['strconfanalyzetable'], $this->misc->printVal($a['table'])), '

    ' . \PHP_EOL; echo '' . \PHP_EOL; } // END if multi analyze @@ -153,7 +152,7 @@ trait AdminTrait $this->printTrail($type); $this->printTitle($this->lang['stranalyze'], 'pg.analyze'); - echo '" . \PHP_EOL; + echo '" . \PHP_EOL; if ('table' === $type) { echo '

    ', \sprintf($this->lang['strconfanalyzetable'], $this->misc->printVal($_REQUEST['object'])), '

    ' . \PHP_EOL; @@ -190,7 +189,7 @@ trait AdminTrait $this->printTrail('schema'); $this->printTitle($this->lang['strvacuum'], 'pg.vacuum'); - echo '" . \PHP_EOL; + echo '" . \PHP_EOL; foreach ($_REQUEST['ma'] as $v) { $a = \unserialize(\htmlspecialchars_decode($v, \ENT_QUOTES)); @@ -202,7 +201,7 @@ trait AdminTrait $this->printTrail($type); $this->printTitle($this->lang['strvacuum'], 'pg.vacuum'); - echo '" . \PHP_EOL; + echo '" . \PHP_EOL; if ('table' === $type) { echo '

    ', \sprintf($this->lang['strconfvacuumtable'], $this->misc->printVal($_REQUEST['object'])), '

    ' . \PHP_EOL; @@ -286,7 +285,7 @@ trait AdminTrait $old_val['autovacuum_vacuum_cost_limit'] = ''; } - echo '" . \PHP_EOL; + echo '" . \PHP_EOL; echo $this->view->form; echo '' . \PHP_EOL; echo \sprintf('%s', \htmlspecialchars($_REQUEST['table']), \PHP_EOL); @@ -384,9 +383,19 @@ trait AdminTrait $msg .= \sprintf('%s
    ', $sql); if (0 === $status) { - $msg .= \sprintf('%s: %s
    ', \htmlentities($o, \ENT_QUOTES, 'UTF-8'), $this->lang['strclusteredgood']); + $msg .= \sprintf( + '%s: %s
    ', + \htmlentities($o, \ENT_QUOTES, 'UTF-8'), + $this->lang['strclusteredgood'] + ); } else { - $this->doDefault(\sprintf('%s %s%s: %s
    ', $type, $msg, \htmlentities($o, \ENT_QUOTES, 'UTF-8'), $this->lang['strclusteredbad'])); + $this->doDefault(\sprintf( + '%s %s%s: %s
    ', + $type, + $msg, + \htmlentities($o, \ENT_QUOTES, 'UTF-8'), + $this->lang['strclusteredbad'] + )); return; } @@ -440,21 +449,31 @@ trait AdminTrait $status = $data->reindex(\mb_strtoupper($type), $o, isset($_REQUEST['reindex_force'])); if (0 === $status) { - $msg .= \sprintf('%s: %s
    ', \htmlentities($o, \ENT_QUOTES, 'UTF-8'), $this->lang['strreindexgood']); + $msg .= \sprintf( + '%s: %s
    ', + \htmlentities($o, \ENT_QUOTES, 'UTF-8'), + $this->lang['strreindexgood'] + ); } else { - $this->doDefault(\sprintf('%s %s%s: %s
    ', $type, $msg, \htmlentities($o, \ENT_QUOTES, 'UTF-8'), $this->lang['strreindexbad'])); + $this->doDefault(\sprintf( + '%s %s%s: %s
    ', + $type, + $msg, + \htmlentities($o, \ENT_QUOTES, 'UTF-8'), + $this->lang['strreindexbad'] + )); return; } } // Everything went fine, back to the Default page.... - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doDefault($msg); } else { $status = $data->reindex(\mb_strtoupper($type), $_REQUEST['object'], isset($_REQUEST['reindex_force'])); if (0 === $status) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doAdmin($type, $this->lang['strreindexgood']); } else { $this->doAdmin($type, $this->lang['strreindexbad']); @@ -485,22 +504,32 @@ trait AdminTrait $status = $data->analyzeDB($o); if (0 === $status) { - $msg .= \sprintf('%s: %s
    ', \htmlentities($o, \ENT_QUOTES, 'UTF-8'), $this->lang['stranalyzegood']); + $msg .= \sprintf( + '%s: %s
    ', + \htmlentities($o, \ENT_QUOTES, 'UTF-8'), + $this->lang['stranalyzegood'] + ); } else { - $this->doDefault(\sprintf('%s %s%s: %s
    ', $type, $msg, \htmlentities($o, \ENT_QUOTES, 'UTF-8'), $this->lang['stranalyzebad'])); + $this->doDefault(\sprintf( + '%s %s%s: %s
    ', + $type, + $msg, + \htmlentities($o, \ENT_QUOTES, 'UTF-8'), + $this->lang['stranalyzebad'] + )); return; } } // Everything went fine, back to the Default page.... - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doDefault($msg); } else { //we must pass table here. When empty, analyze the whole db $status = $data->analyzeDB($_REQUEST['table']); if (0 === $status) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); $this->doAdmin($type, $this->lang['stranalyzegood']); } else { $this->doAdmin($type, $this->lang['stranalyzebad']); @@ -531,12 +560,24 @@ trait AdminTrait [$status, $sql] = $data->vacuumDB($t, isset($_REQUEST['vacuum_analyze']), isset($_REQUEST['vacuum_full']), isset($_REQUEST['vacuum_freeze'])); if (0 !== $status) { - return $this->doDefault(\sprintf('%s %s%s: %s
    ', $type, $msg, \htmlentities($t, \ENT_QUOTES, 'UTF-8'), $this->lang['strvacuumbad'])); + return $this->doDefault(\sprintf( + '%s %s%s: %s
    ', + $type, + $msg, + \htmlentities($t, \ENT_QUOTES, 'UTF-8'), + $this->lang['strvacuumbad'] + )); } - $msg .= \sprintf('%s%s %s: %s
    ', $sql, \PHP_EOL, \htmlentities($t, \ENT_QUOTES, 'UTF-8'), $this->lang['strvacuumgood']); + $msg .= \sprintf( + '%s%s %s: %s
    ', + $sql, + \PHP_EOL, + \htmlentities($t, \ENT_QUOTES, 'UTF-8'), + $this->lang['strvacuumgood'] + ); } // Everything went fine, back to the Default page.... - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); return $this->doDefault($msg); } @@ -544,7 +585,7 @@ trait AdminTrait [$status, $sql] = $data->vacuumDB($_REQUEST['table'], isset($_REQUEST['vacuum_analyze']), isset($_REQUEST['vacuum_full']), isset($_REQUEST['vacuum_freeze'])); if (0 === $status) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); return $this->doAdmin($type, \sprintf('%s%s%s', $sql, \PHP_EOL, $this->lang['strvacuumgood'])); } @@ -647,7 +688,12 @@ trait AdminTrait echo ''; $table_hidden_inputs = ('table' === $type) ? - \sprintf('%s', \htmlspecialchars($_REQUEST['object']), \PHP_EOL, \PHP_EOL) : ''; + \sprintf( + '%s%s', + \htmlspecialchars($_REQUEST['object']), + \PHP_EOL, + \PHP_EOL + ) : ''; [$recluster_help, $reclusterconf] = $this->_getReclusterConf($data, $type, $table_hidden_inputs); @@ -661,7 +707,7 @@ trait AdminTrait // Vacuum echo '
    ' . \PHP_EOL; - echo '" . \PHP_EOL; + echo '" . \PHP_EOL; echo '

    ' . \PHP_EOL; echo $this->view->form; @@ -672,7 +718,7 @@ trait AdminTrait // Analyze echo '

    ' . \PHP_EOL; - echo '" . \PHP_EOL; + echo '" . \PHP_EOL; echo '

    ' . \PHP_EOL; echo $this->view->form; echo $table_hidden_inputs; @@ -685,7 +731,7 @@ trait AdminTrait // Reindex echo '

    ' . \PHP_EOL; - echo '" . \PHP_EOL; + echo '" . \PHP_EOL; echo '

    ' . \PHP_EOL; echo $this->view->form; echo $table_hidden_inputs; @@ -803,11 +849,14 @@ trait AdminTrait return ['', '']; } $script = $this->script; - $recluster_help = \sprintf('

    %s%s' . \PHP_EOL; - $reclusterconf .= '" . \PHP_EOL; + $reclusterconf .= '" . \PHP_EOL; $reclusterconf .= $this->view->form; $reclusterconf .= $table_hidden_inputs; @@ -854,48 +903,55 @@ trait AdminTrait 'namespace' => [ 'title' => $this->lang['strschema'], 'field' => Decorator::field('nspname'), - 'url' => self::SUBFOLDER . "/redirect/schema?{$this->misc->href}&", + 'url' => \containerInstance()->subFolder . "/redirect/schema?{$this->misc->href}&", 'vars' => ['schema' => 'nspname'], ], 'relname' => [ 'title' => $this->lang['strtable'], 'field' => Decorator::field('relname'), - 'url' => self::SUBFOLDER . "/redirect/table?{$this->misc->href}&", + 'url' => \containerInstance()->subFolder . "/redirect/table?{$this->misc->href}&", 'vars' => ['table' => 'relname', 'schema' => 'nspname'], ], 'autovacuum_enabled' => [ 'title' => $this->lang['strenabled'], - 'field' => Decorator::callback($enlight, ['autovacuum_enabled', $defaults['autovacuum']]), + 'field' => Decorator::callback($enlight, ['autovacuum_enabled', + $defaults['autovacuum'], ]), 'type' => 'verbatim', ], 'autovacuum_vacuum_threshold' => [ 'title' => $this->lang['strvacuumbasethreshold'], - 'field' => Decorator::callback($enlight, ['autovacuum_vacuum_threshold', $defaults['autovacuum_vacuum_threshold']]), + 'field' => Decorator::callback($enlight, ['autovacuum_vacuum_threshold', + $defaults['autovacuum_vacuum_threshold'], ]), 'type' => 'verbatim', ], 'autovacuum_vacuum_scale_factor' => [ 'title' => $this->lang['strvacuumscalefactor'], - 'field' => Decorator::callback($enlight, ['autovacuum_vacuum_scale_factor', $defaults['autovacuum_vacuum_scale_factor']]), + 'field' => Decorator::callback($enlight, ['autovacuum_vacuum_scale_factor', + $defaults['autovacuum_vacuum_scale_factor'], ]), 'type' => 'verbatim', ], 'autovacuum_analyze_threshold' => [ 'title' => $this->lang['stranalybasethreshold'], - 'field' => Decorator::callback($enlight, ['autovacuum_analyze_threshold', $defaults['autovacuum_analyze_threshold']]), + 'field' => Decorator::callback($enlight, ['autovacuum_analyze_threshold', + $defaults['autovacuum_analyze_threshold'], ]), 'type' => 'verbatim', ], 'autovacuum_analyze_scale_factor' => [ 'title' => $this->lang['stranalyzescalefactor'], - 'field' => Decorator::callback($enlight, ['autovacuum_analyze_scale_factor', $defaults['autovacuum_analyze_scale_factor']]), + 'field' => Decorator::callback($enlight, ['autovacuum_analyze_scale_factor', + $defaults['autovacuum_analyze_scale_factor'], ]), 'type' => 'verbatim', ], 'autovacuum_vacuum_cost_delay' => [ 'title' => $this->lang['strvacuumcostdelay'], - 'field' => Decorator::concat(Decorator::callback($enlight, ['autovacuum_vacuum_cost_delay', $defaults['autovacuum_vacuum_cost_delay']]), 'ms'), + 'field' => Decorator::concat(Decorator::callback($enlight, ['autovacuum_vacuum_cost_delay', + $defaults['autovacuum_vacuum_cost_delay'], ]), 'ms'), 'type' => 'verbatim', ], 'autovacuum_vacuum_cost_limit' => [ 'title' => $this->lang['strvacuumcostlimit'], - 'field' => Decorator::callback($enlight, ['autovacuum_vacuum_cost_limit', $defaults['autovacuum_vacuum_cost_limit']]), + 'field' => Decorator::callback($enlight, ['autovacuum_vacuum_cost_limit', + $defaults['autovacuum_vacuum_cost_limit'], ]), 'type' => 'verbatim', ], ]; @@ -935,7 +991,8 @@ trait AdminTrait ]; if ('table' === $type) { - unset($actions['edit']['vars']['schema'], + unset( + $actions['edit']['vars']['schema'], $actions['delete']['vars']['schema'], $columns['namespace'], $columns['relname'] @@ -947,7 +1004,7 @@ trait AdminTrait if (('table' === $type) && (0 === $autovac->recordCount())) { echo '
    '; - echo 'misc->href}&table="; + echo 'misc->href}&table="; echo \htmlspecialchars($_REQUEST['table']); echo "\">{$this->lang['straddvacuumtable']}"; } diff --git a/src/traits/ExportTrait.php b/src/traits/ExportTrait.php index 803bb58b..9098c2df 100644 --- a/src/traits/ExportTrait.php +++ b/src/traits/ExportTrait.php @@ -172,7 +172,7 @@ trait ExportTrait { $content = \sprintf( '%s', - self::SUBFOLDER . '/src/views', + \containerInstance()->subFolder . '/src/views', $endpoint, \PHP_EOL ); diff --git a/src/traits/HelperTrait.php b/src/traits/HelperTrait.php index 0728ede1..e7c3d1ef 100644 --- a/src/traits/HelperTrait.php +++ b/src/traits/HelperTrait.php @@ -18,29 +18,6 @@ namespace PHPPgAdmin\Traits; */ trait HelperTrait { - /** - * static reference to subfolder in which the app is running. - * - * @var null|string - */ - public static $subFolder = null; - - /** - * Gets the subfolder. - * - * @param string $path The path - * - * @return string the subfolder - */ - public function getSubfolder(string $path = ''): string - { - if (null === self::$subFolder) { - self::$subFolder = $this->container->subfolder; - } - - return \implode(\DIRECTORY_SEPARATOR, [self::$subFolder, $path]); - } - /** * Halts the execution of the program. It's like calling exit() but using builtin Slim Exceptions. * @@ -172,18 +149,6 @@ trait HelperTrait return $bytes; } - /** - * Returns a string with html
    variant replaced with a new line. - * - * @param string $msg message to parse (
    separated) - * - * @return string parsed message (linebreak separated) - */ - public static function br2ln($msg) - { - return \str_replace(['
    ', '
    ', '
    '], \PHP_EOL, $msg); - } - /** * Receives N parameters and sends them to the console adding where was it called from. * diff --git a/src/traits/InsertEditRowTrait.php b/src/traits/InsertEditRowTrait.php index a6c2ac2a..742d518f 100644 --- a/src/traits/InsertEditRowTrait.php +++ b/src/traits/InsertEditRowTrait.php @@ -119,12 +119,12 @@ trait InsertEditRowTrait $fksprops['code'] .= "var table='" . \addslashes(\htmlentities($table, \ENT_QUOTES, 'UTF-8')) . "';"; $fksprops['code'] .= "var server='" . \htmlentities($_REQUEST['server'], \ENT_QUOTES, 'UTF-8') . "';"; $fksprops['code'] .= "var database='" . \addslashes(\htmlentities($_REQUEST['database'], \ENT_QUOTES, 'UTF-8')) . "';"; - $fksprops['code'] .= "var subfolder='" . self::SUBFOLDER . "';"; + $fksprops['code'] .= "var subfolder='" . \containerInstance()->subFolder . "';"; $fksprops['code'] .= '' . \PHP_EOL; $fksprops['code'] .= '
    '; $fksprops['code'] .= '
    '; - $fksprops['code'] .= ''; + $fksprops['code'] .= ''; } else { /* we have no foreign keys on this table */ return false; diff --git a/src/traits/MiscTrait.php b/src/traits/MiscTrait.php index 7c5e21b4..be7a390c 100644 --- a/src/traits/MiscTrait.php +++ b/src/traits/MiscTrait.php @@ -6,6 +6,7 @@ namespace PHPPgAdmin\Traits; +use PHPPgAdmin\ContainerUtils; use PHPPgAdmin\Decorators\Decorator; /** @@ -161,11 +162,11 @@ trait MiscTrait } if (!isset($vars['url'])) { - $vars['url'] = self::SUBFOLDER . '/redirect'; + $vars['url'] = \containerInstance()->subFolder . '/redirect'; } - if (self::SUBFOLDER . '/redirect' === $vars['url'] && isset($vars['params']['subject'])) { - $vars['url'] = self::SUBFOLDER . '/redirect/' . $vars['params']['subject']; + if (containerInstance()->subFolder . '/redirect' === $vars['url'] && isset($vars['params']['subject'])) { + $vars['url'] = \containerInstance()->subFolder . '/redirect/' . $vars['params']['subject']; unset($vars['params']['subject']); } @@ -287,7 +288,7 @@ trait MiscTrait case 'cid': case 'tid': $align = 'right'; - $out = \nl2br(\htmlspecialchars(self::br2ln($str))); + $out = \nl2br(\htmlspecialchars(ContainerUtils::br2ln($str))); break; case 'yesno': @@ -319,7 +320,7 @@ trait MiscTrait break; case 'nbsp': - $out = \nl2br(\str_replace(' ', ' ', self::br2ln($str))); + $out = \nl2br(\str_replace(' ', ' ', ContainerUtils::br2ln($str))); break; case 'verbatim': @@ -345,7 +346,7 @@ trait MiscTrait $out = \htmlspecialchars($str); } else { //$tag = 'span'; - $out = \nl2br(\htmlspecialchars(self::br2ln($str))); + $out = \nl2br(\htmlspecialchars(ContainerUtils::br2ln($str))); } } @@ -1038,14 +1039,14 @@ trait MiscTrait return [ 'sql' => [ 'title' => $lang['strsql'], - 'url' => self::SUBFOLDER . '/src/views/sqledit', + 'url' => \containerInstance()->subFolder . '/src/views/sqledit', 'urlvars' => ['action' => 'sql', 'subject' => 'schema'], 'help' => 'pg.sql', 'icon' => 'SqlEditor', ], 'find' => [ 'title' => $lang['strfind'], - 'url' => self::SUBFOLDER . '/src/views/sqledit', + 'url' => \containerInstance()->subFolder . '/src/views/sqledit', 'urlvars' => ['action' => 'find', 'subject' => 'schema'], 'icon' => 'Search', ], @@ -1143,43 +1144,56 @@ trait MiscTrait $tabs = []; switch ($section) { - case 'root':$tabs = $this->getTabsRoot($data); + case 'root': + $tabs = $this->getTabsRoot($data); break; - case 'server':$tabs = $this->getTabsServer($data); + case 'server': + $tabs = $this->getTabsServer($data); break; - case 'database':$tabs = $this->getTabsDatabase($data); + case 'database': + $tabs = $this->getTabsDatabase($data); break; - case 'schema':$tabs = $this->getTabsSchema($data); + case 'schema': + $tabs = $this->getTabsSchema($data); break; - case 'table':$tabs = $this->getTabsTable($data); + case 'table': + $tabs = $this->getTabsTable($data); break; - case 'view':$tabs = $this->getTabsView($data); + case 'view': + $tabs = $this->getTabsView($data); break; - case 'matview':$tabs = $this->getTabsMatview($data); + case 'matview': + $tabs = $this->getTabsMatview($data); break; - case 'function':$tabs = $this->getTabsFunction($data); + case 'function': + $tabs = $this->getTabsFunction($data); break; - case 'aggregate':$tabs = $this->getTabsAggregate($data); + case 'aggregate': + $tabs = $this->getTabsAggregate($data); break; - case 'role':$tabs = $this->getTabsRole($data); + case 'role': + $tabs = $this->getTabsRole($data); break; - case 'popup':$tabs = $this->getTabsPopup($data); + case 'popup': + $tabs = $this->getTabsPopup($data); break; - case 'column':$tabs = $this->getTabsColumn($data); + case 'column': + $tabs = $this->getTabsColumn($data); break; - case 'fulltext':$tabs = $this->getTabsFulltext($data); + case 'fulltext': + $tabs = $this->getTabsFulltext($data); break; } diff --git a/src/traits/ViewsMatviewsTrait.php b/src/traits/ViewsMatviewsTrait.php index 9a35516d..15813802 100644 --- a/src/traits/ViewsMatviewsTrait.php +++ b/src/traits/ViewsMatviewsTrait.php @@ -64,7 +64,7 @@ trait ViewsMatviewsTrait $attrs = $data->getTableAttributes($_REQUEST[$this->keystring]); - echo ''; + echo ''; echo \PHP_EOL; if (0 < $attrs->recordCount()) { @@ -118,12 +118,13 @@ trait ViewsMatviewsTrait '>', \htmlspecialchars($v), '' . \PHP_EOL; } echo '
    ', $data->printField( + echo ''; + echo $data->printField( "values[{$attrs->fields['attname']}]", $_REQUEST['values'][$attrs->fields['attname']], $attrs->fields['type'] - ), '
    ' . \PHP_EOL; echo ""; echo "\n
    {$this->lang['strtables']}
    " . \PHP_EOL; @@ -322,7 +323,7 @@ trait ViewsMatviewsTrait $status = $data->createView($_POST['formView'], $viewQuery, false, $_POST['formComment'], $is_materialized); if (0 === $status) { - $this->misc->setReloadBrowser(true); + $this->view->setReloadBrowser(true); return $this->doDefault($this->lang['strviewcreated']); } @@ -375,7 +376,7 @@ trait ViewsMatviewsTrait } \asort($arrFields); - echo '' . \PHP_EOL; + echo '' . \PHP_EOL; echo '' . \PHP_EOL; echo ""; echo "\n\n', \htmlentities(\serialize($a), \ENT_COMPAT, 'UTF-8')) . \PHP_EOL; } diff --git a/src/xhtml/XHtmlSimpleElement.php b/src/xhtml/XHtmlSimpleElement.php index d08abadf..fa529fa8 100644 --- a/src/xhtml/XHtmlSimpleElement.php +++ b/src/xhtml/XHtmlSimpleElement.php @@ -6,8 +6,6 @@ namespace PHPPgAdmin\XHtml; -use PHPPgAdmin\ContainerUtils; - /** * XHtmlSimpleElement. * @@ -19,18 +17,6 @@ use PHPPgAdmin\ContainerUtils; class XHtmlSimpleElement { use \PHPPgAdmin\Traits\HelperTrait; - /** - * @var string - */ - const BASE_PATH = ContainerUtils::BASE_PATH; - /** - * @var string - */ - const SUBFOLDER = ContainerUtils::SUBFOLDER; - /** - * @var string - */ - const DEBUGMODE = ContainerUtils::DEBUGMODE; public $_element; diff --git a/tests/_support/Helper/Unit.php b/tests/_support/Helper/Unit.php index 447192dd..abb182cc 100644 --- a/tests/_support/Helper/Unit.php +++ b/tests/_support/Helper/Unit.php @@ -7,32 +7,19 @@ namespace Helper; \defined('IN_TEST') || \define('IN_TEST', true); -use PHPPgAdmin\ContainerUtils; -if (!\is_readable(ContainerUtils::BASE_PATH . '/src/lib.inc.php')) { +$bootstrapfile = \dirname(__DIR__, 3) . '/src/lib.inc.php'; + +if (!\is_readable($bootstrapfile)) { die('lib.inc.php is not readable'); } -\defined('IN_TEST') || \define('IN_TEST', true); -require_once ContainerUtils::BASE_PATH . '/src/lib.inc.php'; +require_once $bootstrapfile; // here you can define custom actions // all public methods declared in helper class will be available in $I class Unit extends \Codeception\Module { - /** - * @var string - */ - const BASE_PATH = ContainerUtils::BASE_PATH; - /** - * @var string - */ - const SUBFOLDER = ContainerUtils::SUBFOLDER; - /** - * @var string - */ - const DEBUGMODE = ContainerUtils::DEBUGMODE; - /** * @var \PHPPgAdmin */ @@ -40,16 +27,11 @@ class Unit extends \Codeception\Module private static $_conf; - public static function getDir() - { - return self::DIRNAME; - } - public static function getContainer() { //$conf = self::getConf(); if (!static::$_container) { - self::$_container = ContainerUtils::getContainerInstance(); + self::$_container = containerInstance(); } //dump(PHP_SAPI); diff --git a/tests/unit/ContainerTest.php b/tests/unit/ContainerTest.php index 7f435d94..aee3a87f 100644 --- a/tests/unit/ContainerTest.php +++ b/tests/unit/ContainerTest.php @@ -20,7 +20,6 @@ class ContainerTest extends \Codeception\Test\Unit public function testContainerValidity(): void { - $utils = $this->container['utils']; self::assertTrue( $this->container instanceof \Psr\Container\ContainerInterface, '$container must be an instance of \Psr\Container\ContainerInterface' @@ -29,9 +28,8 @@ class ContainerTest extends \Codeception\Test\Unit public function testContainerUtils(): void { - $utils = $this->container['utils']; self::assertTrue( - $this->container->utils instanceof \PHPPgAdmin\ContainerUtils, + $this->container instanceof \PHPPgAdmin\ContainerUtils, '$container->utils must be an instance of PHPPgAdmin\ContainerUtils' ); } @@ -56,7 +54,7 @@ class ContainerTest extends \Codeception\Test\Unit { $Helper = $this->getModule('\Helper\Unit'); $this->container = $Helper::getContainer(); - self::$BASE_PATH = $Helper::BASE_PATH; + self::$BASE_PATH = $this->container->BASE_PATH; $this->container->misc->setNoDBConnection(true); } diff --git a/tests/unit/DataEntitiesTest.php b/tests/unit/DataEntitiesTest.php index a16d5f7e..b076f184 100644 --- a/tests/unit/DataEntitiesTest.php +++ b/tests/unit/DataEntitiesTest.php @@ -63,7 +63,7 @@ class DataEntitiesTest extends \Codeception\Test\Unit { $Helper = $this->getModule('\Helper\Unit'); $this->container = $Helper::getContainer(); - self::$BASE_PATH = $Helper::BASE_PATH; + self::$BASE_PATH = self::$BASE_PATH = $this->container->BASE_PATH; $this->container->get('misc')->setNoDBConnection(true); // Helper // \Codeception\Util\Debug::debug('BASE_PATH is ' . \BASE_PATH); diff --git a/tests/unit/PublicSectionsTest.php b/tests/unit/PublicSectionsTest.php index 4a6bb7da..bd1d57ba 100644 --- a/tests/unit/PublicSectionsTest.php +++ b/tests/unit/PublicSectionsTest.php @@ -133,7 +133,7 @@ class PublicSectionsTest extends \Codeception\Test\Unit { $Helper = $this->getModule('\Helper\Unit'); $this->container = $Helper::getContainer(); - self::$BASE_PATH = $Helper::BASE_PATH; + self::$BASE_PATH = self::$BASE_PATH = $this->container->BASE_PATH; $this->container->get('misc')->setNoDBConnection(true); // Helper //\Codeception\Util\Debug::debug('BASE_PATH is ' . \BASE_PATH); diff --git a/tests/unit/TablesAndViewsTest.php b/tests/unit/TablesAndViewsTest.php index 3d6004a9..a362805f 100644 --- a/tests/unit/TablesAndViewsTest.php +++ b/tests/unit/TablesAndViewsTest.php @@ -86,7 +86,7 @@ class TablesAndViewsTest extends \Codeception\Test\Unit { $Helper = $this->getModule('\Helper\Unit'); $this->container = $Helper::getContainer(); - self::$BASE_PATH = $Helper::BASE_PATH; + self::$BASE_PATH = self::$BASE_PATH = $this->container->BASE_PATH; $this->container->get('misc')->setNoDBConnection(true); //\Codeception\Util\Debug::debug('BASE_PATH is ' . \BASE_PATH); } diff --git a/tests/unit/UserEntitiesTest.php b/tests/unit/UserEntitiesTest.php index bd1345cc..76072ed3 100644 --- a/tests/unit/UserEntitiesTest.php +++ b/tests/unit/UserEntitiesTest.php @@ -63,7 +63,7 @@ class UserEntitiesTest extends \Codeception\Test\Unit { $Helper = $this->getModule('\Helper\Unit'); $this->container = $Helper::getContainer(); - self::$BASE_PATH = $Helper::BASE_PATH; + self::$BASE_PATH = self::$BASE_PATH = $this->container->BASE_PATH; $this->container->get('misc')->setNoDBConnection(true); // Helper //\Codeception\Util\Debug::debug('BASE_PATH is ' . \BASE_PATH); diff --git a/tests/unit/ViewTest.php b/tests/unit/ViewTest.php index 77a473b9..b758f7c1 100644 --- a/tests/unit/ViewTest.php +++ b/tests/unit/ViewTest.php @@ -178,7 +178,7 @@ class ViewTest extends \Codeception\Test\Unit { $Helper = $this->getModule('\Helper\Unit'); $this->container = $Helper::getContainer(); - self::$BASE_PATH = $Helper::BASE_PATH; + self::$BASE_PATH = self::$BASE_PATH = $this->container->BASE_PATH; $this->container->get('misc')->setNoDBConnection(true); // Helper //\Codeception\Util\Debug::debug('BASE_PATH is ' . \BASE_PATH); diff --git a/tools/composer-require-checker b/tools/composer-require-checker new file mode 120000 index 00000000..5a931534 --- /dev/null +++ b/tools/composer-require-checker @@ -0,0 +1 @@ +/home/ffflabs/.phive/phars/composer-require-checker-2.1.0.phar \ No newline at end of file diff --git a/tools/phpcpd b/tools/phpcpd new file mode 120000 index 00000000..8e085ba5 --- /dev/null +++ b/tools/phpcpd @@ -0,0 +1 @@ +/home/ffflabs/.phive/phars/phpcpd-4.1.0.phar \ No newline at end of file diff --git a/tools/phpcs b/tools/phpcs new file mode 120000 index 00000000..18b16ce6 --- /dev/null +++ b/tools/phpcs @@ -0,0 +1 @@ +/home/ffflabs/.phive/phars/phpcs-3.5.3.phar \ No newline at end of file diff --git a/tools/phpmd b/tools/phpmd new file mode 120000 index 00000000..7384b0ce --- /dev/null +++ b/tools/phpmd @@ -0,0 +1 @@ +/home/ffflabs/.phive/phars/phpmd-2.7.0.phar \ No newline at end of file diff --git a/tools/reviewdog b/tools/reviewdog new file mode 100755 index 00000000..cf8bccd2 Binary files /dev/null and b/tools/reviewdog differ diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..027b4495 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "keyofStringsOnly": true, + "allowJs": true, + "checkJs": true, + "declarationDir": "types", + "declaration": false, + //"emitDeclarationOnly": true, + "noEmit": true, + "outDir": "build", + + + + }, + "exclude": ["node_modules"], + "outDir":"build" + +} diff --git a/workbox-config.js b/workbox-config.js new file mode 100644 index 00000000..6078ae0a --- /dev/null +++ b/workbox-config.js @@ -0,0 +1,20 @@ +module.exports = { + "globDirectory": "assets/", + "globPatterns": [ + "**/*.{css,eot,svg,png,js,xml,ico,jpg,gif,swf,html,css}" + ], + "swDest": "assets/sw.js", + "swSrc": "assets/sw.dev.js", + + + globIgnores: [ + + "cbpapi/**", + "cbpfactor/**", + "css/**", + "js/**", + "*.json", + + "../workbox-config.js", + ] +}; diff --git a/yarn.lock b/yarn.lock index ab1fe0cc..f57af271 100644 --- a/yarn.lock +++ b/yarn.lock @@ -114,6 +114,18 @@ resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== +"@types/jquery@^3.5.1": + version "3.5.1" + resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.5.1.tgz#cebb057acf5071c40e439f30e840c57a30d406c3" + integrity sha512-Tyctjh56U7eX2b9udu3wG853ASYP0uagChJcQJXLUXEU6C/JiW5qt5dl8ao01VRj1i5pgXPAf8f1mq4+FDLRQg== + dependencies: + "@types/sizzle" "*" + +"@types/sizzle@*": + version "2.3.2" + resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.2.tgz#a811b8c18e2babab7d542b3365887ae2e4d9de47" + integrity sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg== + acorn-jsx@^5.2.0: version "5.3.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" @@ -139,6 +151,11 @@ ansi-colors@^4.1.1: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + ansi-regex@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" @@ -149,6 +166,11 @@ ansi-regex@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -176,6 +198,15 @@ astral-regex@^1.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + babel-eslint@^10.1.0: version "10.1.0" resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" @@ -188,6 +219,62 @@ babel-eslint@^10.1.0: eslint-visitor-keys "^1.0.0" resolve "^1.12.0" +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= + dependencies: + babel-runtime "^6.22.0" + +babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.8.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.26.0, babel-types@^6.8.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== + balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" @@ -206,6 +293,17 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + chalk@^2.0.0: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -252,6 +350,11 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= +core-js@^2.4.0: + version "2.6.11" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c" + integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg== + cross-spawn@^7.0.2: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -261,6 +364,13 @@ cross-spawn@^7.0.2: shebang-command "^2.0.0" which "^2.0.1" +debug@^2.6.8: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" @@ -292,7 +402,14 @@ enquirer@^2.3.5: dependencies: ansi-colors "^4.1.1" -escape-string-regexp@^1.0.5: +errno@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" + integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== + dependencies: + prr "~1.0.1" + +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= @@ -504,6 +621,23 @@ globals@^12.1.0: dependencies: type-fest "^0.8.1" +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== + +graceful-fs@^4.1.2: + version "4.2.4" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + dependencies: + ansi-regex "^2.0.0" + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -514,11 +648,21 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +he@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== +image-size@~0.5.0: + version "0.5.5" + resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.5.5.tgz#09dfd4ab9d20e29eb1c3e80b8990378df9e3cb9c" + integrity sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w= + import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.1.tgz#633ff618506e793af5ac91bf48b72677e15cbe66" @@ -545,6 +689,13 @@ inherits@2: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== +invariant@^2.2.2: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -567,11 +718,16 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= -js-tokens@^4.0.0: +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= + js-yaml@^3.13.1: version "3.14.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" @@ -595,6 +751,28 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= +less@^3.9.0: + version "3.12.2" + resolved "https://registry.yarnpkg.com/less/-/less-3.12.2.tgz#157e6dd32a68869df8859314ad38e70211af3ab4" + integrity sha512-+1V2PCMFkL+OIj2/HrtrvZw0BC0sYLMICJfbQjuj/K8CEnlrFX6R5cKKgzzttsZDHyxQNL1jqMREjKN3ja/E3Q== + dependencies: + tslib "^1.10.0" + optionalDependencies: + errno "^0.1.1" + graceful-fs "^4.1.2" + image-size "~0.5.0" + make-dir "^2.1.0" + mime "^1.4.1" + native-request "^1.0.5" + source-map "~0.6.0" + +lessc@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/lessc/-/lessc-1.0.2.tgz#b9bedd7f1953f142bbe70ffc00a2378d19a5152a" + integrity sha512-cv7EXQRiD3Cu2Vsy3S9C89G01kOv0TrLQMoWHxscCgkMYdhEvknhaINeQkZbPmUlJ87AEzjPm0y/14Cg9j7/ug== + dependencies: + less "^3.9.0" + levn@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" @@ -603,11 +781,83 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -lodash@^4.17.14, lodash@^4.17.19: +lodash@^4.12.0, lodash@^4.15.0, lodash@^4.17.14, lodash@^4.17.19, lodash@^4.17.4: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== +loose-envify@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +make-dir@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== + dependencies: + pify "^4.0.1" + semver "^5.6.0" + +melody-code-frame@^1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/melody-code-frame/-/melody-code-frame-1.7.5.tgz#047eaebfc09c26ab9fcc57c0470b34b46312245a" + integrity sha512-q/Do+7ZFxRHLN7IhT5RIJrTKh7xNmX3JG4+AD1ZST9iB8gUPYs6yfgGexDRDvtOAAGgLfFbT1DlMWJtldqYaPQ== + dependencies: + lodash "^4.15.0" + +melody-extension-core@^1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/melody-extension-core/-/melody-extension-core-1.7.5.tgz#85b7fc2aaf436e4b7cdc212212eff00d3a81ba08" + integrity sha512-eu/ji2sxpKvob03+1bdtuRr9XTW/VdogjHXvHiMYIK5DslpREcdGLVDEVAa1dfnnzoKGso76XCOHTJy0pImRfg== + dependencies: + babel-template "^6.8.0" + babel-types "^6.8.1" + lodash "^4.12.0" + shortid "^2.2.6" + +melody-idom@^1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/melody-idom/-/melody-idom-1.7.5.tgz#fdd425476fa963c549272ffc6c2842a84c316dcd" + integrity sha512-CsMg+vPyaIs9Wl/pTEgevQs+DfPzEpsNnHcaZNBGgQo3GvLItVgrg3Z8z3obVkPikRrHyRnwBPWIWiRyeh6KHg== + dependencies: + lodash "^4.12.0" + +melody-parser@^1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/melody-parser/-/melody-parser-1.7.5.tgz#6f10e02f194159792a2f83d51e8790ba6ce71141" + integrity sha512-ffWDWl76G3lgTQUZ3SqGY0oZeul9FrKAnV+8+j3+afrS7AjBC32w5H+Imi00+qcOgdkpoU3eWwisqKc+pQmQ8g== + dependencies: + he "^1.1.0" + lodash "^4.12.0" + melody-code-frame "^1.7.5" + +melody-runtime@^1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/melody-runtime/-/melody-runtime-1.7.5.tgz#af6c93017b9874df5bd81168d75adc20ac5e9730" + integrity sha512-SmkH57Y6FYn+NP15dES85zmhYsjsvVmvh3euLeMuAPWwqqSm28AIZ9btPpkDUCDu/L7JAQ8dTaflbpeDgBwnPQ== + dependencies: + lodash "^4.12.0" + +melody-traverse@^1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/melody-traverse/-/melody-traverse-1.7.5.tgz#b40b80331c47aa483b477c7fbebd1400e21d8e59" + integrity sha512-k9agECp5qEyIDybedgMNHPalb6wfwy5WlczJriOAn/swggeoq3+HojXSABo3uKM7K8xXNmpVhW/wOJA86oqjIQ== + +melody-types@^1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/melody-types/-/melody-types-1.7.5.tgz#6de13f2c6f9504db890a3261a49fc18a26e31018" + integrity sha512-KkZmYlkmHtK10Hyx0mVNBZg1OXctIzZo2w3Vyc5AOV+KLA5lRiG6Z3Lp+G8o1LD6UZY0PC83/57hw3gs2Qj+Tg== + dependencies: + babel-types "^6.8.1" + +mime@^1.4.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== + minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" @@ -627,11 +877,26 @@ mkdirp@^0.5.1: dependencies: minimist "^1.2.5" +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + ms@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== +nanoid@^2.1.0: + version "2.1.11" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-2.1.11.tgz#ec24b8a758d591561531b4176a01e3ab4f0f0280" + integrity sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA== + +native-request@^1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/native-request/-/native-request-1.0.7.tgz#ff742dc555b4c8f2f1c14b548639ba174e573856" + integrity sha512-9nRjinI9bmz+S7dgNtf4A70+/vPhnd+2krGpy4SUlADuOuSa24IDkNaZ+R/QT1wQ6S8jBdi6wE7fLekFZNfUpQ== + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -678,6 +943,11 @@ path-parse@^1.0.6: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -690,6 +960,24 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" +prettier-plugin-twig-melody@^0.4.6: + version "0.4.6" + resolved "https://registry.yarnpkg.com/prettier-plugin-twig-melody/-/prettier-plugin-twig-melody-0.4.6.tgz#0ce8f1fac622105ef3e37cc75799402cf9d325c1" + integrity sha512-5/sk+0efzxQ4r4hiZiWVQ6mxqaekeOIbGpwLUUtNjcKpAO4HmWsEzXpCEIdq2GjqrgjuPDlknJaa5g4B5Qx/jg== + dependencies: + babel-types "^6.26.0" + melody-extension-core "^1.7.5" + melody-parser "^1.7.5" + melody-traverse "^1.7.5" + melody-types "^1.7.5" + prettier "^1.8.2" + resolve "^1.12.0" + +prettier@^1.8.2: + version "1.19.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" + integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== + prettier@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.1.tgz#d9485dd5e499daa6cb547023b87a6cf51bee37d6" @@ -700,11 +988,21 @@ progress@^2.0.0: resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= + punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== + regexpp@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" @@ -729,6 +1027,11 @@ rimraf@2.6.3: dependencies: glob "^7.1.3" +semver@^5.6.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + semver@^7.2.1: version "7.3.2" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" @@ -746,6 +1049,13 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +shortid@^2.2.6: + version "2.2.15" + resolved "https://registry.yarnpkg.com/shortid/-/shortid-2.2.15.tgz#2b902eaa93a69b11120373cd42a1f1fe4437c122" + integrity sha512-5EaCy2mx2Jgc/Fdn9uuDuNIIfWBpzY4XIlhoqtXF6qsf+/+SGZ+FxDdX/ZsMZiWupIWNqAEmiNY4RC+LSmCeOw== + dependencies: + nanoid "^2.1.0" + slice-ansi@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" @@ -760,6 +1070,11 @@ source-map@^0.5.0: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= +source-map@~0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -774,6 +1089,13 @@ string-width@^3.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + strip-ansi@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" @@ -793,6 +1115,11 @@ strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -822,11 +1149,26 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= + to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= +tslib@^1.10.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043" + integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q== + +tslib@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.1.tgz#410eb0d113e5b6356490eec749603725b021b43e" + integrity sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ== + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -839,6 +1181,11 @@ type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== +typescript@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.3.tgz#153bbd468ef07725c1df9c77e8b453f8d36abba5" + integrity sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg== + uri-js@^4.2.2: version "4.4.0" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.0.tgz#aa714261de793e8a82347a7bcc9ce74e86f28602" -- cgit v1.2.3
    {$this->lang['strviewname']}
    " . \PHP_EOL; @@ -409,6 +410,7 @@ trait ViewsMatviewsTrait for ($i = 0; $i < $linkCount; ++$i) { // Initialise variables + $formLink[$i] = $formLink[$i] ?? []; $this->coalesceArr($formLink[$i], 'operator', 'INNER JOIN'); echo "
    " . \PHP_EOL; diff --git a/src/translations/Afrikaans.php b/src/translations/Afrikaans.php index 54633668..4a29df04 100644 --- a/src/translations/Afrikaans.php +++ b/src/translations/Afrikaans.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Afrikaans language. + * + * @SuppressWarnings(PHPMD) */ class Afrikaans extends AbstractLang { diff --git a/src/translations/Arabic.php b/src/translations/Arabic.php index c1adb2c2..2bd22f60 100644 --- a/src/translations/Arabic.php +++ b/src/translations/Arabic.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Arabic language. + * + * @SuppressWarnings(PHPMD) */ class Arabic extends AbstractLang { diff --git a/src/translations/Catalan.php b/src/translations/Catalan.php index f8f7697b..962f8803 100644 --- a/src/translations/Catalan.php +++ b/src/translations/Catalan.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Catalan language. + * + * @SuppressWarnings(PHPMD) */ class Catalan extends AbstractLang { diff --git a/src/translations/ChineseSim.php b/src/translations/ChineseSim.php index 3d45e39a..7226d468 100644 --- a/src/translations/ChineseSim.php +++ b/src/translations/ChineseSim.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for ChineseSim language. + * + * @SuppressWarnings(PHPMD) */ class ChineseSim extends AbstractLang { diff --git a/src/translations/ChineseTr.php b/src/translations/ChineseTr.php index 0f52b9b7..e6769dbf 100644 --- a/src/translations/ChineseTr.php +++ b/src/translations/ChineseTr.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for ChineseTr language. + * + * @SuppressWarnings(PHPMD) */ class ChineseTr extends AbstractLang { diff --git a/src/translations/ChineseUtf8ZhCn.php b/src/translations/ChineseUtf8ZhCn.php index 4bc315f3..65e85201 100644 --- a/src/translations/ChineseUtf8ZhCn.php +++ b/src/translations/ChineseUtf8ZhCn.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for ChineseUtf8ZhCn language. + * + * @SuppressWarnings(PHPMD) */ class ChineseUtf8ZhCn extends AbstractLang { diff --git a/src/translations/ChineseUtf8ZhTw.php b/src/translations/ChineseUtf8ZhTw.php index dc4c5fa3..7edf1027 100644 --- a/src/translations/ChineseUtf8ZhTw.php +++ b/src/translations/ChineseUtf8ZhTw.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for ChineseUtf8ZhTw language. + * + * @SuppressWarnings(PHPMD) */ class ChineseUtf8ZhTw extends AbstractLang { diff --git a/src/translations/Czech.php b/src/translations/Czech.php index a331f8f3..a3a5d3e3 100644 --- a/src/translations/Czech.php +++ b/src/translations/Czech.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Czech language. + * + * @SuppressWarnings(PHPMD) */ class Czech extends AbstractLang { diff --git a/src/translations/Danish.php b/src/translations/Danish.php index 084b475f..2603f9eb 100644 --- a/src/translations/Danish.php +++ b/src/translations/Danish.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Danish language. + * + * @SuppressWarnings(PHPMD) */ class Danish extends AbstractLang { diff --git a/src/translations/Dutch.php b/src/translations/Dutch.php index c66ef240..26a2137b 100644 --- a/src/translations/Dutch.php +++ b/src/translations/Dutch.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Dutch language. + * + * @SuppressWarnings(PHPMD) */ class Dutch extends AbstractLang { diff --git a/src/translations/English.php b/src/translations/English.php index c1782fd0..007157a1 100644 --- a/src/translations/English.php +++ b/src/translations/English.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Ukrainian language. + * + * @SuppressWarnings(PHPMD) */ class English extends AbstractLang { diff --git a/src/translations/French.php b/src/translations/French.php index 603b5337..32047076 100644 --- a/src/translations/French.php +++ b/src/translations/French.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for French language. + * + * @SuppressWarnings(PHPMD) */ class French extends AbstractLang { diff --git a/src/translations/Galician.php b/src/translations/Galician.php index 08c1fc41..37da8d75 100644 --- a/src/translations/Galician.php +++ b/src/translations/Galician.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Galician language. + * + * @SuppressWarnings(PHPMD) */ class Galician extends AbstractLang { diff --git a/src/translations/German.php b/src/translations/German.php index 0b0c6e04..3057dfdd 100644 --- a/src/translations/German.php +++ b/src/translations/German.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for German language. + * + * @SuppressWarnings(PHPMD) */ class German extends AbstractLang { diff --git a/src/translations/Greek.php b/src/translations/Greek.php index 34348a6a..b02b2c17 100644 --- a/src/translations/Greek.php +++ b/src/translations/Greek.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Greek language. + * + * @SuppressWarnings(PHPMD) */ class Greek extends AbstractLang { diff --git a/src/translations/Hebrew.php b/src/translations/Hebrew.php index b2d5f4c0..e92f2818 100644 --- a/src/translations/Hebrew.php +++ b/src/translations/Hebrew.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Hebrew language. + * + * @SuppressWarnings(PHPMD) */ class Hebrew extends AbstractLang { diff --git a/src/translations/Hungarian.php b/src/translations/Hungarian.php index 7b9ff72b..d08856a0 100644 --- a/src/translations/Hungarian.php +++ b/src/translations/Hungarian.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Hungarian language. + * + * @SuppressWarnings(PHPMD) */ class Hungarian extends AbstractLang { diff --git a/src/translations/Italian.php b/src/translations/Italian.php index f024c63d..976a143f 100644 --- a/src/translations/Italian.php +++ b/src/translations/Italian.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Italian language. + * + * @SuppressWarnings(PHPMD) */ class Italian extends AbstractLang { diff --git a/src/translations/Japanese.php b/src/translations/Japanese.php index b25d1e75..6af1161e 100644 --- a/src/translations/Japanese.php +++ b/src/translations/Japanese.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Japanese language. + * + * @SuppressWarnings(PHPMD) */ class Japanese extends AbstractLang { diff --git a/src/translations/Lithuanian.php b/src/translations/Lithuanian.php index 727d266f..428d675c 100644 --- a/src/translations/Lithuanian.php +++ b/src/translations/Lithuanian.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Lithuanian language. + * + * @SuppressWarnings(PHPMD) */ class Lithuanian extends AbstractLang { diff --git a/src/translations/Mongol.php b/src/translations/Mongol.php index 6129cffe..b74aedf4 100644 --- a/src/translations/Mongol.php +++ b/src/translations/Mongol.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Mongol language. + * + * @SuppressWarnings(PHPMD) */ class Mongol extends AbstractLang { diff --git a/src/translations/Polish.php b/src/translations/Polish.php index ce12d448..a40cb2fc 100644 --- a/src/translations/Polish.php +++ b/src/translations/Polish.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Polish language. + * + * @SuppressWarnings(PHPMD) */ class Polish extends AbstractLang { diff --git a/src/translations/PortugueseBr.php b/src/translations/PortugueseBr.php index 40b219bd..d033e61f 100644 --- a/src/translations/PortugueseBr.php +++ b/src/translations/PortugueseBr.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for PortugueseBr language. + * + * @SuppressWarnings(PHPMD) */ class PortugueseBr extends AbstractLang { diff --git a/src/translations/PortuguesePt.php b/src/translations/PortuguesePt.php index 395b3fe4..3f876f6a 100644 --- a/src/translations/PortuguesePt.php +++ b/src/translations/PortuguesePt.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for PortuguesePt language. + * + * @SuppressWarnings(PHPMD) */ class PortuguesePt extends AbstractLang { diff --git a/src/translations/Romanian.php b/src/translations/Romanian.php index 184eba41..77976706 100644 --- a/src/translations/Romanian.php +++ b/src/translations/Romanian.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Romanian language. + * + * @SuppressWarnings(PHPMD) */ class Romanian extends AbstractLang { diff --git a/src/translations/Russian.php b/src/translations/Russian.php index 03c37111..37d4a930 100644 --- a/src/translations/Russian.php +++ b/src/translations/Russian.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Russian language. + * + * @SuppressWarnings(PHPMD) */ class Russian extends AbstractLang { diff --git a/src/translations/RussianUtf8.php b/src/translations/RussianUtf8.php index bbe96e70..4aad8cad 100644 --- a/src/translations/RussianUtf8.php +++ b/src/translations/RussianUtf8.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for RussianUtf8 language. + * + * @SuppressWarnings(PHPMD) */ class RussianUtf8 extends AbstractLang { diff --git a/src/translations/Slovak.php b/src/translations/Slovak.php index e3834a5e..6427a83d 100644 --- a/src/translations/Slovak.php +++ b/src/translations/Slovak.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Slovak language. + * + * @SuppressWarnings(PHPMD) */ class Slovak extends AbstractLang { diff --git a/src/translations/Spanish.php b/src/translations/Spanish.php index 9f6d6a77..63bb9e18 100644 --- a/src/translations/Spanish.php +++ b/src/translations/Spanish.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Spanish language. + * + * @SuppressWarnings(PHPMD) */ class Spanish extends AbstractLang { diff --git a/src/translations/Swedish.php b/src/translations/Swedish.php index 6eaa8791..23818a96 100644 --- a/src/translations/Swedish.php +++ b/src/translations/Swedish.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Swedish language. + * + * @SuppressWarnings(PHPMD) */ class Swedish extends AbstractLang { diff --git a/src/translations/Turkish.php b/src/translations/Turkish.php index 897a1da6..ab32559e 100644 --- a/src/translations/Turkish.php +++ b/src/translations/Turkish.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Turkish language. + * + * @SuppressWarnings(PHPMD) */ class Turkish extends AbstractLang { diff --git a/src/translations/Ukrainian.php b/src/translations/Ukrainian.php index d73366d9..5029df01 100644 --- a/src/translations/Ukrainian.php +++ b/src/translations/Ukrainian.php @@ -8,6 +8,8 @@ namespace PHPPgAdmin\Translations; /** * Class providing translation for Ukrainian language. + * + * @SuppressWarnings(PHPMD) */ class Ukrainian extends AbstractLang { diff --git a/src/xhtml/HTMLController.php b/src/xhtml/HTMLController.php index 27e2f3e4..192253e7 100644 --- a/src/xhtml/HTMLController.php +++ b/src/xhtml/HTMLController.php @@ -6,7 +6,6 @@ namespace PHPPgAdmin\XHtml; -use PHPPgAdmin\ContainerUtils; use PHPPgAdmin\Decorators\Decorator; /** @@ -15,18 +14,6 @@ use PHPPgAdmin\Decorators\Decorator; class HTMLController { use \PHPPgAdmin\Traits\HelperTrait; - /** - * @var string - */ - const BASE_PATH = ContainerUtils::BASE_PATH; - /** - * @var string - */ - const SUBFOLDER = ContainerUtils::SUBFOLDER; - /** - * @var string - */ - const DEBUGMODE = ContainerUtils::DEBUGMODE; public $form = ''; @@ -40,24 +27,33 @@ class HTMLController public $controller_title = 'html'; + /** + * @var \PHPPgAdmin\ViewManager + */ public $view; + /** + * @var \PHPPgAdmin\Misc + */ + public $misc; + public $appName; public $appVersion; public $appLangFiles; - public $misc; - public $conf; public $appThemes; + /** + * @var \PHPPgAdmin\ContainerUtils + */ protected $container; // Constructor - public function __construct(\Slim\Container $container, $controller_name = null) + public function __construct(\PHPPgAdmin\ContainerUtils $container, $controller_name = null) { $this->container = $container; $this->lang = $container->get('lang'); diff --git a/src/xhtml/HTMLFooterController.php b/src/xhtml/HTMLFooterController.php index 17ca4695..e529a56f 100644 --- a/src/xhtml/HTMLFooterController.php +++ b/src/xhtml/HTMLFooterController.php @@ -55,7 +55,7 @@ class HTMLFooterController extends HTMLController { $reload_param = 'none'; - if ($this->misc->getReloadBrowser()) { + if ($this->view->getReloadBrowser()) { $reload_param = 'other'; } elseif ($this->_reload_drop_database) { $reload_param = 'database'; diff --git a/src/xhtml/HTMLHeaderController.php b/src/xhtml/HTMLHeaderController.php index 95f18206..41b70086 100644 --- a/src/xhtml/HTMLHeaderController.php +++ b/src/xhtml/HTMLHeaderController.php @@ -15,6 +15,8 @@ class HTMLHeaderController extends HTMLController private $_no_output = false; + private $_reload_drop_database = false; + /** * Sets the value of private member variable $_no_output. * @@ -42,10 +44,6 @@ class HTMLHeaderController extends HTMLController */ public function printHeader($title = '', $script = null, $do_print = true, $template = 'header.twig') { - if (\function_exists('newrelic_disable_autorum')) { - newrelic_disable_autorum(); - } - $lang = $this->lang; $viewVars = []; @@ -53,8 +51,16 @@ class HTMLHeaderController extends HTMLController $viewVars['dir'] = (0 !== \strcasecmp($lang['applangdir'], 'ltr')) ? ' dir="' . \htmlspecialchars($lang['applangdir']) . '"' : ''; $viewVars['headertemplate'] = $template; $viewVars['title'] = ('' !== $title) ? ' - ' . $title : ''; + $viewVars['lang'] = $lang; $viewVars['appName'] = \htmlspecialchars($this->appName); + $reload_param = 'none'; + if ($this->view->getReloadBrowser()) { + $reload_param = 'other'; + } elseif ($this->_reload_drop_database) { + $reload_param = 'database'; + } + $viewVars['reload'] = $reload_param; $viewVars['script'] = $script; $header_html = $this->view->fetch($template, $viewVars); diff --git a/src/xhtml/HTMLNavbarController.php b/src/xhtml/HTMLNavbarController.php index beac11c0..fe0c28cf 100644 --- a/src/xhtml/HTMLNavbarController.php +++ b/src/xhtml/HTMLNavbarController.php @@ -46,8 +46,6 @@ class HTMLNavbarController extends HTMLController ]; $viewVars = $this->_getSearchPathsCrumbs($crumbs, $viewVars); - //\Kint::dump($viewVars); - $trail_html .= $this->getContainer()->view->fetch('components/trail.twig', $viewVars); if ($do_print) { @@ -59,6 +57,29 @@ class HTMLNavbarController extends HTMLController return $trail_html; } + /** + * Get the URL for the last active tab of a particular tab bar. + * + * @param string $section + * + * @return null|mixed + */ + public function getLastTabURL($section) + { + //$data = $this->getDatabaseAccessor(); + + $tabs = $this->misc->getNavTabs($section); + + if (isset($_SESSION['webdbLastTab'][$section], $tabs[$_SESSION['webdbLastTab'][$section]])) { + $tab = $tabs[$_SESSION['webdbLastTab'][$section]]; + } else { + $tab = \reset($tabs); + } + // $this->prtrace(['section' => $section, 'tabs' => $tabs, 'tab' => $tab]); + + return isset($tab['url']) ? $tab : null; + } + /** * Display navigation tabs. * @@ -73,6 +94,11 @@ class HTMLNavbarController extends HTMLController $from = $from ? $from : __METHOD__; $this->misc = $this->misc; + $_SESSION['webdbLastTab'] = $_SESSION['webdbLastTab'] ?? []; + + if (!\is_array($_SESSION['webdbLastTab'])) { + $_SESSION['webdbLastTab'] = [$alltabs => $activetab]; + } if (\is_string($alltabs)) { $_SESSION['webdbLastTab'][$alltabs] = $activetab; @@ -166,7 +192,7 @@ class HTMLNavbarController extends HTMLController foreach ($search_paths as $schema) { $url = \str_replace(['&', 'redirect/database'], ['&', 'redirect/schema'], $dburl . '&schema=' . $schema); - $destination = $this->container->utils->getDestinationWithLastTab('database'); + $destination = $this->container->getDestinationWithLastTab('database'); //$this->dump(['url' => $url, 'destination' => $destination]); $search_path_crumbs[$schema] = [ 'title' => $lang['strschema'], @@ -222,7 +248,7 @@ class HTMLNavbarController extends HTMLController 'sql' => [ 'attr' => [ 'href' => [ - 'url' => self::SUBFOLDER . '/src/views/sqledit', + 'url' => \containerInstance()->subFolder . '/src/views/sqledit', 'urlvars' => \array_merge($reqvars, [ 'action' => 'sql', ]), @@ -236,7 +262,7 @@ class HTMLNavbarController extends HTMLController 'history' => [ 'attr' => [ 'href' => [ - 'url' => self::SUBFOLDER . '/src/views/history', + 'url' => \containerInstance()->subFolder . '/src/views/history', 'urlvars' => \array_merge($reqvars, [ 'action' => 'pophistory', ]), @@ -249,7 +275,7 @@ class HTMLNavbarController extends HTMLController 'find' => [ 'attr' => [ 'href' => [ - 'url' => self::SUBFOLDER . '/src/views/sqledit', + 'url' => \containerInstance()->subFolder . '/src/views/sqledit', 'urlvars' => \array_merge($reqvars, [ 'action' => 'find', ]), @@ -263,7 +289,7 @@ class HTMLNavbarController extends HTMLController 'logout' => [ 'attr' => [ 'href' => [ - 'url' => self::SUBFOLDER . '/src/views/servers', + 'url' => \containerInstance()->subFolder . '/src/views/servers', 'urlvars' => [ 'action' => 'logout', 'logoutServer' => \sha1("{$server_info['host']}:{$server_info['port']}:{$server_info['sslmode']}"), @@ -325,7 +351,7 @@ class HTMLNavbarController extends HTMLController $trail['root'] = [ 'text' => $appName, - 'url' => self::SUBFOLDER . '/src/views/servers', + 'url' => \containerInstance()->subFolder . '/src/views/servers', 'icon' => 'Introduction', ]; diff --git a/src/xhtml/HTMLTableController.php b/src/xhtml/HTMLTableController.php index dbd6d2a0..41391ab8 100644 --- a/src/xhtml/HTMLTableController.php +++ b/src/xhtml/HTMLTableController.php @@ -210,7 +210,7 @@ class HTMLTableController extends HTMLController $lang = $this->lang; if ($this->has_ma) { - $matop_html .= '' . \PHP_EOL; + $matop_html .= '' . \PHP_EOL; $matop_html .= \sprintf('%s', $this->ma['url'], \PHP_EOL); $this->coalesceArr($this->ma, 'vars', []); @@ -293,7 +293,6 @@ class HTMLTableController extends HTMLController foreach ($this->ma['keycols'] as $k => $v) { $a[$k] = $tabledata->fields[$v]; } - //\Kint::dump($a); $tbody_html .= \sprintf('