Skip to content

Commit

Permalink
Creating Tag v6.0.0 at 2020-05-25 - its time to bump to a real release
Browse files Browse the repository at this point in the history
  • Loading branch information
ffflabs committed May 25, 2020
1 parent 3a069a8 commit 1f03c41
Show file tree
Hide file tree
Showing 234 changed files with 340 additions and 340 deletions.
2 changes: 1 addition & 1 deletion .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
declare(strict_types=1);

/**
* PHPPgAdmin 6.0.1
* PHPPgAdmin 6.0.0
*/

use Ergebnis\PhpCsFixer\Config;
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
declare(strict_types=1);

/**
* PHPPgAdmin 6.0.1
* PHPPgAdmin 6.0.0
*/

// This section is made to be able to parse requests coming from PHP Builtin webserver
Expand Down
2 changes: 1 addition & 1 deletion src/classes/ADORecordSet.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* PHPPgAdmin 6.0.1
* PHPPgAdmin 6.0.0
*/

namespace PHPPgAdmin;
Expand Down
2 changes: 1 addition & 1 deletion src/classes/ADOdbException.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* PHPPgAdmin 6.0.1
* PHPPgAdmin 6.0.0
*/

namespace PHPPgAdmin;
Expand Down
2 changes: 1 addition & 1 deletion src/classes/ArrayRecordSet.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* PHPPgAdmin 6.0.1
* PHPPgAdmin 6.0.0
*/

namespace PHPPgAdmin;
Expand Down
144 changes: 72 additions & 72 deletions src/classes/ContainerUtils.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* PHPPgAdmin 6.0.1
* PHPPgAdmin 6.0.0
*/

namespace PHPPgAdmin;
Expand Down Expand Up @@ -65,55 +65,55 @@ class ContainerUtils
public function __construct()
{
$composerinfo = \json_decode(\file_get_contents(BASE_PATH . '/composer.json'));
$appVersion = $composerinfo->extra->version;
$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,
'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,
'base_version' => 61,
// Application version
'appVersion' => 'v' . $appVersion,
'appVersion' => 'v' . $appVersion,
// Application name
'appName' => 'phpPgAdmin6',
'appName' => 'phpPgAdmin6',

// PostgreSQL and PHP minimum version
'postgresqlMinVer' => '9.3',
'phpMinVer' => $phpMinVer,
'displayErrorDetails' => self::DEBUGMODE,
'addContentLengthHeader' => false,
'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' => '',
'msg' => '',
'appThemes' => [
'default' => 'Default',
'default' => 'Default',
'cappuccino' => 'Cappuccino',
'gotar' => 'Blue/Green',
'bootstrap' => 'Bootstrap3',
'gotar' => 'Blue/Green',
'bootstrap' => 'Bootstrap3',
],
'settings' => $settings,
'settings' => $settings,
];

$this->_app = new App($config);

// Fetch DI Container
$container = $this->_app->getContainer();
$container['utils'] = $this;
$container['version'] = 'v' . $appVersion;
$container['errors'] = [];
$container['requestobj'] = $container['request'];
$container = $this->_app->getContainer();
$container['utils'] = $this;
$container['version'] = 'v' . $appVersion;
$container['errors'] = [];
$container['requestobj'] = $container['request'];
$container['responseobj'] = $container['response'];

$this->container = $container;
Expand Down Expand Up @@ -172,62 +172,21 @@ public static function createContainer($conf)
return [$_instance->container, self::$_instance->_app];
}

private function setConf($conf)
{
$container = self::getContainerInstance();
$conf['plugins'] = [];

$container['conf'] = static function ($c) use ($conf) {
$display_sizes = $conf['display_sizes'];

if (\is_array($display_sizes)) {
$conf['display_sizes'] = [
'schemas' => (bool) isset($display_sizes['schemas']) && true === $display_sizes['schemas'],
'tables' => (bool) isset($display_sizes['tables']) && true === $display_sizes['tables'],
];
} else {
$conf['display_sizes'] = [
'schemas' => (bool) $display_sizes,
'tables' => (bool) $display_sizes,
];
}

if (!isset($conf['theme'])) {
$conf['theme'] = 'default';
}

foreach ($conf['servers'] as &$server) {
if (!isset($server['port'])) {
$server['port'] = 5432;
}

if (!isset($server['sslmode'])) {
$server['sslmode'] = 'unspecified';
}
}

return $conf;
};
$container->subfolder = self::SUBFOLDER;

return $this;
}

