diff options
author | Amenadiel <amenadiel@gmail.com> | 2020-01-07 21:59:58 +0300 |
---|---|---|
committer | Amenadiel <amenadiel@gmail.com> | 2020-01-07 21:59:58 +0300 |
commit | 331c63826e1e85fd3b8ecb076ad113e859d47493 (patch) | |
tree | 207e7cbe19c586fcdf46dd1e202d2de22be8e388 /src | |
parent | 1575f35d6aa2fe1f45117a66be794ba9cefc5b37 (diff) |
rebase develop on top of master
Diffstat (limited to 'src')
132 files changed, 675 insertions, 827 deletions
diff --git a/src/classes/ADONewConnection.php b/src/classes/ADONewConnection.php index 19f89da4..d8308376 100644 --- a/src/classes/ADONewConnection.php +++ b/src/classes/ADONewConnection.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin; @@ -9,14 +9,10 @@ namespace PHPPgAdmin; /** * @file * Extends ADONewConnection to let correct inference on PHPDoc params - * - * @package PHPPgAdmin */ /** * Extends ADONewConnection to let correct inference on PHPDoc params. - * - * @package PHPPgAdmin */ class ADONewConnection extends \ADONewConnection { diff --git a/src/classes/ADORecordSet.php b/src/classes/ADORecordSet.php index 1fce8893..fd739503 100644 --- a/src/classes/ADORecordSet.php +++ b/src/classes/ADORecordSet.php @@ -1,22 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin; /** - * @file - * Extends ADORecordSet to let correct inference on PHPDoc params - * - * @package PHPPgAdmin - */ - -/** * Extends ADORecordSet to let correct inference on PHPDoc params. - * - * @package PHPPgAdmin */ class ADORecordSet extends \ADORecordSet { diff --git a/src/classes/ADOdbException.php b/src/classes/ADOdbException.php index 3817f0b8..3ecc6e63 100644 --- a/src/classes/ADOdbException.php +++ b/src/classes/ADOdbException.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin; @@ -19,7 +19,6 @@ namespace PHPPgAdmin; * Latest version is available at http://php.weblogs.com * Exception-handling code using PHP5 exceptions (try-catch-throw). * - * @package PHPPgAdmin * * @author John Lim * @copyright 2000-2013 John Lim <jlim@natsoft.com> @@ -158,6 +157,6 @@ class ADOdbException extends \Exception //\PC::debug(['errno' => $errno, 'fn' => $fn, 'errmsg' => $errmsg], $tag); - throw new \PHPPgAdmin\ADOdbException($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection); + throw new self($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection); } } diff --git a/src/classes/ArrayRecordSet.php b/src/classes/ArrayRecordSet.php index 0e18e3d6..b7d61932 100644 --- a/src/classes/ArrayRecordSet.php +++ b/src/classes/ArrayRecordSet.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin; @@ -11,8 +11,6 @@ namespace PHPPgAdmin; * Really simple RecordSet to allow printTable of arrays. * * Id: ArrayRecordSet.php,v 1.3 2007/01/10 01:46:28 soranzo Exp $ - * - * @package PHPPgAdmin */ /** @@ -20,8 +18,6 @@ namespace PHPPgAdmin; * Mimics the behavior of an ADORecordset. * * Id: ArrayRecordSet.php,v 1.3 2007/01/10 01:46:28 soranzo Exp $ - * - * @package PHPPgAdmin */ class ArrayRecordSet { diff --git a/src/classes/ContainerUtils.php b/src/classes/ContainerUtils.php index 1e13fb20..b416e6af 100644 --- a/src/classes/ContainerUtils.php +++ b/src/classes/ContainerUtils.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin; @@ -13,8 +13,6 @@ namespace PHPPgAdmin; /** * A class that adds convenience methods to the container. - * - * @package PHPPgAdmin */ class ContainerUtils { @@ -31,7 +29,7 @@ class ContainerUtils */ public function __construct() { - $composerinfo = json_decode(file_get_contents(BASE_PATH.'/composer.json')); + $composerinfo = json_decode(file_get_contents(BASE_PATH . '/composer.json')); $appVersion = $composerinfo->version; $phpMinVer = (str_replace(['<', '>', '='], '', $composerinfo->require->php)); @@ -49,14 +47,14 @@ class ContainerUtils 'base_path' => BASE_PATH, 'debug' => DEBUGMODE, - 'routerCacheFile' => BASE_PATH.'/temp/route.cache.php', + 'routerCacheFile' => BASE_PATH . '/temp/route.cache.php', // 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' => 60, // Application version - 'appVersion' => 'v'.$appVersion, + 'appVersion' => 'v' . $appVersion, // Application name 'appName' => 'phpPgAdmin6', @@ -73,7 +71,7 @@ class ContainerUtils // Fetch DI Container $container = $this->app->getContainer(); $container['utils'] = $this; - $container['version'] = 'v'.$appVersion; + $container['version'] = 'v' . $appVersion; $container['errors'] = []; $this->container = $container; @@ -88,24 +86,76 @@ class ContainerUtils return [self::$instance->container, self::$instance->app]; } + public function icon($icon) + { + + $conf = $this->container->conf; + if (is_string($icon)) { + $path = "/assets/images/themes/{$conf['theme']}/{$icon}"; + if (file_exists(\BASE_PATH . $path . '.png')) { + return SUBFOLDER . $path . '.png'; + } + + if (file_exists(\BASE_PATH . $path . '.gif')) { + return SUBFOLDER . $path . '.gif'; + } + + if (file_exists(\BASE_PATH . $path . '.ico')) { + return SUBFOLDER . $path . '.ico'; + } + + $path = "/assets/images/themes/default/{$icon}"; + if (file_exists(\BASE_PATH . $path . '.png')) { + return SUBFOLDER . $path . '.png'; + } + + if (file_exists(\BASE_PATH . $path . '.gif')) { + return SUBFOLDER . $path . '.gif'; + } + + if (file_exists(\BASE_PATH . $path . '.ico')) { + return SUBFOLDER . $path . '.ico'; + } + } else { + // Icon from plugins + $path = "/plugins/{$icon[0]}/images/{$icon[1]}"; + if (file_exists(\BASE_PATH . $path . '.png')) { + return SUBFOLDER . $path . '.png'; + } + + if (file_exists(\BASE_PATH . $path . '.gif')) { + return SUBFOLDER . $path . '.gif'; + } + + if (file_exists(\BASE_PATH . $path . '.ico')) { + return SUBFOLDER . $path . '.ico'; + } + } + + return ''; + } + public function maybeRenderIframes($response, $subject, $query_string) { $c = $this->container; $in_test = $c->view->offsetGet('in_test'); if ($in_test === '1') { - $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 : ''), + 'icon' => [ + 'Refresh' => $this->icon('Refresh'), + 'Servers' => $this->icon('Servers'), + ], + 'url' => '/src/views/' . $subject . ($query_string ? '?' . $query_string : ''), 'headertemplate' => 'header.twig', ]; - return $c->view->render($response, 'iframe_view.twig', $viewVars); + return $c->view->render($response, 'main.twig', $viewVars); } /** @@ -206,10 +256,10 @@ class ContainerUtils // if server_id isn't set, then you will be redirected to intro if ($this->container->requestobj->getQueryParam('server') === null) { - $destinationurl = \SUBFOLDER.'/src/views/intro'; + $destinationurl = \SUBFOLDER . '/src/views/intro'; } else { // otherwise, you'll be redirected to the login page for that server; - $destinationurl = \SUBFOLDER.'/src/views/login'.($query_string ? '?'.$query_string : ''); + $destinationurl = \SUBFOLDER . '/src/views/login' . ($query_string ? '?' . $query_string : ''); } return $destinationurl; @@ -233,7 +283,7 @@ class ContainerUtils $destinationurl = $this->getRedirectUrl(); } else { $url = $this->container->misc->getLastTabURL($subject); - $this->addFlash($url, 'getLastTabURL for '.$subject); + $this->addFlash($url, 'getLastTabURL for ' . $subject); // Load query vars into superglobal arrays if (isset($url['urlvars'])) { $urlvars = []; diff --git a/src/classes/Misc.php b/src/classes/Misc.php index c364f895..a5c5e554 100644 --- a/src/classes/Misc.php +++ b/src/classes/Misc.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin; @@ -11,16 +11,12 @@ namespace PHPPgAdmin; * Class to hold various commonly used functions * * Id: Misc.php,v 1.171 2008/03/17 21:35:48 ioguix Exp $ - * - * @package PHPPgAdmin */ /** * Class to hold various commonly used functions. * * Release: Misc.php,v 1.171 2008/03/17 21:35:48 ioguix Exp $ - * - * @package PHPPgAdmin */ class Misc { @@ -112,7 +108,7 @@ class Misc if (count($this->conf['servers']) === 1) { $info = $this->conf['servers'][0]; - $this->_server_id = sha1($info['host'].':'.$info['port'].':'.$info['sslmode']); + $this->_server_id = sha1($info['host'] . ':' . $info['port'] . ':' . $info['sslmode']); } elseif ($request_server !== null) { $this->_server_id = $request_server; } elseif (isset($_SESSION['webdbLogin']) && count($_SESSION['webdbLogin']) > 0) { @@ -182,8 +178,8 @@ class Misc { if ($help !== null) { $helplink = $this->getHelpLink($help); - $str .= '<a class="help" href="'.$helplink.'" title="'.$this->lang['strhelp'].'" target="phppgadminhelp">'; - $str .= $this->lang['strhelpicon'].'</a>'; + $str .= '<a class="help" href="' . $helplink . '" title="' . $this->lang['strhelp'] . '" target="phppgadminhelp">'; + $str .= $this->lang['strhelpicon'] . '</a>'; } if ($do_print) { echo $str; @@ -201,7 +197,7 @@ class Misc */ public function getHelpLink($help) { - return htmlspecialchars(SUBFOLDER.'/help?help='.urlencode($help).'&server='.urlencode($this->getServerId())); + return htmlspecialchars(SUBFOLDER . '/help?help=' . urlencode($help) . '&server=' . urlencode($this->getServerId())); } /** @@ -332,7 +328,7 @@ class Misc return null; } - $_type = '\PHPPgAdmin\Database\\'.$_type; + $_type = '\PHPPgAdmin\Database\\' . $_type; $this->prtrace('driver:', $_type); @@ -454,7 +450,7 @@ class Misc // Otherwise, look for it in the conf file foreach ($this->conf['servers'] as $idx => $info) { - $server_string = $info['host'].':'.$info['port'].':'.$info['sslmode']; + $server_string = $info['host'] . ':' . $info['port'] . ':' . $info['sslmode']; $server_sha = sha1($server_string); if ($this->_server_id === $server_string || @@ -609,13 +605,13 @@ class Misc $schema = $this->container->schema || isset($_REQUEST['schema']) ? $_REQUEST['schema'] : null; if ($server && $exclude_from !== 'server') { - $href[] = 'server='.urlencode($server); + $href[] = 'server=' . urlencode($server); } if ($database && $exclude_from !== 'database') { - $href[] = 'database='.urlencode($database); + $href[] = 'database=' . urlencode($database); } if ($schema && $exclude_from !== 'schema') { - $href[] = 'schema='.urlencode($schema); + $href[] = 'schema=' . urlencode($schema); } $this->href = htmlentities(implode('&', $href)); @@ -630,14 +626,14 @@ class Misc { $form = []; if ($this->container->server) { - $form[] = '<input type="hidden" name="server" value="'.htmlspecialchars($this->container->server).'" />'; + $form[] = '<input type="hidden" name="server" value="' . htmlspecialchars($this->container->server) . '" />'; } if ($this->container->database) { - $form[] = '<input type="hidden" name="database" value="'.htmlspecialchars($this->container->database).'" />'; + $form[] = '<input type="hidden" name="database" value="' . htmlspecialchars($this->container->database) . '" />'; } if ($this->container->schema) { - $form[] = '<input type="hidden" name="schema" value="'.htmlspecialchars($this->container->schema).'" />'; + $form[] = '<input type="hidden" name="schema" value="' . htmlspecialchars($this->container->schema) . '" />'; } $this->form = implode("\n", $form); @@ -729,49 +725,8 @@ class Misc public function icon($icon) { - if (is_string($icon)) { - $path = "/assets/images/themes/{$this->conf['theme']}/{$icon}"; - if (file_exists(\BASE_PATH.$path.'.png')) { - return SUBFOLDER.$path.'.png'; - } - - if (file_exists(\BASE_PATH.$path.'.gif')) { - return SUBFOLDER.$path.'.gif'; - } - - if (file_exists(\BASE_PATH.$path.'.ico')) { - return SUBFOLDER.$path.'.ico'; - } - - $path = "/assets/images/themes/default/{$icon}"; - if (file_exists(\BASE_PATH.$path.'.png')) { - return SUBFOLDER.$path.'.png'; - } - - if (file_exists(\BASE_PATH.$path.'.gif')) { - return SUBFOLDER.$path.'.gif'; - } - - if (file_exists(\BASE_PATH.$path.'.ico')) { - return SUBFOLDER.$path.'.ico'; - } - } else { - // Icon from plugins - $path = "/plugins/{$icon[0]}/images/{$icon[1]}"; - if (file_exists(\BASE_PATH.$path.'.png')) { - return SUBFOLDER.$path.'.png'; - } - - if (file_exists(\BASE_PATH.$path.'.gif')) { - return SUBFOLDER.$path.'.gif'; - } - - if (file_exists(\BASE_PATH.$path.'.ico')) { - return SUBFOLDER.$path.'.ico'; - } - } + return $this->container->utils->icon($icon); - return ''; } /** @@ -814,7 +769,7 @@ class Misc if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $data->fieldClean($str); - return '"'.$str.'"'; + return '"' . $str . '"'; } return escapeshellcmd($str); diff --git a/src/classes/PluginManager.php b/src/classes/PluginManager.php index 1dac7470..5bbdbcaf 100644 --- a/src/classes/PluginManager.php +++ b/src/classes/PluginManager.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin; @@ -13,8 +13,6 @@ namespace PHPPgAdmin; /** * A class that implements the plugin's system. - * - * @package PHPPgAdmin */ class PluginManager { diff --git a/src/classes/Translations.php b/src/classes/Translations.php index 98b12c8d..31a80b70 100644 --- a/src/classes/Translations.php +++ b/src/classes/Translations.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin; diff --git a/src/controllers/AcinsertController.php b/src/controllers/AcinsertController.php index 05a4b183..656554d5 100644 --- a/src/controllers/AcinsertController.php +++ b/src/controllers/AcinsertController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -76,7 +76,7 @@ class AcinsertController extends BaseController } } echo '</tr>'.PHP_EOL; - ++$i; + $i++; $res->moveNext(); } echo '</table>'.PHP_EOL; diff --git a/src/controllers/AggregatesController.php b/src/controllers/AggregatesController.php index 20ba4db1..e134b594 100644 --- a/src/controllers/AggregatesController.php +++ b/src/controllers/AggregatesController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class AggregatesController extends BaseController { diff --git a/src/controllers/AlldbController.php b/src/controllers/AlldbController.php index 6ec0952b..c6ccfdf7 100644 --- a/src/controllers/AlldbController.php +++ b/src/controllers/AlldbController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class AlldbController extends BaseController { diff --git a/src/controllers/BaseController.php b/src/controllers/BaseController.php index d9676681..df151334 100644 --- a/src/controllers/BaseController.php +++ b/src/controllers/BaseController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -9,8 +9,6 @@ namespace PHPPgAdmin\Controller; ini_set('display_errors', 1); /** * Base controller class. - * - * @package PHPPgAdmin */ class BaseController { @@ -45,7 +43,8 @@ class BaseController public $controller_title = 'base'; protected $table_controller; protected $trail_controller; - protected $tree_controller; + private static $_tree_controller = null; + protected $footer_controller; protected $header_controller; protected $scripts = ''; @@ -68,7 +67,7 @@ class BaseController $this->container = $container; $this->lang = $container->get('lang'); - $this->controller_name = str_replace(__NAMESPACE__.'\\', '', get_class($this)); + $this->controller_name = str_replace(__NAMESPACE__ . '\\', '', get_class($this)); $this->view_name = str_replace('controller', '', strtolower($this->controller_name)); $this->script = $this->view_name; @@ -153,7 +152,7 @@ class BaseController { $title = $title ? $title : $this->controller_title; - return $prefix.$this->lang[$title].($suffix ? ': '.$suffix : ''); + return $prefix . $this->lang[$title] . ($suffix ? ': ' . $suffix : ''); } public function getContainer() @@ -164,7 +163,11 @@ class BaseController private function _getTableController() { if (null === $this->table_controller) { - $this->table_controller = new \PHPPgAdmin\XHtml\HTMLTableController($this->getContainer(), $this->controller_name); + $this->prtrace(__METHOD__); + $this->table_controller = new \PHPPgAdmin\XHtml\HTMLTableController( + $this->getContainer(), + $this->controller_name + ); } return $this->table_controller; @@ -173,7 +176,11 @@ class BaseController private function _getFooterController() { if (null === $this->footer_controller) { - $this->footer_controller = new \PHPPgAdmin\XHtml\HTMLFooterController($this->getContainer(), $this->controller_name); + $this->prtrace(__METHOD__); + $this->footer_controller = new \PHPPgAdmin\XHtml\HTMLFooterController( + $this->getContainer(), + $this->controller_name + ); } return $this->footer_controller; @@ -182,7 +189,11 @@ class BaseController private function _getHeaderController() { if (null === $this->header_controller) { - $this->header_controller = new \PHPPgAdmin\XHtml\HTMLHeaderController($this->getContainer(), $this->controller_name); + $this->prtrace(__METHOD__); + $this->header_controller = new \PHPPgAdmin\XHtml\HTMLHeaderController( + $this->getContainer(), + $this->controller_name + ); } return $this->header_controller; @@ -191,19 +202,50 @@ class BaseController private function _getNavbarController() { if (null === $this->trail_controller) { - $this->trail_controller = new \PHPPgAdmin\XHtml\HTMLNavbarController($this->getContainer(), $this->controller_name); + $this->prtrace(__METHOD__); + $this->trail_controller = new \PHPPgAdmin\XHtml\HTMLNavbarController( + $this->getContainer(), + $this->controller_name + ); } return $this->trail_controller; } - private function _getTreeController() + /** + * Gets the tree instance. + * + * @param \Slim\Container $container the $app container + * @param <type> $controller_name The controller name + * + * @return \PHPPgAdmin\XHtml\TreeController The tree controller instance. + */ + private static function _getTreeInstance($container, $controller_name) { - if (null === $this->tree_controller) { - $this->tree_controller = new \PHPPgAdmin\XHtml\TreeController($this->getContainer(), $this->controller_name); + if (null === self::$_tree_controller) { + self::$_tree_controller = new \PHPPgAdmin\XHtml\TreeController( + $container, + $controller_name + ); } - return $this->tree_controller; + return self::$_tree_controller; + } + + /** + * Gets the tree controller. + * + * @param string $from From where is this method being called, for debug purposes + * + * @return \PHPPgAdmin\XHtml\TreeController The tree controller. + */ + private function _getTreeController($from) + { + //$tree = self::_getTreeInstance($this->getContainer(), $this->controller_name); + $tree = new \PHPPgAdmin\XHtml\TreeController($this->getContainer(), $this->controller_name); + $this->prtrace(__METHOD__); + return $tree; + } /** @@ -229,7 +271,8 @@ class BaseController public function adjustTabsForTree($tabs) { - $tree = $this->_getTreeController(); + //$tree = self::_getTreeInstance($this->getContainer(), $this->controller_name); + $tree = $this->_getTreeController(__METHOD__); return $tree->adjustTabsForTree($tabs); } @@ -240,15 +283,24 @@ class BaseController * @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 * - * @return \Slim\Http\Response|string the json rendered tree + * @return string the json rendered tree */ - public function printTree(&$_treedata, &$attrs, $section, $print = true) + public function printTree(&$_treedata, &$attrs, $section) { - $tree = $this->_getTreeController(); - return $tree->printTree($_treedata, $attrs, $section, $print); + $tree = $this->_getTreeController(__METHOD__); + + $treedata = []; + + if ($_treedata->recordCount() > 0) { + while (!$_treedata->EOF) { + $treedata[] = $_treedata->fields; + $_treedata->moveNext(); + } + } + + return $tree->printTreeJSON($treedata, $attrs, $section); } public function printTrail($trail = [], $do_print = true) @@ -300,11 +352,25 @@ class BaseController return $footer_controller->setNoBottomLink($flag); } - public function printFooter($doBody = true, $template = 'footer.twig') + /** + * Prints or returns the controller's footer + * + * @param boolean $doBody If false, return the body instead of print. Defaults to true + * @param string $template The template to render + * @param array $viewParams Optional - extra view parameters + * + * @return <type> ( description_of_the_return_value ) + */ + public function printFooter($doBody = true, $template = 'footer.twig', $viewParams = []) { $footer_controller = $this->_getFooterController(); - return $footer_controller->printFooter($doBody, $template); + $footer_html = $footer_controller->getFooter($template, $viewParams); + if ($doBody) { + echo $footer_html; + } else { + return $footer_html; + } } public function printReload($database, $do_print = true) @@ -397,7 +463,7 @@ class BaseController $html = ''; $msg = htmlspecialchars(\PHPPgAdmin\Traits\HelperTrait::br2ln($msg)); if ('' != $msg) { - $html .= '<p class="message">'.nl2br($msg).'</p>'.PHP_EOL; + $html .= '<p class="message">' . nl2br($msg) . '</p>' . PHP_EOL; } if ($do_print) { echo $html; diff --git a/src/controllers/BrowserController.php b/src/controllers/BrowserController.php index 7fbf51e6..a7b351cb 100644 --- a/src/controllers/BrowserController.php +++ b/src/controllers/BrowserController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class BrowserController extends BaseController { diff --git a/src/controllers/CastsController.php b/src/controllers/CastsController.php index 209e2616..7989adfa 100644 --- a/src/controllers/CastsController.php +++ b/src/controllers/CastsController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class CastsController extends BaseController { diff --git a/src/controllers/ColpropertiesController.php b/src/controllers/ColpropertiesController.php index 2edbe1e0..558545e2 100644 --- a/src/controllers/ColpropertiesController.php +++ b/src/controllers/ColpropertiesController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class ColpropertiesController extends BaseController { diff --git a/src/controllers/ConstraintsController.php b/src/controllers/ConstraintsController.php index ad7c1a75..26696bf0 100644 --- a/src/controllers/ConstraintsController.php +++ b/src/controllers/ConstraintsController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class ConstraintsController extends BaseController { @@ -119,7 +117,7 @@ class ConstraintsController extends BaseController $cnPre = function (&$rowdata) use ($data) { if (is_null($rowdata->fields['consrc'])) { $atts = $data->getAttributeNames($_REQUEST['table'], explode(' ', $rowdata->fields['indkey'])); - $rowdata->fields['+definition'] = ('u' == $rowdata->fields['contype'] ? 'UNIQUE (' : 'PRIMARY KEY (').join(',', $atts).')'; + $rowdata->fields['+definition'] = ('u' == $rowdata->fields['contype'] ? 'UNIQUE (' : 'PRIMARY KEY (').implode(',', $atts).')'; } else { $rowdata->fields['+definition'] = $rowdata->fields['consrc']; } @@ -329,7 +327,7 @@ class ConstraintsController extends BaseController // Check that they've given at least one source column if (!isset($_REQUEST['SourceColumnList']) && (!isset($_POST['IndexColumnList']) || !is_array($_POST['IndexColumnList']) || - 0 == sizeof($_POST['IndexColumnList']))) { + 0 == count($_POST['IndexColumnList']))) { return $this->formAddForeignKey($this->lang['strfkneedscols']); } // Copy the IndexColumnList variable from stage 1 @@ -476,8 +474,8 @@ class ConstraintsController extends BaseController // If IndexColumnList or SourceColumnList are empty, return to screen to select referencing table columns if (!is_array($_POST['IndexColumnList']) - || 0 == sizeof($_POST['IndexColumnList']) - || 0 == sizeof($temp)) { + || 0 == count($_POST['IndexColumnList']) + || 0 == count($temp)) { return $this->_selectFKColumns($this->lang['strfkneedscols']); } @@ -624,7 +622,7 @@ class ConstraintsController extends BaseController if ('primary' == $type) { // Check that they've given at least one column if (!isset($_POST['IndexColumnList']) || !is_array($_POST['IndexColumnList']) - || 0 == sizeof($_POST['IndexColumnList']) + || 0 == count($_POST['IndexColumnList']) ) { $this->formPrimaryOrUniqueKey($type, $this->lang['strpkneedscols']); } else { @@ -638,7 +636,7 @@ class ConstraintsController extends BaseController } elseif ('unique' == $type) { // Check that they've given at least one column if (!isset($_POST['IndexColumnList']) || !is_array($_POST['IndexColumnList']) - || 0 == sizeof($_POST['IndexColumnList']) + || 0 == count($_POST['IndexColumnList']) ) { $this->formPrimaryOrUniqueKey($type, $this->lang['struniqneedscols']); } else { diff --git a/src/controllers/ConversionsController.php b/src/controllers/ConversionsController.php index 45fc0d3d..121793e2 100644 --- a/src/controllers/ConversionsController.php +++ b/src/controllers/ConversionsController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class ConversionsController extends BaseController { diff --git a/src/controllers/DatabaseController.php b/src/controllers/DatabaseController.php index ba8eb110..0494a5b3 100644 --- a/src/controllers/DatabaseController.php +++ b/src/controllers/DatabaseController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class DatabaseController extends BaseController { @@ -45,22 +43,22 @@ class DatabaseController extends BaseController $scripts = ''; // normal flow if ('locks' == $this->action || 'processes' == $this->action) { - $scripts .= '<script src="'.\SUBFOLDER.'/assets/js/database.js" type="text/javascript"></script>'; + $scripts .= '<script src="' . \SUBFOLDER . '/assets/js/database.js" type="text/javascript"></script>'; $refreshTime = $this->conf['ajax_refresh'] * 1500; - $scripts .= '<script type="text/javascript">'.PHP_EOL; + $scripts .= '<script type="text/javascript">' . PHP_EOL; $scripts .= "var Database = {\n"; $scripts .= "ajax_time_refresh: {$refreshTime},\n"; - $scripts .= "str_start: {text:'{$this->lang['strstart']}',icon: '".$this->misc->icon('Execute')."'},\n"; - $scripts .= "str_stop: {text:'{$this->lang['strstop']}',icon: '".$this->misc->icon('Stop')."'},\n"; - $scripts .= "load_icon: '".$this->misc->icon('Loading')."',\n"; + $scripts .= "str_start: {text:'{$this->lang['strstart']}',icon: '" . $this->misc->icon('Execute') . "'},\n"; + $scripts .= "str_stop: {text:'{$this->lang['strstop']}',icon: '" . $this->misc->icon('Stop') . "'},\n"; + $scripts .= "load_icon: '" . $this->misc->icon('Loading') . "',\n"; $scripts .= "server:'{$_REQUEST['server']}',\n"; $scripts .= "dbname:'{$_REQUEST['database']}',\n"; $scripts .= "action:'refresh_{$this->action}',\n"; - $scripts .= "errmsg: '".str_replace("'", "\\'", $this->lang['strconnectionfail'])."'\n"; + $scripts .= "errmsg: '" . str_replace("'", "\\'", $this->lang['strconnectionfail']) . "'\n"; $scripts .= "};\n"; - $scripts .= '</script>'.PHP_EOL; + $scripts .= '</script>' . PHP_EOL; } $header_template = 'header.twig'; @@ -121,7 +119,7 @@ class DatabaseController extends BaseController $this->printFooter(true, $footer_template); } - public function doTree($print = true) + public function doTree() { $reqvars = $this->misc->getRequestVars('database'); $tabs = $this->misc->getNavTabs('database'); @@ -149,7 +147,7 @@ class DatabaseController extends BaseController ), ]; - return $this->printTree($items, $attrs, 'database', $print); + return $this->printTree($items, $attrs, 'database'); } /** @@ -185,11 +183,11 @@ class DatabaseController extends BaseController $this->printTabs('database', 'find'); $this->printMsg($msg); - echo '<form action="'.\SUBFOLDER.'/src/views/database" method="post">'.PHP_EOL; + echo '<form action="' . \SUBFOLDER . '/src/views/database" method="post">' . PHP_EOL; echo '<p><input name="term" value="', htmlspecialchars($_REQUEST['term']), - "\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" />".PHP_EOL; + "\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" />" . PHP_EOL; // Output list of filters. This is complex due to all the 'has' and 'conf' feature possibilities - echo '<select name="filter">'.PHP_EOL; + echo '<select name="filter">' . PHP_EOL; echo $this->_printTypeOption(''); echo $this->_printTypeOption('COLUMN'); @@ -213,12 +211,12 @@ class DatabaseController extends BaseController echo $this->_printTypeOption('LANGUAGE'); } - echo '</select>'.PHP_EOL; - echo "<input type=\"submit\" value=\"{$this->lang['strfind']}\" />".PHP_EOL; + echo '</select>' . PHP_EOL; + echo "<input type=\"submit\" value=\"{$this->lang['strfind']}\" />" . PHP_EOL; echo $this->misc->form; - echo '<input type="hidden" name="action" value="find" /></p>'.PHP_EOL; - echo '<input type="hidden" name="confirm" value="true" /></p>'.PHP_EOL; - echo '</form>'.PHP_EOL; + echo '<input type="hidden" name="action" value="find" /></p>' . PHP_EOL; + echo '<input type="hidden" name="confirm" value="true" /></p>' . PHP_EOL; + echo '</form>' . PHP_EOL; // Default focus $this->setFocus('forms[0].term'); @@ -235,7 +233,7 @@ class DatabaseController extends BaseController $filter = $_REQUEST['filter']; $optionhtml = sprintf('%s<option value="%s" %s>', "\t", $curr, ($curr === $filter) ? ' selected="selected"' : ''); $optionhtml .= $this->_translatedType($curr); - $optionhtml .= '</option>'.PHP_EOL; + $optionhtml .= '</option>' . PHP_EOL; return $optionhtml; } @@ -279,95 +277,95 @@ class DatabaseController extends BaseController { switch ($curr) { case 'SCHEMA': - echo '<li><a href="'.\SUBFOLDER."/redirect/schema?{$this->misc->href}&schema="; + echo '<li><a href="' . \SUBFOLDER . "/redirect/schema?{$this->misc->href}&schema="; echo $this->misc->printVal($rs->fields['name']), '">'; echo $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']); - echo '</a></li>'.PHP_EOL; + echo '</a></li>' . PHP_EOL; break; case 'TABLE': echo '<li>'; echo "<a href=\"tables?subject=schema&{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; - echo '<a href="'.\SUBFOLDER."/redirect/table?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '&table=', - urlencode($rs->fields['name']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + echo '<a href="' . \SUBFOLDER . "/redirect/table?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '&table=', + urlencode($rs->fields['name']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; case 'VIEW': echo '<li>'; echo "<a href=\"views?subject=schema&{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; - echo '<a href="'.\SUBFOLDER."/redirect/view?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '&view=', - urlencode($rs->fields['name']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + echo '<a href="' . \SUBFOLDER . "/redirect/view?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '&view=', + urlencode($rs->fields['name']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; case 'SEQUENCE': echo '<li>'; echo "<a href=\"sequences?subject=schema&{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; echo "<a href=\"sequences?subject=sequence&action=properties&{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), - '&sequence=', urlencode($rs->fields['name']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + '&sequence=', urlencode($rs->fields['name']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; case 'COLUMNTABLE': echo '<li>'; - echo '<a href="'.\SUBFOLDER."/redirect/schema?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; + echo '<a href="' . \SUBFOLDER . "/redirect/schema?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; echo "<a href=\"tblproperties?subject=table&{$this->misc->href}&table=", urlencode($rs->fields['relname']), '&schema=', urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '</a>.'; echo "<a href=\"colproperties?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '&table=', urlencode($rs->fields['relname']), '&column=', urlencode($rs->fields['name']), '">', - $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; case 'COLUMNVIEW': echo '<li>'; - echo '<a href="'.\SUBFOLDER."/redirect/schema?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; + echo '<a href="' . \SUBFOLDER . "/redirect/schema?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; echo "<a href=\"viewproperties?subject=view&{$this->misc->href}&view=", urlencode($rs->fields['relname']), '&schema=', urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '</a>.'; echo "<a href=\"colproperties?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '&view=', urlencode($rs->fields['relname']), '&column=', urlencode($rs->fields['name']), '">', - $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; case 'INDEX': echo '<li>'; - echo '<a href="'.\SUBFOLDER."/redirect/schema?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; - echo '<a href="'.\SUBFOLDER."/redirect/table?{$this->misc->href}&table=", urlencode($rs->fields['relname']), '&schema=', urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '</a>.'; - echo "<a href=\"indexes?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '&table=', urlencode($rs->fields['relname']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + echo '<a href="' . \SUBFOLDER . "/redirect/schema?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; + echo '<a href="' . \SUBFOLDER . "/redirect/table?{$this->misc->href}&table=", urlencode($rs->fields['relname']), '&schema=', urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '</a>.'; + echo "<a href=\"indexes?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '&table=', urlencode($rs->fields['relname']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; case 'CONSTRAINTTABLE': echo '<li>'; - echo '<a href="'.\SUBFOLDER."/redirect/schema?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; - echo '<a href="'.\SUBFOLDER."/redirect/table?{$this->misc->href}&table=", urlencode($rs->fields['relname']), '&schema=', urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '</a>.'; + echo '<a href="' . \SUBFOLDER . "/redirect/schema?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; + echo '<a href="' . \SUBFOLDER . "/redirect/table?{$this->misc->href}&table=", urlencode($rs->fields['relname']), '&schema=', urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '</a>.'; echo "<a href=\"constraints?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '&table=', - urlencode($rs->fields['relname']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + urlencode($rs->fields['relname']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; case 'CONSTRAINTDOMAIN': echo '<li>'; echo "<a href=\"domains?subject=schema&{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; echo "<a href=\"domains?action=properties&{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '&domain=', urlencode($rs->fields['relname']), '">', - $this->misc->printVal($rs->fields['relname']), '.', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + $this->misc->printVal($rs->fields['relname']), '.', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; case 'TRIGGER': echo '<li>'; - echo '<a href="'.\SUBFOLDER."/redirect/schema?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; - echo '<a href="'.\SUBFOLDER."/redirect/table?{$this->misc->href}&table=", urlencode($rs->fields['relname']), '&schema=', urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '</a>.'; + echo '<a href="' . \SUBFOLDER . "/redirect/schema?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; + echo '<a href="' . \SUBFOLDER . "/redirect/table?{$this->misc->href}&table=", urlencode($rs->fields['relname']), '&schema=', urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '</a>.'; echo "<a href=\"triggers?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '&table=', urlencode($rs->fields['relname']), '">', - $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; case 'RULETABLE': echo '<li>'; - echo '<a href="'.\SUBFOLDER."/redirect/schema?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; - echo '<a href="'.\SUBFOLDER."/redirect/table?{$this->misc->href}&table=", urlencode($rs->fields['relname']), '&schema=', urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '</a>.'; + echo '<a href="' . \SUBFOLDER . "/redirect/schema?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; + echo '<a href="' . \SUBFOLDER . "/redirect/table?{$this->misc->href}&table=", urlencode($rs->fields['relname']), '&schema=', urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '</a>.'; echo "<a href=\"rules?subject=table&{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '&reltype=table&table=', - urlencode($rs->fields['relname']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + urlencode($rs->fields['relname']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; case 'RULEVIEW': echo '<li>'; - echo '<a href="'.\SUBFOLDER."/redirect/schema?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; - echo '<a href="'.\SUBFOLDER."/redirect/view?{$this->misc->href}&view=", urlencode($rs->fields['relname']), '&schema=', urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '</a>.'; + echo '<a href="' . \SUBFOLDER . "/redirect/schema?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; + echo '<a href="' . \SUBFOLDER . "/redirect/view?{$this->misc->href}&view=", urlencode($rs->fields['relname']), '&schema=', urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['relname']), '</a>.'; echo "<a href=\"rules?subject=view&{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '&reltype=view&view=', - urlencode($rs->fields['relname']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + urlencode($rs->fields['relname']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; case 'FUNCTION': @@ -375,53 +373,53 @@ class DatabaseController extends BaseController echo "<a href=\"functions?subject=schema&{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; echo "<a href=\"functions?action=properties&{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '&function=', urlencode($rs->fields['name']), '&function_oid=', urlencode($rs->fields['oid']), '">', - $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; case 'TYPE': echo '<li>'; echo "<a href=\"types?subject=schema&{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; echo "<a href=\"types?action=properties&{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '&type=', - urlencode($rs->fields['name']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + urlencode($rs->fields['name']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; case 'DOMAIN': echo '<li>'; echo "<a href=\"domains?subject=schema&{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; echo "<a href=\"domains?action=properties&{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '&domain=', - urlencode($rs->fields['name']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + urlencode($rs->fields['name']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; case 'OPERATOR': echo '<li>'; echo "<a href=\"operators?subject=schema&{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; echo "<a href=\"operators?action=properties&{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '&operator=', - urlencode($rs->fields['name']), '&operator_oid=', urlencode($rs->fields['oid']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + urlencode($rs->fields['name']), '&operator_oid=', urlencode($rs->fields['oid']), '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; case 'CONVERSION': echo '<li>'; echo "<a href=\"conversions?subject=schema&{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; echo "<a href=\"conversions?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), - '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + '">', $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; case 'LANGUAGE': - echo "<li><a href=\"languages?{$this->misc->href}\">", $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + echo "<li><a href=\"languages?{$this->misc->href}\">", $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; case 'AGGREGATE': echo '<li>'; echo "<a href=\"aggregates?subject=schema&{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; echo "<a href=\"aggregates?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', - $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; case 'OPCLASS': echo '<li>'; - echo '<a href="'.\SUBFOLDER."/redirect/schema?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; + echo '<a href="' . \SUBFOLDER . "/redirect/schema?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', $this->misc->printVal($rs->fields['schemaname']), '</a>.'; echo "<a href=\"opclasses?{$this->misc->href}&schema=", urlencode($rs->fields['schemaname']), '">', - $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>'.PHP_EOL; + $this->_highlight($this->misc->printVal($rs->fields['name']), $_REQUEST['term']), '</a></li>' . PHP_EOL; break; } @@ -446,25 +444,25 @@ class DatabaseController extends BaseController $curr = $rs->fields['type']; } else { if ('' != $curr) { - echo '</ul>'.PHP_EOL; + echo '</ul>' . PHP_EOL; } $curr = $rs->fields['type']; echo '<h3>'; echo $this->_translatedType($curr); echo '</h3>'; - echo '<ul>'.PHP_EOL; + echo '<ul>' . PHP_EOL; } } $this->_printHtmlForType($curr, $rs); $rs->moveNext(); } - echo '</ul>'.PHP_EOL; + echo '</ul>' . PHP_EOL; - echo '<p>', $rs->recordCount(), ' ', $this->lang['strobjects'], '</p>'.PHP_EOL; + echo '<p>', $rs->recordCount(), ' ', $this->lang['strobjects'], '</p>' . PHP_EOL; } else { - echo "<p>{$this->lang['strnoobjects']}</p>".PHP_EOL; + echo "<p>{$this->lang['strnoobjects']}</p>" . PHP_EOL; } } @@ -539,7 +537,7 @@ class DatabaseController extends BaseController $this->printMsg($msg); if (0 === strlen($msg)) { - echo '<br /><a id="control" href=""><img src="'.$this->misc->icon('Refresh')."\" alt=\"{$this->lang['strrefresh']}\" title=\"{$this->lang['strrefresh']}\"/> {$this->lang['strrefresh']}</a>"; + echo '<br /><a id="control" href=""><img src="' . $this->misc->icon('Refresh') . "\" alt=\"{$this->lang['strrefresh']}\" title=\"{$this->lang['strrefresh']}\"/> {$this->lang['strrefresh']}</a>"; } echo '<div id="data_block">'; @@ -553,7 +551,7 @@ class DatabaseController extends BaseController // Display prepared transactions if ($data->hasPreparedXacts()) { - echo "<h3>{$this->lang['strpreparedxacts']}</h3>".PHP_EOL; + echo "<h3>{$this->lang['strpreparedxacts']}</h3>" . PHP_EOL; $prep_xacts = $data->getPreparedXacts($_REQUEST['database']); $columns = [ @@ -581,7 +579,7 @@ class DatabaseController extends BaseController } // Fetch the processes from the database - echo "<h3>{$this->lang['strprocesses']}</h3>".PHP_EOL; + echo "<h3>{$this->lang['strprocesses']}</h3>" . PHP_EOL; $processes = $data->getProcesses($_REQUEST['database']); $columns = [ @@ -721,7 +719,7 @@ class DatabaseController extends BaseController $this->printTrail('database'); $this->printTabs('database', 'locks'); - echo '<br /><a id="control" href=""><img src="'.$this->misc->icon('Refresh')."\" alt=\"{$this->lang['strrefresh']}\" title=\"{$this->lang['strrefresh']}\"/> {$this->lang['strrefresh']}</a>"; + echo '<br /><a id="control" href=""><img src="' . $this->misc->icon('Refresh') . "\" alt=\"{$this->lang['strrefresh']}\" title=\"{$this->lang['strrefresh']}\"/> {$this->lang['strrefresh']}</a>"; echo '<div id="data_block">'; $this->currentLocks(); @@ -740,27 +738,27 @@ class DatabaseController extends BaseController $this->printTrail('database'); $this->printTabs('database', 'sql'); - echo "<p>{$this->lang['strentersql']}</p>".PHP_EOL; - echo '<form action="'.\SUBFOLDER.'/src/views/sql" method="post" enctype="multipart/form-data" id="sqlform">'.PHP_EOL; - echo "<p>{$this->lang['strsql']}<br />".PHP_EOL; + echo "<p>{$this->lang['strentersql']}</p>" . PHP_EOL; + echo '<form action="' . \SUBFOLDER . '/src/views/sql" method="post" enctype="multipart/form-data" id="sqlform">' . PHP_EOL; + echo "<p>{$this->lang['strsql']}<br />" . PHP_EOL; echo '<textarea style="width:95%;" rows="15" cols="50" name="query" id="query">', - htmlspecialchars($_SESSION['sqlquery']), '</textarea></p>'.PHP_EOL; + htmlspecialchars($_SESSION['sqlquery']), '</textarea></p>' . PHP_EOL; // Check that file uploads are enabled if (ini_get('file_uploads')) { // Don't show upload option if max size of uploads is zero $max_size = $this->misc->inisizeToBytes(ini_get('upload_max_filesize')); - if (is_double($max_size) && $max_size > 0) { - echo "<p><input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"{$max_size}\" />".PHP_EOL; - echo "<label for=\"script\">{$this->lang['struploadscript']}</label> <input id=\"script\" name=\"script\" type=\"file\" /></p>".PHP_EOL; + if (is_float($max_size) && $max_size > 0) { + echo "<p><input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"{$max_size}\" />" . PHP_EOL; + echo "<label for=\"script\">{$this->lang['struploadscript']}</label> <input id=\"script\" name=\"script\" type=\"file\" /></p>" . PHP_EOL; } } - echo '<p><input type="checkbox" id="paginate" name="paginate"', (isset($_REQUEST['paginate']) ? ' checked="checked"' : ''), " /><label for=\"paginate\">{$this->lang['strpaginate']}</label></p>".PHP_EOL; - echo "<p><input type=\"submit\" name=\"execute\" accesskey=\"r\" value=\"{$this->lang['strexecute']}\" />".PHP_EOL; + echo '<p><input type="checkbox" id="paginate" name="paginate"', (isset($_REQUEST['paginate']) ? ' checked="checked"' : ''), " /><label for=\"paginate\">{$this->lang['strpaginate']}</label></p>" . PHP_EOL; + echo "<p><input type=\"submit\" name=\"execute\" accesskey=\"r\" value=\"{$this->lang['strexecute']}\" />" . PHP_EOL; echo $this->misc->form; - echo "<input type=\"reset\" accesskey=\"q\" value=\"{$this->lang['strreset']}\" /></p>".PHP_EOL; - echo '</form>'.PHP_EOL; + echo "<input type=\"reset\" accesskey=\"q\" value=\"{$this->lang['strreset']}\" /></p>" . PHP_EOL; + echo '</form>' . PHP_EOL; // Default focus $this->setFocus('forms[0].query'); diff --git a/src/controllers/DataexportController.php b/src/controllers/DataexportController.php index 6f627103..eabb59d6 100644 --- a/src/controllers/DataexportController.php +++ b/src/controllers/DataexportController.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; /** * Base controller class. - * - * @package PHPPgAdmin */ class DataexportController extends BaseController { diff --git a/src/controllers/DataimportController.php b/src/controllers/DataimportController.php index c9be0be5..ed4ce1ea 100644 --- a/src/controllers/DataimportController.php +++ b/src/controllers/DataimportController.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; /** * Base controller class. - * - * @package PHPPgAdmin */ class DataimportController extends BaseController { @@ -152,7 +150,7 @@ class DataimportController extends BaseController $format[$i] = 'VALUE'; // Type is always text $types[$i] = 'text'; - ++$i; + $i++; } $status = $data->insertRow($_REQUEST['table'], $fields, $vars, $nulls, $format, $types); if (0 != $status) { @@ -262,7 +260,7 @@ class DataimportController extends BaseController $format[$i] = 'VALUE'; // Type is always text $types[$i] = 'text'; - ++$i; + $i++; } $status = $data->insertRow($_REQUEST['table'], $t_fields, $vars, $nulls, $format, $types); @@ -270,7 +268,7 @@ class DataimportController extends BaseController $data->rollbackTransaction(); $this->halt(sprintf($this->lang['strimporterrorline'], $row)); } - ++$row; + $row++; } break; diff --git a/src/controllers/DbexportController.php b/src/controllers/DbexportController.php index 09c2596e..6f3bf29f 100644 --- a/src/controllers/DbexportController.php +++ b/src/controllers/DbexportController.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; /** * Base controller class. - * - * @package PHPPgAdmin */ class DbexportController extends BaseController { diff --git a/src/controllers/DisplayController.php b/src/controllers/DisplayController.php index 5def4323..b1544a12 100644 --- a/src/controllers/DisplayController.php +++ b/src/controllers/DisplayController.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; /** * Base controller class. - * - * @package PHPPgAdmin */ class DisplayController extends BaseController { @@ -769,14 +767,14 @@ class DisplayController extends BaseController echo $this->misc->printVal($data->formatType($attrs->fields['type'], $attrs->fields['atttypmod'])); echo '<input type="hidden" name="types[', htmlspecialchars($attrs->fields['attname']), ']" value="', htmlspecialchars($attrs->fields['type']), '" /></td>'; - ++$elements; + $elements++; echo '<td style="white-space:nowrap;">'.PHP_EOL; echo '<select name="format['.htmlspecialchars($attrs->fields['attname']), ']">'.PHP_EOL; echo '<option value="VALUE"', ($_REQUEST['format'][$attrs->fields['attname']] == 'VALUE') ? ' selected="selected"' : '', ">{$this->lang['strvalue']}</option>".PHP_EOL; $selected = ($_REQUEST['format'][$attrs->fields['attname']] == 'EXPRESSION') ? ' selected="selected"' : ''; echo '<option value="EXPRESSION"'.$selected.">{$this->lang['strexpression']}</option>".PHP_EOL; echo "</select>\n</td>".PHP_EOL; - ++$elements; + $elements++; echo '<td style="white-space:nowrap;">'; // Output null box if the column allows nulls (doesn't look at CHECKs or ASSERTIONS) if (!$attrs->fields['attnotnull']) { @@ -786,7 +784,7 @@ class DisplayController extends BaseController } echo "<label><span><input type=\"checkbox\" class=\"nullcheckbox\" name=\"nulls[{$attrs->fields['attname']}]\"", isset($_REQUEST['nulls'][$attrs->fields['attname']]) ? ' checked="checked"' : '', ' /></span></label></td>'.PHP_EOL; - ++$elements; + $elements++; } else { echo ' </td>'; } @@ -811,9 +809,9 @@ class DisplayController extends BaseController echo $data->printField("values[{$attrs->fields['attname']}]", $resultset->fields[$attrs->fields['attname']], $attrs->fields['type'], $extras); echo '</td>'; - ++$elements; + $elements++; echo '</tr>'.PHP_EOL; - ++$i; + $i++; $attrs->moveNext(); } echo '</table>'.PHP_EOL; @@ -1118,7 +1116,7 @@ class DisplayController extends BaseController list($min_page, $max_page) = $this->_getMinMaxPages($page, $pages); - for ($i = $min_page; $i <= $max_page; ++$i) { + for ($i = $min_page; $i <= $max_page; $i++) { $result .= (($i === $page) ? $i : sprintf('<a class="pagenav" href="display?%s&page=%s">%s</a>', $url, $i, $i)).PHP_EOL; } diff --git a/src/controllers/DomainsController.php b/src/controllers/DomainsController.php index 3cb0afb7..776c4c87 100644 --- a/src/controllers/DomainsController.php +++ b/src/controllers/DomainsController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class DomainsController extends BaseController { diff --git a/src/controllers/FulltextController.php b/src/controllers/FulltextController.php index 59656287..b77c556e 100644 --- a/src/controllers/FulltextController.php +++ b/src/controllers/FulltextController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class FulltextController extends BaseController { diff --git a/src/controllers/FunctionsController.php b/src/controllers/FunctionsController.php index 5b6b4718..57006e5b 100644 --- a/src/controllers/FunctionsController.php +++ b/src/controllers/FunctionsController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class FunctionsController extends BaseController { @@ -390,8 +388,8 @@ class FunctionsController extends BaseController $names_arr = $data->phpArray($fndata->fields['proargnames']); $modes_arr = $data->phpArray($fndata->fields['proargmodes']); $args = ''; - $args_arr_size = sizeof($args_arr); - for ($i = 0; $i < $args_arr_size; ++$i) { + $args_arr_size = count($args_arr); + for ($i = 0; $i < $args_arr_size; $i++) { if (0 != $i) { $args .= ', '; } @@ -576,7 +574,7 @@ class FunctionsController extends BaseController } // Display function properties - if (is_array($data->funcprops) && sizeof($data->funcprops) > 0) { + if (is_array($data->funcprops) && count($data->funcprops) > 0) { echo "<tr><th class=\"data\" colspan=\"5\">{$this->lang['strproperties']}</th></tr>".PHP_EOL; echo '<tr><td class="data1" colspan="5">'.PHP_EOL; $i = 0; @@ -588,7 +586,7 @@ class FunctionsController extends BaseController '>', $this->misc->printVal($p), '</option>'.PHP_EOL; } echo '</select><br />'.PHP_EOL; - ++$i; + $i++; } echo '</td></tr>'.PHP_EOL; } @@ -746,7 +744,7 @@ class FunctionsController extends BaseController } // Show flags - if (is_array($data->funcprops) && sizeof($data->funcprops) > 0) { + if (is_array($data->funcprops) && count($data->funcprops) > 0) { // Fetch an array of the function properties $funcprops = $data->getFunctionProperties($funcdata->fields); echo "<tr><th class=\"data\" colspan=\"4\">{$this->lang['strproperties']}</th></tr>".PHP_EOL; @@ -1067,7 +1065,7 @@ class FunctionsController extends BaseController } // Display function properties - if (is_array($data->funcprops) && sizeof($data->funcprops) > 0) { + if (is_array($data->funcprops) && count($data->funcprops) > 0) { echo "<tr><th class=\"data required\" colspan=\"4\">{$this->lang['strproperties']}</th></tr>".PHP_EOL; echo '<tr><td class="data1" colspan="4">'.PHP_EOL; $i = 0; @@ -1079,7 +1077,7 @@ class FunctionsController extends BaseController '>', $this->misc->printVal($p), '</option>'.PHP_EOL; } echo '</select><br />'.PHP_EOL; - ++$i; + $i++; } echo '</td></tr>'.PHP_EOL; } @@ -1214,7 +1212,7 @@ class FunctionsController extends BaseController $szReturn .= '<script type="text/javascript">'; $szReturn .= "RebuildArgTR('{$szMode}','{$szArgName}','{$szArgType}',new Boolean({$bArgIsArray},{$subfolder}));"; $szReturn .= '</script>;'; - ++$nC; + $nC++; } return $szReturn; @@ -1264,8 +1262,8 @@ class FunctionsController extends BaseController $names_arr = $data->phpArray($funcdata->fields['proargnames']); $modes_arr = $data->phpArray($funcdata->fields['proargmodes']); $args = ''; - $args_arr_size = sizeof($args_arr); - for ($i = 0; $i < $args_arr_size; ++$i) { + $args_arr_size = count($args_arr); + for ($i = 0; $i < $args_arr_size; $i++) { if (0 != $i) { $args .= ', '; } diff --git a/src/controllers/GroupsController.php b/src/controllers/GroupsController.php index 44d513e3..7c0e759e 100644 --- a/src/controllers/GroupsController.php +++ b/src/controllers/GroupsController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class GroupsController extends BaseController { diff --git a/src/controllers/HelpController.php b/src/controllers/HelpController.php index 62285a8f..bcab8722 100644 --- a/src/controllers/HelpController.php +++ b/src/controllers/HelpController.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; /** * Base controller class. - * - * @package PHPPgAdmin */ class HelpController extends BaseController { diff --git a/src/controllers/HistoryController.php b/src/controllers/HistoryController.php index 54c05253..cdd2f74a 100644 --- a/src/controllers/HistoryController.php +++ b/src/controllers/HistoryController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class HistoryController extends BaseController { @@ -60,7 +58,7 @@ class HistoryController extends BaseController // Set the name of the window $this->setWindowName('history'); - return $this->printFooter(true, 'footer_sqledit.twig'); + return $this->printFooter(true, 'footer_sqledit.twig', true); } public function doDefault() @@ -70,14 +68,14 @@ class HistoryController extends BaseController $this->printHeader($this->headerTitle(), $this->scripts, true, 'header.twig'); // Bring to the front always - echo '<body onload="window.focus();">'.PHP_EOL; + echo '<body onload="window.focus();">' . PHP_EOL; - echo '<form action="'.\SUBFOLDER.'/src/views/history" method="post">'.PHP_EOL; + echo '<form action="' . \SUBFOLDER . '/src/views/history" method="post">' . PHP_EOL; $this->printConnection('history'); echo '</form><br />'; if (!isset($_REQUEST['database'])) { - echo "<p>{$this->lang['strnodatabaseselected']}</p>".PHP_EOL; + echo "<p>{$this->lang['strnodatabaseselected']}</p>" . PHP_EOL; return; } @@ -133,7 +131,7 @@ class HistoryController extends BaseController echo $this->printTable($history, $columns, $actions, 'history-history', $this->lang['strnohistory']); } else { - echo "<p>{$this->lang['strnohistory']}</p>".PHP_EOL; + echo "<p>{$this->lang['strnohistory']}</p>" . PHP_EOL; } $navlinks = [ @@ -191,19 +189,19 @@ class HistoryController extends BaseController $this->printHeader($this->headerTitle(), $this->scripts); // Bring to the front always - echo '<body onload="window.focus();">'.PHP_EOL; + echo '<body onload="window.focus();">' . PHP_EOL; - echo "<h3>{$this->lang['strdelhistory']}</h3>".PHP_EOL; - echo "<p>{$this->lang['strconfdelhistory']}</p>".PHP_EOL; + echo "<h3>{$this->lang['strdelhistory']}</h3>" . PHP_EOL; + echo "<p>{$this->lang['strconfdelhistory']}</p>" . PHP_EOL; echo '<pre>', htmlentities($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']][$qid]['query'], ENT_QUOTES, 'UTF-8'), '</pre>'; - echo '<form action="'.\SUBFOLDER.'/src/views/history" method="post">'.PHP_EOL; - echo '<input type="hidden" name="action" value="delhistory" />'.PHP_EOL; - echo "<input type=\"hidden\" name=\"queryid\" value=\"${qid}\" />".PHP_EOL; + echo '<form action="' . \SUBFOLDER . '/src/views/history" method="post">' . PHP_EOL; + echo '<input type="hidden" name="action" value="delhistory" />' . PHP_EOL; + echo "<input type=\"hidden\" name=\"queryid\" value=\"${qid}\" />" . PHP_EOL; echo $this->misc->form; - echo "<input type=\"submit\" name=\"yes\" value=\"{$this->lang['stryes']}\" />".PHP_EOL; - echo "<input type=\"submit\" name=\"no\" value=\"{$this->lang['strno']}\" />".PHP_EOL; - echo '</form>'.PHP_EOL; + echo "<input type=\"submit\" name=\"yes\" value=\"{$this->lang['stryes']}\" />" . PHP_EOL; + echo "<input type=\"submit\" name=\"no\" value=\"{$this->lang['strno']}\" />" . PHP_EOL; + echo '</form>' . PHP_EOL; } else { unset($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']][$qid]); } @@ -215,17 +213,17 @@ class HistoryController extends BaseController $this->printHeader($this->headerTitle(), $this->scripts); // Bring to the front always - echo '<body onload="window.focus();">'.PHP_EOL; + echo '<body onload="window.focus();">' . PHP_EOL; - echo "<h3>{$this->lang['strclearhistory']}</h3>".PHP_EOL; - echo "<p>{$this->lang['strconfclearhistory']}</p>".PHP_EOL; + echo "<h3>{$this->lang['strclearhistory']}</h3>" . PHP_EOL; + echo "<p>{$this->lang['strconfclearhistory']}</p>" . PHP_EOL; - echo '<form action="'.\SUBFOLDER.'/src/views/history" method="post">'.PHP_EOL; - echo '<input type="hidden" name="action" value="clearhistory" />'.PHP_EOL; + echo '<form action="' . \SUBFOLDER . '/src/views/history" method="post">' . PHP_EOL; + echo '<input type="hidden" name="action" value="clearhistory" />' . PHP_EOL; echo $this->misc->form; - echo "<input type=\"submit\" name=\"yes\" value=\"{$this->lang['stryes']}\" />".PHP_EOL; - echo "<input type=\"submit\" name=\"no\" value=\"{$this->lang['strno']}\" />".PHP_EOL; - echo '</form>'.PHP_EOL; + echo "<input type=\"submit\" name=\"yes\" value=\"{$this->lang['stryes']}\" />" . PHP_EOL; + echo "<input type=\"submit\" name=\"no\" value=\"{$this->lang['strno']}\" />" . PHP_EOL; + echo '</form>' . PHP_EOL; } else { unset($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']]); } diff --git a/src/controllers/IndexesController.php b/src/controllers/IndexesController.php index 4256bc0a..4b28fa47 100644 --- a/src/controllers/IndexesController.php +++ b/src/controllers/IndexesController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class IndexesController extends BaseController { diff --git a/src/controllers/InfoController.php b/src/controllers/InfoController.php index 3e385538..bcf2d6df 100644 --- a/src/controllers/InfoController.php +++ b/src/controllers/InfoController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class InfoController extends BaseController { @@ -176,7 +174,7 @@ class InfoController extends BaseController echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['n_tup_del'], 'int4', $this->shownull), '</td>'.PHP_EOL; echo "\t</tr>".PHP_EOL; $tablestatstups->movenext(); - ++$i; + $i++; } echo '</table>'.PHP_EOL; @@ -258,7 +256,7 @@ class InfoController extends BaseController echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>".PHP_EOL; echo "\t</tr>".PHP_EOL; $tablestatsio->movenext(); - ++$i; + $i++; } echo '</table>'.PHP_EOL; @@ -286,7 +284,7 @@ class InfoController extends BaseController echo "\t\t<td>", $this->misc->printVal($indexstatstups->fields['idx_tup_fetch'], 'int4', $this->shownull), '</td>'.PHP_EOL; echo "\t</tr>".PHP_EOL; $indexstatstups->movenext(); - ++$i; + $i++; } echo '</table>'.PHP_EOL; @@ -321,7 +319,7 @@ class InfoController extends BaseController echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>".PHP_EOL; echo "\t</tr>".PHP_EOL; $indexstatsio->movenext(); - ++$i; + $i++; } echo '</table>'.PHP_EOL; diff --git a/src/controllers/IntroController.php b/src/controllers/IntroController.php index c45f0bbe..2a95b6a3 100644 --- a/src/controllers/IntroController.php +++ b/src/controllers/IntroController.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; /** * Base controller class. - * - * @package PHPPgAdmin */ class IntroController extends BaseController { diff --git a/src/controllers/LanguagesController.php b/src/controllers/LanguagesController.php index b8508a28..d1375209 100644 --- a/src/controllers/LanguagesController.php +++ b/src/controllers/LanguagesController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class LanguagesController extends BaseController { diff --git a/src/controllers/LoginController.php b/src/controllers/LoginController.php index f5cd5821..ff6b94c2 100644 --- a/src/controllers/LoginController.php +++ b/src/controllers/LoginController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -109,7 +109,7 @@ class LoginController extends BaseController $login_html .= '<td><input id="loginPassword" type="password" name="loginPassword_'.$md5_server.'" size="24" /></td>'; $login_html .= '</tr>'; $login_html .= '</table>'; - if (sizeof($this->conf['servers']) > 1) { + if (count($this->conf['servers']) > 1) { $checked = isset($_POST['loginShared']) ? 'checked="checked"' : ''; $login_html .= '<p><input type="checkbox" id="loginShared" name="loginShared" '.$checked.' />'; $login_html .= '<label for="loginShared">'.$this->lang['strtrycred'].'</label></p>'; diff --git a/src/controllers/MaterializedviewpropertiesController.php b/src/controllers/MaterializedviewpropertiesController.php index 49f0d0e0..11c3b38c 100644 --- a/src/controllers/MaterializedviewpropertiesController.php +++ b/src/controllers/MaterializedviewpropertiesController.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; /** * Base controller class. - * - * @package PHPPgAdmin */ class MaterializedviewpropertiesController extends BaseController { diff --git a/src/controllers/MaterializedviewsController.php b/src/controllers/MaterializedviewsController.php index 3c483c75..47f8adeb 100644 --- a/src/controllers/MaterializedviewsController.php +++ b/src/controllers/MaterializedviewsController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class MaterializedviewsController extends BaseController { diff --git a/src/controllers/OpclassesController.php b/src/controllers/OpclassesController.php index 34494336..4a7a8cca 100644 --- a/src/controllers/OpclassesController.php +++ b/src/controllers/OpclassesController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class OpclassesController extends BaseController { diff --git a/src/controllers/OperatorsController.php b/src/controllers/OperatorsController.php index 0c40aa96..4b84de97 100644 --- a/src/controllers/OperatorsController.php +++ b/src/controllers/OperatorsController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class OperatorsController extends BaseController { diff --git a/src/controllers/PrivilegesController.php b/src/controllers/PrivilegesController.php index 186a0ef5..9a113cb7 100644 --- a/src/controllers/PrivilegesController.php +++ b/src/controllers/PrivilegesController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -95,7 +95,7 @@ class PrivilegesController extends BaseController $privileges = $data->getPrivileges($object, $subject); } - if (sizeof($privileges) > 0) { + if (count($privileges) > 0) { echo '<table>'.PHP_EOL; if ($data->hasRoles()) { echo "<tr><th class=\"data\">{$this->lang['strrole']}</th>"; @@ -150,7 +150,7 @@ class PrivilegesController extends BaseController echo '<td>', $this->misc->printVal($v[3]), '</td>'.PHP_EOL; } echo '</tr>'.PHP_EOL; - ++$i; + $i++; } echo '</table>'; diff --git a/src/controllers/RolesController.php b/src/controllers/RolesController.php index 69741a98..c7dbc4d2 100644 --- a/src/controllers/RolesController.php +++ b/src/controllers/RolesController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class RolesController extends BaseController { diff --git a/src/controllers/RulesController.php b/src/controllers/RulesController.php index 84286d09..8af5b0e8 100644 --- a/src/controllers/RulesController.php +++ b/src/controllers/RulesController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class RulesController extends BaseController { diff --git a/src/controllers/SchemasController.php b/src/controllers/SchemasController.php index 0ecbd6ed..48b4f13e 100644 --- a/src/controllers/SchemasController.php +++ b/src/controllers/SchemasController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class SchemasController extends BaseController { diff --git a/src/controllers/SequencesController.php b/src/controllers/SequencesController.php index 53f1bf4b..719cfc23 100644 --- a/src/controllers/SequencesController.php +++ b/src/controllers/SequencesController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class SequencesController extends BaseController { diff --git a/src/controllers/ServersController.php b/src/controllers/ServersController.php index e186b054..419c9953 100644 --- a/src/controllers/ServersController.php +++ b/src/controllers/ServersController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class ServersController extends BaseController { diff --git a/src/controllers/SqlController.php b/src/controllers/SqlController.php index d143fccf..60844211 100644 --- a/src/controllers/SqlController.php +++ b/src/controllers/SqlController.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; /** * Base controller class. - * - * @package PHPPgAdmin */ class SqlController extends BaseController { @@ -131,7 +129,7 @@ class SqlController extends BaseController // If rows returned, then display the results $num_fields = pg_numfields($rs); echo "<p><table>\n<tr>"; - for ($k = 0; $k < $num_fields; ++$k) { + for ($k = 0; $k < $num_fields; $k++) { echo '<th class="data">', $misc->printVal(pg_fieldname($rs, $k)), '</th>'; } @@ -145,7 +143,7 @@ class SqlController extends BaseController } echo '</tr>'.PHP_EOL; $row = pg_fetch_row($rs); - ++$i; + $i++; } echo '</table><br/>'.PHP_EOL; @@ -218,7 +216,7 @@ class SqlController extends BaseController } echo '</tr>'.PHP_EOL; $rs->moveNext(); - ++$i; + $i++; } echo '</table>'.PHP_EOL; echo '<p>', $rs->recordCount(), " {$this->lang['strrows']}</p>".PHP_EOL; diff --git a/src/controllers/SqleditController.php b/src/controllers/SqleditController.php index 6e329766..0a746623 100644 --- a/src/controllers/SqleditController.php +++ b/src/controllers/SqleditController.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; /** * Base controller class. - * - * @package PHPPgAdmin */ class SqleditController extends BaseController { @@ -46,8 +44,8 @@ class SqleditController extends BaseController $this->printHeader($title, $this->scripts, true, 'header_sqledit.twig'); $this->printBody(true, 'sql_edit'); echo $body_text; - - $this->printFooter(true, 'footer_sqledit.twig'); + $this->container->get('view')->offsetSet('inPopUp', true); + $this->printFooter(true, 'footer_sqledit.twig', true); } /** @@ -67,7 +65,7 @@ class SqleditController extends BaseController $default_html = $this->printTabs($this->misc->getNavTabs('popup'), 'sql', false); - $default_html .= '<form action="'.\SUBFOLDER.'/src/views/sql" method="post" enctype="multipart/form-data" class="sqlform" id="sqlform" target="detail">'; + $default_html .= '<form action="' . \SUBFOLDER . '/src/views/sql" method="post" enctype="multipart/form-data" class="sqlform" id="sqlform" target="detail">'; $default_html .= PHP_EOL; $default_html .= $this->printConnection('sql', false); @@ -77,48 +75,48 @@ class SqleditController extends BaseController $default_html .= '<label>'; $default_html .= $this->misc->printHelp($this->lang['strsearchpath'], 'pg.schema.search_path', false); - $default_html .= ': <input type="text" name="search_path" id="search_path" size="45" value="'.$search_path.'" />'; - $default_html .= '</label>'.PHP_EOL; + $default_html .= ': <input type="text" name="search_path" id="search_path" size="45" value="' . $search_path . '" />'; + $default_html .= '</label>' . PHP_EOL; - $default_html .= '</div>'.PHP_EOL; + $default_html .= '</div>' . PHP_EOL; $default_html .= '<div id="queryedition" style="padding:1%;width:98%;float:left;">'; $default_html .= PHP_EOL; - $default_html .= '<textarea style="width:98%;" rows="10" cols="50" name="query" id="query" resizable="true">'.$sqlquery.'</textarea>'; + $default_html .= '<textarea style="width:98%;" rows="10" cols="50" name="query" id="query" resizable="true">' . $sqlquery . '</textarea>'; $default_html .= PHP_EOL; - $default_html .= '</div>'.PHP_EOL; + $default_html .= '</div>' . PHP_EOL; $default_html .= '<div class="sqledit_bottom_inputs" >'; if (ini_get('file_uploads')) { // Don't show upload option if max size of uploads is zero $max_size = $this->misc->inisizeToBytes(ini_get('upload_max_filesize')); - if (is_double($max_size) && $max_size > 0) { + if (is_float($max_size) && $max_size > 0) { $default_html .= '<p class="upload_sql_script">'; - $default_html .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.$max_size.'" />'; + $default_html .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . $max_size . '" />'; $default_html .= PHP_EOL; - $default_html .= '<label for="script">'.$this->lang['struploadscript'].'</label>'; + $default_html .= '<label for="script">' . $this->lang['struploadscript'] . '</label>'; $default_html .= ' <input class="btn btn-small" id="script" name="script" type="file" /></p>'; - $default_html .= '</p>'.PHP_EOL; + $default_html .= '</p>' . PHP_EOL; } } // Check that file uploads are enabled $checked = (isset($_REQUEST['paginate']) ? ' checked="checked"' : ''); - $default_html .= '<p><input type="submit" class="btn btn-small" name="execute" accesskey="r" value="'.$this->lang['strexecute'].'" />'; + $default_html .= '<p><input type="submit" class="btn btn-small" name="execute" accesskey="r" value="' . $this->lang['strexecute'] . '" />'; $default_html .= PHP_EOL; - $default_html .= '<input type="reset" class="btn btn-small" accesskey="q" value="'.$this->lang['strreset'].'" /></p>'; + $default_html .= '<input type="reset" class="btn btn-small" accesskey="q" value="' . $this->lang['strreset'] . '" /></p>'; $default_html .= PHP_EOL; $default_html .= '<p>'; $default_html .= '<label for="paginate">'; - $default_html .= '<input type="checkbox" id="paginate" name="paginate"'.$checked.' /> '.$this->lang['strpaginate'].' '; - $default_html .= '</label>'.PHP_EOL; - $default_html .= '</p>'.PHP_EOL; + $default_html .= '<input type="checkbox" id="paginate" name="paginate"' . $checked . ' /> ' . $this->lang['strpaginate'] . ' '; + $default_html .= '</label>' . PHP_EOL; + $default_html .= '</p>' . PHP_EOL; - $default_html .= '</div>'.PHP_EOL; + $default_html .= '</div>' . PHP_EOL; $default_html .= '</form>'; $default_html .= PHP_EOL; @@ -173,9 +171,9 @@ class SqleditController extends BaseController $default_html = $this->printTabs($this->misc->getNavTabs('popup'), 'find', false); - $default_html .= '<form action="database" method="post" target="detail">'.PHP_EOL; + $default_html .= '<form action="database" method="post" target="detail">' . PHP_EOL; $default_html .= $this->printConnection('find', false); - $default_html .= '<p><input class="focusme" name="term" id="term" value="'.htmlspecialchars($_REQUEST['term'])."\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" />".PHP_EOL; + $default_html .= '<p><input class="focusme" name="term" id="term" value="' . htmlspecialchars($_REQUEST['term']) . "\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" />" . PHP_EOL; $filters = $this->_getFilters(); $advanced_filters = $this->_getAdvancedFilters(); @@ -189,22 +187,22 @@ class SqleditController extends BaseController } // Output list of filters. This is complex due to all the 'has' and 'conf' feature possibilities - $default_html .= "<select id='filter' name=\"filter\">".PHP_EOL; - $default_html .= sprintf('%s<option value=""'.('' == $_REQUEST['filter'] ? ' selected="selected" ' : '').">{$this->lang['strallobjects']}</option>".PHP_EOL, "\t"); + $default_html .= "<select id='filter' name=\"filter\">" . PHP_EOL; + $default_html .= sprintf('%s<option value=""' . ('' == $_REQUEST['filter'] ? ' selected="selected" ' : '') . ">{$this->lang['strallobjects']}</option>" . PHP_EOL, "\t"); foreach ($filters as $type => $props) { - $default_html .= sprintf('%s<option value="%s" %s >%s</option>'.PHP_EOL, "\t", $type, $props['selected'], $this->lang[$props['langkey']]); + $default_html .= sprintf('%s<option value="%s" %s >%s</option>' . PHP_EOL, "\t", $type, $props['selected'], $this->lang[$props['langkey']]); } if ($this->conf['show_advanced']) { foreach ($advanced_filters as $type => $props) { - $default_html .= sprintf('%s<option value="%s" %s >%s</option>'.PHP_EOL, "\t", $type, $props['selected'], $this->lang[$props['langkey']]); + $default_html .= sprintf('%s<option value="%s" %s >%s</option>' . PHP_EOL, "\t", $type, $props['selected'], $this->lang[$props['langkey']]); } } - $default_html .= '</select>'.PHP_EOL; + $default_html .= '</select>' . PHP_EOL; - $default_html .= "<input type=\"submit\" value=\"{$this->lang['strfind']}\" />".PHP_EOL; - $default_html .= '<input type="hidden" name="action" value="find" /></p>'.PHP_EOL; - $default_html .= '</form>'.PHP_EOL; + $default_html .= "<input type=\"submit\" value=\"{$this->lang['strfind']}\" />" . PHP_EOL; + $default_html .= '<input type="hidden" name="action" value="find" /></p>' . PHP_EOL; + $default_html .= '</form>' . PHP_EOL; // Default focus $this->setFocus('forms[0].term'); diff --git a/src/controllers/TablesController.php b/src/controllers/TablesController.php index 329f99bd..cd273b6e 100644 --- a/src/controllers/TablesController.php +++ b/src/controllers/TablesController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class TablesController extends BaseController { @@ -142,7 +140,7 @@ class TablesController extends BaseController 'table' => [ 'title' => $this->lang['strtable'], 'field' => Decorator::field('relname'), - 'url' => \SUBFOLDER."/redirect/table?{$this->misc->href}&", + 'url' => \SUBFOLDER . "/redirect/table?{$this->misc->href}&", 'vars' => ['table' => 'relname'], ], 'owner' => [ @@ -323,8 +321,6 @@ class TablesController extends BaseController //\Kint::dump($tables); - echo $this->printTable($tables, $columns, $actions, $this->table_place, $this->lang['strnotables']); - $navlinks = [ 'create' => [ 'attr' => [ @@ -358,7 +354,15 @@ class TablesController extends BaseController 'content' => $this->lang['strcreatetablelike'], ]; } - $this->printNavLinks($navlinks, 'tables-tables', get_defined_vars()); + $tablesContent = $this->printTable( + $tables, + $columns, + $actions, + $this->table_place, + $this->lang['strnotables'] + ); + + $navLinks = $this->printNavLinks($navlinks, 'tables-tables', get_defined_vars(), false); } public function displayJson() @@ -469,46 +473,46 @@ class TablesController extends BaseController $this->printTitle($this->lang['strcreatetable'], 'pg.table.create'); $this->printMsg($msg); - echo '<form action="'.\SUBFOLDER.'/src/views/'.$this->script.'" method="post">'; + echo '<form action="' . \SUBFOLDER . '/src/views/' . $this->script . '" method="post">'; echo PHP_EOL; - echo '<table>'.PHP_EOL; - echo "\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strname']}</th>".PHP_EOL; + echo '<table>' . PHP_EOL; + echo "\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strname']}</th>" . PHP_EOL; echo "\t\t<td class=\"data\"><input name=\"name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"", - htmlspecialchars($_REQUEST['name']), "\" /></td>\n\t</tr>".PHP_EOL; - echo "\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strnumcols']}</th>".PHP_EOL; + htmlspecialchars($_REQUEST['name']), "\" /></td>\n\t</tr>" . PHP_EOL; + echo "\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strnumcols']}</th>" . PHP_EOL; echo "\t\t<td class=\"data\"><input name=\"fields\" size=\"5\" maxlength=\"{$data->_maxNameLen}\" value=\"", - htmlspecialchars($_REQUEST['fields']), "\" /></td>\n\t</tr>".PHP_EOL; - echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['stroptions']}</th>".PHP_EOL; - echo "\t\t<td class=\"data\"><label for=\"withoutoids\"><input type=\"checkbox\" id=\"withoutoids\" name=\"withoutoids\"", isset($_REQUEST['withoutoids']) ? ' checked="checked"' : '', " />WITHOUT OIDS</label></td>\n\t</tr>".PHP_EOL; + htmlspecialchars($_REQUEST['fields']), "\" /></td>\n\t</tr>" . PHP_EOL; + echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['stroptions']}</th>" . PHP_EOL; + echo "\t\t<td class=\"data\"><label for=\"withoutoids\"><input type=\"checkbox\" id=\"withoutoids\" name=\"withoutoids\"", isset($_REQUEST['withoutoids']) ? ' checked="checked"' : '', " />WITHOUT OIDS</label></td>\n\t</tr>" . PHP_EOL; // Tablespace (if there are any) if ($data->hasTablespaces() && $tablespaces->recordCount() > 0) { - echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['strtablespace']}</th>".PHP_EOL; - echo "\t\t<td class=\"data1\">\n\t\t\t<select name=\"spcname\">".PHP_EOL; + echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['strtablespace']}</th>" . PHP_EOL; + echo "\t\t<td class=\"data1\">\n\t\t\t<select name=\"spcname\">" . PHP_EOL; // Always offer the default (empty) option echo "\t\t\t\t<option value=\"\"", - ('' == $_REQUEST['spcname']) ? ' selected="selected"' : '', '></option>'.PHP_EOL; + ('' == $_REQUEST['spcname']) ? ' selected="selected"' : '', '></option>' . PHP_EOL; // Display all other tablespaces while (!$tablespaces->EOF) { $spcname = htmlspecialchars($tablespaces->fields['spcname']); echo "\t\t\t\t<option value=\"{$spcname}\"", - ($tablespaces->fields['spcname'] == $_REQUEST['spcname']) ? ' selected="selected"' : '', ">{$spcname}</option>".PHP_EOL; + ($tablespaces->fields['spcname'] == $_REQUEST['spcname']) ? ' selected="selected"' : '', ">{$spcname}</option>" . PHP_EOL; $tablespaces->moveNext(); } - echo "\t\t\t</select>\n\t\t</td>\n\t</tr>".PHP_EOL; + echo "\t\t\t</select>\n\t\t</td>\n\t</tr>" . PHP_EOL; } - echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['strcomment']}</th>".PHP_EOL; + echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['strcomment']}</th>" . PHP_EOL; echo "\t\t<td><textarea name=\"tblcomment\" rows=\"3\" cols=\"32\">", - htmlspecialchars($_REQUEST['tblcomment']), "</textarea></td>\n\t</tr>".PHP_EOL; + htmlspecialchars($_REQUEST['tblcomment']), "</textarea></td>\n\t</tr>" . PHP_EOL; - echo '</table>'.PHP_EOL; - echo '<p><input type="hidden" name="action" value="create" />'.PHP_EOL; - echo '<input type="hidden" name="stage" value="2" />'.PHP_EOL; + echo '</table>' . PHP_EOL; + echo '<p><input type="hidden" name="action" value="create" />' . PHP_EOL; + echo '<input type="hidden" name="stage" value="2" />' . PHP_EOL; echo $this->misc->form; - echo "<input type=\"submit\" value=\"{$this->lang['strnext']}\" />".PHP_EOL; - echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" /></p>".PHP_EOL; - echo '</form>'.PHP_EOL; + echo "<input type=\"submit\" value=\"{$this->lang['strnext']}\" />" . PHP_EOL; + echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" /></p>" . PHP_EOL; + echo '</form>' . PHP_EOL; break; case 2: @@ -534,17 +538,17 @@ class TablesController extends BaseController $this->printTitle($this->lang['strcreatetable'], 'pg.table.create'); $this->printMsg($msg); - echo '<script src="'.\SUBFOLDER.'/assets/js/tables.js" type="text/javascript"></script>'; - echo '<form action="'.\SUBFOLDER.'/src/views/tables" method="post">'.PHP_EOL; + echo '<script src="' . \SUBFOLDER . '/assets/js/tables.js" type="text/javascript"></script>'; + echo '<form action="' . \SUBFOLDER . '/src/views/tables" method="post">' . PHP_EOL; // Output table header - echo '<table>'.PHP_EOL; + echo '<table>' . PHP_EOL; echo "\t<tr><th colspan=\"2\" class=\"data required\">{$this->lang['strcolumn']}</th><th colspan=\"2\" class=\"data required\">{$this->lang['strtype']}</th>"; echo "<th class=\"data\">{$this->lang['strlength']}</th><th class=\"data\">{$this->lang['strnotnull']}</th>"; echo "<th class=\"data\">{$this->lang['struniquekey']}</th><th class=\"data\">{$this->lang['strprimarykey']}</th>"; - echo "<th class=\"data\">{$this->lang['strdefault']}</th><th class=\"data\">{$this->lang['strcomment']}</th></tr>".PHP_EOL; + echo "<th class=\"data\">{$this->lang['strdefault']}</th><th class=\"data\">{$this->lang['strcomment']}</th></tr>" . PHP_EOL; - for ($i = 0; $i < $_REQUEST['fields']; ++$i) { + for ($i = 0; $i < $_REQUEST['fields']; $i++) { if (!isset($_REQUEST['field'][$i])) { $_REQUEST['field'][$i] = ''; } @@ -561,16 +565,16 @@ class TablesController extends BaseController $_REQUEST['colcomment'][$i] = ''; } - echo "\t<tr>\n\t\t<td>", $i + 1, '. </td>'.PHP_EOL; + echo "\t<tr>\n\t\t<td>", $i + 1, '. </td>' . PHP_EOL; echo "\t\t<td><input name=\"field[{$i}]\" size=\"16\" maxlength=\"{$data->_maxNameLen}\" value=\"", - htmlspecialchars($_REQUEST['field'][$i]), '" /></td>'.PHP_EOL; - echo "\t\t<td>\n\t\t\t<select name=\"type[{$i}]\" class=\"select2\" id=\"types{$i}\" onchange=\"checkLengths(this.options[this.selectedIndex].value,{$i});\">".PHP_EOL; + htmlspecialchars($_REQUEST['field'][$i]), '" /></td>' . PHP_EOL; + echo "\t\t<td>\n\t\t\t<select name=\"type[{$i}]\" class=\"select2\" id=\"types{$i}\" onchange=\"checkLengths(this.options[this.selectedIndex].value,{$i});\">" . PHP_EOL; // Output any "magic" types foreach ($data->extraTypes as $v) { $types_for_js[strtolower($v)] = 1; echo "\t\t\t\t<option value=\"", htmlspecialchars($v), '"', (isset($_REQUEST['type'][$i]) && $_REQUEST['type'][$i] == $v) ? ' selected="selected"' : '', '>', - $this->misc->printVal($v), '</option>'.PHP_EOL; + $this->misc->printVal($v), '</option>' . PHP_EOL; } $types->moveFirst(); while (!$types->EOF) { @@ -578,7 +582,7 @@ class TablesController extends BaseController $types_for_js[$typname] = 1; echo "\t\t\t\t<option value=\"", htmlspecialchars($typname), '"', (isset($_REQUEST['type'][$i]) && $_REQUEST['type'][$i] == $typname) ? ' selected="selected"' : '', '>', - $this->misc->printVal($typname), '</option>'.PHP_EOL; + $this->misc->printVal($typname), '</option>' . PHP_EOL; $types->moveNext(); } echo "\t\t\t</select>\n\t\t\n"; @@ -589,46 +593,46 @@ class TablesController extends BaseController foreach ($predefined_size_types as $value) { $escaped_predef_types[] = "'{$value}'"; } - echo '<script type="text/javascript">predefined_lengths = new Array('.implode(',', $escaped_predef_types).");</script>\n\t</td>"; + echo '<script type="text/javascript">predefined_lengths = new Array(' . implode(',', $escaped_predef_types) . ");</script>\n\t</td>"; } // Output array type selector - echo "\t\t<td>\n\t\t\t<select name=\"array[{$i}]\">".PHP_EOL; - echo "\t\t\t\t<option value=\"\"", (isset($_REQUEST['array'][$i]) && $_REQUEST['array'][$i] == '') ? ' selected="selected"' : '', '></option>'.PHP_EOL; - echo "\t\t\t\t<option value=\"[]\"", (isset($_REQUEST['array'][$i]) && $_REQUEST['array'][$i] == '[]') ? ' selected="selected"' : '', '>[ ]</option>'.PHP_EOL; - echo "\t\t\t</select>\n\t\t</td>".PHP_EOL; + echo "\t\t<td>\n\t\t\t<select name=\"array[{$i}]\">" . PHP_EOL; + echo "\t\t\t\t<option value=\"\"", (isset($_REQUEST['array'][$i]) && $_REQUEST['array'][$i] == '') ? ' selected="selected"' : '', '></option>' . PHP_EOL; + echo "\t\t\t\t<option value=\"[]\"", (isset($_REQUEST['array'][$i]) && $_REQUEST['array'][$i] == '[]') ? ' selected="selected"' : '', '>[ ]</option>' . PHP_EOL; + echo "\t\t\t</select>\n\t\t</td>" . PHP_EOL; echo "\t\t<td><input name=\"length[{$i}]\" id=\"lengths{$i}\" size=\"10\" value=\"", - htmlspecialchars($_REQUEST['length'][$i]), '" /></td>'.PHP_EOL; - echo "\t\t<td><input type=\"checkbox\" name=\"notnull[{$i}]\"", (isset($_REQUEST['notnull'][$i])) ? ' checked="checked"' : '', ' /></td>'.PHP_EOL; + htmlspecialchars($_REQUEST['length'][$i]), '" /></td>' . PHP_EOL; + echo "\t\t<td><input type=\"checkbox\" name=\"notnull[{$i}]\"", (isset($_REQUEST['notnull'][$i])) ? ' checked="checked"' : '', ' /></td>' . PHP_EOL; echo "\t\t<td style=\"text-align: center\"><input type=\"checkbox\" name=\"uniquekey[{$i}]\"" - .(isset($_REQUEST['uniquekey'][$i]) ? ' checked="checked"' : '').' /></td>'.PHP_EOL; + . (isset($_REQUEST['uniquekey'][$i]) ? ' checked="checked"' : '') . ' /></td>' . PHP_EOL; echo "\t\t<td style=\"text-align: center\"><input type=\"checkbox\" name=\"primarykey[{$i}]\" " - .(isset($_REQUEST['primarykey'][$i]) ? ' checked="checked"' : '') - .' /></td>'.PHP_EOL; + . (isset($_REQUEST['primarykey'][$i]) ? ' checked="checked"' : '') + . ' /></td>' . PHP_EOL; echo "\t\t<td><input name=\"default[{$i}]\" size=\"20\" value=\"", - htmlspecialchars($_REQUEST['default'][$i]), '" /></td>'.PHP_EOL; + htmlspecialchars($_REQUEST['default'][$i]), '" /></td>' . PHP_EOL; echo "\t\t<td><input name=\"colcomment[{$i}]\" size=\"40\" value=\"", htmlspecialchars($_REQUEST['colcomment'][$i]), "\" /> <script type=\"text/javascript\">checkLengths(document.getElementById('types{$i}').value,{$i});</script> - </td>\n\t</tr>".PHP_EOL; + </td>\n\t</tr>" . PHP_EOL; } - echo '</table>'.PHP_EOL; - echo '<p><input type="hidden" name="action" value="create" />'.PHP_EOL; - echo '<input type="hidden" name="stage" value="3" />'.PHP_EOL; + echo '</table>' . PHP_EOL; + echo '<p><input type="hidden" name="action" value="create" />' . PHP_EOL; + echo '<input type="hidden" name="stage" value="3" />' . PHP_EOL; echo $this->misc->form; - echo '<input type="hidden" name="name" value="', htmlspecialchars($_REQUEST['name']), '" />'.PHP_EOL; - echo '<input type="hidden" name="fields" value="', htmlspecialchars($_REQUEST['fields']), '" />'.PHP_EOL; + echo '<input type="hidden" name="name" value="', htmlspecialchars($_REQUEST['name']), '" />' . PHP_EOL; + echo '<input type="hidden" name="fields" value="', htmlspecialchars($_REQUEST['fields']), '" />' . PHP_EOL; if (isset($_REQUEST['withoutoids'])) { - echo '<input type="hidden" name="withoutoids" value="true" />'.PHP_EOL; + echo '<input type="hidden" name="withoutoids" value="true" />' . PHP_EOL; } - echo '<input type="hidden" name="tblcomment" value="', htmlspecialchars($_REQUEST['tblcomment']), '" />'.PHP_EOL; + echo '<input type="hidden" name="tblcomment" value="', htmlspecialchars($_REQUEST['tblcomment']), '" />' . PHP_EOL; if (isset($_REQUEST['spcname'])) { - echo '<input type="hidden" name="spcname" value="', htmlspecialchars($_REQUEST['spcname']), '" />'.PHP_EOL; + echo '<input type="hidden" name="spcname" value="', htmlspecialchars($_REQUEST['spcname']), '" />' . PHP_EOL; } - echo "<input type=\"submit\" value=\"{$this->lang['strcreate']}\" />".PHP_EOL; - echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" /></p>".PHP_EOL; - echo '</form>'.PHP_EOL; + echo "<input type=\"submit\" value=\"{$this->lang['strcreate']}\" />" . PHP_EOL; + echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" /></p>" . PHP_EOL; + echo '</form>' . PHP_EOL; break; case 3: @@ -693,7 +697,7 @@ class TablesController extends BaseController break; default: - echo "<p>{$this->lang['strinvalidparam']}</p>".PHP_EOL; + echo "<p>{$this->lang['strinvalidparam']}</p>" . PHP_EOL; } } @@ -736,13 +740,13 @@ class TablesController extends BaseController unset($tbltmp); - echo '<form action="'.\SUBFOLDER.'/src/views/tables" method="post">'.PHP_EOL; - echo "<table>\n\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strname']}</th>".PHP_EOL; - echo "\t\t<td class=\"data\"><input name=\"name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"", htmlspecialchars($_REQUEST['name']), "\" /></td>\n\t</tr>".PHP_EOL; - echo "\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strcreatetablelikeparent']}</th>".PHP_EOL; + echo '<form action="' . \SUBFOLDER . '/src/views/tables" method="post">' . PHP_EOL; + echo "<table>\n\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strname']}</th>" . PHP_EOL; + echo "\t\t<td class=\"data\"><input name=\"name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"", htmlspecialchars($_REQUEST['name']), "\" /></td>\n\t</tr>" . PHP_EOL; + echo "\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strcreatetablelikeparent']}</th>" . PHP_EOL; echo "\t\t<td class=\"data\">"; echo \PHPPgAdmin\XHtml\HTMLController::printCombo($tables, 'like', true, $tblsel, false); - echo "</td>\n\t</tr>".PHP_EOL; + echo "</td>\n\t</tr>" . PHP_EOL; if ($data->hasTablespaces()) { $tblsp_ = $data->getTablespaces(); if ($tblsp_->recordCount() > 0) { @@ -752,10 +756,10 @@ class TablesController extends BaseController $tblsp[$a['spcname']] = $a['spcname']; } - echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['strtablespace']}</th>".PHP_EOL; + echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['strtablespace']}</th>" . PHP_EOL; echo "\t\t<td class=\"data\">"; echo \PHPPgAdmin\XHtml\HTMLController::printCombo($tblsp, 'tablespace', true, $_REQUEST['tablespace'], false); - echo "</td>\n\t</tr>".PHP_EOL; + echo "</td>\n\t</tr>" . PHP_EOL; } } echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['stroptions']}</th>\n\t\t<td class=\"data\">"; @@ -772,14 +776,14 @@ class TablesController extends BaseController isset($_REQUEST['withindexes']) ? ' checked="checked"' : '', "/>{$this->lang['strcreatelikewithindexes']}</label>"; } - echo "</td>\n\t</tr>".PHP_EOL; + echo "</td>\n\t</tr>" . PHP_EOL; echo '</table>'; - echo '<input type="hidden" name="action" value="confcreatelike" />'.PHP_EOL; + echo '<input type="hidden" name="action" value="confcreatelike" />' . PHP_EOL; echo $this->misc->form; - echo "<p><input type=\"submit\" value=\"{$this->lang['strcreate']}\" />".PHP_EOL; - echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" /></p>".PHP_EOL; - echo '</form>'.PHP_EOL; + echo "<p><input type=\"submit\" value=\"{$this->lang['strcreate']}\" />" . PHP_EOL; + echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" /></p>" . PHP_EOL; + echo '</form>' . PHP_EOL; } else { if ('' == trim($_REQUEST['name'])) { $this->doCreateLike(false, $this->lang['strtableneedsname']); @@ -831,10 +835,10 @@ class TablesController extends BaseController $attrs = $data->getTableAttributes($_REQUEST['table']); - echo '<form action="'.\SUBFOLDER.'/src/views/tables" method="post" id="selectform">'.PHP_EOL; + echo '<form action="' . \SUBFOLDER . '/src/views/tables" method="post" id="selectform">' . PHP_EOL; if ($attrs->recordCount() > 0) { // JavaScript for select all feature - echo '<script type="text/javascript">'.PHP_EOL; + echo '<script type="text/javascript">' . PHP_EOL; echo "//<![CDATA[\n"; echo " function selectAll() {\n"; echo " for (var i=0; i<document.getElementById('selectform').elements.length; i++) {\n"; @@ -842,10 +846,10 @@ class TablesController extends BaseController echo " if (e.name.indexOf('show') == 0) e.checked = document.getElementById('selectform').selectall.checked;\n"; echo " }\n"; echo " }\n"; - echo '//]]>'.PHP_EOL; - echo '</script>'.PHP_EOL; + echo '//]]>' . PHP_EOL; + echo '</script>' . PHP_EOL; - echo '<table>'.PHP_EOL; + echo '<table>' . PHP_EOL; // Output table header echo "<tr><th class=\"data\">{$this->lang['strshow']}</th><th class=\"data\">{$this->lang['strcolumn']}</th>"; @@ -866,42 +870,42 @@ class TablesController extends BaseController // Continue drawing row $id = (0 == ($i % 2) ? '1' : '2'); - echo "<tr class=\"data{$id}\">".PHP_EOL; + echo "<tr class=\"data{$id}\">" . PHP_EOL; echo '<td style="white-space:nowrap;">'; echo '<input type="checkbox" name="show[', htmlspecialchars($attrs->fields['attname']), ']"', isset($_REQUEST['show'][$attrs->fields['attname']]) ? ' checked="checked"' : '', ' /></td>'; echo '<td style="white-space:nowrap;">', $this->misc->printVal($attrs->fields['attname']), '</td>'; echo '<td style="white-space:nowrap;">', $this->misc->printVal($data->formatType($attrs->fields['type'], $attrs->fields['atttypmod'])), '</td>'; echo '<td style="white-space:nowrap;">'; - echo "<select name=\"ops[{$attrs->fields['attname']}]\">".PHP_EOL; + echo "<select name=\"ops[{$attrs->fields['attname']}]\">" . PHP_EOL; foreach (array_keys($data->selectOps) as $v) { echo '<option value="', htmlspecialchars($v), '"', ($_REQUEST['ops'][$attrs->fields['attname']] == $v) ? ' selected="selected"' : '', - '>', htmlspecialchars($v), '</option>'.PHP_EOL; + '>', htmlspecialchars($v), '</option>' . PHP_EOL; } - echo "</select>\n</td>".PHP_EOL; + echo "</select>\n</td>" . PHP_EOL; echo '<td style="white-space:nowrap;">', $data->printField( "values[{$attrs->fields['attname']}]", $_REQUEST['values'][$attrs->fields['attname']], $attrs->fields['type'] ), '</td>'; - echo '</tr>'.PHP_EOL; - ++$i; + echo '</tr>' . PHP_EOL; + $i++; $attrs->moveNext(); } // Select all checkbox echo "<tr><td colspan=\"5\"><input type=\"checkbox\" id=\"selectall\" name=\"selectall\" accesskey=\"a\" onclick=\"javascript:selectAll()\" /><label for=\"selectall\">{$this->lang['strselectallfields']}</label></td>"; - echo '</tr></table>'.PHP_EOL; + echo '</tr></table>' . PHP_EOL; } else { - echo "<p>{$this->lang['strinvalidparam']}</p>".PHP_EOL; + echo "<p>{$this->lang['strinvalidparam']}</p>" . PHP_EOL; } - echo '<p><input type="hidden" name="action" value="selectrows" />'.PHP_EOL; - echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />'.PHP_EOL; - echo '<input type="hidden" name="subject" value="table" />'.PHP_EOL; + echo '<p><input type="hidden" name="action" value="selectrows" />' . PHP_EOL; + echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />' . PHP_EOL; + echo '<input type="hidden" name="subject" value="table" />' . PHP_EOL; echo $this->misc->form; - echo "<input type=\"submit\" name=\"select\" accesskey=\"r\" value=\"{$this->lang['strselect']}\" />".PHP_EOL; - echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" /></p>".PHP_EOL; - echo '</form>'.PHP_EOL; + echo "<input type=\"submit\" name=\"select\" accesskey=\"r\" value=\"{$this->lang['strselect']}\" />" . PHP_EOL; + echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" /></p>" . PHP_EOL; + echo '</form>' . PHP_EOL; return; } @@ -920,7 +924,7 @@ class TablesController extends BaseController } } - if (0 == sizeof($_POST['show'])) { + if (0 == count($_POST['show'])) { $this->doSelectRows(true, $this->lang['strselectneedscol']); } else { // Generate query SQL @@ -963,9 +967,9 @@ class TablesController extends BaseController $this->coalesceArr($_REQUEST, 'nulls', []); $this->coalesceArr($_REQUEST, 'format', []); - echo '<form action="'.\SUBFOLDER.'/src/views/tables" method="post" id="ac_form">'.PHP_EOL; + echo '<form action="' . \SUBFOLDER . '/src/views/tables" method="post" id="ac_form">' . PHP_EOL; if ($attrs->recordCount() > 0) { - echo '<table>'.PHP_EOL; + echo '<table>' . PHP_EOL; // Output table header echo "<tr><th class=\"data\">{$this->lang['strcolumn']}</th><th class=\"data\">{$this->lang['strtype']}</th>"; @@ -993,17 +997,17 @@ class TablesController extends BaseController // Continue drawing row $id = (0 == ($i % 2) ? '1' : '2'); - echo "<tr class=\"data{$id}\">".PHP_EOL; + echo "<tr class=\"data{$id}\">" . PHP_EOL; echo '<td style="white-space:nowrap;">', $this->misc->printVal($attrs->fields['attname']), '</td>'; - echo '<td style="white-space:nowrap;">'.PHP_EOL; + echo '<td style="white-space:nowrap;">' . PHP_EOL; echo $this->misc->printVal($data->formatType($attrs->fields['type'], $attrs->fields['atttypmod'])); echo "<input type=\"hidden\" name=\"types[{$attrs->fields['attnum']}]\" value=\"", htmlspecialchars($attrs->fields['type']), '" /></td>'; - echo '<td style="white-space:nowrap;">'.PHP_EOL; - echo "<select name=\"format[{$attrs->fields['attnum']}]\">".PHP_EOL; - echo '<option value="VALUE"', ($_REQUEST['format'][$attrs->fields['attnum']] == 'VALUE') ? ' selected="selected"' : '', ">{$this->lang['strvalue']}</option>".PHP_EOL; - echo '<option value="EXPRESSION"', ($_REQUEST['format'][$attrs->fields['attnum']] == 'EXPRESSION') ? ' selected="selected"' : '', ">{$this->lang['strexpression']}</option>".PHP_EOL; - echo "</select>\n</td>".PHP_EOL; + echo '<td style="white-space:nowrap;">' . PHP_EOL; + echo "<select name=\"format[{$attrs->fields['attnum']}]\">" . PHP_EOL; + echo '<option value="VALUE"', ($_REQUEST['format'][$attrs->fields['attnum']] == 'VALUE') ? ' selected="selected"' : '', ">{$this->lang['strvalue']}</option>" . PHP_EOL; + echo '<option value="EXPRESSION"', ($_REQUEST['format'][$attrs->fields['attnum']] == 'EXPRESSION') ? ' selected="selected"' : '', ">{$this->lang['strexpression']}</option>" . PHP_EOL; + echo "</select>\n</td>" . PHP_EOL; echo '<td style="white-space:nowrap;">'; // Output null box if the column allows nulls (doesn't look at CHECKs or ASSERTIONS) if (!$attrs->fields['attnotnull']) { @@ -1029,40 +1033,40 @@ class TablesController extends BaseController } else { echo $data->printField("values[{$attrs->fields['attnum']}]", $_REQUEST['values'][$attrs->fields['attnum']], $attrs->fields['type'], ['class' => 'insert_row_input']); } - echo '</td>'.PHP_EOL; - echo '</tr>'.PHP_EOL; - ++$i; + echo '</td>' . PHP_EOL; + echo '</tr>' . PHP_EOL; + $i++; $attrs->moveNext(); } - echo '</table>'.PHP_EOL; + echo '</table>' . PHP_EOL; if (!isset($_SESSION['counter'])) { $_SESSION['counter'] = 0; } - echo '<input type="hidden" name="action" value="insertrow" />'.PHP_EOL; - echo '<input type="hidden" name="fields" value="', htmlentities(serialize($fields), ENT_QUOTES, 'UTF-8'), '" />'.PHP_EOL; - echo '<input type="hidden" name="protection_counter" value="'.$_SESSION['counter'].'" />'.PHP_EOL; - echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />'.PHP_EOL; - echo "<p><input type=\"submit\" name=\"insert\" value=\"{$this->lang['strinsert']}\" />".PHP_EOL; - echo "<input type=\"submit\" name=\"insertandrepeat\" accesskey=\"r\" value=\"{$this->lang['strinsertandrepeat']}\" />".PHP_EOL; - echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />".PHP_EOL; + echo '<input type="hidden" name="action" value="insertrow" />' . PHP_EOL; + echo '<input type="hidden" name="fields" value="', htmlentities(serialize($fields), ENT_QUOTES, 'UTF-8'), '" />' . PHP_EOL; + echo '<input type="hidden" name="protection_counter" value="' . $_SESSION['counter'] . '" />' . PHP_EOL; + echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />' . PHP_EOL; + echo "<p><input type=\"submit\" name=\"insert\" value=\"{$this->lang['strinsert']}\" />" . PHP_EOL; + echo "<input type=\"submit\" name=\"insertandrepeat\" accesskey=\"r\" value=\"{$this->lang['strinsertandrepeat']}\" />" . PHP_EOL; + echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />" . PHP_EOL; if (false !== $fksprops) { if ('default off' != $this->conf['autocomplete']) { - echo "<input type=\"checkbox\" id=\"no_ac\" value=\"1\" checked=\"checked\" /><label for=\"no_ac\">{$this->lang['strac']}</label>".PHP_EOL; + echo "<input type=\"checkbox\" id=\"no_ac\" value=\"1\" checked=\"checked\" /><label for=\"no_ac\">{$this->lang['strac']}</label>" . PHP_EOL; } else { - echo "<input type=\"checkbox\" id=\"no_ac\" value=\"0\" /><label for=\"no_ac\">{$this->lang['strac']}</label>".PHP_EOL; + echo "<input type=\"checkbox\" id=\"no_ac\" value=\"0\" /><label for=\"no_ac\">{$this->lang['strac']}</label>" . PHP_EOL; } } - echo '</p>'.PHP_EOL; + echo '</p>' . PHP_EOL; } else { - echo "<p>{$this->lang['strnofieldsforinsert']}</p>".PHP_EOL; - echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />".PHP_EOL; + echo "<p>{$this->lang['strnofieldsforinsert']}</p>" . PHP_EOL; + echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />" . PHP_EOL; } echo $this->misc->form; - echo '</form>'.PHP_EOL; - echo '<script src="'.\SUBFOLDER.'/assets/js/insert_or_edit_row.js" type="text/javascript"></script>'; + echo '</form>' . PHP_EOL; + echo '<script src="' . \SUBFOLDER . '/assets/js/insert_or_edit_row.js" type="text/javascript"></script>'; } /** @@ -1114,29 +1118,29 @@ class TablesController extends BaseController $this->printTrail('schema'); $this->printTitle($this->lang['strempty'], 'pg.table.empty'); - echo '<form action="'.\SUBFOLDER.'/src/views/tables" method="post">'.PHP_EOL; + echo '<form action="' . \SUBFOLDER . '/src/views/tables" method="post">' . PHP_EOL; foreach ($_REQUEST['ma'] as $v) { $a = unserialize(htmlspecialchars_decode($v, ENT_QUOTES)); - echo '<p>'.sprintf($this->lang['strconfemptytable'], $this->misc->printVal($a['table'])); + echo '<p>' . sprintf($this->lang['strconfemptytable'], $this->misc->printVal($a['table'])); - echo '</p>'.PHP_EOL; + echo '</p>' . PHP_EOL; printf('<input type="hidden" name="table[]" value="%s" />', htmlspecialchars($a['table'])); } // END mutli empty } else { $this->printTrail('table'); $this->printTitle($this->lang['strempty'], 'pg.table.empty'); - echo '<p>', sprintf($this->lang['strconfemptytable'], $this->misc->printVal($_REQUEST['table'])), '</p>'.PHP_EOL; + echo '<p>', sprintf($this->lang['strconfemptytable'], $this->misc->printVal($_REQUEST['table'])), '</p>' . PHP_EOL; - echo '<form action="'.\SUBFOLDER.'/src/views/tables" method="post">'.PHP_EOL; + echo '<form action="' . \SUBFOLDER . '/src/views/tables" method="post">' . PHP_EOL; - echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />'.PHP_EOL; + echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />' . PHP_EOL; // END not mutli empty } echo "<input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$this->lang['strcascade']}</label>"; - echo '<input type="hidden" name="action" value="empty" />'.PHP_EOL; + echo '<input type="hidden" name="action" value="empty" />' . PHP_EOL; echo $this->misc->form; - echo "<input type=\"submit\" name=\"empty\" value=\"{$this->lang['strempty']}\" /> <input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />".PHP_EOL; + echo "<input type=\"submit\" name=\"empty\" value=\"{$this->lang['strempty']}\" /> <input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />" . PHP_EOL; echo "</form>\n"; // END if confirm } else { // Do Empty @@ -1163,7 +1167,7 @@ class TablesController extends BaseController return $this->doDefault($msg); } - return $this->doDefault($sql.'<br>'.$this->lang['strtableemptiedbad']); + return $this->doDefault($sql . '<br>' . $this->lang['strtableemptiedbad']); // END not mutli empty } // END do Empty @@ -1189,28 +1193,28 @@ class TablesController extends BaseController $this->printTrail('schema'); $this->printTitle($this->lang['strdrop'], 'pg.table.drop'); - echo '<form action="'.\SUBFOLDER.'/src/views/tables" method="post">'.PHP_EOL; + echo '<form action="' . \SUBFOLDER . '/src/views/tables" method="post">' . PHP_EOL; foreach ($_REQUEST['ma'] as $v) { $a = unserialize(htmlspecialchars_decode($v, ENT_QUOTES)); - echo '<p>', sprintf($this->lang['strconfdroptable'], $this->misc->printVal($a['table'])), '</p>'.PHP_EOL; + echo '<p>', sprintf($this->lang['strconfdroptable'], $this->misc->printVal($a['table'])), '</p>' . PHP_EOL; printf('<input type="hidden" name="table[]" value="%s" />', htmlspecialchars($a['table'])); } } else { $this->printTrail('table'); $this->printTitle($this->lang['strdrop'], 'pg.table.drop'); - echo '<p>', sprintf($this->lang['strconfdroptable'], $this->misc->printVal($_REQUEST['table'])), '</p>'.PHP_EOL; + echo '<p>', sprintf($this->lang['strconfdroptable'], $this->misc->printVal($_REQUEST['table'])), '</p>' . PHP_EOL; - echo '<form action="'.\SUBFOLDER.'/src/views/tables" method="post">'.PHP_EOL; - echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />'.PHP_EOL; + echo '<form action="' . \SUBFOLDER . '/src/views/tables" method="post">' . PHP_EOL; + echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />' . PHP_EOL; // END if multi drop } - echo '<input type="hidden" name="action" value="drop" />'.PHP_EOL; + echo '<input type="hidden" name="action" value="drop" />' . PHP_EOL; echo $this->misc->form; - echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$this->lang['strcascade']}</label></p>".PHP_EOL; - echo "<input type=\"submit\" name=\"drop\" value=\"{$this->lang['strdrop']}\" />".PHP_EOL; - echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />".PHP_EOL; + echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$this->lang['strcascade']}</label></p>" . PHP_EOL; + echo "<input type=\"submit\" name=\"drop\" value=\"{$this->lang['strdrop']}\" />" . PHP_EOL; + echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />" . PHP_EOL; echo "</form>\n"; // END confirm } else { //If multi drop diff --git a/src/controllers/TablespacesController.php b/src/controllers/TablespacesController.php index f7d6ce65..f75aa4d0 100644 --- a/src/controllers/TablespacesController.php +++ b/src/controllers/TablespacesController.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; /** * Base controller class. - * - * @package PHPPgAdmin */ class TablespacesController extends BaseController { diff --git a/src/controllers/TblpropertiesController.php b/src/controllers/TblpropertiesController.php index f9dc15e6..77efa977 100644 --- a/src/controllers/TblpropertiesController.php +++ b/src/controllers/TblpropertiesController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class TblpropertiesController extends BaseController { @@ -454,7 +452,7 @@ class TblpropertiesController extends BaseController } // Don't show upload option if max size of uploads is zero $max_size = $misc->inisizeToBytes(ini_get('upload_max_filesize')); - if (is_double($max_size) && $max_size > 0) { + if (is_float($max_size) && $max_size > 0) { echo '<form action="'.\SUBFOLDER.'/src/views/dataimport" method="post" enctype="multipart/form-data">'.PHP_EOL; echo '<table>'.PHP_EOL; echo "\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strformat']}</th>".PHP_EOL; @@ -684,7 +682,7 @@ class TblpropertiesController extends BaseController foreach ($p['keys'] as $k => $c) { if (is_null($p['keys'][$k]['consrc'])) { $atts = $data->getAttributeNames($_REQUEST['table'], explode(' ', $p['keys'][$k]['indkey'])); - $c['consrc'] = ('u' == $c['contype'] ? 'UNIQUE (' : 'PRIMARY KEY (').join(',', $atts).')'; + $c['consrc'] = ('u' == $c['contype'] ? 'UNIQUE (' : 'PRIMARY KEY (').implode(',', $atts).')'; } if ($c['p_field'] == $s) { diff --git a/src/controllers/TriggersController.php b/src/controllers/TriggersController.php index 8f0004f3..f3c35ae0 100644 --- a/src/controllers/TriggersController.php +++ b/src/controllers/TriggersController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class TriggersController extends BaseController { diff --git a/src/controllers/TypesController.php b/src/controllers/TypesController.php index 527bc917..feaf79a1 100644 --- a/src/controllers/TypesController.php +++ b/src/controllers/TypesController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class TypesController extends BaseController { @@ -302,7 +300,7 @@ class TypesController extends BaseController $nbVals = count($vals); echo "<tr>\n\t<th class=\"data left\" rowspan=\"${nbVals}\">{$this->lang['strenumvalues']}</th>".PHP_EOL; echo "<td class=\"data2\">{$vals[0]['enumval']}</td></tr>".PHP_EOL; - for ($i = 1; $i < $nbVals; ++$i) { + for ($i = 1; $i < $nbVals; $i++) { echo '<td class="data', 2 - ($i % 2), "\">{$vals[$i]['enumval']}</td></tr>".PHP_EOL; } } @@ -434,7 +432,7 @@ class TypesController extends BaseController echo "\t<tr><th colspan=\"2\" class=\"data required\">{$this->lang['strfield']}</th><th colspan=\"2\" class=\"data required\">{$this->lang['strtype']}</th>"; echo "<th class=\"data\">{$this->lang['strlength']}</th><th class=\"data\">{$this->lang['strcomment']}</th></tr>".PHP_EOL; - for ($i = 0; $i < $_REQUEST['fields']; ++$i) { + for ($i = 0; $i < $_REQUEST['fields']; $i++) { if (!isset($_REQUEST['field'][$i])) { $_REQUEST['field'][$i] = ''; } @@ -602,7 +600,7 @@ class TypesController extends BaseController echo '<table>'.PHP_EOL; echo "\t<tr><th colspan=\"2\" class=\"data required\">{$this->lang['strvalue']}</th></tr>".PHP_EOL; - for ($i = 0; $i < $_REQUEST['values']; ++$i) { + for ($i = 0; $i < $_REQUEST['values']; $i++) { if (!isset($_REQUEST['value'][$i])) { $_REQUEST['value'][$i] = ''; } diff --git a/src/controllers/UsersController.php b/src/controllers/UsersController.php index 903bf50f..3a20be61 100644 --- a/src/controllers/UsersController.php +++ b/src/controllers/UsersController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class UsersController extends BaseController { diff --git a/src/controllers/ViewpropertiesController.php b/src/controllers/ViewpropertiesController.php index 50db70a5..674695ef 100644 --- a/src/controllers/ViewpropertiesController.php +++ b/src/controllers/ViewpropertiesController.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; /** * Base controller class. - * - * @package PHPPgAdmin */ class ViewpropertiesController extends BaseController { diff --git a/src/controllers/ViewsController.php b/src/controllers/ViewsController.php index 13abe756..10a43fa7 100644 --- a/src/controllers/ViewsController.php +++ b/src/controllers/ViewsController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Controller; @@ -10,8 +10,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * Base controller class. - * - * @package PHPPgAdmin */ class ViewsController extends BaseController { diff --git a/src/decorators/ActionUrlDecorator.php b/src/decorators/ActionUrlDecorator.php index 5b6c37bf..221069ea 100644 --- a/src/decorators/ActionUrlDecorator.php +++ b/src/decorators/ActionUrlDecorator.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Decorators; diff --git a/src/decorators/ArrayMergeDecorator.php b/src/decorators/ArrayMergeDecorator.php index 2ac10995..52af3ed7 100644 --- a/src/decorators/ArrayMergeDecorator.php +++ b/src/decorators/ArrayMergeDecorator.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Decorators; diff --git a/src/decorators/BranchUrlDecorator.php b/src/decorators/BranchUrlDecorator.php index d120d641..56e7fa57 100644 --- a/src/decorators/BranchUrlDecorator.php +++ b/src/decorators/BranchUrlDecorator.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Decorators; diff --git a/src/decorators/CallbackDecorator.php b/src/decorators/CallbackDecorator.php index 81d8b48d..ac97ea9d 100644 --- a/src/decorators/CallbackDecorator.php +++ b/src/decorators/CallbackDecorator.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Decorators; diff --git a/src/decorators/ConcatDecorator.php b/src/decorators/ConcatDecorator.php index f51c32a1..55feff85 100644 --- a/src/decorators/ConcatDecorator.php +++ b/src/decorators/ConcatDecorator.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Decorators; diff --git a/src/decorators/Decorator.php b/src/decorators/Decorator.php index ecc19155..dbef8adf 100644 --- a/src/decorators/Decorator.php +++ b/src/decorators/Decorator.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Decorators; diff --git a/src/decorators/FieldDecorator.php b/src/decorators/FieldDecorator.php index 2588d72c..4e153fd8 100644 --- a/src/decorators/FieldDecorator.php +++ b/src/decorators/FieldDecorator.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Decorators; diff --git a/src/decorators/IfEmptyDecorator.php b/src/decorators/IfEmptyDecorator.php index 1ddca1e2..32cab9c4 100644 --- a/src/decorators/IfEmptyDecorator.php +++ b/src/decorators/IfEmptyDecorator.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Decorators; diff --git a/src/decorators/RedirectUrlDecorator.php b/src/decorators/RedirectUrlDecorator.php index a41dcf5b..9a36198b 100644 --- a/src/decorators/RedirectUrlDecorator.php +++ b/src/decorators/RedirectUrlDecorator.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Decorators; diff --git a/src/decorators/ReplaceDecorator.php b/src/decorators/ReplaceDecorator.php index 923a88cd..012138f2 100644 --- a/src/decorators/ReplaceDecorator.php +++ b/src/decorators/ReplaceDecorator.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Decorators; diff --git a/src/decorators/UrlDecorator.php b/src/decorators/UrlDecorator.php index 3c15d065..82625405 100644 --- a/src/decorators/UrlDecorator.php +++ b/src/decorators/UrlDecorator.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Decorators; diff --git a/src/help/PostgresDoc10.php b/src/help/PostgresDoc10.php index 21e2dffa..88804d37 100644 --- a/src/help/PostgresDoc10.php +++ b/src/help/PostgresDoc10.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Help; diff --git a/src/help/PostgresDoc74.php b/src/help/PostgresDoc74.php index 86188b9f..e3ad2fcd 100644 --- a/src/help/PostgresDoc74.php +++ b/src/help/PostgresDoc74.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Help; diff --git a/src/help/PostgresDoc80.php b/src/help/PostgresDoc80.php index 57d8c527..f098b5c6 100644 --- a/src/help/PostgresDoc80.php +++ b/src/help/PostgresDoc80.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Help; diff --git a/src/help/PostgresDoc81.php b/src/help/PostgresDoc81.php index 0e2737af..b7365a44 100644 --- a/src/help/PostgresDoc81.php +++ b/src/help/PostgresDoc81.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Help; diff --git a/src/help/PostgresDoc82.php b/src/help/PostgresDoc82.php index 465ae33d..d8ea35d3 100644 --- a/src/help/PostgresDoc82.php +++ b/src/help/PostgresDoc82.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Help; diff --git a/src/help/PostgresDoc83.php b/src/help/PostgresDoc83.php index 35398e1e..c6075303 100644 --- a/src/help/PostgresDoc83.php +++ b/src/help/PostgresDoc83.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Help; diff --git a/src/help/PostgresDoc84.php b/src/help/PostgresDoc84.php index 249232d7..fcd1c235 100644 --- a/src/help/PostgresDoc84.php +++ b/src/help/PostgresDoc84.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Help; diff --git a/src/help/PostgresDoc90.php b/src/help/PostgresDoc90.php index e4712f8b..17458336 100644 --- a/src/help/PostgresDoc90.php +++ b/src/help/PostgresDoc90.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Help; diff --git a/src/help/PostgresDoc91.php b/src/help/PostgresDoc91.php index c5fee134..012e8b4f 100644 --- a/src/help/PostgresDoc91.php +++ b/src/help/PostgresDoc91.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Help; diff --git a/src/help/PostgresDoc92.php b/src/help/PostgresDoc92.php index 450cce78..1276aacd 100644 --- a/src/help/PostgresDoc92.php +++ b/src/help/PostgresDoc92.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Help; diff --git a/src/help/PostgresDoc93.php b/src/help/PostgresDoc93.php index 63b1dd1e..d8a0726a 100644 --- a/src/help/PostgresDoc93.php +++ b/src/help/PostgresDoc93.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Help; diff --git a/src/help/PostgresDoc94.php b/src/help/PostgresDoc94.php index eae827cd..c1833bc8 100644 --- a/src/help/PostgresDoc94.php +++ b/src/help/PostgresDoc94.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Help; diff --git a/src/help/PostgresDoc95.php b/src/help/PostgresDoc95.php index 0b9a3025..c2135bb7 100644 --- a/src/help/PostgresDoc95.php +++ b/src/help/PostgresDoc95.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Help; diff --git a/src/help/PostgresDoc96.php b/src/help/PostgresDoc96.php index 595e6fc6..7018e64d 100644 --- a/src/help/PostgresDoc96.php +++ b/src/help/PostgresDoc96.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Help; diff --git a/src/lib.inc.php b/src/lib.inc.php index 8c182bf3..8ad85cf0 100644 --- a/src/lib.inc.php +++ b/src/lib.inc.php @@ -1,11 +1,10 @@ <?php /** - * Function library read in upon startup + * Function library read in upon startup. * * Release: lib.inc.php,v 1.123 2008/04/06 01:10:35 xzilla Exp $ */ - defined('BASE_PATH') or define('BASE_PATH', dirname(__DIR__)); define('THEME_PATH', BASE_PATH . '/assets/themes'); @@ -53,35 +52,17 @@ if (!ini_get('session.auto_start')) { session_start(); } -// Global functions and polyfills -function maybeRenderIframes($c, $response, $subject, $query_string) -{ - $in_test = $c->view->offsetGet('in_test'); - - if ($in_test === '1') { - $className = '\PHPPgAdmin\Controller\\' . ucfirst($subject) . 'Controller'; - $controller = new $className($c); - return $controller->render(); - } - - $viewVars = [ - 'url' => '/src/views/' . $subject . ($query_string ? '?' . $query_string : ''), - 'headertemplate' => 'header.twig', - ]; - - return $c->view->render($response, 'iframe_view.twig', $viewVars); -}; // Dumb Polyfill to avoid errors with Kint if ( class_exists('Kint')) { \Kint::$enabled_mode = DEBUGMODE; Kint\Renderer\RichRenderer::$folder = false; - } else { class Kint { - static $enabled_mode = false; - static $aliases = []; + public static $enabled_mode = false; + public static $aliases = []; + public static function dump() {} } } @@ -96,19 +77,19 @@ function ddd(...$v) \Kint::$aliases[] = 'ddd'; // Polyfill for PHPConsole if (isset($conf['php_console']) && - class_exists('PhpConsole\Helper') && + class_exists('\PhpConsole\Helper') && $conf['php_console'] === true) { \PhpConsole\Helper::register(); // it will register global PC class if (!is_null($phpConsoleHandler)) { $phpConsoleHandler->start(); // initialize phpConsoleHandler*/ } - } else { class PC { public static function debug() {} } } +//\PC::dump($phpConsoleHandler); ini_set('display_errors', intval(DEBUGMODE)); ini_set('display_startup_errors', intval(DEBUGMODE)); @@ -121,7 +102,6 @@ if (DEBUGMODE) { list($container, $app) = \PHPPgAdmin\ContainerUtils::createContainer(); if ($container instanceof \Psr\Container\ContainerInterface) { - if (PHP_SAPI == 'cli-server') { $subfolder = '/index.php'; } elseif (isset($conf['subfolder']) && is_string($conf['subfolder'])) { @@ -164,6 +144,7 @@ $container['conf'] = function ($c) use ($conf) { $server['sslmode'] = 'unspecified'; } } + return $conf; }; @@ -175,6 +156,7 @@ $container['lang'] = function ($c) { $container['plugin_manager'] = function ($c) { $plugin_manager = new \PHPPgAdmin\PluginManager($c); + return $plugin_manager; }; @@ -199,6 +181,7 @@ $container['misc'] = function ($c) { $_SESSION['ppaTheme'] = $_theme; $misc->setConf('theme', $_theme); } + return $misc; }; @@ -231,6 +214,7 @@ $container['view'] = function ($c) { $view->offsetSet('appName', $c->get('settings')['appName']); $misc->setView($view); + return $view; }; diff --git a/src/middleware/PopulateRequestResponse.php b/src/middleware/PopulateRequestResponse.php index 97416fa8..47ccd3ea 100644 --- a/src/middleware/PopulateRequestResponse.php +++ b/src/middleware/PopulateRequestResponse.php @@ -4,7 +4,7 @@ namespace PHPPgAdmin\Middleware; /** * Set the requestobj and responseobj properties of the container - * as the value of $request and $response, which already contain the route + * as the value of $request and $response, which already contain the route. */ class PopulateRequestResponse extends Middleware { @@ -15,7 +15,6 @@ class PopulateRequestResponse extends Middleware \Psr\Http\Message\ResponseInterface $response, $next ) { - $container = $this->container; $container['requestobj'] = $request; $container['responseobj'] = $response; @@ -35,7 +34,7 @@ class PopulateRequestResponse extends Middleware $query_string = $request->getUri()->getQuery(); $container->view->offsetSet('query_string', $query_string); - $path = (SUBFOLDER ? (SUBFOLDER . '/') : '') . $request->getUri()->getPath() . ($query_string ? '?' . $query_string : ''); + $path = (SUBFOLDER ? (SUBFOLDER.'/') : '').$request->getUri()->getPath().($query_string ? '?'.$query_string : ''); $container->view->offsetSet('path', $path); $params = $request->getParams(); @@ -68,7 +67,7 @@ class PopulateRequestResponse extends Middleware $messages = $container->flash->getMessages(); if (!empty($messages)) { foreach ($messages as $key => $message) { - \PC::debug($message, 'Flash: ' . $key); + \PC::debug($message, 'Flash: '.$key); } } diff --git a/src/traits/AdminTrait.php b/src/traits/AdminTrait.php index e0a01fac..e301fb7b 100644 --- a/src/traits/AdminTrait.php +++ b/src/traits/AdminTrait.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Traits; diff --git a/src/traits/ExportTrait.php b/src/traits/ExportTrait.php index 9b95183b..2af4ce06 100644 --- a/src/traits/ExportTrait.php +++ b/src/traits/ExportTrait.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Traits; diff --git a/src/traits/FormTrait.php b/src/traits/FormTrait.php index bd2ad4c8..248862e0 100644 --- a/src/traits/FormTrait.php +++ b/src/traits/FormTrait.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Traits; diff --git a/src/traits/HelperTrait.php b/src/traits/HelperTrait.php index cabc0e1e..060e04d6 100644 --- a/src/traits/HelperTrait.php +++ b/src/traits/HelperTrait.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Traits; @@ -13,8 +13,6 @@ namespace PHPPgAdmin\Traits; /** * A trait with helpers methods to debug, halt the app and format text to html. - * - * @package PHPPgAdmin */ trait HelperTrait { diff --git a/src/traits/InsertEditRowTrait.php b/src/traits/InsertEditRowTrait.php index 8b535b1d..6958e46d 100644 --- a/src/traits/InsertEditRowTrait.php +++ b/src/traits/InsertEditRowTrait.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Traits; diff --git a/src/traits/MiscTrait.php b/src/traits/MiscTrait.php index 821d05e9..efe537be 100644 --- a/src/traits/MiscTrait.php +++ b/src/traits/MiscTrait.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Traits; @@ -15,8 +15,6 @@ use PHPPgAdmin\Decorators\Decorator; /** * A trait to deal with nav tabs. - * - * @package PHPPgAdmin */ trait MiscTrait { @@ -215,7 +213,7 @@ trait MiscTrait if (!isset($params['clip']) || $params['clip'] !== true) { return $str; } - $maxlen = isset($params['cliplen']) && is_integer($params['cliplen']) ? $params['cliplen'] : $this->conf['max_chars']; + $maxlen = isset($params['cliplen']) && is_int($params['cliplen']) ? $params['cliplen'] : $this->conf['max_chars']; $ellipsis = isset($params['ellipsis']) ? $params['ellipsis'] : $this->lang['strellipsis']; if (strlen($str) > $maxlen) { $str = substr($str, 0, $maxlen - 1).$ellipsis; diff --git a/src/traits/ServersTrait.php b/src/traits/ServersTrait.php index 9ddccc14..2cdcedf7 100644 --- a/src/traits/ServersTrait.php +++ b/src/traits/ServersTrait.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Traits; diff --git a/src/traits/ViewsMatViewsPropertiesTrait.php b/src/traits/ViewsMatViewsPropertiesTrait.php index a618f5af..aa67484c 100644 --- a/src/traits/ViewsMatViewsPropertiesTrait.php +++ b/src/traits/ViewsMatViewsPropertiesTrait.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Traits; diff --git a/src/traits/ViewsMatviewsTrait.php b/src/traits/ViewsMatviewsTrait.php index 40e40c8c..d2c91dda 100644 --- a/src/traits/ViewsMatviewsTrait.php +++ b/src/traits/ViewsMatviewsTrait.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Traits; @@ -120,7 +120,7 @@ trait ViewsMatviewsTrait $attrs->fields['type'] ), '</td>'; echo '</tr>'.PHP_EOL; - ++$i; + $i++; $attrs->moveNext(); } // Select all checkbox @@ -155,7 +155,7 @@ trait ViewsMatviewsTrait } } - if (0 == sizeof($_POST['show'])) { + if (0 == count($_POST['show'])) { return $this->doSelectRows(true, $this->lang['strselectneedscol']); } // Generate query SQL @@ -226,7 +226,7 @@ trait ViewsMatviewsTrait $tmpHsh[$arrTmp['fieldname']] = 1; } elseif ('rename' == $_POST['dblFldMeth']) { // field exist and must be renamed - ++$tmpHsh[$arrTmp['fieldname']]; + $tmpHsh[$arrTmp['fieldname']]++; $selFields .= $field_element.' AS "'.implode('_', $field_arr).'_'.$tmpHsh[$arrTmp['fieldname']].'", '; } // if field already exist, just ignore this one @@ -246,7 +246,7 @@ trait ViewsMatviewsTrait } } // We must perform some magic to make sure that we have a valid join order - $count = sizeof($arrLinks); + $count = count($arrLinks); } return [$arrLinks, $count]; @@ -325,7 +325,7 @@ trait ViewsMatviewsTrait $arrUsedTbls[] = $tbl2; } } - ++$j; + $j++; } //if linkFields has no length then either _POST['formLink'] was not set, or there were no join conditions @@ -375,10 +375,10 @@ trait ViewsMatviewsTrait { $data = $this->misc->getDatabaseAccessor(); - $tblCount = sizeof($_POST['formTables']); + $tblCount = count($_POST['formTables']); $arrSelTables = []; //unserialize our schema/table information and store in arrSelTables - for ($i = 0; $i < $tblCount; ++$i) { + for ($i = 0; $i < $tblCount; $i++) { $arrSelTables[] = unserialize($_POST['formTables'][$i]); } @@ -391,7 +391,7 @@ trait ViewsMatviewsTrait //if we have schemas we need to specify the correct schema for each table we're retrieiving //with getTableAttributes $curSchema = $data->_schema; - for ($i = 0; $i < $tblCount; ++$i) { + for ($i = 0; $i < $tblCount; $i++) { if ($arrSelTables[$i]['schemaname'] != $data->_schema) { $data->setSchema($arrSelTables[$i]['schemaname']); } @@ -442,7 +442,7 @@ trait ViewsMatviewsTrait echo "<tr><th class=\"data\">{$this->lang['strviewlink']}</th></tr>"; $rowClass = 'data1'; $formLink = []; - for ($i = 0; $i < $linkCount; ++$i) { + for ($i = 0; $i < $linkCount; $i++) { // Initialise variables $this->coalesceArr($formLink[$i], 'operator', 'INNER JOIN'); @@ -478,7 +478,7 @@ trait ViewsMatviewsTrait echo '<table>'.PHP_EOL; echo "<tr><th class=\"data\">{$this->lang['strviewconditions']}</th></tr>"; $rowClass = 'data1'; - for ($i = 0; $i < $linkCount; ++$i) { + for ($i = 0; $i < $linkCount; $i++) { echo "<tr>\n<td class=\"${rowClass}\">".PHP_EOL; echo \PHPPgAdmin\XHtml\HTMLController::printCombo($arrFields, "formCondition[${i}][field]"); echo \PHPPgAdmin\XHtml\HTMLController::printCombo($arrOperators, "formCondition[${i}][operator]", false, '', false); diff --git a/src/translations/Afrikaans.php b/src/translations/Afrikaans.php index fd11785f..139b162d 100644 --- a/src/translations/Afrikaans.php +++ b/src/translations/Afrikaans.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Afrikaans language. - * - * @package PHPPgAdmin */ class Afrikaans extends English { diff --git a/src/translations/Arabic.php b/src/translations/Arabic.php index 4ef3ef97..40f9180e 100644 --- a/src/translations/Arabic.php +++ b/src/translations/Arabic.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Arabic language. - * - * @package PHPPgAdmin */ class Arabic extends English { diff --git a/src/translations/Catalan.php b/src/translations/Catalan.php index 80cff727..280a0eba 100644 --- a/src/translations/Catalan.php +++ b/src/translations/Catalan.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Catalan language. - * - * @package PHPPgAdmin */ class Catalan extends English { diff --git a/src/translations/ChineseSim.php b/src/translations/ChineseSim.php index 313b7b49..353c8a6c 100644 --- a/src/translations/ChineseSim.php +++ b/src/translations/ChineseSim.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for ChineseSim language. - * - * @package PHPPgAdmin */ class ChineseSim extends English { diff --git a/src/translations/ChineseTr.php b/src/translations/ChineseTr.php index 36b45d18..abdc40cf 100644 --- a/src/translations/ChineseTr.php +++ b/src/translations/ChineseTr.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for ChineseTr language. - * - * @package PHPPgAdmin */ class ChineseTr extends English { diff --git a/src/translations/ChineseUtf8ZhCn.php b/src/translations/ChineseUtf8ZhCn.php index 3f333ad7..e7ed24da 100644 --- a/src/translations/ChineseUtf8ZhCn.php +++ b/src/translations/ChineseUtf8ZhCn.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for ChineseUtf8ZhCn language. - * - * @package PHPPgAdmin */ class ChineseUtf8ZhCn extends English { diff --git a/src/translations/ChineseUtf8ZhTw.php b/src/translations/ChineseUtf8ZhTw.php index c1f255f2..588357be 100644 --- a/src/translations/ChineseUtf8ZhTw.php +++ b/src/translations/ChineseUtf8ZhTw.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for ChineseUtf8ZhTw language. - * - * @package PHPPgAdmin */ class ChineseUtf8ZhTw extends English { diff --git a/src/translations/Czech.php b/src/translations/Czech.php index ebc65933..e6cc7abd 100644 --- a/src/translations/Czech.php +++ b/src/translations/Czech.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Czech language. - * - * @package PHPPgAdmin */ class Czech extends English { diff --git a/src/translations/Danish.php b/src/translations/Danish.php index 5a178dcc..34ded5ef 100644 --- a/src/translations/Danish.php +++ b/src/translations/Danish.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Danish language. - * - * @package PHPPgAdmin */ class Danish extends English { diff --git a/src/translations/Dutch.php b/src/translations/Dutch.php index eabcaed7..a20a960c 100644 --- a/src/translations/Dutch.php +++ b/src/translations/Dutch.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Dutch language. - * - * @package PHPPgAdmin */ class Dutch extends English { diff --git a/src/translations/English.php b/src/translations/English.php index 8624d9c3..3f7ce4fe 100644 --- a/src/translations/English.php +++ b/src/translations/English.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Ukrainian language. - * - * @package PHPPgAdmin */ class English { diff --git a/src/translations/French.php b/src/translations/French.php index 12934928..6f63267e 100644 --- a/src/translations/French.php +++ b/src/translations/French.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for French language. - * - * @package PHPPgAdmin */ class French extends English { diff --git a/src/translations/Galician.php b/src/translations/Galician.php index f227eb3e..d0b533f9 100644 --- a/src/translations/Galician.php +++ b/src/translations/Galician.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Galician language. - * - * @package PHPPgAdmin */ class Galician extends English { diff --git a/src/translations/German.php b/src/translations/German.php index b5a683fd..e472368b 100644 --- a/src/translations/German.php +++ b/src/translations/German.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for German language. - * - * @package PHPPgAdmin */ class German extends English { diff --git a/src/translations/Greek.php b/src/translations/Greek.php index 38164f4f..b16dab24 100644 --- a/src/translations/Greek.php +++ b/src/translations/Greek.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Greek language. - * - * @package PHPPgAdmin */ class Greek extends English { diff --git a/src/translations/Hebrew.php b/src/translations/Hebrew.php index e428104c..1fae8eda 100644 --- a/src/translations/Hebrew.php +++ b/src/translations/Hebrew.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Hebrew language. - * - * @package PHPPgAdmin */ class Hebrew extends English { diff --git a/src/translations/Hungarian.php b/src/translations/Hungarian.php index 8c5048a9..a2336ba3 100644 --- a/src/translations/Hungarian.php +++ b/src/translations/Hungarian.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Hungarian language. - * - * @package PHPPgAdmin */ class Hungarian extends English { diff --git a/src/translations/Italian.php b/src/translations/Italian.php index fd9443df..56036fe9 100644 --- a/src/translations/Italian.php +++ b/src/translations/Italian.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Italian language. - * - * @package PHPPgAdmin */ class Italian extends English { diff --git a/src/translations/Japanese.php b/src/translations/Japanese.php index 8fb06dde..c6450256 100644 --- a/src/translations/Japanese.php +++ b/src/translations/Japanese.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Japanese language. - * - * @package PHPPgAdmin */ class Japanese extends English { diff --git a/src/translations/Lithuanian.php b/src/translations/Lithuanian.php index f34dbeba..5bc8afbe 100644 --- a/src/translations/Lithuanian.php +++ b/src/translations/Lithuanian.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Lithuanian language. - * - * @package PHPPgAdmin */ class Lithuanian extends English { diff --git a/src/translations/Mongol.php b/src/translations/Mongol.php index 8ccbfe07..cbb04a27 100644 --- a/src/translations/Mongol.php +++ b/src/translations/Mongol.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Mongol language. - * - * @package PHPPgAdmin */ class Mongol extends English { diff --git a/src/translations/Polish.php b/src/translations/Polish.php index c46c5cc0..ee98c34b 100644 --- a/src/translations/Polish.php +++ b/src/translations/Polish.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Polish language. - * - * @package PHPPgAdmin */ class Polish extends English { diff --git a/src/translations/PortugueseBr.php b/src/translations/PortugueseBr.php index fe26f8c8..ceef5abb 100644 --- a/src/translations/PortugueseBr.php +++ b/src/translations/PortugueseBr.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for PortugueseBr language. - * - * @package PHPPgAdmin */ class PortugueseBr extends English { diff --git a/src/translations/PortuguesePt.php b/src/translations/PortuguesePt.php index de896eb4..4027981e 100644 --- a/src/translations/PortuguesePt.php +++ b/src/translations/PortuguesePt.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for PortuguesePt language. - * - * @package PHPPgAdmin */ class PortuguesePt extends English { diff --git a/src/translations/Romanian.php b/src/translations/Romanian.php index 939fd9b3..1f561af2 100644 --- a/src/translations/Romanian.php +++ b/src/translations/Romanian.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Romanian language. - * - * @package PHPPgAdmin */ class Romanian extends English { diff --git a/src/translations/Russian.php b/src/translations/Russian.php index 3732b23a..2b0d8487 100644 --- a/src/translations/Russian.php +++ b/src/translations/Russian.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Russian language. - * - * @package PHPPgAdmin */ class Russian extends English { diff --git a/src/translations/RussianUtf8.php b/src/translations/RussianUtf8.php index 91c3b06f..98e24448 100644 --- a/src/translations/RussianUtf8.php +++ b/src/translations/RussianUtf8.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for RussianUtf8 language. - * - * @package PHPPgAdmin */ class RussianUtf8 extends English { diff --git a/src/translations/Slovak.php b/src/translations/Slovak.php index be258973..3bb59eb4 100644 --- a/src/translations/Slovak.php +++ b/src/translations/Slovak.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Slovak language. - * - * @package PHPPgAdmin */ class Slovak extends English { diff --git a/src/translations/Spanish.php b/src/translations/Spanish.php index 33541e68..de79e0c6 100644 --- a/src/translations/Spanish.php +++ b/src/translations/Spanish.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Spanish language. - * - * @package PHPPgAdmin */ class Spanish extends English { diff --git a/src/translations/Swedish.php b/src/translations/Swedish.php index 47092aa3..cbdae492 100644 --- a/src/translations/Swedish.php +++ b/src/translations/Swedish.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Swedish language. - * - * @package PHPPgAdmin */ class Swedish extends English { diff --git a/src/translations/Turkish.php b/src/translations/Turkish.php index 4f732232..20a934d1 100644 --- a/src/translations/Turkish.php +++ b/src/translations/Turkish.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Turkish language. - * - * @package PHPPgAdmin */ class Turkish extends English { diff --git a/src/translations/Ukrainian.php b/src/translations/Ukrainian.php index e8b7d58b..c9f00773 100644 --- a/src/translations/Ukrainian.php +++ b/src/translations/Ukrainian.php @@ -1,15 +1,13 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\Translations; /** * Class providing translation for Ukrainian language. - * - * @package PHPPgAdmin */ class Ukrainian extends English { diff --git a/src/xhtml/HTMLController.php b/src/xhtml/HTMLController.php index 4825d6c7..775e9cea 100644 --- a/src/xhtml/HTMLController.php +++ b/src/xhtml/HTMLController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\XHtml; diff --git a/src/xhtml/HTMLFooterController.php b/src/xhtml/HTMLFooterController.php index 77cfee63..cc7a9403 100644 --- a/src/xhtml/HTMLFooterController.php +++ b/src/xhtml/HTMLFooterController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\XHtml; @@ -44,12 +44,14 @@ class HTMLFooterController extends HTMLController } /** - * Prints the page footer. + * fetches the page footer. * - * @param bool $doBody True to output body tag, false to return the html - * @param mixed $template + * @param string $template the template's name + * @param array $viewParams Optional - extra view parameters + * + * @return string the html content for the footer section */ - public function printFooter($doBody = true, $template = 'footer.twig') + public function getFooter($template = 'footer.twig', $viewParams = []) { $reload_param = 'none'; if ($this->misc->getReloadBrowser()) { @@ -59,17 +61,15 @@ class HTMLFooterController extends HTMLController } $this->view->offsetSet('script_footer', ''); + $this->view->offsetSet('inPopUp', $inPopUp); $this->view->offsetSet('reload', $reload_param); $this->view->offsetSet('footer_template', $template); $this->view->offsetSet('print_bottom_link', !$this->_no_bottom_link); - - $footer_html = $this->view->fetch($template); - - if ($doBody) { - echo $footer_html; - } else { - return $footer_html; + foreach ($viewParams as $key => $value) { + $this->view->offsetSet($key, $value); } + return $this->view->fetch($template); + } /** @@ -79,9 +79,9 @@ class HTMLFooterController extends HTMLController */ public function setFocus($object) { - echo '<script type="text/javascript">'.PHP_EOL; + echo '<script type="text/javascript">' . PHP_EOL; echo " document.{$object}.focus();\n"; - echo '</script>'.PHP_EOL; + echo '</script>' . PHP_EOL; } /** @@ -93,11 +93,11 @@ class HTMLFooterController extends HTMLController */ public function setWindowName($name, $addServer = true) { - echo '<script type="text/javascript">'.PHP_EOL; + echo '<script type="text/javascript">' . PHP_EOL; echo "//<![CDATA[\n"; - echo " window.name = '{$name}", ($addServer ? ':'.htmlspecialchars($this->misc->getServerId()) : ''), "';\n"; - echo '//]]>'.PHP_EOL; - echo '</script>'.PHP_EOL; + echo " window.name = '{$name}", ($addServer ? ':' . htmlspecialchars($this->misc->getServerId()) : ''), "';\n"; + echo '//]]>' . PHP_EOL; + echo '</script>' . PHP_EOL; } /** @@ -111,13 +111,11 @@ class HTMLFooterController extends HTMLController * Allows to give some environnement details to plugins. * and 'browse' is the place inside that code (doBrowse). * @param bool $do_print if true, print html, if false, return html - * @param mixed $from can either be null, false or the method calling this one + * @param stromg $from who is calling this method (mostly for debug) */ public function printNavLinks($navlinks, $place, $env, $do_print, $from) { - if (null === $from || false === $from) { - $from = __METHOD__; - } + //$this->prtrace($navlinks); $plugin_manager = $this->plugin_manager; @@ -130,11 +128,9 @@ class HTMLFooterController extends HTMLController $plugin_manager->doHook('navlinks', $plugin_functions_parameters); if (count($navlinks) > 0) { - if ($do_print) { - $this->printLinksList($navlinks, 'navlink', true, $from); - } else { - return $this->printLinksList($navlinks, 'navlink', false, $from); - } + + return $this->printLinksList($navlinks, 'navlink', $do_print, $from); + } } } diff --git a/src/xhtml/HTMLHeaderController.php b/src/xhtml/HTMLHeaderController.php index 5d26b001..6e0d71dd 100644 --- a/src/xhtml/HTMLHeaderController.php +++ b/src/xhtml/HTMLHeaderController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\XHtml; diff --git a/src/xhtml/HTMLNavbarController.php b/src/xhtml/HTMLNavbarController.php index c9705bf2..6ed7d949 100644 --- a/src/xhtml/HTMLNavbarController.php +++ b/src/xhtml/HTMLNavbarController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\XHtml; diff --git a/src/xhtml/HTMLTableController.php b/src/xhtml/HTMLTableController.php index 2012a8eb..ed9dd508 100644 --- a/src/xhtml/HTMLTableController.php +++ b/src/xhtml/HTMLTableController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\XHtml; @@ -209,7 +209,7 @@ class HTMLTableController extends HTMLController switch ($column_id) { case 'actions': - if (sizeof($actions) > 0) { + if (count($actions) > 0) { $thead_html .= '<th class="data" >'.$column['title'].'</th>'.PHP_EOL; } @@ -316,7 +316,7 @@ class HTMLTableController extends HTMLController $tbody_html .= '</tr>'.PHP_EOL; $tabledata->moveNext(); - ++$i; + $i++; } $tbody_html .= '</tbody>'; @@ -341,7 +341,7 @@ class HTMLTableController extends HTMLController $class = (isset($column['class']) && '' !== $column['class']) ? $column['class'] : ''; - if ($column_id !== 'actions' || sizeof($actions) > 0) { + if ($column_id !== 'actions' || count($actions) > 0) { $tfoot_html .= "<td class=\"data{$class}\"></td>".PHP_EOL; } } diff --git a/src/xhtml/TreeController.php b/src/xhtml/TreeController.php index a762295a..e5062072 100644 --- a/src/xhtml/TreeController.php +++ b/src/xhtml/TreeController.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\XHtml; @@ -46,49 +46,6 @@ class TreeController /** * 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 - * 'text' - the text for the tree node - * 'icon' - an icon for node - * 'openIcon' - an alternative icon when the node is expanded - * 'toolTip' - tool tip text for the node - * 'action' - URL to visit when single clicking the node - * 'iconAction' - URL to visit when single clicking the icon node - * 'branch' - URL for child nodes (tree XML) - * 'expand' - the action to return XML for the subtree - * 'nodata' - message to display when node has no children - * @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 - */ - public function printTree(&$_treedata, &$attrs, $section, $print = true) - { - $plugin_manager = $this->plugin_manager; - - $treedata = []; - - if ($_treedata->recordCount() > 0) { - while (!$_treedata->EOF) { - $treedata[] = $_treedata->fields; - $_treedata->moveNext(); - } - } - - $tree_params = [ - 'treedata' => &$treedata, - 'attrs' => &$attrs, - 'section' => $section, - ]; - - $plugin_manager->doHook('tree', $tree_params); - - return $this->printTreeJSON($treedata, $attrs, $print); - } - - /** - * Produce JSON data for the browser tree. - * * @param array $treedata a set of records to populate the tree * @param array $attrs Attributes for tree items * 'text' - the text for the tree node @@ -100,22 +57,30 @@ class TreeController * 'branch' - URL for child nodes (tree JSON) * 'expand' - the action to return JSON for the subtree * 'nodata' - message to display when node has no children - * @param bool $print either to return or echo the result + * @param string $section section of the tree * * @return \Slim\Http\Response|string the json rendered tree */ - private function printTreeJSON(&$treedata, &$attrs, $print = true) + public function printTreeJSON(&$treedata, &$attrs, $section = '') { + $tree_params = [ + 'treedata' => &$treedata, + 'attrs' => &$attrs, + 'section' => $section, + ]; + $plugin_manager = $this->plugin_manager; + $plugin_manager->doHook('tree', $tree_params); + $parent = []; if (isset($attrs['is_root'])) { $parent = [ 'id' => 'root', 'children' => true, - 'icon' => \SUBFOLDER.'/assets/images/themes/default/Servers.png', + 'icon' => \SUBFOLDER . '/assets/images/themes/default/Servers.png', 'state' => ['opened' => true], - 'a_attr' => ['href' => str_replace('//', '/', \SUBFOLDER.'/src/views/servers')], - 'url' => str_replace('//', '/', \SUBFOLDER.'/src/views/servers?action=tree'), + 'a_attr' => ['href' => str_replace('//', '/', \SUBFOLDER . '/src/views/servers')], + 'url' => str_replace('//', '/', \SUBFOLDER . '/src/views/servers?action=tree'), 'text' => 'Servers', ]; } elseif (count($treedata) > 0) { @@ -137,7 +102,7 @@ class TreeController ]; $url = Decorator::get_sanitized_value($attrs['branch'], $rec); if ($url && strpos($url, '/src/views') === false) { - $url = str_replace('//', '/', \SUBFOLDER.'/src/views/'.$url); + $url = str_replace('//', '/', \SUBFOLDER . '/src/views/' . $url); } if ($url) { $tree['url'] = $url; @@ -152,20 +117,17 @@ class TreeController $parent = ['children' => false]; } - if (true === $print) { - if (isset($_REQUEST['children'])) { - $children = $parent; - $parent = ['children' => $children]; - } - - return $this - ->container - ->responseobj - ->withStatus(200) - ->withJson($parent); + if (isset($_REQUEST['children'])) { + $children = $parent; + $parent = ['children' => $children]; } - return $parent; + return $this + ->container + ->responseobj + ->withStatus(200) + ->withJson($parent); + } /** diff --git a/src/xhtml/XHtmlButton.php b/src/xhtml/XHtmlButton.php index 24dabd16..0eed0c8b 100644 --- a/src/xhtml/XHtmlButton.php +++ b/src/xhtml/XHtmlButton.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\XHtml; diff --git a/src/xhtml/XHtmlElement.php b/src/xhtml/XHtmlElement.php index 86a076aa..9f124339 100644 --- a/src/xhtml/XHtmlElement.php +++ b/src/xhtml/XHtmlElement.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\XHtml; diff --git a/src/xhtml/XHtmlOption.php b/src/xhtml/XHtmlOption.php index 1edd111f..5216558a 100644 --- a/src/xhtml/XHtmlOption.php +++ b/src/xhtml/XHtmlOption.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\XHtml; diff --git a/src/xhtml/XHtmlSelect.php b/src/xhtml/XHtmlSelect.php index b3d20a27..2f103aa9 100644 --- a/src/xhtml/XHtmlSelect.php +++ b/src/xhtml/XHtmlSelect.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\XHtml; diff --git a/src/xhtml/XHtmlSimpleElement.php b/src/xhtml/XHtmlSimpleElement.php index 3aa11fb9..ae0291cb 100644 --- a/src/xhtml/XHtmlSimpleElement.php +++ b/src/xhtml/XHtmlSimpleElement.php @@ -1,7 +1,7 @@ <?php /** - * PHPPgAdmin v6.0.0-RC2 + * PHPPgAdmin v6.0.0-RC1. */ namespace PHPPgAdmin\XHtml; |