@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | */ |
6 | 6 | require_once './src/lib.inc.php'; |
7 | 7 | |
8 | -$app->post('/redirect[/{subject}]', function ($request, $response, $args) { |
|
8 | +$app->post('/redirect[/{subject}]', function($request, $response, $args) { |
|
9 | 9 | |
10 | 10 | $body = $response->getBody(); |
11 | 11 | $query_string = $request->getUri()->getQuery(); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | }); |
57 | 57 | |
58 | -$app->get('/redirect[/{subject}]', function ($request, $response, $args) { |
|
58 | +$app->get('/redirect[/{subject}]', function($request, $response, $args) { |
|
59 | 59 | |
60 | 60 | $subject = (isset($args['subject'])) ? $args['subject'] : 'root'; |
61 | 61 | $destinationurl = $this->utils->getDestinationWithLastTab($subject); |
@@ -63,31 +63,31 @@ discard block |
||
63 | 63 | |
64 | 64 | }); |
65 | 65 | |
66 | -$app->get('/src/views/browser', function ($request, $response, $args) { |
|
66 | +$app->get('/src/views/browser', function($request, $response, $args) { |
|
67 | 67 | |
68 | 68 | $controller = new \PHPPgAdmin\Controller\BrowserController($this, true); |
69 | 69 | return $controller->render(); |
70 | 70 | }); |
71 | 71 | |
72 | -$app->get('/src/views/login', function ($request, $response, $args) { |
|
72 | +$app->get('/src/views/login', function($request, $response, $args) { |
|
73 | 73 | |
74 | 74 | $controller = new \PHPPgAdmin\Controller\LoginController($this, true); |
75 | 75 | return $controller->render(); |
76 | 76 | }); |
77 | 77 | |
78 | -$app->get('/src/views/servers', function ($request, $response, $args) { |
|
78 | +$app->get('/src/views/servers', function($request, $response, $args) { |
|
79 | 79 | |
80 | 80 | $controller = new \PHPPgAdmin\Controller\ServersController($this, true); |
81 | 81 | return $controller->render(); |
82 | 82 | }); |
83 | 83 | |
84 | -$app->get('/src/views/intro', function ($request, $response, $args) { |
|
84 | +$app->get('/src/views/intro', function($request, $response, $args) { |
|
85 | 85 | |
86 | 86 | $controller = new \PHPPgAdmin\Controller\IntroController($this, true); |
87 | 87 | return $controller->render(); |
88 | 88 | }); |
89 | 89 | |
90 | -$app->map(['GET', 'POST'], '/src/views/{subject}', function ($request, $response, $args) { |
|
90 | +$app->map(['GET', 'POST'], '/src/views/{subject}', function($request, $response, $args) { |
|
91 | 91 | |
92 | 92 | $subject = $args['subject']; |
93 | 93 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | return $controller->render(); |
97 | 97 | }); |
98 | 98 | |
99 | -$app->get('/[{subject}]', function ($request, $response, $args) { |
|
99 | +$app->get('/[{subject}]', function($request, $response, $args) { |
|
100 | 100 | |
101 | 101 | $subject = (isset($args['subject'])) ? $args['subject'] : 'intro'; |
102 | 102 | $_server_info = $this->misc->getServerInfo(); |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Register the plugins |
31 | - * |
|
32 | - * @param \Slim\Container $container |
|
33 | - * @internal param $this ->language - Language that have been used. |
|
34 | - * @throws \Interop\Container\Exception\ContainerException |
|
35 | - * @throws \Slim\Exception\ContainerValueNotFoundException |
|
31 | + * |
|
32 | + * @param \Slim\Container $container |
|
33 | + * @internal param $this ->language - Language that have been used. |
|
34 | + * @throws \Interop\Container\Exception\ContainerException |
|
35 | + * @throws \Slim\Exception\ContainerValueNotFoundException |
|
36 | 36 | */ |
37 | 37 | public function __construct(\Slim\Container $container) |
38 | 38 | { |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | /** |
71 | 71 | * Add a plugin in the list of plugins to manage |
72 | - * |
|
72 | + * |
|
73 | 73 | * @param $plugin - Instance from plugin |
74 | 74 | */ |
75 | 75 | public function add_plugin($plugin) |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | /** |
109 | 109 | * Execute the plugins hook functions when needed. |
110 | - * |
|
110 | + * |
|
111 | 111 | * @param $hook - The place where the function will be called |
112 | 112 | * @param $function_args - An array reference with arguments to give to called function |
113 | 113 | */ |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | |
128 | 128 | /** |
129 | 129 | * Execute a plugin's action |
130 | - * |
|
130 | + * |
|
131 | 131 | * @param $plugin_name - The plugin name. |
132 | 132 | * @param $action - action that will be executed. |
133 | 133 | */ |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | public function __construct() |
91 | 91 | { |
92 | 92 | |
93 | - $keyword_replace = function ($keywords, $text, $ncs = false) { |
|
93 | + $keyword_replace = function($keywords, $text, $ncs = false) { |
|
94 | 94 | $cm = $ncs ? 'i' : ''; |
95 | 95 | foreach ($keywords as $keyword) { |
96 | 96 | $search[] = "/(\\b$keyword\\b)/" . $cm; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | return preg_replace($search, $replace, $text); |
104 | 104 | }; |
105 | 105 | |
106 | - $preproc_replace = function ($preproc, $text) { |
|
106 | + $preproc_replace = function($preproc, $text) { |
|
107 | 107 | foreach ($preproc as $proc) { |
108 | 108 | $search[] = "/(\\s*#\s*$proc\\b)/"; |
109 | 109 | $replace[] = '<span class="keyword">\\0</span>'; |
@@ -112,11 +112,11 @@ discard block |
||
112 | 112 | return preg_replace($search, $replace, $text); |
113 | 113 | }; |
114 | 114 | |
115 | - $sch_syntax_helper = function ($text) { |
|
115 | + $sch_syntax_helper = function($text) { |
|
116 | 116 | return $text; |
117 | 117 | }; |
118 | 118 | |
119 | - $syntax_highlight_helper = function ($text, $language) use ($keyword_replace, $preproc_replace) { |
|
119 | + $syntax_highlight_helper = function($text, $language) use ($keyword_replace, $preproc_replace) { |
|
120 | 120 | $preproc = []; |
121 | 121 | $preproc['C++'] = [ |
122 | 122 | 'if', |
@@ -1921,66 +1921,64 @@ discard block |
||
1921 | 1921 | 'PL/I' => true, |
1922 | 1922 | 'SQL' => true, |
1923 | 1923 | ]; |
1924 | - $ncs = false; |
|
1924 | + $ncs = false; |
|
1925 | 1925 | if (array_key_exists($language, $case_insensitive)) { |
1926 | 1926 | $ncs = true; |
1927 | 1927 | } |
1928 | 1928 | |
1929 | 1929 | $text = array_key_exists($language, $preproc) ? |
1930 | - $preproc_replace($preproc[$language], $text) : |
|
1931 | - $text; |
|
1930 | + $preproc_replace($preproc[$language], $text) : $text; |
|
1932 | 1931 | $text = array_key_exists($language, $keywords) ? |
1933 | - $keyword_replace($keywords[$language], $text, $ncs) : |
|
1934 | - $text; |
|
1932 | + $keyword_replace($keywords[$language], $text, $ncs) : $text; |
|
1935 | 1933 | |
1936 | 1934 | return $text; |
1937 | 1935 | }; |
1938 | 1936 | |
1939 | - $rtrim1 = function ($span, $lang, $ch) use ($syntax_highlight_helper) { |
|
1937 | + $rtrim1 = function($span, $lang, $ch) use ($syntax_highlight_helper) { |
|
1940 | 1938 | return $syntax_highlight_helper(substr($span, 0, -1), $lang); |
1941 | 1939 | }; |
1942 | 1940 | |
1943 | - $rtrim1_htmlesc = function ($span, $lang, $ch) { |
|
1941 | + $rtrim1_htmlesc = function($span, $lang, $ch) { |
|
1944 | 1942 | return htmlspecialchars(substr($span, 0, -1)); |
1945 | 1943 | }; |
1946 | 1944 | |
1947 | - $sch_rtrim1 = function ($span, $lang, $ch) use ($sch_syntax_helper) { |
|
1945 | + $sch_rtrim1 = function($span, $lang, $ch) use ($sch_syntax_helper) { |
|
1948 | 1946 | return $sch_syntax_helper(substr($span, 0, -1)); |
1949 | 1947 | }; |
1950 | 1948 | |
1951 | - $rtrim2 = function ($span, $lang, $ch) { |
|
1949 | + $rtrim2 = function($span, $lang, $ch) { |
|
1952 | 1950 | return substr($span, 0, -2); |
1953 | 1951 | }; |
1954 | 1952 | |
1955 | - $syn_proc = function ($span, $lang, $ch) use ($syntax_highlight_helper) { |
|
1953 | + $syn_proc = function($span, $lang, $ch) use ($syntax_highlight_helper) { |
|
1956 | 1954 | return $syntax_highlight_helper($span, $lang); |
1957 | 1955 | }; |
1958 | 1956 | |
1959 | - $dash_putback = function ($span, $lang, $ch) use ($syntax_highlight_helper) { |
|
1957 | + $dash_putback = function($span, $lang, $ch) use ($syntax_highlight_helper) { |
|
1960 | 1958 | return $syntax_highlight_helper('-' . $span, $lang); |
1961 | 1959 | }; |
1962 | 1960 | |
1963 | - $slash_putback = function ($span, $lang, $ch) use ($syntax_highlight_helper) { |
|
1961 | + $slash_putback = function($span, $lang, $ch) use ($syntax_highlight_helper) { |
|
1964 | 1962 | return $syntax_highlight_helper('/' . $span, $lang); |
1965 | 1963 | }; |
1966 | 1964 | |
1967 | - $slash_putback_rtrim1 = function ($span, $lang, $ch) use ($rtrim1) { |
|
1965 | + $slash_putback_rtrim1 = function($span, $lang, $ch) use ($rtrim1) { |
|
1968 | 1966 | return $rtrim1('/' . $span, $lang, $ch); |
1969 | 1967 | }; |
1970 | 1968 | |
1971 | - $lparen_putback = function ($span, $lang, $ch) use ($syntax_highlight_helper) { |
|
1969 | + $lparen_putback = function($span, $lang, $ch) use ($syntax_highlight_helper) { |
|
1972 | 1970 | return $syntax_highlight_helper('(' . $span, $lang); |
1973 | 1971 | }; |
1974 | 1972 | |
1975 | - $lparen_putback_rtrim1 = function ($span, $lang, $ch) use ($rtrim1) { |
|
1973 | + $lparen_putback_rtrim1 = function($span, $lang, $ch) use ($rtrim1) { |
|
1976 | 1974 | return $rtrim1('(' . $span, $lang, $ch); |
1977 | 1975 | }; |
1978 | 1976 | |
1979 | - $prepend_xml_opentag = function ($span, $lang, $ch) { |
|
1977 | + $prepend_xml_opentag = function($span, $lang, $ch) { |
|
1980 | 1978 | return '<span class="xml_tag"><' . $span; |
1981 | 1979 | }; |
1982 | 1980 | |
1983 | - $proc_void = function ($span, $lang, $ch) { |
|
1981 | + $proc_void = function($span, $lang, $ch) { |
|
1984 | 1982 | return $span; |
1985 | 1983 | }; |
1986 | 1984 | |
@@ -2442,8 +2440,7 @@ discard block |
||
2442 | 2440 | |
2443 | 2441 | $oldstate = $state; |
2444 | 2442 | $state = array_key_exists($ch, $this->states[$language][$state]) ? |
2445 | - $this->states[$language][$state][$ch] : |
|
2446 | - $this->states[$language][$state][0]; |
|
2443 | + $this->states[$language][$state][$ch] : $this->states[$language][$state][0]; |
|
2447 | 2444 | |
2448 | 2445 | $span .= $ch; |
2449 | 2446 |
@@ -212,7 +212,7 @@ |
||
212 | 212 | $status = -1; // ini |
213 | 213 | if ($rs->recordCount() and ($rs->fields['vacrelid'] == $toid)) { |
214 | 214 | // table exists in pg_autovacuum, UPDATE |
215 | - $sql = sprintf("UPDATE \"pg_catalog\".\"pg_autovacuum\" SET |
|
215 | + $sql = sprintf("UPDATE \"pg_catalog\".\"pg_autovacuum\" SET |
|
216 | 216 | enabled = '%s', |
217 | 217 | vac_base_thresh = %s, |
218 | 218 | vac_scale_factor = %s, |
@@ -394,7 +394,7 @@ |
||
394 | 394 | // Pick out array entries by carefully parsing. This is necessary in order |
395 | 395 | // to cope with double quotes and commas, etc. |
396 | 396 | $elements = []; |
397 | - $i = $j = 0; |
|
397 | + $i = $j = 0; |
|
398 | 398 | $in_quotes = false; |
399 | 399 | while ($i < strlen($arr)) { |
400 | 400 | // If current char is a double quote and it's not escaped, then |
@@ -2075,7 +2075,7 @@ |
||
2075 | 2075 | // Pick out individual ACE's by carefully parsing. This is necessary in order |
2076 | 2076 | // to cope with usernames and stuff that contain commas |
2077 | 2077 | $aces = []; |
2078 | - $i = $j = 0; |
|
2078 | + $i = $j = 0; |
|
2079 | 2079 | $in_quotes = false; |
2080 | 2080 | while ($i < strlen($acl)) { |
2081 | 2081 | // If current char is a double quote and it's not escaped, then |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $lang = $this->lang; |
100 | 100 | $data = $misc->getDatabaseAccessor(); |
101 | 101 | |
102 | - $attPre = function (&$rowdata, $actions) use ($data) { |
|
102 | + $attPre = function(&$rowdata, $actions) use ($data) { |
|
103 | 103 | |
104 | 104 | $rowdata->fields['+type'] = $data->formatType($rowdata->fields['type'], $rowdata->fields['atttypmod']); |
105 | 105 | $attname = $rowdata->fields['attname']; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | return $actions; |
114 | 114 | }; |
115 | 115 | |
116 | - $cstrRender = function ($s, $p) use ($misc, $data) { |
|
116 | + $cstrRender = function($s, $p) use ($misc, $data) { |
|
117 | 117 | |
118 | 118 | $str = ''; |
119 | 119 | foreach ($p['keys'] as $k => $c) { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * @param $parser |
37 | 37 | * @param $cdata |
38 | 38 | */ |
39 | - $_charHandler = function ($parser, $cdata) use (&$state, &$curr_col_val) { |
|
39 | + $_charHandler = function($parser, $cdata) use (&$state, &$curr_col_val) { |
|
40 | 40 | if ($state == 'COLUMN') { |
41 | 41 | $curr_col_val .= $cdata; |
42 | 42 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @param $name |
50 | 50 | * @param $attrs |
51 | 51 | */ |
52 | - $_startElement = function ($parser, $name, $attrs) use ($data, $misc, &$state, &$curr_col_name, &$curr_col_null) { |
|
52 | + $_startElement = function($parser, $name, $attrs) use ($data, $misc, &$state, &$curr_col_name, &$curr_col_null) { |
|
53 | 53 | |
54 | 54 | switch ($name) { |
55 | 55 | case 'DATA': |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | * @param $parser |
114 | 114 | * @param $name |
115 | 115 | */ |
116 | - $_endElement = function ($parser, $name) use ($data, $misc, &$state, &$curr_col_name, &$curr_col_null, &$curr_col_val) { |
|
116 | + $_endElement = function($parser, $name) use ($data, $misc, &$state, &$curr_col_name, &$curr_col_null, &$curr_col_val) { |
|
117 | 117 | |
118 | 118 | switch ($name) { |
119 | 119 | case 'DATA': |
@@ -92,7 +92,7 @@ |
||
92 | 92 | $lang = $this->lang; |
93 | 93 | $data = $misc->getDatabaseAccessor(); |
94 | 94 | |
95 | - $attPre = function (&$rowdata) use ($data) { |
|
95 | + $attPre = function(&$rowdata) use ($data) { |
|
96 | 96 | $rowdata->fields['+type'] = $data->formatType($rowdata->fields['type'], $rowdata->fields['atttypmod']); |
97 | 97 | }; |
98 | 98 |