public function maybeRenderIframes($response, $subject, $query_string)
{
$c = self::getContainerInstance();

$in_test = $c->view->offsetGet('in_test');

if ('1' === $in_test) {
$className = '\PHPPgAdmin\Controller\\' . \ucfirst($subject) . 'Controller';
$className = '\PHPPgAdmin\Controller\\' . \ucfirst($subject) . 'Controller';
$controller = new $className($c);

return $controller->render();
}

$viewVars = [
'url' => '/src/views/' . $subject . ($query_string ? '?' . $query_string : ''),
'url' => '/src/views/' . $subject . ($query_string ? '?' . $query_string : ''),
'headertemplate' => 'header.twig',
];

Expand Down Expand Up @@ -348,10 +307,10 @@ public function getDestinationWithLastTab($subject)
$urlvars[$key] = \PHPPgAdmin\Decorators\Decorator::get_sanitized_value($urlvar, $_REQUEST);
}
$_REQUEST = \array_merge($_REQUEST, $urlvars);
$_GET = \array_merge($_GET, $urlvars);
$_GET = \array_merge($_GET, $urlvars);
}

$actionurl = \PHPPgAdmin\Decorators\Decorator::actionurl($url['url'], $_GET);
$actionurl = \PHPPgAdmin\Decorators\Decorator::actionurl($url['url'], $_GET);
$destinationurl = $actionurl->value($_GET);
}
$destinationurl = \str_replace('views/?', "views/{$subject}?", $destinationurl);
Expand All @@ -369,13 +328,54 @@ public function getDestinationWithLastTab($subject)
public function addError(string $errormsg): ContainerInterface
{
//dump($errormsg);
$errors = $this->container->get('errors');
$errors = $this->container->get('errors');
$errors[] = $errormsg;
$this->container->offsetSet('errors', $errors);

return $this->container;
}

private function setConf($conf)
{
$container = self::getContainerInstance();
$conf['plugins'] = [];

$container['conf'] = static function ($c) use ($conf) {
$display_sizes = $conf['display_sizes'];

if (\is_array($display_sizes)) {
$conf['display_sizes'] = [
'schemas' => (bool) isset($display_sizes['schemas']) && true === $display_sizes['schemas'],
'tables' => (bool) isset($display_sizes['tables']) && true === $display_sizes['tables'],
];
} else {
$conf['display_sizes'] = [
'schemas' => (bool) $display_sizes,
'tables' => (bool) $display_sizes,
];
}

if (!isset($conf['theme'])) {
$conf['theme'] = 'default';
}

foreach ($conf['servers'] as &$server) {
if (!isset($server['port'])) {
$server['port'] = 5432;
}

if (!isset($server['sslmode'])) {
$server['sslmode'] = 'unspecified';
}
}

return $conf;
};
$container->subfolder = self::SUBFOLDER;

return $this;
}

/**
* Sets the views.
*
Expand All @@ -391,9 +391,9 @@ private function setViews()
$container['view'] = static function ($c) {
$misc = $c->misc;
$view = new ViewManager(BASE_PATH . '/assets/templates', [
'cache' => BASE_PATH . '/temp/twigcache',
'cache' => BASE_PATH . '/temp/twigcache',
'auto_reload' => $c->get('settings')['debug'],
'debug' => $c->get('settings')['debug'],
'debug' => $c->get('settings')['debug'],
], $c);

$misc->setView($view);
Expand All @@ -411,7 +411,7 @@ private function setViews()
*/
private function setMisc()
{
$container = self::getContainerInstance();
$container = self::getContainerInstance();
$container['misc'] = static function ($c) {
$misc = new \PHPPgAdmin\Misc($c);

Expand All @@ -433,7 +433,7 @@ private function setMisc()

private function setExtra()
{
$container = self::getContainerInstance();
$container = self::getContainerInstance();
$container['flash'] = static function () {
return new \Slim\Flash\Messages();
};
Expand Down
Loading

0 comments on commit 1f03c41

Please sign in to comment.