diff options
author | ffflabs <amenadiel@gmail.com> | 2020-03-05 21:39:39 +0300 |
---|---|---|
committer | ffflabs <amenadiel@gmail.com> | 2020-03-05 21:39:39 +0300 |
commit | 98393645c36629d551d01b6f7f32a14f5416655d (patch) | |
tree | 7bc0c49d805f7039e5d9c9ba6b7fcd0c247867fe | |
parent | cb2fe756114c2cc7738f2caafe86054728b43b7b (diff) |
removes usage of debug and trace remains int he code
-rw-r--r-- | src/classes/ContainerUtils.php | 4 | ||||
-rw-r--r-- | src/classes/Misc.php | 13 | ||||
-rw-r--r-- | src/controllers/ColpropertiesController.php | 109 | ||||
-rw-r--r-- | src/controllers/DisplayController.php | 3 | ||||
-rw-r--r-- | src/controllers/SchemasController.php | 70 | ||||
-rw-r--r-- | src/controllers/ServersController.php | 52 | ||||
-rw-r--r-- | src/database/Connection.php | 21 | ||||
-rw-r--r-- | src/database/Postgres.php | 2 | ||||
-rw-r--r-- | src/database/databasetraits/DatabaseTrait.php | 2 | ||||
-rw-r--r-- | src/decorators/ActionUrlDecorator.php | 1 | ||||
-rw-r--r-- | src/decorators/RedirectUrlDecorator.php | 2 | ||||
-rw-r--r-- | src/decorators/UrlDecorator.php | 2 | ||||
-rw-r--r-- | src/xhtml/HTMLController.php | 3 | ||||
-rw-r--r-- | src/xhtml/HTMLFooterController.php | 5 | ||||
-rw-r--r-- | src/xhtml/HTMLHeaderController.php | 11 | ||||
-rw-r--r-- | src/xhtml/HTMLNavbarController.php | 7 | ||||
-rw-r--r-- | src/xhtml/HTMLTableController.php | 2 | ||||
-rw-r--r-- | src/xhtml/XHtmlSimpleElement.php | 1 |
18 files changed, 127 insertions, 183 deletions
diff --git a/src/classes/ContainerUtils.php b/src/classes/ContainerUtils.php index 92a91752..c3d66f77 100644 --- a/src/classes/ContainerUtils.php +++ b/src/classes/ContainerUtils.php @@ -71,7 +71,6 @@ class ContainerUtils $appVersion = $composerinfo->extra->version; $phpMinVer = (\str_replace(['<', '>', '='], '', $composerinfo->require->php)); - //$this->prtrace($appVersion); //$this->dump($composerinfo); $settings = [ 'determineRouteBeforeAppMiddleware' => true, @@ -288,6 +287,7 @@ class ContainerUtils return $destinationurl; } + /** * Adds a flash message to the session that will be displayed on the next request. * @@ -317,7 +317,6 @@ class ContainerUtils { $_server_info = $this->container->misc->getServerInfo(); $this->addFlash($subject, 'getDestinationWithLastTab'); - //$this->prtrace('$_server_info', $_server_info); // If username isn't set in server_info, you should login if (!isset($_server_info['username'])) { $destinationurl = $this->getRedirectUrl(); @@ -329,7 +328,6 @@ class ContainerUtils $urlvars = []; foreach ($url['urlvars'] as $key => $urlvar) { - //$this->prtrace($key, $urlvar); $urlvars[$key] = \PHPPgAdmin\Decorators\Decorator::get_sanitized_value($urlvar, $_REQUEST); } $_REQUEST = \array_merge($_REQUEST, $urlvars); diff --git a/src/classes/Misc.php b/src/classes/Misc.php index c65795bb..44adc019 100644 --- a/src/classes/Misc.php +++ b/src/classes/Misc.php @@ -97,8 +97,6 @@ class Misc $base_version = $container->get('settings')['base_version']; - //$this->prtrace($base_version); - // Check for config file version mismatch if (!isset($this->conf['version']) || $base_version > $this->conf['version']) { $container->get('utils')->addError($this->lang['strbadconfig']); @@ -148,7 +146,6 @@ class Misc } elseif (null !== $request_server) { $this->_server_id = $request_server; } elseif (isset($_SESSION['webdbLogin']) && 0 < \count($_SESSION['webdbLogin'])) { - //$this->prtrace('webdbLogin', $_SESSION['webdbLogin']); $this->_server_id = \array_keys($_SESSION['webdbLogin'])[0]; } @@ -327,7 +324,6 @@ class Misc if (null !== $server_id) { $this->_server_id = $server_id; } - //$this->prtrace($this->_server_id); $server_info = $this->getServerInfo($this->_server_id); @@ -345,8 +341,6 @@ class Misc return null; } - - //$this->prtrace('_connection', $_connection); if (!$_connection) { $this->container->utils->addError($lang['strloginfailed']); $this->setErrorMsg($lang['strloginfailed']); @@ -357,8 +351,6 @@ class Misc // The description of the server is returned in $platform. $_type = $_connection->getDriver($platform); - //$this->prtrace(['type' => $_type, 'platform' => $platform, 'pgVersion' => $_connection->conn->pgVersion]); - if (null === $_type) { $errormsg = \sprintf($lang['strpostgresqlversionnotsupported'], $this->postgresqlMinVer); $this->container->utils->addError($errormsg); @@ -368,8 +360,6 @@ class Misc } $_type = '\PHPPgAdmin\Database\\' . $_type; - //$this->prtrace('driver:', $_type); - $this->setServerInfo('platform', $platform, $this->_server_id); $this->setServerInfo('pgVersion', $_connection->conn->pgVersion, $this->_server_id); @@ -381,8 +371,6 @@ class Misc //$this->_data->getHelpPages(); - //$this->prtrace('help_page has ' . count($this->_data->help_page) . ' items'); - /* we work on UTF-8 only encoding */ $this->_data->execute("SET client_encoding TO 'UTF-8'"); @@ -766,7 +754,6 @@ class Misc } } } - //$this->prtrace($v); return $v; } diff --git a/src/controllers/ColpropertiesController.php b/src/controllers/ColpropertiesController.php index 2525dd25..1a481fdf 100644 --- a/src/controllers/ColpropertiesController.php +++ b/src/controllers/ColpropertiesController.php @@ -97,14 +97,13 @@ class ColpropertiesController extends BaseController if (null !== $attrs->fields['comment']) { echo '<p class="comment">', $this->misc->printVal($attrs->fields['comment']), '</p>' . \PHP_EOL; } - //$this->prtrace('$isTable', $isTable); $column = [ 'column' => [ 'title' => $this->lang['strcolumn'], 'field' => Decorator::field('attname'), ], - 'type' => [ + 'type' => [ 'title' => $this->lang['strtype'], 'field' => Decorator::field('+type'), ], @@ -112,9 +111,9 @@ class ColpropertiesController extends BaseController if ($isTable) { $column['notnull'] = [ - 'title' => $this->lang['strnotnull'], - 'field' => Decorator::field('attnotnull'), - 'type' => 'bool', + 'title' => $this->lang['strnotnull'], + 'field' => Decorator::field('attnotnull'), + 'type' => 'bool', 'params' => ['true' => 'NOT NULL', 'false' => ''], ]; $column['default'] = [ @@ -129,8 +128,8 @@ class ColpropertiesController extends BaseController echo '<br />' . \PHP_EOL; $f_attname = $_REQUEST['column']; - $f_table = $this->tableName; - $f_schema = $data->_schema; + $f_table = $this->tableName; + $f_schema = $data->_schema; $data->fieldClean($f_attname); $data->fieldClean($f_table); $data->fieldClean($f_schema); @@ -138,53 +137,53 @@ class ColpropertiesController extends BaseController if ($isTable) { $navlinks = [ 'browse' => [ - 'attr' => [ + 'attr' => [ 'href' => [ - 'url' => 'display', - 'method' => 'post', + 'url' => 'display', + 'method' => 'post', 'urlvars' => [ - 'subject' => 'column', - 'server' => $_REQUEST['server'], - 'database' => $_REQUEST['database'], - 'schema' => $_REQUEST['schema'], - 'table' => $this->tableName, - 'column' => $_REQUEST['column'], - 'return' => 'column', + 'subject' => 'column', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'table' => $this->tableName, + 'column' => $_REQUEST['column'], + 'return' => 'column', 'f_attname' => $f_attname, - 'f_table' => $f_table, - 'f_schema' => $f_schema, + 'f_table' => $f_table, + 'f_schema' => $f_schema, ], ], ], 'content' => $this->lang['strbrowse'], ], - 'alter' => [ - 'attr' => [ + 'alter' => [ + 'attr' => [ 'href' => [ - 'url' => 'colproperties', + 'url' => 'colproperties', 'urlvars' => [ - 'action' => 'properties', - 'server' => $_REQUEST['server'], + 'action' => 'properties', + 'server' => $_REQUEST['server'], 'database' => $_REQUEST['database'], - 'schema' => $_REQUEST['schema'], - 'table' => $this->tableName, - 'column' => $_REQUEST['column'], + 'schema' => $_REQUEST['schema'], + 'table' => $this->tableName, + 'column' => $_REQUEST['column'], ], ], ], 'content' => $this->lang['stralter'], ], - 'drop' => [ - 'attr' => [ + 'drop' => [ + 'attr' => [ 'href' => [ - 'url' => 'tblproperties', + 'url' => 'tblproperties', 'urlvars' => [ - 'action' => 'confirm_drop', - 'server' => $_REQUEST['server'], + 'action' => 'confirm_drop', + 'server' => $_REQUEST['server'], 'database' => $_REQUEST['database'], - 'schema' => $_REQUEST['schema'], - 'table' => $this->tableName, - 'column' => $_REQUEST['column'], + 'schema' => $_REQUEST['schema'], + 'table' => $this->tableName, + 'column' => $_REQUEST['column'], ], ], ], @@ -195,21 +194,21 @@ class ColpropertiesController extends BaseController // Browse link $navlinks = [ 'browse' => [ - 'attr' => [ + 'attr' => [ 'href' => [ - 'url' => 'display', - 'method' => 'post', + 'url' => 'display', + 'method' => 'post', 'urlvars' => [ - 'subject' => 'column', - 'server' => $_REQUEST['server'], - 'database' => $_REQUEST['database'], - 'schema' => $_REQUEST['schema'], - 'view' => $this->tableName, - 'column' => $_REQUEST['column'], - 'return' => 'column', + 'subject' => 'column', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'view' => $this->tableName, + 'column' => $_REQUEST['column'], + 'return' => 'column', 'f_attname' => $f_attname, - 'f_table' => $f_table, - 'f_schema' => $f_schema, + 'f_table' => $f_table, + 'f_schema' => $f_schema, ], ], ], @@ -233,8 +232,6 @@ class ColpropertiesController extends BaseController $this->coalesceArr($_REQUEST, 'stage', 1); - //$this->prtrace('$_REQUEST', $_REQUEST, 'msg', $msg); - switch ($_REQUEST['stage']) { case 1: $this->printTrail('column'); @@ -256,21 +253,21 @@ class ColpropertiesController extends BaseController } echo "<th class=\"data\">{$this->lang['strnotnull']}</th>\n<th class=\"data\">{$this->lang['strdefault']}</th>\n<th class=\"data\">{$this->lang['strcomment']}</th></tr>" . \PHP_EOL; - $column = $data->getTableAttributes($_REQUEST['table'], $_REQUEST['column']); + $column = $data->getTableAttributes($_REQUEST['table'], $_REQUEST['column']); $column->fields['attnotnull'] = $data->phpBool($column->fields['attnotnull']); // Upon first drawing the screen, load the existing column information // from the database. if (!isset($_REQUEST['default'])) { $_REQUEST['field'] = $column->fields['attname']; - $_REQUEST['type'] = $column->fields['base_type']; + $_REQUEST['type'] = $column->fields['base_type']; // Check to see if its' an array type... // @todo this is pretty hacky! if ('[]' === \mb_substr($column->fields['base_type'], \mb_strlen($column->fields['base_type']) - 2)) { - $_REQUEST['type'] = \mb_substr($column->fields['base_type'], 0, \mb_strlen($column->fields['base_type']) - 2); + $_REQUEST['type'] = \mb_substr($column->fields['base_type'], 0, \mb_strlen($column->fields['base_type']) - 2); $_REQUEST['array'] = '[]'; } else { - $_REQUEST['type'] = $column->fields['base_type']; + $_REQUEST['type'] = $column->fields['base_type']; $_REQUEST['array'] = ''; } // To figure out the length, look in the brackets :( @@ -298,13 +295,13 @@ class ColpropertiesController extends BaseController $escaped_predef_types = []; // the JS escaped array elements if ($data->hasAlterColumnType()) { // Fetch all available types - $types = $data->getTypes(true, false, true); + $types = $data->getTypes(true, false, true); $types_for_js = []; echo "<td><select name=\"type\" id=\"type\" class=\"select2\" onchange=\"checkLengths(document.getElementById('type').value,'');\">" . \PHP_EOL; while (!$types->EOF) { - $typname = $types->fields['typname']; + $typname = $types->fields['typname']; $types_for_js[] = $typname; echo "\t<option value=\"", \htmlspecialchars($typname), '"', ($typname === $_REQUEST['type']) ? ' selected="selected"' : '', '>', $this->misc->printVal($typname), '</option>' . \PHP_EOL; @@ -385,8 +382,6 @@ class ColpropertiesController extends BaseController $_REQUEST['oldtype'], $_REQUEST['comment'] ); - - //$this->prtrace('status', $status, 'sql', $sql); if (0 === $status) { if ($_REQUEST['column'] !== $_REQUEST['field']) { $_REQUEST['column'] = $_REQUEST['field']; diff --git a/src/controllers/DisplayController.php b/src/controllers/DisplayController.php index b444529a..104c8c42 100644 --- a/src/controllers/DisplayController.php +++ b/src/controllers/DisplayController.php @@ -168,8 +168,6 @@ class DisplayController extends BaseController $this->printTitle($this->lang[$title]); - //$this->prtrace($subject, $object, $query, $_SESSION['sqlquery']); - $this->printMsg($msg); // If 'sortkey' is not set, default to '' @@ -238,7 +236,6 @@ class DisplayController extends BaseController $query = $query ? $query : \sprintf('SELECT * FROM %s.%s', $_REQUEST['schema'], $object); //$query = isset($_REQUEST['query'])? $_REQUEST['query'] : "select * from {$_REQUEST['schema']}.{$_REQUEST['table']};"; - //$this->prtrace($query); //die(htmlspecialchars($query)); diff --git a/src/controllers/SchemasController.php b/src/controllers/SchemasController.php index 0ec07594..593d8097 100644 --- a/src/controllers/SchemasController.php +++ b/src/controllers/SchemasController.php @@ -99,17 +99,17 @@ class SchemasController extends BaseController $this->printMsg($msg); // Check that the DB actually supports schemas - $schemas = $data->getSchemas(); + $schemas = $data->getSchemas(); $destination = $this->container->utils->getDestinationWithLastTab('schema'); $columns = [ - 'schema' => [ + 'schema' => [ 'title' => $this->lang['strschema'], 'field' => Decorator::field('nspname'), - 'url' => self::SUBFOLDER . "{$destination}&", - 'vars' => ['schema' => 'nspname'], + 'url' => self::SUBFOLDER . "{$destination}&", + 'vars' => ['schema' => 'nspname'], ], - 'owner' => [ + 'owner' => [ 'title' => $this->lang['strowner'], 'field' => Decorator::field('nspowner'), ], @@ -117,10 +117,10 @@ class SchemasController extends BaseController 'title' => $this->lang['strsize'], 'field' => Decorator::field('schema_size'), ], - 'actions' => [ + 'actions' => [ 'title' => $this->lang['stractions'], ], - 'comment' => [ + 'comment' => [ 'title' => $this->lang['strcomment'], 'field' => Decorator::field('nspcomment'), ], @@ -129,38 +129,38 @@ class SchemasController extends BaseController $actions = [ 'multiactions' => [ 'keycols' => ['nsp' => 'nspname'], - 'url' => 'schemas', + 'url' => 'schemas', ], - 'drop' => [ - 'content' => $this->lang['strdrop'], - 'attr' => [ + 'drop' => [ + 'content' => $this->lang['strdrop'], + 'attr' => [ 'href' => [ - 'url' => 'schemas', + 'url' => 'schemas', 'urlvars' => [ 'action' => 'drop', - 'nsp' => Decorator::field('nspname'), + 'nsp' => Decorator::field('nspname'), ], ], ], 'multiaction' => 'drop', ], - 'privileges' => [ + 'privileges' => [ 'content' => $this->lang['strprivileges'], - 'attr' => [ + 'attr' => [ 'href' => [ - 'url' => 'privileges', + 'url' => 'privileges', 'urlvars' => [ 'subject' => 'schema', - 'schema' => Decorator::field('nspname'), + 'schema' => Decorator::field('nspname'), ], ], ], ], - 'alter' => [ + 'alter' => [ 'content' => $this->lang['stralter'], - 'attr' => [ + 'attr' => [ 'href' => [ - 'url' => 'schemas', + 'url' => 'schemas', 'urlvars' => [ 'action' => 'alter', 'schema' => Decorator::field('nspname'), @@ -177,12 +177,12 @@ class SchemasController extends BaseController echo $this->printTable($schemas, $columns, $actions, 'schemas-schemas', $this->lang['strnoschemas']); $this->printNavLinks(['create' => [ - 'attr' => [ + 'attr' => [ 'href' => [ - 'url' => 'schemas', + 'url' => 'schemas', 'urlvars' => [ - 'action' => 'create', - 'server' => $_REQUEST['server'], + 'action' => 'create', + 'server' => $_REQUEST['server'], 'database' => $_REQUEST['database'], ], ], @@ -202,21 +202,19 @@ class SchemasController extends BaseController $reqvars = $this->misc->getRequestVars('schema'); - //$this->prtrace($reqvars); - $attrs = [ - 'text' => Decorator::field('nspname'), - 'icon' => 'Schema', + 'text' => Decorator::field('nspname'), + 'icon' => 'Schema', 'toolTip' => Decorator::field('nspcomment'), - 'action' => Decorator::redirecturl( + 'action' => Decorator::redirecturl( 'redirect', $reqvars, [ 'subject' => 'schema', - 'schema' => Decorator::field('nspname'), + 'schema' => Decorator::field('nspname'), ] ), - 'branch' => Decorator::url( + 'branch' => Decorator::url( 'schemas', $reqvars, [ @@ -237,11 +235,9 @@ class SchemasController extends BaseController $reqvars = $this->misc->getRequestVars('schema'); - //$this->prtrace($reqvars); - $attrs = [ - 'text' => Decorator::field('title'), - 'icon' => Decorator::field('icon'), + 'text' => Decorator::field('title'), + 'icon' => Decorator::field('icon'), 'action' => Decorator::actionurl( Decorator::field('url'), $reqvars, @@ -463,7 +459,7 @@ class SchemasController extends BaseController echo '</form>' . \PHP_EOL; } else { if (\is_array($_POST['nsp'])) { - $msg = ''; + $msg = ''; $status = $data->beginTransaction(); if (0 === $status) { @@ -513,7 +509,7 @@ class SchemasController extends BaseController $this->printMsg($msg); $subject = 'schema'; - $object = $_REQUEST['schema']; + $object = $_REQUEST['schema']; echo $this->formHeader('dbexport'); diff --git a/src/controllers/ServersController.php b/src/controllers/ServersController.php index ec60383a..c44845d8 100644 --- a/src/controllers/ServersController.php +++ b/src/controllers/ServersController.php @@ -80,13 +80,13 @@ class ServersController extends BaseController $this->printMsg($msg); $group = $_GET['group'] ?? false; - $groups = $this->getServersGroups(true, $group); + $groups = $this->getServersGroups(true, $group); $columns = [ 'group' => [ 'title' => $this->lang['strgroup'], 'field' => Decorator::field('desc'), - 'url' => 'servers?', - 'vars' => ['group' => 'id'], + 'url' => 'servers?', + 'vars' => ['group' => 'id'], ], ]; $actions = []; @@ -102,17 +102,17 @@ class ServersController extends BaseController $servers = $this->getServers(true, $group); $columns = [ - 'server' => [ + 'server' => [ 'title' => $this->lang['strserver'], 'field' => Decorator::field('desc'), - 'url' => self::SUBFOLDER . '/redirect/server?', - 'vars' => ['server' => 'sha'], + 'url' => self::SUBFOLDER . '/redirect/server?', + 'vars' => ['server' => 'sha'], ], - 'host' => [ + 'host' => [ 'title' => $this->lang['strhost'], 'field' => Decorator::field('host'), ], - 'port' => [ + 'port' => [ 'title' => $this->lang['strport'], 'field' => Decorator::field('port'), ], @@ -120,7 +120,7 @@ class ServersController extends BaseController 'title' => $this->lang['strusername'], 'field' => Decorator::field('username'), ], - 'actions' => [ + 'actions' => [ 'title' => $this->lang['stractions'], ], ]; @@ -128,11 +128,11 @@ class ServersController extends BaseController $actions = [ 'logout' => [ 'content' => $this->lang['strlogout'], - 'attr' => [ + 'attr' => [ 'href' => [ - 'url' => 'servers', + 'url' => 'servers', 'urlvars' => [ - 'action' => 'logout', + 'action' => 'logout', 'logoutServer' => Decorator::field('id'), ], ], @@ -157,7 +157,7 @@ class ServersController extends BaseController public function doTree() { - $nodes = []; + $nodes = []; $group_id = $_GET['group'] ?? false; // root with srv_groups @@ -179,17 +179,15 @@ class ServersController extends BaseController //$reqvars = $this->misc->getRequestVars('server'); - //$this->prtrace($nodes); - $attrs = [ - 'text' => Decorator::field('desc'), + 'text' => Decorator::field('desc'), // Show different icons for logged in/out - 'icon' => Decorator::field('icon'), + 'icon' => Decorator::field('icon'), 'toolTip' => Decorator::field('id'), - 'action' => Decorator::field('action'), + 'action' => Decorator::field('action'), // Only create a branch url if the user has // logged into the server. - 'branch' => Decorator::field('branch'), + 'branch' => Decorator::field('branch'), ]; return $this->printTree($nodes, $attrs, $this->section); @@ -234,9 +232,9 @@ class ServersController extends BaseController ) ) { $grps[$i] = [ - 'id' => $i, - 'desc' => $group['desc'], - 'icon' => 'Servers', + 'id' => $i, + 'desc' => $group['desc'], + 'icon' => 'Servers', 'action' => Decorator::url( 'servers', [ @@ -247,7 +245,7 @@ class ServersController extends BaseController 'servers', [ 'action' => 'tree', - 'group' => $i, + 'group' => $i, ] ), ]; @@ -256,9 +254,9 @@ class ServersController extends BaseController if (false === $group_id) { $grps['all'] = [ - 'id' => 'all', - 'desc' => $this->lang['strallservers'], - 'icon' => 'Servers', + 'id' => 'all', + 'desc' => $this->lang['strallservers'], + 'icon' => 'Servers', 'action' => Decorator::url( 'servers', [ @@ -269,7 +267,7 @@ class ServersController extends BaseController 'servers', [ 'action' => 'tree', - 'group' => 'all', + 'group' => 'all', ] ), ]; diff --git a/src/database/Connection.php b/src/database/Connection.php index ace8383a..0030fbac 100644 --- a/src/database/Connection.php +++ b/src/database/Connection.php @@ -25,10 +25,10 @@ class Connection protected $server_info; protected $version_dictionary = [ - '13' => 'Postgres13', - '12' => 'Postgres12', - '11' => 'Postgres11', - '10' => 'Postgres10', + '13' => 'Postgres13', + '12' => 'Postgres12', + '11' => 'Postgres11', + '10' => 'Postgres10', '9.7' => 'Postgres96', '9.6' => 'Postgres96', '9.5' => 'Postgres95', @@ -59,10 +59,10 @@ class Connection */ 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']; + $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; @@ -99,7 +99,6 @@ class Connection */ try { $this->conn->connect($pghost, $user, $password, $database); - //$this->prtrace($this->conn); } catch (\Exception $e) { $this->prtrace($e->getMessage(), $e->getTrace()); } @@ -132,7 +131,7 @@ class Connection if (!isset($version)) { $adodb = new ADOdbBase($this->conn, $this->container, $this->server_info); - $sql = 'SELECT VERSION() AS version'; + $sql = 'SELECT VERSION() AS version'; $field = $adodb->selectField($sql, 'version'); // Check the platform, if it's mingw, set it @@ -158,8 +157,6 @@ class Connection } 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]; diff --git a/src/database/Postgres.php b/src/database/Postgres.php index 86bb5a98..a369e775 100644 --- a/src/database/Postgres.php +++ b/src/database/Postgres.php @@ -42,7 +42,6 @@ class Postgres extends ADOdbBase public function __construct(&$conn, $container, $server_info) { - //$this->prtrace('major_version :' . $this->major_version); $this->conn = $conn; $this->container = $container; @@ -488,7 +487,6 @@ class Postgres extends ADOdbBase /* in quote? */ if (0 !== $in_quote) { - //$this->prtrace('in_quote', $in_quote, $line); /* * end of quote if matching non-backslashed character. * backslashes don't count for double quotes, though. diff --git a/src/database/databasetraits/DatabaseTrait.php b/src/database/databasetraits/DatabaseTrait.php index de66fb44..a6bf7a4a 100644 --- a/src/database/databasetraits/DatabaseTrait.php +++ b/src/database/databasetraits/DatabaseTrait.php @@ -102,8 +102,6 @@ trait DatabaseTrait $conf = $this->conf; $server_info = $this->server_info; - //$this->prtrace('server_info', $server_info); - if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser()) { $username = $server_info['username']; $this->clean($username); diff --git a/src/decorators/ActionUrlDecorator.php b/src/decorators/ActionUrlDecorator.php index bd34c2f8..a14c8291 100644 --- a/src/decorators/ActionUrlDecorator.php +++ b/src/decorators/ActionUrlDecorator.php @@ -19,7 +19,6 @@ class ActionUrlDecorator extends Decorator public function value($fields) { - //$this->prtrace($fields); $url = Decorator::get_sanitized_value($this->base, $fields); if (false === $url) { diff --git a/src/decorators/RedirectUrlDecorator.php b/src/decorators/RedirectUrlDecorator.php index b025f8c7..1f04d498 100644 --- a/src/decorators/RedirectUrlDecorator.php +++ b/src/decorators/RedirectUrlDecorator.php @@ -25,8 +25,6 @@ class RedirectUrlDecorator extends Decorator return ''; } - //$this->prtrace('url', $url); - if (!empty($this->queryVars)) { $queryVars = Decorator::get_sanitized_value($this->queryVars, $fields); diff --git a/src/decorators/UrlDecorator.php b/src/decorators/UrlDecorator.php index 131ca0b5..4779dc3e 100644 --- a/src/decorators/UrlDecorator.php +++ b/src/decorators/UrlDecorator.php @@ -36,11 +36,9 @@ class UrlDecorator extends Decorator $sep = '&'; } } - //$this->prtrace('url before', $url); if (self::SUBFOLDER !== '' && (0 === \mb_strpos($url, '/')) && (false === \mb_strpos($url, self::SUBFOLDER))) { $url = \str_replace('//', '/', self::SUBFOLDER . '/' . $url); } - //$this->prtrace('url after', $url); return $url; } } diff --git a/src/xhtml/HTMLController.php b/src/xhtml/HTMLController.php index 1af9c32a..f5d58ad9 100644 --- a/src/xhtml/HTMLController.php +++ b/src/xhtml/HTMLController.php @@ -225,8 +225,6 @@ class HTMLController $schema = $this->container->has('schema') ? $this->container->schema : $_REQUEST['schema']; */ - //$this->prtrace('server', $server, 'database', $database, 'schema', $schema); - if ($server && !isset($urlvars['server']) && 'root' !== $subject) { $urlvars['server'] = $server; @@ -270,7 +268,6 @@ class HTMLController foreach ($links as $link) { if ('PHPPgAdmin\Controller\BaseController::printNavLinks' === $from) { - //$this->prtrace($link); } $list_html .= "\t<li>"; diff --git a/src/xhtml/HTMLFooterController.php b/src/xhtml/HTMLFooterController.php index 62a588e3..6faaa781 100644 --- a/src/xhtml/HTMLFooterController.php +++ b/src/xhtml/HTMLFooterController.php @@ -121,13 +121,12 @@ class HTMLFooterController extends HTMLController if (null === $from || false === $from) { $from = __METHOD__; } - //$this->prtrace($navlinks); // Navlinks hook's place $plugin_functions_parameters = [ 'navlinks' => &$navlinks, - 'place' => $place, - 'env' => $env, + 'place' => $place, + 'env' => $env, ]; if (0 < \count($navlinks)) { diff --git a/src/xhtml/HTMLHeaderController.php b/src/xhtml/HTMLHeaderController.php index 98573de3..6e49cb6b 100644 --- a/src/xhtml/HTMLHeaderController.php +++ b/src/xhtml/HTMLHeaderController.php @@ -50,14 +50,13 @@ class HTMLHeaderController extends HTMLController $viewVars = []; - $viewVars['dir'] = (0 !== \strcasecmp($lang['applangdir'], 'ltr')) ? ' dir="' . \htmlspecialchars($lang['applangdir']) . '"' : ''; + $viewVars['dir'] = (0 !== \strcasecmp($lang['applangdir'], 'ltr')) ? ' dir="' . \htmlspecialchars($lang['applangdir']) . '"' : ''; $viewVars['headertemplate'] = $template; - $viewVars['title'] = ('' !== $title) ? ' - ' . $title : ''; - $viewVars['appName'] = \htmlspecialchars($this->appName); + $viewVars['title'] = ('' !== $title) ? ' - ' . $title : ''; + $viewVars['appName'] = \htmlspecialchars($this->appName); $viewVars['script'] = $script; - //$this->prtrace($viewVars); - $header_html = $this->view->fetch($template, $viewVars); + $header_html = $this->view->fetch($template, $viewVars); /*$plugins_head = []; $_params = ['heads' => &$plugins_head]; @@ -84,7 +83,7 @@ class HTMLHeaderController extends HTMLController public function printBody($doBody = true, $bodyClass = 'detailbody', $onloadInit = false) { $bodyClass = $this->lang['applangdir'] . ' ' . \htmlspecialchars($bodyClass); - $onload = ($onloadInit ? 'onload="init();" ' : ''); + $onload = ($onloadInit ? 'onload="init();" ' : ''); $bodyHtml = \sprintf('<body data-controller="%s" class="%s" %s >', $this->controller_name, $bodyClass, $onload); $bodyHtml .= \PHP_EOL; diff --git a/src/xhtml/HTMLNavbarController.php b/src/xhtml/HTMLNavbarController.php index 2e9e4846..590b8a71 100644 --- a/src/xhtml/HTMLNavbarController.php +++ b/src/xhtml/HTMLNavbarController.php @@ -77,8 +77,6 @@ class HTMLNavbarController extends HTMLController $_SESSION['webdbLastTab'][$alltabs] = $activetab; $alltabs = $this->misc->getNavTabs($alltabs); } - - //$this->prtrace($tabs); $tabs_html = ''; //Getting only visible tabs @@ -90,7 +88,6 @@ class HTMLNavbarController extends HTMLController $tabs[$tab_id] = $tab; $tabs[$tab_id]['active'] = ($tab_id === $activetab) ? ' active' : ''; $tabs[$tab_id]['tablink'] = \str_replace(['&', '.php'], ['&', ''], \htmlentities($this->getActionUrl($tab, $_REQUEST, $from))); - //$this->prtrace('link for ' . $tab_id, $tabs[$tab_id]['tablink']); if (isset($tab['icon']) && $icon = $this->misc->icon($tab['icon'])) { $tabs[$tab_id]['iconurl'] = $icon; } @@ -102,8 +99,6 @@ class HTMLNavbarController extends HTMLController } } - //$this->prtrace($tabs); - if (0 < \count($tabs)) { $width = (int) (100 / \count($tabs)) . '%'; @@ -420,8 +415,6 @@ class HTMLNavbarController extends HTMLController $trail = $this->_getLastTrailPart($subject, $trail); } - //$this->prtrace($trail); - return $trail; } diff --git a/src/xhtml/HTMLTableController.php b/src/xhtml/HTMLTableController.php index 35a091bb..8e9aada5 100644 --- a/src/xhtml/HTMLTableController.php +++ b/src/xhtml/HTMLTableController.php @@ -121,8 +121,6 @@ class HTMLTableController extends HTMLController $tablehtml .= $this->getThead(); - //$this->prtrace($tabledata, $actions); - $tablehtml .= $with_body ? $this->getTbody() : ''; $tablehtml .= $this->getTfooter(); diff --git a/src/xhtml/XHtmlSimpleElement.php b/src/xhtml/XHtmlSimpleElement.php index d8803fc7..a96b56d7 100644 --- a/src/xhtml/XHtmlSimpleElement.php +++ b/src/xhtml/XHtmlSimpleElement.php @@ -68,7 +68,6 @@ class XHtmlSimpleElement $lower_classname = \mb_strtolower(\get_class($this)); return \str_replace('phppgadmin\xhtml\xhtml', '', $lower_classname); - //$this->prtrace('is_element_string', $is_element_string, 'lower_classname', $lower_classname, '__CLASS__'); } /** |