Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/HuasoFoundries/phpPgAdmin6.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmenadiel <amenadiel@gmail.com>2018-11-13 22:53:38 +0300
committerAmenadiel <amenadiel@gmail.com>2018-11-13 22:53:38 +0300
commit7414a06816c8b4e9261c6d5094e99ab75a955a02 (patch)
tree12dc3ae8df92aa3ad5bded079e0f30471eec8985
parent7eecac307d5616e3af79adb6223962436513b4cd (diff)
separates TableTrait::getTableDefPrefix into sevefunctions
-rw-r--r--.php_cs.cache2
-rw-r--r--src/controllers/InfoController.php602
-rw-r--r--src/controllers/TblpropertiesController.php328
-rw-r--r--src/database/databasetraits/DatabaseTrait.php2
-rw-r--r--src/database/databasetraits/TableTrait.php414
5 files changed, 752 insertions, 596 deletions
diff --git a/.php_cs.cache b/.php_cs.cache
index 937c049b..55cadaff 100644
--- a/.php_cs.cache
+++ b/.php_cs.cache
@@ -1 +1 @@
-{"php":"7.2.11-1+ubuntu16.04.1+deb.sury.org+1","version":"2.12.1:v2.12.1#beef6cbe6dec7205edcd143842a49f9a691859a6","rules":{"no_php4_constructor":true,"php_unit_namespaced":{"target":"6.0"},"php_unit_dedicate_assert":{"target":"5.6"},"php_unit_expectation":{"target":"5.6"},"php_unit_mock":{"target":"5.5"},"php_unit_no_expectation_annotation":{"target":"4.3"},"binary_operator_spaces":{"align_double_arrow":true,"align_equals":true},"blank_line_after_opening_tag":true,"blank_line_before_statement":true,"braces":true,"cast_spaces":true,"class_attributes_separation":{"elements":["method"]},"class_definition":true,"concat_space":{"spacing":"none"},"declare_equal_normalize":true,"function_typehint_space":true,"include":true,"increment_style":true,"lowercase_cast":true,"lowercase_static_reference":true,"magic_constant_casing":true,"method_argument_space":{"ensure_fully_multiline":true},"native_function_casing":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_blank_lines_after_phpdoc":true,"no_empty_comment":true,"no_empty_phpdoc":true,"no_empty_statement":true,"no_extra_blank_lines":{"tokens":["break","case","continue","curly_brace_block","default","extra","parenthesis_brace_block","return","square_brace_block","switch","throw","use","useTrait","use_trait"]},"no_leading_import_slash":true,"no_leading_namespace_whitespace":true,"no_mixed_echo_print":{"use":"echo"},"no_multiline_whitespace_around_double_arrow":true,"no_short_bool_cast":true,"no_singleline_whitespace_before_semicolons":true,"no_spaces_around_offset":true,"no_trailing_comma_in_list_call":true,"no_trailing_comma_in_singleline_array":true,"no_unneeded_control_parentheses":true,"no_unneeded_curly_braces":true,"no_unneeded_final_method":true,"no_unused_imports":true,"no_whitespace_before_comma_in_array":true,"no_whitespace_in_blank_line":true,"normalize_index_brace":true,"object_operator_without_whitespace":true,"php_unit_fqcn_annotation":true,"phpdoc_align":true,"phpdoc_annotation_without_dot":true,"phpdoc_indent":true,"phpdoc_inline_tag":true,"phpdoc_no_access":true,"phpdoc_no_alias_tag":true,"phpdoc_no_empty_return":true,"phpdoc_no_useless_inheritdoc":true,"phpdoc_return_self_reference":true,"phpdoc_scalar":true,"phpdoc_separation":true,"phpdoc_single_line_var_spacing":true,"phpdoc_summary":true,"phpdoc_to_comment":true,"phpdoc_trim":true,"phpdoc_types":true,"phpdoc_var_without_name":true,"protected_to_private":true,"return_type_declaration":true,"semicolon_after_instruction":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_class_element_per_statement":{"elements":["property"]},"single_quote":true,"space_after_semicolon":{"remove_in_empty_for_expressions":true},"standardize_increment":true,"standardize_not_equals":true,"ternary_operator_spaces":true,"trailing_comma_in_multiline_array":true,"trim_array_spaces":true,"unary_operator_spaces":true,"whitespace_after_comma_in_array":true,"blank_line_after_namespace":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_constants":true,"lowercase_keywords":true,"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":true,"modernize_types_casting":true,"align_multiline_comment":true,"array_syntax":{"syntax":"short"},"combine_consecutive_issets":true,"combine_consecutive_unsets":true,"compact_nullable_typehint":true,"escape_implicit_backslashes":true,"explicit_indirect_variable":true,"explicit_string_variable":true,"final_internal_class":true,"header_comment":{"commentType":"PHPDoc","header":"PHPPgAdmin v6.0.0-beta.50"},"heredoc_to_nowdoc":true,"list_syntax":{"syntax":"long"},"method_chaining_indentation":true,"multiline_comment_opening_closing":true,"no_null_property_initialization":true,"no_short_echo_tag":true,"no_superfluous_elseif":true,"no_unreachable_default_argument_value":true,"no_useless_else":true,"no_useless_return":true,"ordered_imports":true,"php_unit_strict":true,"php_unit_test_annotation":true,"php_unit_test_class_requires_covers":true,"phpdoc_add_missing_param_annotation":true,"phpdoc_order":true,"phpdoc_types_order":true,"strict_param":true},"hashes":{"src\/classes\/ADOdbException.php":2130494863,"src\/classes\/ADONewConnection.php":971289519,"src\/classes\/ArrayRecordSet.php":643779323,"src\/classes\/ContainerUtils.php":175370279,"src\/classes\/PluginManager.php":407811601,"src\/classes\/Misc.php":3316303728,"src\/classes\/Translations.php":160991078,"src\/classes\/ADORecordSet.php":3392816394,"src\/controllers\/CastsController.php":335351941,"src\/controllers\/RulesController.php":1842521491,"src\/controllers\/IndexesController.php":2293789589,"src\/controllers\/SequencesController.php":2644318859,"src\/controllers\/HelpController.php":457620283,"src\/controllers\/ConversionsController.php":2488461465,"src\/controllers\/LanguagesController.php":2014552592,"src\/controllers\/DisplayController.php":2705959491,"src\/controllers\/FulltextController.php":990578685,"src\/controllers\/TablesController.php":274205487,"src\/controllers\/TblpropertiesController.php":980221542,"src\/controllers\/LoginController.php":1155358024,"src\/controllers\/ColpropertiesController.php":2966427309,"src\/controllers\/PrivilegesController.php":671381246,"src\/controllers\/ConstraintsController.php":3951936773,"src\/controllers\/BrowserController.php":27334506,"src\/controllers\/AlldbController.php":3180251525,"src\/controllers\/ServersController.php":2969505547,"src\/controllers\/GroupsController.php":3589122074,"src\/controllers\/SqleditController.php":3506156270,"src\/controllers\/DomainsController.php":2437453775,"src\/controllers\/IntroController.php":3527686851,"src\/controllers\/ViewsController.php":2166336864,"src\/controllers\/HistoryController.php":2104312742,"src\/controllers\/DataimportController.php":3155922937,"src\/controllers\/ViewpropertiesController.php":332285447,"src\/controllers\/AggregatesController.php":1719053416,"src\/controllers\/DbexportController.php":2538197524,"src\/controllers\/UsersController.php":1357820969,"src\/controllers\/InfoController.php":1032671364,"src\/controllers\/TriggersController.php":2790190857,"src\/controllers\/FunctionsController.php":3078701811,"src\/controllers\/SqlController.php":1813956243,"src\/controllers\/MaterializedviewpropertiesController.php":3677640799,"src\/controllers\/DatabaseController.php":1362991132,"src\/controllers\/TablespacesController.php":1278389524,"src\/controllers\/DataexportController.php":1235645509,"src\/controllers\/RolesController.php":4023407786,"src\/controllers\/OpclassesController.php":493174888,"src\/controllers\/SchemasController.php":3950020332,"src\/controllers\/BaseController.php":3768072940,"src\/controllers\/OperatorsController.php":2630728515,"src\/controllers\/MaterializedviewsController.php":1162741510,"src\/controllers\/TypesController.php":3380810660,"src\/controllers\/AcinsertController.php":3038211285,"src\/database\/Postgres11.php":1968612451,"src\/database\/Postgres95.php":3580037828,"src\/database\/Postgres10.php":1159617323,"src\/database\/Postgres82.php":1223463898,"src\/database\/Postgres84.php":1443073409,"src\/database\/Postgres80.php":3339271718,"src\/database\/ADOdbBase.php":3172754397,"src\/database\/Postgres93.php":1115342788,"src\/database\/Postgres81.php":1882036839,"src\/database\/Postgres96.php":2890058162,"src\/database\/Postgres94.php":3498738139,"src\/database\/Postgres83.php":2876336343,"src\/database\/Postgres92.php":2541277098,"src\/database\/databasetraits\/ColumnTrait.php":312962276,"src\/database\/databasetraits\/IndexTrait.php":3995430341,"src\/database\/databasetraits\/RowTrait.php":436252769,"src\/database\/databasetraits\/TableTrait.php":2575101738,"src\/database\/databasetraits\/AggregateTrait.php":2359388966,"src\/database\/databasetraits\/DomainTrait.php":1221007930,"src\/database\/databasetraits\/SequenceTrait.php":3804542583,"src\/database\/databasetraits\/RoleTrait.php":3287656487,"src\/database\/databasetraits\/PrivilegesTrait.php":671291332,"src\/database\/databasetraits\/HasTrait.php":2573667161,"src\/database\/databasetraits\/SchemaTrait.php":3233033127,"src\/database\/databasetraits\/TablespaceTrait.php":690341956,"src\/database\/databasetraits\/FunctionTrait.php":1691851649,"src\/database\/databasetraits\/FtsTrait.php":3746187234,"src\/database\/databasetraits\/OperatorTrait.php":1045256877,"src\/database\/databasetraits\/ViewTrait.php":2940202456,"src\/database\/databasetraits\/DatabaseTrait.php":27709065,"src\/database\/databasetraits\/TriggerTrait.php":1442455157,"src\/database\/databasetraits\/TypeTrait.php":2974230289,"src\/database\/databasetraits\/StatsTrait.php":683322152,"src\/database\/Postgres.php":551184199,"src\/database\/Postgres90.php":558405099,"src\/database\/Connection.php":2277793921,"src\/database\/Postgres74.php":42477199,"src\/database\/Postgres91.php":4150033219,"src\/decorators\/UrlDecorator.php":942163121,"src\/decorators\/IfEmptyDecorator.php":2166055998,"src\/decorators\/ActionUrlDecorator.php":2593224491,"src\/decorators\/ConcatDecorator.php":2770991218,"src\/decorators\/BranchUrlDecorator.php":3811854664,"src\/decorators\/Decorator.php":2776548581,"src\/decorators\/RedirectUrlDecorator.php":43445443,"src\/decorators\/ArrayMergeDecorator.php":3914056033,"src\/decorators\/CallbackDecorator.php":2733762088,"src\/decorators\/FieldDecorator.php":1486232989,"src\/decorators\/ReplaceDecorator.php":3574023343,"src\/help\/PostgresDoc74.php":729584230,"src\/help\/PostgresDoc81.php":2956660014,"src\/help\/PostgresDoc94.php":1851426879,"src\/help\/PostgresDoc93.php":4212302154,"src\/help\/PostgresDoc92.php":1586070351,"src\/help\/PostgresDoc95.php":3934140533,"src\/help\/PostgresDoc10.php":2676096134,"src\/help\/PostgresDoc96.php":4066673197,"src\/help\/PostgresDoc82.php":1951977576,"src\/help\/PostgresDoc90.php":3612132763,"src\/help\/PostgresDoc84.php":824056857,"src\/help\/PostgresDoc91.php":835437597,"src\/help\/PostgresDoc83.php":2825767305,"src\/help\/PostgresDoc80.php":2833062879,"src\/translations\/ChineseTr.php":986260492,"src\/translations\/Hebrew.php":2792969197,"src\/translations\/Japanese.php":2889708446,"src\/translations\/Czech.php":559934248,"src\/translations\/ChineseUtf8ZhTw.php":1261713366,"src\/translations\/Greek.php":3018240507,"src\/translations\/ChineseUtf8ZhCn.php":274148706,"src\/translations\/Galician.php":1750925620,"src\/translations\/Russian.php":2610820704,"src\/translations\/Arabic.php":2991930496,"src\/translations\/Dutch.php":2818831375,"src\/translations\/Catalan.php":1223612252,"src\/translations\/Hungarian.php":884591538,"src\/translations\/Mongol.php":213405372,"src\/translations\/ChineseSim.php":1146461961,"src\/translations\/Ukrainian.php":352369837,"src\/translations\/German.php":3674378174,"src\/translations\/Romanian.php":2182621768,"src\/translations\/Turkish.php":284509356,"src\/translations\/Polish.php":1941804852,"src\/translations\/Spanish.php":1848333972,"src\/translations\/French.php":657102769,"src\/translations\/PortugueseBr.php":3126239743,"src\/translations\/Lithuanian.php":987792267,"src\/translations\/Danish.php":576630850,"src\/translations\/Swedish.php":629900700,"src\/translations\/RussianUtf8.php":2226467343,"src\/translations\/Afrikaans.php":2436824023,"src\/translations\/English.php":2666324785,"src\/translations\/Italian.php":2079153085,"src\/translations\/PortuguesePt.php":1685761122,"src\/translations\/Slovak.php":3882796903,"src\/xhtml\/TreeController.php":3449163446,"src\/xhtml\/HTMLController.php":2294800327,"src\/xhtml\/XHtmlSimpleElement.php":2092953836,"src\/xhtml\/XHtmlElement.php":2533566513,"src\/xhtml\/XHtmlSelect.php":1626408328,"src\/xhtml\/HTMLFooterController.php":2065079737,"src\/xhtml\/XHtmlButton.php":1760949655,"src\/xhtml\/HTMLTableController.php":4120804546,"src\/xhtml\/XHtmlOption.php":427884174,"src\/xhtml\/HTMLHeaderController.php":2182539335,"src\/xhtml\/HTMLNavbarController.php":2917032119,"src\/traits\/ViewsMatviewsTrait.php":3739078395,"src\/traits\/AdminTrait.php":2407810245,"src\/traits\/HelperTrait.php":1789063907,"src\/traits\/ExportTrait.php":819086192,"src\/traits\/InsertEditRowTrait.php":507809844,"src\/traits\/ServersTrait.php":2216035096,"src\/traits\/ViewsMatViewsPropertiesTrait.php":1906792290,"src\/traits\/MiscTrait.php":2114113215,"src\/traits\/FormTrait.php":820836331,"tests\/views\/indexes.php":2200217953,"tests\/views\/sequences.php":2391962608,"tests\/views\/schemas.php":3216416166,"tests\/views\/constraints.php":770176757,"tests\/views\/dataimport.php":4206850898,"tests\/views\/help.php":1249249498,"tests\/views\/materializedviewproperties.php":1829470648,"tests\/views\/roles.php":1672864739,"tests\/views\/dbexport.php":3968215459,"tests\/views\/acinsert.php":1897644417,"tests\/views\/colproperties.php":1492265034,"tests\/views\/types.php":3692774285,"tests\/views\/users.php":1267301225,"tests\/views\/conversions.php":2269057750,"tests\/views\/casts.php":2069136230,"tests\/views\/display.php":1725142398,"tests\/views\/fulltext.php":2982151426,"tests\/views\/browser.php":1672204021,"tests\/views\/materializedviews.php":1325952107,"tests\/views\/triggers.php":1314289587,"tests\/views\/sql.php":1258056429,"tests\/views\/tblproperties.php":2173582460,"tests\/views\/alldb.php":2613589513,"tests\/views\/history.php":2889894116,"tests\/views\/languages.php":1419316875,"tests\/views\/database.php":2935667329,"tests\/views\/groups.php":83142180,"tests\/views\/tablespaces.php":1324110158,"tests\/views\/opclasses.php":4258972084,"tests\/views\/tables.php":311507377,"tests\/views\/functions.php":3598705695,"tests\/views\/info.php":2562300377,"tests\/views\/servers.php":722835729,"tests\/views\/sqledit.php":704619837,"tests\/views\/dataexport.php":2715985285,"tests\/views\/rules.php":173933293,"tests\/views\/operators.php":4169388562,"tests\/views\/domains.php":1200160286,"tests\/views\/viewproperties.php":1863413022,"tests\/views\/privileges.php":3800423186,"tests\/views\/login.php":2945959251,"tests\/views\/aggregates.php":1863091980,"tests\/views\/intro.php":376554437,"tests\/views\/views.php":4123750352,"tests\/_support\/FunctionalTester.php":1791960406,"tests\/_support\/Helper\/Unit.php":3772399729,"tests\/_support\/Helper\/Functional.php":2402076636,"tests\/_support\/Helper\/Acceptance.php":2797295696,"tests\/_support\/AcceptanceTester.php":2828510810,"tests\/_support\/UnitTester.php":2832432027,"tests\/_support\/_generated\/UnitTesterActions.php":1518530715,"tests\/selenium\/src\/08-domaine.php":4229140364,"tests\/selenium\/src\/99-cleantests.php":4264984845,"tests\/selenium\/src\/01-roles.php":395838551,"tests\/selenium\/src\/10-table.php":601183658,"tests\/selenium\/src\/04-database.php":1965945547,"tests\/selenium\/src\/06-schema.php":1345321947,"tests\/selenium\/src\/12-admin.php":2593952527,"tests\/selenium\/src\/30-view.php":2365788139,"tests\/selenium\/src\/35-index.php":1939154303,"tests\/selenium\/src\/20-constraint.php":2523209670,"tests\/selenium\/src\/15-sequence.php":367482705,"tests\/selenium\/src\/25-column.php":3054171799,"tests\/selenium\/TestSuite.php":1813549218,"tests\/selenium\/testBuilder.class.php":973469769,"tests\/unit\/ViewTest.php":2992254197,"tests\/simpletest\/config.tests.php":2150232111,"tests\/simpletest\/testcase\/Databases\/AdminTest.php":3010341842,"tests\/simpletest\/testcase\/Databases\/SchemaBasicTest.php":1503238630,"tests\/simpletest\/testcase\/Databases\/ProcessesTest.php":3763429944,"tests\/simpletest\/testcase\/Databases\/DatabaseGroupTest.php":3280092872,"tests\/simpletest\/testcase\/Databases\/VariablesTest.php":1255799044,"tests\/simpletest\/testcase\/Databases\/HelpTest.php":2290791666,"tests\/simpletest\/testcase\/Databases\/SqlTest.php":2914835753,"tests\/simpletest\/testcase\/Databases\/CastsTest.php":3663939711,"tests\/simpletest\/testcase\/Databases\/DatabaseTest.php":3060495324,"tests\/simpletest\/testcase\/Databases\/LanguageTest.php":880132126,"tests\/simpletest\/testcase\/Databases\/FindObjectsTest.php":1163989634,"tests\/simpletest\/testcase\/Common\/SecurityTest.php":3243173082,"tests\/simpletest\/testcase\/Common\/ImportTest.php":1502326037,"tests\/simpletest\/testcase\/Common\/CommonGroupTest.php":676971854,"tests\/simpletest\/testcase\/Common\/ExportTest.php":397702403,"tests\/simpletest\/testcase\/testphpPgAdminMain.php":381875153,"tests\/simpletest\/testcase\/Server\/GroupsTest.php":1102666345,"tests\/simpletest\/testcase\/Server\/UsersTest.php":1866900807,"tests\/simpletest\/testcase\/Server\/ReportsTest.php":515612654,"tests\/simpletest\/testcase\/Server\/TableSpacesTest.php":2691617794,"tests\/simpletest\/testcase\/Server\/ServerGroupTest.php":1336235295,"tests\/simpletest\/testcase\/phpcoverage.inc.php":3621930486,"tests\/simpletest\/testcase\/simpletest.inc.php":2274415542,"tests\/simpletest\/testcase\/Public\/common.php":3629984802,"tests\/simpletest\/testcase\/Public\/SetPrecondition.php":342476368,"tests\/simpletest\/testcase\/coveragephpPgAdminMain.php":3565056987,"tests\/simpletest\/testcase\/Schemas\/SequenceTest.php":3132495228,"tests\/simpletest\/testcase\/Schemas\/OpClassTest.php":2559722014,"tests\/simpletest\/testcase\/Schemas\/TypeTest.php":1512547997,"tests\/simpletest\/testcase\/Schemas\/DomainTest.php":1465934092,"tests\/simpletest\/testcase\/Schemas\/ConversionTest.php":3847011304,"tests\/simpletest\/testcase\/Schemas\/SchemasGroupTest.php":2491131148,"tests\/simpletest\/testcase\/Schemas\/TableTest.php":554869547,"tests\/simpletest\/testcase\/Schemas\/FunctionTest.php":1076774832,"tests\/simpletest\/testcase\/Schemas\/AggregateTest.php":716923294,"tests\/simpletest\/testcase\/Schemas\/ViewTest.php":3352467516,"tests\/simpletest\/testcase\/Schemas\/OperatorTest.php":235673383,"tests\/simpletest\/testcase\/Tables\/InfoTest.php":4235842439,"tests\/simpletest\/testcase\/Tables\/ConstraintsTest.php":1971542248,"tests\/simpletest\/testcase\/Tables\/RulesTest.php":1751535839,"tests\/simpletest\/testcase\/Tables\/TableGroupTest.php":2030866382,"tests\/simpletest\/testcase\/Tables\/TriggersTest.php":2233351446,"tests\/simpletest\/testcase\/Tables\/IndexesTest.php":1222565530,"tests\/simpletest\/testcase\/Tables\/DeadlockTest.php":237439304,"tests\/simpletest\/testcase\/Tables\/ColumnTest.php":384266998,"tests\/simpletest\/tests.php":1931879116,"index.php":2695501869}} \ No newline at end of file
+{"php":"7.2.12-1+ubuntu16.04.1+deb.sury.org+1","version":"2.12.1:v2.12.1#beef6cbe6dec7205edcd143842a49f9a691859a6","rules":{"no_php4_constructor":true,"php_unit_namespaced":{"target":"6.0"},"php_unit_dedicate_assert":{"target":"5.6"},"php_unit_expectation":{"target":"5.6"},"php_unit_mock":{"target":"5.5"},"php_unit_no_expectation_annotation":{"target":"4.3"},"binary_operator_spaces":{"align_double_arrow":true,"align_equals":true},"blank_line_after_opening_tag":true,"blank_line_before_statement":true,"braces":true,"cast_spaces":true,"class_attributes_separation":{"elements":["method"]},"class_definition":true,"concat_space":{"spacing":"none"},"declare_equal_normalize":true,"function_typehint_space":true,"include":true,"increment_style":true,"lowercase_cast":true,"lowercase_static_reference":true,"magic_constant_casing":true,"method_argument_space":{"ensure_fully_multiline":true},"native_function_casing":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_blank_lines_after_phpdoc":true,"no_empty_comment":true,"no_empty_phpdoc":true,"no_empty_statement":true,"no_extra_blank_lines":{"tokens":["break","case","continue","curly_brace_block","default","extra","parenthesis_brace_block","return","square_brace_block","switch","throw","use","useTrait","use_trait"]},"no_leading_import_slash":true,"no_leading_namespace_whitespace":true,"no_mixed_echo_print":{"use":"echo"},"no_multiline_whitespace_around_double_arrow":true,"no_short_bool_cast":true,"no_singleline_whitespace_before_semicolons":true,"no_spaces_around_offset":true,"no_trailing_comma_in_list_call":true,"no_trailing_comma_in_singleline_array":true,"no_unneeded_control_parentheses":true,"no_unneeded_curly_braces":true,"no_unneeded_final_method":true,"no_unused_imports":true,"no_whitespace_before_comma_in_array":true,"no_whitespace_in_blank_line":true,"normalize_index_brace":true,"object_operator_without_whitespace":true,"php_unit_fqcn_annotation":true,"phpdoc_align":true,"phpdoc_annotation_without_dot":true,"phpdoc_indent":true,"phpdoc_inline_tag":true,"phpdoc_no_access":true,"phpdoc_no_alias_tag":true,"phpdoc_no_empty_return":true,"phpdoc_no_useless_inheritdoc":true,"phpdoc_return_self_reference":true,"phpdoc_scalar":true,"phpdoc_separation":true,"phpdoc_single_line_var_spacing":true,"phpdoc_summary":true,"phpdoc_to_comment":true,"phpdoc_trim":true,"phpdoc_types":true,"phpdoc_var_without_name":true,"protected_to_private":true,"return_type_declaration":true,"semicolon_after_instruction":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_class_element_per_statement":{"elements":["property"]},"single_quote":true,"space_after_semicolon":{"remove_in_empty_for_expressions":true},"standardize_increment":true,"standardize_not_equals":true,"ternary_operator_spaces":true,"trailing_comma_in_multiline_array":true,"trim_array_spaces":true,"unary_operator_spaces":true,"whitespace_after_comma_in_array":true,"blank_line_after_namespace":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_constants":true,"lowercase_keywords":true,"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":true,"modernize_types_casting":true,"align_multiline_comment":true,"array_syntax":{"syntax":"short"},"combine_consecutive_issets":true,"combine_consecutive_unsets":true,"compact_nullable_typehint":true,"escape_implicit_backslashes":true,"explicit_indirect_variable":true,"explicit_string_variable":true,"final_internal_class":true,"header_comment":{"commentType":"PHPDoc","header":"PHPPgAdmin v6.0.0-beta.50"},"heredoc_to_nowdoc":true,"list_syntax":{"syntax":"long"},"method_chaining_indentation":true,"multiline_comment_opening_closing":true,"no_null_property_initialization":true,"no_short_echo_tag":true,"no_superfluous_elseif":true,"no_unreachable_default_argument_value":true,"no_useless_else":true,"no_useless_return":true,"ordered_imports":true,"php_unit_strict":true,"php_unit_test_annotation":true,"php_unit_test_class_requires_covers":true,"phpdoc_add_missing_param_annotation":true,"phpdoc_order":true,"phpdoc_types_order":true,"strict_param":true},"hashes":{"src\/classes\/ADOdbException.php":2130494863,"src\/classes\/ADONewConnection.php":971289519,"src\/classes\/ArrayRecordSet.php":643779323,"src\/classes\/ContainerUtils.php":175370279,"src\/classes\/PluginManager.php":407811601,"src\/classes\/Misc.php":3316303728,"src\/classes\/Translations.php":160991078,"src\/classes\/ADORecordSet.php":3392816394,"src\/controllers\/CastsController.php":335351941,"src\/controllers\/RulesController.php":1842521491,"src\/controllers\/IndexesController.php":2293789589,"src\/controllers\/SequencesController.php":2644318859,"src\/controllers\/HelpController.php":457620283,"src\/controllers\/ConversionsController.php":2488461465,"src\/controllers\/LanguagesController.php":2014552592,"src\/controllers\/DisplayController.php":2705959491,"src\/controllers\/FulltextController.php":990578685,"src\/controllers\/TablesController.php":274205487,"src\/controllers\/TblpropertiesController.php":2934279786,"src\/controllers\/LoginController.php":1155358024,"src\/controllers\/ColpropertiesController.php":2966427309,"src\/controllers\/PrivilegesController.php":671381246,"src\/controllers\/ConstraintsController.php":3951936773,"src\/controllers\/BrowserController.php":27334506,"src\/controllers\/AlldbController.php":3180251525,"src\/controllers\/ServersController.php":2969505547,"src\/controllers\/GroupsController.php":3589122074,"src\/controllers\/SqleditController.php":3506156270,"src\/controllers\/DomainsController.php":2437453775,"src\/controllers\/IntroController.php":3527686851,"src\/controllers\/ViewsController.php":2166336864,"src\/controllers\/HistoryController.php":2104312742,"src\/controllers\/DataimportController.php":2309332207,"src\/controllers\/ViewpropertiesController.php":332285447,"src\/controllers\/AggregatesController.php":1719053416,"src\/controllers\/DbexportController.php":2538197524,"src\/controllers\/UsersController.php":1357820969,"src\/controllers\/InfoController.php":1992725295,"src\/controllers\/TriggersController.php":2790190857,"src\/controllers\/FunctionsController.php":3078701811,"src\/controllers\/SqlController.php":1813956243,"src\/controllers\/MaterializedviewpropertiesController.php":3677640799,"src\/controllers\/DatabaseController.php":1362991132,"src\/controllers\/TablespacesController.php":1278389524,"src\/controllers\/DataexportController.php":1235645509,"src\/controllers\/RolesController.php":4023407786,"src\/controllers\/OpclassesController.php":493174888,"src\/controllers\/SchemasController.php":3950020332,"src\/controllers\/BaseController.php":3768072940,"src\/controllers\/OperatorsController.php":2630728515,"src\/controllers\/MaterializedviewsController.php":1162741510,"src\/controllers\/TypesController.php":3380810660,"src\/controllers\/AcinsertController.php":3038211285,"src\/database\/Postgres11.php":1968612451,"src\/database\/Postgres95.php":3580037828,"src\/database\/Postgres10.php":1159617323,"src\/database\/Postgres82.php":1223463898,"src\/database\/Postgres84.php":1443073409,"src\/database\/Postgres80.php":3339271718,"src\/database\/ADOdbBase.php":3172754397,"src\/database\/Postgres93.php":1115342788,"src\/database\/Postgres81.php":1882036839,"src\/database\/Postgres96.php":2890058162,"src\/database\/Postgres94.php":3498738139,"src\/database\/Postgres83.php":2876336343,"src\/database\/Postgres92.php":2541277098,"src\/database\/databasetraits\/ColumnTrait.php":312962276,"src\/database\/databasetraits\/IndexTrait.php":3995430341,"src\/database\/databasetraits\/RowTrait.php":436252769,"src\/database\/databasetraits\/TableTrait.php":3937322987,"src\/database\/databasetraits\/AggregateTrait.php":2359388966,"src\/database\/databasetraits\/DomainTrait.php":1221007930,"src\/database\/databasetraits\/SequenceTrait.php":3804542583,"src\/database\/databasetraits\/RoleTrait.php":3287656487,"src\/database\/databasetraits\/PrivilegesTrait.php":671291332,"src\/database\/databasetraits\/HasTrait.php":2573667161,"src\/database\/databasetraits\/SchemaTrait.php":3233033127,"src\/database\/databasetraits\/TablespaceTrait.php":690341956,"src\/database\/databasetraits\/FunctionTrait.php":1691851649,"src\/database\/databasetraits\/FtsTrait.php":3746187234,"src\/database\/databasetraits\/OperatorTrait.php":1045256877,"src\/database\/databasetraits\/ViewTrait.php":2940202456,"src\/database\/databasetraits\/DatabaseTrait.php":3077244940,"src\/database\/databasetraits\/TriggerTrait.php":1442455157,"src\/database\/databasetraits\/TypeTrait.php":2974230289,"src\/database\/databasetraits\/StatsTrait.php":683322152,"src\/database\/Postgres.php":551184199,"src\/database\/Postgres90.php":558405099,"src\/database\/Connection.php":2277793921,"src\/database\/Postgres74.php":42477199,"src\/database\/Postgres91.php":4150033219,"src\/decorators\/UrlDecorator.php":942163121,"src\/decorators\/IfEmptyDecorator.php":2166055998,"src\/decorators\/ActionUrlDecorator.php":2593224491,"src\/decorators\/ConcatDecorator.php":2770991218,"src\/decorators\/BranchUrlDecorator.php":3811854664,"src\/decorators\/Decorator.php":2776548581,"src\/decorators\/RedirectUrlDecorator.php":43445443,"src\/decorators\/ArrayMergeDecorator.php":3914056033,"src\/decorators\/CallbackDecorator.php":2733762088,"src\/decorators\/FieldDecorator.php":1486232989,"src\/decorators\/ReplaceDecorator.php":3574023343,"src\/help\/PostgresDoc74.php":729584230,"src\/help\/PostgresDoc81.php":2956660014,"src\/help\/PostgresDoc94.php":1851426879,"src\/help\/PostgresDoc93.php":4212302154,"src\/help\/PostgresDoc92.php":1586070351,"src\/help\/PostgresDoc95.php":3934140533,"src\/help\/PostgresDoc10.php":2676096134,"src\/help\/PostgresDoc96.php":4066673197,"src\/help\/PostgresDoc82.php":1951977576,"src\/help\/PostgresDoc90.php":3612132763,"src\/help\/PostgresDoc84.php":824056857,"src\/help\/PostgresDoc91.php":835437597,"src\/help\/PostgresDoc83.php":2825767305,"src\/help\/PostgresDoc80.php":2833062879,"src\/translations\/ChineseTr.php":986260492,"src\/translations\/Hebrew.php":2792969197,"src\/translations\/Japanese.php":2889708446,"src\/translations\/Czech.php":559934248,"src\/translations\/ChineseUtf8ZhTw.php":1261713366,"src\/translations\/Greek.php":3018240507,"src\/translations\/ChineseUtf8ZhCn.php":274148706,"src\/translations\/Galician.php":1750925620,"src\/translations\/Russian.php":2610820704,"src\/translations\/Arabic.php":2991930496,"src\/translations\/Dutch.php":2818831375,"src\/translations\/Catalan.php":1223612252,"src\/translations\/Hungarian.php":884591538,"src\/translations\/Mongol.php":213405372,"src\/translations\/ChineseSim.php":1146461961,"src\/translations\/Ukrainian.php":352369837,"src\/translations\/German.php":3674378174,"src\/translations\/Romanian.php":2182621768,"src\/translations\/Turkish.php":284509356,"src\/translations\/Polish.php":1941804852,"src\/translations\/Spanish.php":1848333972,"src\/translations\/French.php":657102769,"src\/translations\/PortugueseBr.php":3126239743,"src\/translations\/Lithuanian.php":987792267,"src\/translations\/Danish.php":576630850,"src\/translations\/Swedish.php":629900700,"src\/translations\/RussianUtf8.php":2226467343,"src\/translations\/Afrikaans.php":2436824023,"src\/translations\/English.php":2666324785,"src\/translations\/Italian.php":2079153085,"src\/translations\/PortuguesePt.php":1685761122,"src\/translations\/Slovak.php":3882796903,"src\/xhtml\/TreeController.php":3449163446,"src\/xhtml\/HTMLController.php":2294800327,"src\/xhtml\/XHtmlSimpleElement.php":2092953836,"src\/xhtml\/XHtmlElement.php":2533566513,"src\/xhtml\/XHtmlSelect.php":1626408328,"src\/xhtml\/HTMLFooterController.php":2065079737,"src\/xhtml\/XHtmlButton.php":1760949655,"src\/xhtml\/HTMLTableController.php":4120804546,"src\/xhtml\/XHtmlOption.php":427884174,"src\/xhtml\/HTMLHeaderController.php":2182539335,"src\/xhtml\/HTMLNavbarController.php":2917032119,"src\/traits\/ViewsMatviewsTrait.php":3739078395,"src\/traits\/AdminTrait.php":2407810245,"src\/traits\/HelperTrait.php":1789063907,"src\/traits\/ExportTrait.php":819086192,"src\/traits\/InsertEditRowTrait.php":507809844,"src\/traits\/ServersTrait.php":2216035096,"src\/traits\/ViewsMatViewsPropertiesTrait.php":1906792290,"src\/traits\/MiscTrait.php":2114113215,"src\/traits\/FormTrait.php":820836331,"tests\/views\/indexes.php":2200217953,"tests\/views\/sequences.php":2391962608,"tests\/views\/schemas.php":3216416166,"tests\/views\/constraints.php":770176757,"tests\/views\/dataimport.php":4206850898,"tests\/views\/help.php":1249249498,"tests\/views\/materializedviewproperties.php":1829470648,"tests\/views\/roles.php":1672864739,"tests\/views\/dbexport.php":3968215459,"tests\/views\/acinsert.php":1897644417,"tests\/views\/colproperties.php":1492265034,"tests\/views\/types.php":3692774285,"tests\/views\/users.php":1267301225,"tests\/views\/conversions.php":2269057750,"tests\/views\/casts.php":2069136230,"tests\/views\/display.php":1725142398,"tests\/views\/fulltext.php":2982151426,"tests\/views\/browser.php":1672204021,"tests\/views\/materializedviews.php":1325952107,"tests\/views\/triggers.php":1314289587,"tests\/views\/sql.php":1258056429,"tests\/views\/tblproperties.php":2173582460,"tests\/views\/alldb.php":2613589513,"tests\/views\/history.php":2889894116,"tests\/views\/languages.php":1419316875,"tests\/views\/database.php":2935667329,"tests\/views\/groups.php":83142180,"tests\/views\/tablespaces.php":1324110158,"tests\/views\/opclasses.php":4258972084,"tests\/views\/tables.php":311507377,"tests\/views\/functions.php":3598705695,"tests\/views\/info.php":2562300377,"tests\/views\/servers.php":722835729,"tests\/views\/sqledit.php":704619837,"tests\/views\/dataexport.php":2715985285,"tests\/views\/rules.php":173933293,"tests\/views\/operators.php":4169388562,"tests\/views\/domains.php":1200160286,"tests\/views\/viewproperties.php":1863413022,"tests\/views\/privileges.php":3800423186,"tests\/views\/login.php":2945959251,"tests\/views\/aggregates.php":1863091980,"tests\/views\/intro.php":376554437,"tests\/views\/views.php":4123750352,"tests\/_support\/FunctionalTester.php":1791960406,"tests\/_support\/Helper\/Unit.php":3772399729,"tests\/_support\/Helper\/Functional.php":2402076636,"tests\/_support\/Helper\/Acceptance.php":2797295696,"tests\/_support\/AcceptanceTester.php":2828510810,"tests\/_support\/UnitTester.php":2832432027,"tests\/_support\/_generated\/UnitTesterActions.php":1518530715,"tests\/selenium\/src\/08-domaine.php":4229140364,"tests\/selenium\/src\/99-cleantests.php":4264984845,"tests\/selenium\/src\/01-roles.php":395838551,"tests\/selenium\/src\/10-table.php":601183658,"tests\/selenium\/src\/04-database.php":1965945547,"tests\/selenium\/src\/06-schema.php":1345321947,"tests\/selenium\/src\/12-admin.php":2593952527,"tests\/selenium\/src\/30-view.php":2365788139,"tests\/selenium\/src\/35-index.php":1939154303,"tests\/selenium\/src\/20-constraint.php":2523209670,"tests\/selenium\/src\/15-sequence.php":367482705,"tests\/selenium\/src\/25-column.php":3054171799,"tests\/selenium\/TestSuite.php":1813549218,"tests\/selenium\/testBuilder.class.php":973469769,"tests\/unit\/ViewTest.php":2992254197,"tests\/simpletest\/config.tests.php":2150232111,"tests\/simpletest\/testcase\/Databases\/AdminTest.php":3010341842,"tests\/simpletest\/testcase\/Databases\/SchemaBasicTest.php":1503238630,"tests\/simpletest\/testcase\/Databases\/ProcessesTest.php":3763429944,"tests\/simpletest\/testcase\/Databases\/DatabaseGroupTest.php":3280092872,"tests\/simpletest\/testcase\/Databases\/VariablesTest.php":1255799044,"tests\/simpletest\/testcase\/Databases\/HelpTest.php":2290791666,"tests\/simpletest\/testcase\/Databases\/SqlTest.php":2914835753,"tests\/simpletest\/testcase\/Databases\/CastsTest.php":3663939711,"tests\/simpletest\/testcase\/Databases\/DatabaseTest.php":3060495324,"tests\/simpletest\/testcase\/Databases\/LanguageTest.php":880132126,"tests\/simpletest\/testcase\/Databases\/FindObjectsTest.php":1163989634,"tests\/simpletest\/testcase\/Common\/SecurityTest.php":3243173082,"tests\/simpletest\/testcase\/Common\/ImportTest.php":1502326037,"tests\/simpletest\/testcase\/Common\/CommonGroupTest.php":676971854,"tests\/simpletest\/testcase\/Common\/ExportTest.php":397702403,"tests\/simpletest\/testcase\/testphpPgAdminMain.php":381875153,"tests\/simpletest\/testcase\/Server\/GroupsTest.php":1102666345,"tests\/simpletest\/testcase\/Server\/UsersTest.php":1866900807,"tests\/simpletest\/testcase\/Server\/ReportsTest.php":515612654,"tests\/simpletest\/testcase\/Server\/TableSpacesTest.php":2691617794,"tests\/simpletest\/testcase\/Server\/ServerGroupTest.php":1336235295,"tests\/simpletest\/testcase\/phpcoverage.inc.php":3621930486,"tests\/simpletest\/testcase\/simpletest.inc.php":2274415542,"tests\/simpletest\/testcase\/Public\/common.php":3629984802,"tests\/simpletest\/testcase\/Public\/SetPrecondition.php":342476368,"tests\/simpletest\/testcase\/coveragephpPgAdminMain.php":3565056987,"tests\/simpletest\/testcase\/Schemas\/SequenceTest.php":3132495228,"tests\/simpletest\/testcase\/Schemas\/OpClassTest.php":2559722014,"tests\/simpletest\/testcase\/Schemas\/TypeTest.php":1512547997,"tests\/simpletest\/testcase\/Schemas\/DomainTest.php":1465934092,"tests\/simpletest\/testcase\/Schemas\/ConversionTest.php":3847011304,"tests\/simpletest\/testcase\/Schemas\/SchemasGroupTest.php":2491131148,"tests\/simpletest\/testcase\/Schemas\/TableTest.php":554869547,"tests\/simpletest\/testcase\/Schemas\/FunctionTest.php":1076774832,"tests\/simpletest\/testcase\/Schemas\/AggregateTest.php":716923294,"tests\/simpletest\/testcase\/Schemas\/ViewTest.php":3352467516,"tests\/simpletest\/testcase\/Schemas\/OperatorTest.php":235673383,"tests\/simpletest\/testcase\/Tables\/InfoTest.php":4235842439,"tests\/simpletest\/testcase\/Tables\/ConstraintsTest.php":1971542248,"tests\/simpletest\/testcase\/Tables\/RulesTest.php":1751535839,"tests\/simpletest\/testcase\/Tables\/TableGroupTest.php":2030866382,"tests\/simpletest\/testcase\/Tables\/TriggersTest.php":2233351446,"tests\/simpletest\/testcase\/Tables\/IndexesTest.php":1222565530,"tests\/simpletest\/testcase\/Tables\/DeadlockTest.php":237439304,"tests\/simpletest\/testcase\/Tables\/ColumnTest.php":384266998,"tests\/simpletest\/tests.php":1931879116,"index.php":2695501869}} \ No newline at end of file
diff --git a/src/controllers/InfoController.php b/src/controllers/InfoController.php
index 8a66ae30..c702e2d0 100644
--- a/src/controllers/InfoController.php
+++ b/src/controllers/InfoController.php
@@ -51,7 +51,7 @@ class InfoController extends BaseController
$this->printMsg($msg);
// common params for printVal
- $shownull = ['null' => true];
+ $this->shownull = ['null' => true];
// Fetch info
$referrers = $data->getReferrers($_REQUEST['table']);
@@ -68,306 +68,342 @@ class InfoController extends BaseController
&& (0 == $tablestatstups->recordCount() && 0 == $tablestatsio->recordCount()
&& 0 == $indexstatstups->recordCount() && 0 == $indexstatsio->recordCount())) {
$this->printMsg($this->lang['strnoinfo']);
- } else {
- // Referring foreign tables
- if ($referrers !== -99 && $referrers->recordCount() > 0) {
- echo "<h3>{$this->lang['strreferringtables']}</h3>".PHP_EOL;
-
- $columns = [
- 'schema' => [
- 'title' => $this->lang['strschema'],
- 'field' => Decorator::field('nspname'),
- ],
- 'table' => [
- 'title' => $this->lang['strtable'],
- 'field' => Decorator::field('relname'),
- ],
- 'name' => [
- 'title' => $this->lang['strname'],
- 'field' => Decorator::field('conname'),
- ],
- 'definition' => [
- 'title' => $this->lang['strdefinition'],
- 'field' => Decorator::field('consrc'),
- ],
- 'actions' => [
- 'title' => $this->lang['stractions'],
- ],
- ];
-
- $actions = [
- 'properties' => [
- 'content' => $this->lang['strproperties'],
- 'attr' => [
- 'href' => [
- 'url' => 'constraints',
- 'urlvars' => [
- 'schema' => Decorator::field('nspname'),
- 'table' => Decorator::field('relname'),
- ],
- ],
- ],
- ],
- ];
- echo $this->printTable($referrers, $columns, $actions, 'info-referrers', $this->lang['strnodata']);
- }
+ return;
+ }
+ // Referring foreign tables
+ if ($referrers !== -99 && $referrers->recordCount() > 0) {
+ $this->_printReferring($referrers);
+ }
- // Parent tables
- if ($parents->recordCount() > 0) {
- echo "<h3>{$this->lang['strparenttables']}</h3>".PHP_EOL;
+ // Parent tables
+ if ($parents->recordCount() > 0) {
+ $this->_printParents($parents);
+ }
- $columns = [
- 'schema' => [
- 'title' => $this->lang['strschema'],
- 'field' => Decorator::field('nspname'),
- ],
- 'table' => [
- 'title' => $this->lang['strtable'],
- 'field' => Decorator::field('relname'),
- ],
- 'actions' => [
- 'title' => $this->lang['stractions'],
- ],
- ];
-
- $actions = [
- 'properties' => [
- 'content' => $this->lang['strproperties'],
- 'attr' => [
- 'href' => [
- 'url' => 'tblproperties',
- 'urlvars' => [
- 'schema' => Decorator::field('nspname'),
- 'table' => Decorator::field('relname'),
- ],
- ],
- ],
- ],
- ];
+ // Child tables
+ if ($children->recordCount() > 0) {
+ $this->_printChildren($children);
+ }
- echo $this->printTable($parents, $columns, $actions, 'info-parents', $this->lang['strnodata']);
- }
+ // Row performance
+ if ($tablestatstups->recordCount() > 0) {
+ $this->_printTablestatstups($tablestatstups);
+ }
- // Child tables
- if ($children->recordCount() > 0) {
- echo "<h3>{$this->lang['strchildtables']}</h3>".PHP_EOL;
+ // I/O performance
+ if ($tablestatsio->recordCount() > 0) {
+ $this->_printTablestatsio($tablestatsio);
+ }
- $columns = [
- 'schema' => [
- 'title' => $this->lang['strschema'],
- 'field' => Decorator::field('nspname'),
- ],
- 'table' => [
- 'title' => $this->lang['strtable'],
- 'field' => Decorator::field('relname'),
- ],
- 'actions' => [
- 'title' => $this->lang['stractions'],
- ],
- ];
-
- $actions = [
- 'properties' => [
- 'content' => $this->lang['strproperties'],
- 'attr' => [
- 'href' => [
- 'url' => 'tblproperties',
- 'urlvars' => [
- 'schema' => Decorator::field('nspname'),
- 'table' => Decorator::field('relname'),
- ],
- ],
+ // Index row performance
+ if ($indexstatstups->recordCount() > 0) {
+ $this->_printIndexstatstups($indexstatstups);
+ }
+
+ // Index I/0 performance
+ if ($indexstatsio->recordCount() > 0) {
+ $this->_printIndexstatsio($indexstatsio);
+ }
+ }
+
+ private function _printChildren($children)
+ {
+ echo "<h3>{$this->lang['strchildtables']}</h3>".PHP_EOL;
+
+ $columns = [
+ 'schema' => [
+ 'title' => $this->lang['strschema'],
+ 'field' => Decorator::field('nspname'),
+ ],
+ 'table' => [
+ 'title' => $this->lang['strtable'],
+ 'field' => Decorator::field('relname'),
+ ],
+ 'actions' => [
+ 'title' => $this->lang['stractions'],
+ ],
+ ];
+
+ $actions = [
+ 'properties' => [
+ 'content' => $this->lang['strproperties'],
+ 'attr' => [
+ 'href' => [
+ 'url' => 'tblproperties',
+ 'urlvars' => [
+ 'schema' => Decorator::field('nspname'),
+ 'table' => Decorator::field('relname'),
],
],
- ];
+ ],
+ ],
+ ];
+
+ echo $this->printTable($children, $columns, $actions, 'info-children', $this->lang['strnodata']);
+ }
+
+ private function _printTablestatstups($tablestatstups)
+ {
+ echo "<h3>{$this->lang['strrowperf']}</h3>".PHP_EOL;
+
+ echo '<table>'.PHP_EOL;
+ echo "\t<tr>".PHP_EOL;
+ echo "\t\t<th class=\"data\" colspan=\"2\">{$this->lang['strsequential']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\" colspan=\"2\">{$this->lang['strindex']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strrows2']}</th>".PHP_EOL;
+ echo "\t</tr>".PHP_EOL;
+ echo "\t<tr>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strscan']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strread']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strscan']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strfetch']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strinsert']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strupdate']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strdelete']}</th>".PHP_EOL;
+ echo "\t</tr>".PHP_EOL;
+ $i = 0;
+
+ while (!$tablestatstups->EOF) {
+ $id = (0 == ($i % 2) ? '1' : '2');
+ echo "\t<tr class=\"data{$id}\">".PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['seq_scan'], 'int4', $this->shownull), '</td>'.PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['seq_tup_read'], 'int4', $this->shownull), '</td>'.PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['idx_scan'], 'int4', $this->shownull), '</td>'.PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['idx_tup_fetch'], 'int4', $this->shownull), '</td>'.PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['n_tup_ins'], 'int4', $this->shownull), '</td>'.PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['n_tup_upd'], 'int4', $this->shownull), '</td>'.PHP_EOL;
+ 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;
+ }
+
+ echo '</table>'.PHP_EOL;
+ }
- echo $this->printTable($children, $columns, $actions, 'info-children', $this->lang['strnodata']);
+ private function _printTablestatsio($tablestatsio)
+ {
+ echo "<h3>{$this->lang['strioperf']}</h3>".PHP_EOL;
+
+ echo '<table>'.PHP_EOL;
+ echo "\t<tr>".PHP_EOL;
+ echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strheap']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strindex']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strtoast']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strtoastindex']}</th>".PHP_EOL;
+ echo "\t</tr>".PHP_EOL;
+ echo "\t<tr>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>".PHP_EOL;
+ echo "\t</tr>".PHP_EOL;
+ $i = 0;
+
+ while (!$tablestatsio->EOF) {
+ $id = (0 == ($i % 2) ? '1' : '2');
+ echo "\t<tr class=\"data{$id}\">".PHP_EOL;
+
+ $total = $tablestatsio->fields['heap_blks_hit'] + $tablestatsio->fields['heap_blks_read'];
+ if ($total > 0) {
+ $percentage = round(($tablestatsio->fields['heap_blks_hit'] / $total) * 100);
+ } else {
+ $percentage = 0;
}
- // Row performance
- if ($tablestatstups->recordCount() > 0) {
- echo "<h3>{$this->lang['strrowperf']}</h3>".PHP_EOL;
-
- echo '<table>'.PHP_EOL;
- echo "\t<tr>".PHP_EOL;
- echo "\t\t<th class=\"data\" colspan=\"2\">{$this->lang['strsequential']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\" colspan=\"2\">{$this->lang['strindex']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strrows2']}</th>".PHP_EOL;
- echo "\t</tr>".PHP_EOL;
- echo "\t<tr>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strscan']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strread']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strscan']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strfetch']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strinsert']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strupdate']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strdelete']}</th>".PHP_EOL;
- echo "\t</tr>".PHP_EOL;
- $i = 0;
-
- while (!$tablestatstups->EOF) {
- $id = (0 == ($i % 2) ? '1' : '2');
- echo "\t<tr class=\"data{$id}\">".PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['seq_scan'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['seq_tup_read'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['idx_scan'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['idx_tup_fetch'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['n_tup_ins'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['n_tup_upd'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['n_tup_del'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t</tr>".PHP_EOL;
- $tablestatstups->movenext();
- ++$i;
- }
-
- echo '</table>'.PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['heap_blks_read'], 'int4', $this->shownull), '</td>'.PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['heap_blks_hit'], 'int4', $this->shownull), '</td>'.PHP_EOL;
+ echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>".PHP_EOL;
+
+ $total = $tablestatsio->fields['idx_blks_hit'] + $tablestatsio->fields['idx_blks_read'];
+ if ($total > 0) {
+ $percentage = round(($tablestatsio->fields['idx_blks_hit'] / $total) * 100);
+ } else {
+ $percentage = 0;
}
- // I/O performance
- if ($tablestatsio->recordCount() > 0) {
- echo "<h3>{$this->lang['strioperf']}</h3>".PHP_EOL;
-
- echo '<table>'.PHP_EOL;
- echo "\t<tr>".PHP_EOL;
- echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strheap']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strindex']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strtoast']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strtoastindex']}</th>".PHP_EOL;
- echo "\t</tr>".PHP_EOL;
- echo "\t<tr>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>".PHP_EOL;
- echo "\t</tr>".PHP_EOL;
- $i = 0;
-
- while (!$tablestatsio->EOF) {
- $id = (0 == ($i % 2) ? '1' : '2');
- echo "\t<tr class=\"data{$id}\">".PHP_EOL;
-
- $total = $tablestatsio->fields['heap_blks_hit'] + $tablestatsio->fields['heap_blks_read'];
- if ($total > 0) {
- $percentage = round(($tablestatsio->fields['heap_blks_hit'] / $total) * 100);
- } else {
- $percentage = 0;
- }
-
- echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['heap_blks_read'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['heap_blks_hit'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>".PHP_EOL;
-
- $total = $tablestatsio->fields['idx_blks_hit'] + $tablestatsio->fields['idx_blks_read'];
- if ($total > 0) {
- $percentage = round(($tablestatsio->fields['idx_blks_hit'] / $total) * 100);
- } else {
- $percentage = 0;
- }
-
- echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['idx_blks_read'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['idx_blks_hit'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>".PHP_EOL;
-
- $total = $tablestatsio->fields['toast_blks_hit'] + $tablestatsio->fields['toast_blks_read'];
- if ($total > 0) {
- $percentage = round(($tablestatsio->fields['toast_blks_hit'] / $total) * 100);
- } else {
- $percentage = 0;
- }
-
- echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['toast_blks_read'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['toast_blks_hit'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>".PHP_EOL;
-
- $total = $tablestatsio->fields['tidx_blks_hit'] + $tablestatsio->fields['tidx_blks_read'];
- if ($total > 0) {
- $percentage = round(($tablestatsio->fields['tidx_blks_hit'] / $total) * 100);
- } else {
- $percentage = 0;
- }
-
- echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['tidx_blks_read'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['tidx_blks_hit'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>".PHP_EOL;
- echo "\t</tr>".PHP_EOL;
- $tablestatsio->movenext();
- ++$i;
- }
-
- echo '</table>'.PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['idx_blks_read'], 'int4', $this->shownull), '</td>'.PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['idx_blks_hit'], 'int4', $this->shownull), '</td>'.PHP_EOL;
+ echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>".PHP_EOL;
+
+ $total = $tablestatsio->fields['toast_blks_hit'] + $tablestatsio->fields['toast_blks_read'];
+ if ($total > 0) {
+ $percentage = round(($tablestatsio->fields['toast_blks_hit'] / $total) * 100);
+ } else {
+ $percentage = 0;
}
- // Index row performance
- if ($indexstatstups->recordCount() > 0) {
- echo "<h3>{$this->lang['stridxrowperf']}</h3>".PHP_EOL;
-
- echo '<table>'.PHP_EOL;
- echo "\t<tr>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strindex']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strscan']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strread']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strfetch']}</th>".PHP_EOL;
- echo "\t</tr>".PHP_EOL;
- $i = 0;
-
- while (!$indexstatstups->EOF) {
- $id = (0 == ($i % 2) ? '1' : '2');
- echo "\t<tr class=\"data{$id}\">".PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($indexstatstups->fields['indexrelname']), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($indexstatstups->fields['idx_scan'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($indexstatstups->fields['idx_tup_read'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($indexstatstups->fields['idx_tup_fetch'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t</tr>".PHP_EOL;
- $indexstatstups->movenext();
- ++$i;
- }
-
- echo '</table>'.PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['toast_blks_read'], 'int4', $this->shownull), '</td>'.PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['toast_blks_hit'], 'int4', $this->shownull), '</td>'.PHP_EOL;
+ echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>".PHP_EOL;
+
+ $total = $tablestatsio->fields['tidx_blks_hit'] + $tablestatsio->fields['tidx_blks_read'];
+ if ($total > 0) {
+ $percentage = round(($tablestatsio->fields['tidx_blks_hit'] / $total) * 100);
+ } else {
+ $percentage = 0;
}
- // Index I/0 performance
- if ($indexstatsio->recordCount() > 0) {
- echo "<h3>{$this->lang['stridxioperf']}</h3>".PHP_EOL;
-
- echo '<table>'.PHP_EOL;
- echo "\t<tr>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strindex']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>".PHP_EOL;
- echo "\t</tr>".PHP_EOL;
- $i = 0;
-
- while (!$indexstatsio->EOF) {
- $id = (0 == ($i % 2) ? '1' : '2');
- echo "\t<tr class=\"data{$id}\">".PHP_EOL;
- $total = $indexstatsio->fields['idx_blks_hit'] + $indexstatsio->fields['idx_blks_read'];
- if ($total > 0) {
- $percentage = round(($indexstatsio->fields['idx_blks_hit'] / $total) * 100);
- } else {
- $percentage = 0;
- }
-
- echo "\t\t<td>", $this->misc->printVal($indexstatsio->fields['indexrelname']), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($indexstatsio->fields['idx_blks_read'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($indexstatsio->fields['idx_blks_hit'], 'int4', $shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>".PHP_EOL;
- echo "\t</tr>".PHP_EOL;
- $indexstatsio->movenext();
- ++$i;
- }
-
- echo '</table>'.PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['tidx_blks_read'], 'int4', $this->shownull), '</td>'.PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['tidx_blks_hit'], 'int4', $this->shownull), '</td>'.PHP_EOL;
+ echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>".PHP_EOL;
+ echo "\t</tr>".PHP_EOL;
+ $tablestatsio->movenext();
+ ++$i;
+ }
+
+ echo '</table>'.PHP_EOL;
+ }
+
+ private function _printIndexstatstups($indexstatstups)
+ {
+ echo "<h3>{$this->lang['stridxrowperf']}</h3>".PHP_EOL;
+
+ echo '<table>'.PHP_EOL;
+ echo "\t<tr>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strindex']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strscan']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strread']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strfetch']}</th>".PHP_EOL;
+ echo "\t</tr>".PHP_EOL;
+ $i = 0;
+
+ while (!$indexstatstups->EOF) {
+ $id = (0 == ($i % 2) ? '1' : '2');
+ echo "\t<tr class=\"data{$id}\">".PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($indexstatstups->fields['indexrelname']), '</td>'.PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($indexstatstups->fields['idx_scan'], 'int4', $this->shownull), '</td>'.PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($indexstatstups->fields['idx_tup_read'], 'int4', $this->shownull), '</td>'.PHP_EOL;
+ 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;
+ }
+
+ echo '</table>'.PHP_EOL;
+ }
+
+ private function _printIndexstatsio($indexstatsio)
+ {
+ echo "<h3>{$this->lang['stridxioperf']}</h3>".PHP_EOL;
+
+ echo '<table>'.PHP_EOL;
+ echo "\t<tr>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strindex']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>".PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>".PHP_EOL;
+ echo "\t</tr>".PHP_EOL;
+ $i = 0;
+
+ while (!$indexstatsio->EOF) {
+ $id = (0 == ($i % 2) ? '1' : '2');
+ echo "\t<tr class=\"data{$id}\">".PHP_EOL;
+ $total = $indexstatsio->fields['idx_blks_hit'] + $indexstatsio->fields['idx_blks_read'];
+ if ($total > 0) {
+ $percentage = round(($indexstatsio->fields['idx_blks_hit'] / $total) * 100);
+ } else {
+ $percentage = 0;
}
+
+ echo "\t\t<td>", $this->misc->printVal($indexstatsio->fields['indexrelname']), '</td>'.PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($indexstatsio->fields['idx_blks_read'], 'int4', $this->shownull), '</td>'.PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($indexstatsio->fields['idx_blks_hit'], 'int4', $this->shownull), '</td>'.PHP_EOL;
+ echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>".PHP_EOL;
+ echo "\t</tr>".PHP_EOL;
+ $indexstatsio->movenext();
+ ++$i;
}
+
+ echo '</table>'.PHP_EOL;
+ }
+
+ private function _printParents($parents)
+ {
+ echo "<h3>{$this->lang['strparenttables']}</h3>".PHP_EOL;
+
+ $columns = [
+ 'schema' => [
+ 'title' => $this->lang['strschema'],
+ 'field' => Decorator::field('nspname'),
+ ],
+ 'table' => [
+ 'title' => $this->lang['strtable'],
+ 'field' => Decorator::field('relname'),
+ ],
+ 'actions' => [
+ 'title' => $this->lang['stractions'],
+ ],
+ ];
+
+ $actions = [
+ 'properties' => [
+ 'content' => $this->lang['strproperties'],
+ 'attr' => [
+ 'href' => [
+ 'url' => 'tblproperties',
+ 'urlvars' => [
+ 'schema' => Decorator::field('nspname'),
+ 'table' => Decorator::field('relname'),
+ ],
+ ],
+ ],
+ ],
+ ];
+
+ echo $this->printTable($parents, $columns, $actions, 'info-parents', $this->lang['strnodata']);
+ }
+
+ private function _printReferring($referrers)
+ {
+ echo "<h3>{$this->lang['strreferringtables']}</h3>".PHP_EOL;
+
+ $columns = [
+ 'schema' => [
+ 'title' => $this->lang['strschema'],
+ 'field' => Decorator::field('nspname'),
+ ],
+ 'table' => [
+ 'title' => $this->lang['strtable'],
+ 'field' => Decorator::field('relname'),
+ ],
+ 'name' => [
+ 'title' => $this->lang['strname'],
+ 'field' => Decorator::field('conname'),
+ ],
+ 'definition' => [
+ 'title' => $this->lang['strdefinition'],
+ 'field' => Decorator::field('consrc'),
+ ],
+ 'actions' => [
+ 'title' => $this->lang['stractions'],
+ ],
+ ];
+
+ $actions = [
+ 'properties' => [
+ 'content' => $this->lang['strproperties'],
+ 'attr' => [
+ 'href' => [
+ 'url' => 'constraints',
+ 'urlvars' => [
+ 'schema' => Decorator::field('nspname'),
+ 'table' => Decorator::field('relname'),
+ ],
+ ],
+ ],
+ ],
+ ];
+
+ echo $this->printTable($referrers, $columns, $actions, 'info-referrers', $this->lang['strnodata']);
}
}
diff --git a/src/controllers/TblpropertiesController.php b/src/controllers/TblpropertiesController.php
index 37acdd8c..930cf29f 100644
--- a/src/controllers/TblpropertiesController.php
+++ b/src/controllers/TblpropertiesController.php
@@ -103,172 +103,25 @@ class TblpropertiesController extends BaseController
*/
public function doDefault($msg = '')
{
- $misc = $this->misc;
- $data = $misc->getDatabaseAccessor();
-
- $attPre = function (&$rowdata, $actions) use ($data) {
- $rowdata->fields['+type'] = $data->formatType($rowdata->fields['type'], $rowdata->fields['atttypmod']);
- $attname = $rowdata->fields['attname'];
- $table = $_REQUEST['table'];
- $data->fieldClean($attname);
- $data->fieldClean($table);
-
- $actions['browse']['attr']['href']['urlvars']['query'] = "SELECT \"{$attname}\", count(*) AS \"count\"
- FROM \"{$table}\" GROUP BY \"{$attname}\" ORDER BY \"{$attname}\"";
-
- return $actions;
- };
-
- $cstrRender = function ($s, $p) use ($misc, $data) {
- $str = '';
- 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).')';
- }
-
- if ($c['p_field'] == $s) {
- switch ($c['contype']) {
- case 'p':
- $str .= '<a href="constraints?'.$misc->href.'&amp;table='.urlencode($c['p_table']).'&amp;schema='.urlencode($c['p_schema']).'"><img src="'.
- $misc->icon('PrimaryKey').'" alt="[pk]" title="'.htmlentities($c['consrc'], ENT_QUOTES, 'UTF-8').'" /></a>';
-
- break;
- case 'f':
- $str .= '<a href="tblproperties?'.$misc->href.'&amp;table='.urlencode($c['f_table']).'&amp;schema='.urlencode($c['f_schema']).'"><img src="'.
- $misc->icon('ForeignKey').'" alt="[fk]" title="'.htmlentities($c['consrc'], ENT_QUOTES, 'UTF-8').'" /></a>';
-
- break;
- case 'u':
- $str .= '<a href="constraints?'.$misc->href.'&amp;table='.urlencode($c['p_table']).'&amp;schema='.urlencode($c['p_schema']).'"><img src="'.
- $misc->icon('UniqueConstraint').'" alt="[uniq]" title="'.htmlentities($c['consrc'], ENT_QUOTES, 'UTF-8').'" /></a>';
-
- break;
- case 'c':
- $str .= '<a href="constraints?'.$misc->href.'&amp;table='.urlencode($c['p_table']).'&amp;schema='.urlencode($c['p_schema']).'"><img src="'.
- $misc->icon('CheckConstraint').'" alt="[check]" title="'.htmlentities($c['consrc'], ENT_QUOTES, 'UTF-8').'" /></a>';
- }
- }
- }
-
- return $str;
- };
+ $misc = $this->misc;
+ $this->data = $misc->getDatabaseAccessor();
$this->printTrail('table');
$this->printTabs('table', 'columns');
$this->printMsg($msg);
// Get table
- $tdata = $data->getTable($_REQUEST['table']);
+ $tdata = $this->data->getTable($_REQUEST['table']);
// Get columns
- $attrs = $data->getTableAttributes($_REQUEST['table']);
+ $attrs = $this->data->getTableAttributes($_REQUEST['table']);
// Get constraints keys
- $ck = $data->getConstraintsWithFields($_REQUEST['table']);
+ $ck = $this->data->getConstraintsWithFields($_REQUEST['table']);
// Show comment if any
if (null !== $tdata->fields['relcomment']) {
echo '<p class="comment">', $misc->printVal($tdata->fields['relcomment']), '</p>'.PHP_EOL;
}
-
- $columns = [
- 'column' => [
- 'title' => $this->lang['strcolumn'],
- 'field' => Decorator::field('attname'),
- 'url' => "colproperties?subject=column&amp;{$misc->href}&amp;table=".urlencode($_REQUEST['table']).'&amp;',
- 'vars' => ['column' => 'attname'],
- ],
- 'type' => [
- 'title' => $this->lang['strtype'],
- 'field' => Decorator::field('+type'),
- ],
- 'notnull' => [
- 'title' => $this->lang['strnotnull'],
- 'field' => Decorator::field('attnotnull'),
- 'type' => 'bool',
- 'params' => ['true' => 'NOT NULL', 'false' => ''],
- ],
- 'default' => [
- 'title' => $this->lang['strdefault'],
- 'field' => Decorator::field('adsrc'),
- ],
- 'keyprop' => [
- 'title' => $this->lang['strconstraints'],
- 'class' => 'constraint_cell',
- 'field' => Decorator::field('attname'),
- 'type' => 'callback',
- 'params' => [
- 'function' => $cstrRender,
- 'keys' => $ck->getArray(),
- ],
- ],
- 'actions' => [
- 'title' => $this->lang['stractions'],
- ],
- 'comment' => [
- 'title' => $this->lang['strcomment'],
- 'field' => Decorator::field('comment'),
- ],
- ];
-
- $actions = [
- 'browse' => [
- 'content' => $this->lang['strbrowse'],
- 'attr' => [
- 'href' => [
- 'url' => 'display',
- 'urlvars' => [
- 'table' => $_REQUEST['table'],
- 'subject' => 'column',
- 'return' => 'table',
- 'column' => Decorator::field('attname'),
- ],
- ],
- ],
- ],
- 'alter' => [
- 'content' => $this->lang['stralter'],
- 'attr' => [
- 'href' => [
- 'url' => 'colproperties',
- 'urlvars' => [
- 'subject' => 'column',
- 'action' => 'properties',
- 'table' => $_REQUEST['table'],
- 'column' => Decorator::field('attname'),
- ],
- ],
- ],
- ],
- 'privileges' => [
- 'content' => $this->lang['strprivileges'],
- 'attr' => [
- 'href' => [
- 'url' => 'privileges',
- 'urlvars' => [
- 'subject' => 'column',
- 'table' => $_REQUEST['table'],
- 'column' => Decorator::field('attname'),
- ],
- ],
- ],
- ],
- 'drop' => [
- 'content' => $this->lang['strdrop'],
- 'attr' => [
- 'href' => [
- 'url' => 'tblproperties',
- 'urlvars' => [
- 'subject' => 'column',
- 'action' => 'confirm_drop',
- 'table' => $_REQUEST['table'],
- 'column' => Decorator::field('attname'),
- ],
- ],
- ],
- ],
- ];
-
- echo $this->printTable($attrs, $columns, $actions, 'tblproperties-tblproperties', $this->lang['strnodata'], $attPre);
+ $this->_printTable($ck, $attrs);
$navlinks = [
'browse' => [
@@ -805,4 +658,173 @@ class TblpropertiesController extends BaseController
}
}
}
+
+ private function _getAttPre($data)
+ {
+ $attPre = function (&$rowdata, $actions) use ($data) {
+ $rowdata->fields['+type'] = $data->formatType($rowdata->fields['type'], $rowdata->fields['atttypmod']);
+ $attname = $rowdata->fields['attname'];
+ $table = $_REQUEST['table'];
+ $data->fieldClean($attname);
+ $data->fieldClean($table);
+
+ $actions['browse']['attr']['href']['urlvars']['query'] = "SELECT \"{$attname}\", count(*) AS \"count\"
+ FROM \"{$table}\" GROUP BY \"{$attname}\" ORDER BY \"{$attname}\"";
+
+ return $actions;
+ };
+
+ return $attPre;
+ }
+
+ private function _getCstrRender($misc, $data)
+ {
+ $cstrRender = function ($s, $p) use ($misc, $data) {
+ $str = '';
+ 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).')';
+ }
+
+ if ($c['p_field'] == $s) {
+ switch ($c['contype']) {
+ case 'p':
+ $str .= '<a href="constraints?'.$misc->href.'&amp;table='.urlencode($c['p_table']).'&amp;schema='.urlencode($c['p_schema']).'"><img src="'.
+ $misc->icon('PrimaryKey').'" alt="[pk]" title="'.htmlentities($c['consrc'], ENT_QUOTES, 'UTF-8').'" /></a>';
+
+ break;
+ case 'f':
+ $str .= '<a href="tblproperties?'.$misc->href.'&amp;table='.urlencode($c['f_table']).'&amp;schema='.urlencode($c['f_schema']).'"><img src="'.
+ $misc->icon('ForeignKey').'" alt="[fk]" title="'.htmlentities($c['consrc'], ENT_QUOTES, 'UTF-8').'" /></a>';
+
+ break;
+ case 'u':
+ $str .= '<a href="constraints?'.$misc->href.'&amp;table='.urlencode($c['p_table']).'&amp;schema='.urlencode($c['p_schema']).'"><img src="'.
+ $misc->icon('UniqueConstraint').'" alt="[uniq]" title="'.htmlentities($c['consrc'], ENT_QUOTES, 'UTF-8').'" /></a>';
+
+ break;
+ case 'c':
+ $str .= '<a href="constraints?'.$misc->href.'&amp;table='.urlencode($c['p_table']).'&amp;schema='.urlencode($c['p_schema']).'"><img src="'.
+ $misc->icon('CheckConstraint').'" alt="[check]" title="'.htmlentities($c['consrc'], ENT_QUOTES, 'UTF-8').'" /></a>';
+ }
+ }
+ }
+
+ return $str;
+ };
+
+ return $cstrRender;
+ }
+
+ private function _printTable($ck, $attrs)
+ {
+ $misc = $this->misc;
+
+ $data = $this->data;
+
+ $attPre = $this->_getAttPre($data);
+
+ $cstrRender = $this->_getCstrRender($misc, $data);
+
+ $columns = [
+ 'column' => [
+ 'title' => $this->lang['strcolumn'],
+ 'field' => Decorator::field('attname'),
+ 'url' => "colproperties?subject=column&amp;{$misc->href}&amp;table=".urlencode($_REQUEST['table']).'&amp;',
+ 'vars' => ['column' => 'attname'],
+ ],
+ 'type' => [
+ 'title' => $this->lang['strtype'],
+ 'field' => Decorator::field('+type'),
+ ],
+ 'notnull' => [
+ 'title' => $this->lang['strnotnull'],
+ 'field' => Decorator::field('attnotnull'),
+ 'type' => 'bool',
+ 'params' => ['true' => 'NOT NULL', 'false' => ''],
+ ],
+ 'default' => [
+ 'title' => $this->lang['strdefault'],
+ 'field' => Decorator::field('adsrc'),
+ ],
+ 'keyprop' => [
+ 'title' => $this->lang['strconstraints'],
+ 'class' => 'constraint_cell',
+ 'field' => Decorator::field('attname'),
+ 'type' => 'callback',
+ 'params' => [
+ 'function' => $cstrRender,
+ 'keys' => $ck->getArray(),
+ ],
+ ],
+ 'actions' => [
+ 'title' => $this->lang['stractions'],
+ ],
+ 'comment' => [
+ 'title' => $this->lang['strcomment'],
+ 'field' => Decorator::field('comment'),
+ ],
+ ];
+
+ $actions = [
+ 'browse' => [
+ 'content' => $this->lang['strbrowse'],
+ 'attr' => [
+ 'href' => [
+ 'url' => 'display',
+ 'urlvars' => [
+ 'table' => $_REQUEST['table'],
+ 'subject' => 'column',
+ 'return' => 'table',
+ 'column' => Decorator::field('attname'),
+ ],
+ ],
+ ],
+ ],
+ 'alter' => [
+ 'content' => $this->lang['stralter'],
+ 'attr' => [
+ 'href' => [
+ 'url' => 'colproperties',
+ 'urlvars' => [
+ 'subject' => 'column',
+ 'action' => 'properties',
+ 'table' => $_REQUEST['table'],
+ 'column' => Decorator::field('attname'),
+ ],
+ ],
+ ],
+ ],
+ 'privileges' => [
+ 'content' => $this->lang['strprivileges'],
+ 'attr' => [
+ 'href' => [
+ 'url' => 'privileges',
+ 'urlvars' => [
+ 'subject' => 'column',
+ 'table' => $_REQUEST['table'],
+ 'column' => Decorator::field('attname'),
+ ],
+ ],
+ ],
+ ],
+ 'drop' => [
+ 'content' => $this->lang['strdrop'],
+ 'attr' => [
+ 'href' => [
+ 'url' => 'tblproperties',
+ 'urlvars' => [
+ 'subject' => 'column',
+ 'action' => 'confirm_drop',
+ 'table' => $_REQUEST['table'],
+ 'column' => Decorator::field('attname'),
+ ],
+ ],
+ ],
+ ],
+ ];
+
+ echo $this->printTable($attrs, $columns, $actions, 'tblproperties-tblproperties', $this->lang['strnodata'], $attPre);
+ }
}
diff --git a/src/database/databasetraits/DatabaseTrait.php b/src/database/databasetraits/DatabaseTrait.php
index ece84844..45029e83 100644
--- a/src/database/databasetraits/DatabaseTrait.php
+++ b/src/database/databasetraits/DatabaseTrait.php
@@ -117,7 +117,7 @@ trait DatabaseTrait
if (isset($server_info['hiddendbs']) && $server_info['hiddendbs']) {
$hiddendbs = $server_info['hiddendbs'];
- $not_in = "('" . implode("','", $hiddendbs) . "')";
+ $not_in = "('".implode("','", $hiddendbs)."')";
$clause .= " AND pdb.datname NOT IN {$not_in} ";
}
diff --git a/src/database/databasetraits/TableTrait.php b/src/database/databasetraits/TableTrait.php
index c364516a..759e9e4c 100644
--- a/src/database/databasetraits/TableTrait.php
+++ b/src/database/databasetraits/TableTrait.php
@@ -163,22 +163,114 @@ trait TableTrait
}
// Output a reconnect command to create the table as the correct user
- $sql = $this->getChangeUserSQL($t->fields['relowner']) . "\n\n";
+ $sql = $this->getChangeUserSQL($t->fields['relowner'])."\n\n";
- // Set schema search path
- $sql .= "SET search_path = \"{$t->fields['nspname']}\", pg_catalog;\n\n";
-
- // Begin CREATE TABLE definition
- $sql .= "-- Definition\n\n";
- // DROP TABLE must be fully qualified in case a table with the same name exists
- $sql .= $cleanprefix . 'DROP TABLE ';
- $sql .= "\"{$t->fields['nspname']}\".\"{$t->fields['relname']}\";\n";
- $sql .= "CREATE TABLE \"{$t->fields['nspname']}\".\"{$t->fields['relname']}\" (\n";
+ $sql = $this->_dumpCreate($t, $sql, $cleanprefix);
// Output all table columns
$col_comments_sql = ''; // Accumulate comments on columns
$num = $atts->RecordCount() + $cons->RecordCount();
$i = 1;
+
+ $sql = $this->_dumpSerials($atts, $sql, $col_comments_sql, $num);
+
+ $consOutput = $this->_dumpConstraints($cons, $sql, $num);
+
+ if ($consOutput === null) {
+ return null;
+ }
+ $sql = $consOutput;
+
+ $sql .= ')';
+
+ // @@@@ DUMP CLUSTERING INFORMATION
+
+ // Inherits
+ /**
+ * XXX: This is currently commented out as handling inheritance isn't this simple.
+ * You also need to make sure you don't dump inherited columns and defaults, as well
+ * as inherited NOT NULL and CHECK constraints. So for the time being, we just do
+ * not claim to support inheritance.
+ * $parents = $this->getTableParents($table);
+ * if ($parents->RecordCount() > 0) {
+ * $sql .= " INHERITS (";
+ * while (!$parents->EOF) {
+ * $this->fieldClean($parents->fields['relname']);
+ * // Qualify the parent table if it's in another schema
+ * if ($parents->fields['schemaname'] != $this->_schema) {
+ * $this->fieldClean($parents->fields['schemaname']);
+ * $sql .= "\"{$parents->fields['schemaname']}\".";
+ * }
+ * $sql .= "\"{$parents->fields['relname']}\"";.
+ *
+ * $parents->moveNext();
+ * if (!$parents->EOF) $sql .= ', ';
+ * }
+ * $sql .= ")";
+ * }
+ */
+
+ // Handle WITHOUT OIDS
+ if ($this->hasObjectID($table)) {
+ $sql .= ' WITH OIDS';
+ } else {
+ $sql .= ' WITHOUT OIDS';
+ }
+
+ $sql .= ";\n";
+
+ $colStorage = $this->_dumpColStats($atts, $sql);
+
+ if ($colStorage === null) {
+ return null;
+ }
+ $sql = $colStorage;
+
+ // Comment
+ if ($t->fields['relcomment'] !== null) {
+ $this->clean($t->fields['relcomment']);
+ $sql .= "\n-- Comment\n\n";
+ $sql .= "COMMENT ON TABLE \"{$t->fields['nspname']}\".\"{$t->fields['relname']}\" IS '{$t->fields['relcomment']}';\n";
+ }
+
+ // Add comments on columns, if any
+ if ($col_comments_sql != '') {
+ $sql .= $col_comments_sql;
+ }
+
+ // Privileges
+ $privs = $this->getPrivileges($table, 'table');
+ if (!is_array($privs)) {
+ $this->rollbackTransaction();
+
+ return null;
+ }
+
+ $privsOutput = $this->_dumpPrivileges($privs, $sql);
+
+ if ($privsOutput === null) {
+ return null;
+ }
+ $sql .= $privsOutput;
+
+ // Add a newline to separate data that follows (if any)
+ $sql .= "\n";
+
+ return $sql;
+ }
+
+ /**
+ * Dumps serial-like columns in the table.
+ *
+ * @param \PHPPgAdmin\ADORecordSet $atts table attributes
+ * @param string $sql The sql sentence generated so far
+ * @param string $col_comments_sql Column comments, passed by reference
+ * @param int $num Table attributes count + table constraints count
+ *
+ * @return string original $sql plus appended strings
+ */
+ private function _dumpSerials($atts, $sql, &$col_comments_sql, $num)
+ {
while (!$atts->EOF) {
$this->fieldClean($atts->fields['attname']);
$sql .= " \"{$atts->fields['attname']}\"";
@@ -191,7 +283,7 @@ trait TableTrait
$sql .= ' BIGSERIAL';
}
} else {
- $sql .= ' ' . $this->formatType($atts->fields['type'], $atts->fields['atttypmod']);
+ $sql .= ' '.$this->formatType($atts->fields['type'], $atts->fields['atttypmod']);
// Add NOT NULL if necessary
if ($this->phpBool($atts->fields['attnotnull'])) {
@@ -220,6 +312,21 @@ trait TableTrait
$atts->moveNext();
++$i;
}
+
+ return $sql;
+ }
+
+ /**
+ * Dumps constraints.
+ *
+ * @param \PHPPgAdmin\ADORecordSet $cons The table constraints
+ * @param string $sql The sql sentence generated so far
+ * @param int $num Table attributes count + table constraints count
+ *
+ * @return string original $sql plus appended strings
+ */
+ private function _dumpConstraints($cons, $sql, $num)
+ {
// Output all table constraints
while (!$cons->EOF) {
$this->fieldClean($cons->fields['conname']);
@@ -231,12 +338,12 @@ trait TableTrait
switch ($cons->fields['contype']) {
case 'p':
$keys = $this->getAttributeNames($table, explode(' ', $cons->fields['indkey']));
- $sql .= 'PRIMARY KEY (' . join(',', $keys) . ')';
+ $sql .= 'PRIMARY KEY ('.join(',', $keys).')';
break;
case 'u':
$keys = $this->getAttributeNames($table, explode(' ', $cons->fields['indkey']));
- $sql .= 'UNIQUE (' . join(',', $keys) . ')';
+ $sql .= 'UNIQUE ('.join(',', $keys).')';
break;
default:
@@ -258,44 +365,19 @@ trait TableTrait
++$i;
}
- $sql .= ')';
-
- // @@@@ DUMP CLUSTERING INFORMATION
-
- // Inherits
- /**
- * XXX: This is currently commented out as handling inheritance isn't this simple.
- * You also need to make sure you don't dump inherited columns and defaults, as well
- * as inherited NOT NULL and CHECK constraints. So for the time being, we just do
- * not claim to support inheritance.
- * $parents = $this->getTableParents($table);
- * if ($parents->RecordCount() > 0) {
- * $sql .= " INHERITS (";
- * while (!$parents->EOF) {
- * $this->fieldClean($parents->fields['relname']);
- * // Qualify the parent table if it's in another schema
- * if ($parents->fields['schemaname'] != $this->_schema) {
- * $this->fieldClean($parents->fields['schemaname']);
- * $sql .= "\"{$parents->fields['schemaname']}\".";
- * }
- * $sql .= "\"{$parents->fields['relname']}\"";.
- *
- * $parents->moveNext();
- * if (!$parents->EOF) $sql .= ', ';
- * }
- * $sql .= ")";
- * }
- */
-
- // Handle WITHOUT OIDS
- if ($this->hasObjectID($table)) {
- $sql .= ' WITH OIDS';
- } else {
- $sql .= ' WITHOUT OIDS';
- }
-
- $sql .= ";\n";
+ return $sql;
+ }
+ /**
+ * Dumps col statistics.
+ *
+ * @param \PHPPgAdmin\ADORecordSet $atts table attributes
+ * @param string $sql The sql sentence generated so far
+ *
+ * @return string original $sql plus appended strings
+ */
+ private function _dumpColStats($atts, $sql)
+ {
// Column storage and statistics
$atts->moveFirst();
$first = true;
@@ -340,126 +422,142 @@ trait TableTrait
$atts->moveNext();
}
- // Comment
- if ($t->fields['relcomment'] !== null) {
- $this->clean($t->fields['relcomment']);
- $sql .= "\n-- Comment\n\n";
- $sql .= "COMMENT ON TABLE \"{$t->fields['nspname']}\".\"{$t->fields['relname']}\" IS '{$t->fields['relcomment']}';\n";
- }
-
- // Add comments on columns, if any
- if ($col_comments_sql != '') {
- $sql .= $col_comments_sql;
- }
-
- // Privileges
- $privs = $this->getPrivileges($table, 'table');
- if (!is_array($privs)) {
- $this->rollbackTransaction();
+ return $sql;
+ }
- return null;
- }
+ /**
+ * Dumps privileges.
+ *
+ * @param \PHPPgAdmin\ADORecordSet $privs The table privileges
+ * @param string $sql The sql sentence generated so far
+ *
+ * @return string original $sql plus appended strings
+ */
+ private function _dumpPrivileges($privs, $sql)
+ {
+ if (sizeof($privs) <= 0) {
+ return $sql;
+ }
+ $sql .= "\n-- Privileges\n\n";
+ /*
+ * Always start with REVOKE ALL FROM PUBLIC, so that we don't have to
+ * wire-in knowledge about the default public privileges for different
+ * kinds of objects.
+ */
+ $sql .= "REVOKE ALL ON TABLE \"{$t->fields['nspname']}\".\"{$t->fields['relname']}\" FROM PUBLIC;\n";
+ foreach ($privs as $v) {
+ // Get non-GRANT OPTION privs
+ $nongrant = array_diff($v[2], $v[4]);
- if (sizeof($privs) > 0) {
- $sql .= "\n-- Privileges\n\n";
- /*
- * Always start with REVOKE ALL FROM PUBLIC, so that we don't have to
- * wire-in knowledge about the default public privileges for different
- * kinds of objects.
- */
- $sql .= "REVOKE ALL ON TABLE \"{$t->fields['nspname']}\".\"{$t->fields['relname']}\" FROM PUBLIC;\n";
- foreach ($privs as $v) {
- // Get non-GRANT OPTION privs
- $nongrant = array_diff($v[2], $v[4]);
-
- // Skip empty or owner ACEs
- if (sizeof($v[2]) == 0 || ($v[0] == 'user' && $v[1] == $t->fields['relowner'])) {
- continue;
- }
+ // Skip empty or owner ACEs
+ if (sizeof($v[2]) == 0 || ($v[0] == 'user' && $v[1] == $t->fields['relowner'])) {
+ continue;
+ }
- // Change user if necessary
- if ($this->hasGrantOption() && $v[3] != $t->fields['relowner']) {
- $grantor = $v[3];
- $this->clean($grantor);
- $sql .= "SET SESSION AUTHORIZATION '{$grantor}';\n";
- }
+ // Change user if necessary
+ if ($this->hasGrantOption() && $v[3] != $t->fields['relowner']) {
+ $grantor = $v[3];
+ $this->clean($grantor);
+ $sql .= "SET SESSION AUTHORIZATION '{$grantor}';\n";
+ }
- // Output privileges with no GRANT OPTION
- $sql .= 'GRANT ' . join(', ', $nongrant) . " ON TABLE \"{$t->fields['relname']}\" TO ";
- switch ($v[0]) {
- case 'public':
- $sql .= "PUBLIC;\n";
+ // Output privileges with no GRANT OPTION
+ $sql .= 'GRANT '.join(', ', $nongrant)." ON TABLE \"{$t->fields['relname']}\" TO ";
+ switch ($v[0]) {
+ case 'public':
+ $sql .= "PUBLIC;\n";
- break;
- case 'user':
- case 'role':
- $this->fieldClean($v[1]);
- $sql .= "\"{$v[1]}\";\n";
+ break;
+ case 'user':
+ case 'role':
+ $this->fieldClean($v[1]);
+ $sql .= "\"{$v[1]}\";\n";
- break;
- case 'group':
- $this->fieldClean($v[1]);
- $sql .= "GROUP \"{$v[1]}\";\n";
+ break;
+ case 'group':
+ $this->fieldClean($v[1]);
+ $sql .= "GROUP \"{$v[1]}\";\n";
- break;
- default:
- // Unknown privilege type - fail
- $this->rollbackTransaction();
+ break;
+ default:
+ // Unknown privilege type - fail
+ $this->rollbackTransaction();
- return null;
- }
+ return null;
+ }
- // Reset user if necessary
- if ($this->hasGrantOption() && $v[3] != $t->fields['relowner']) {
- $sql .= "RESET SESSION AUTHORIZATION;\n";
- }
+ // Reset user if necessary
+ if ($this->hasGrantOption() && $v[3] != $t->fields['relowner']) {
+ $sql .= "RESET SESSION AUTHORIZATION;\n";
+ }
- // Output privileges with GRANT OPTION
+ // Output privileges with GRANT OPTION
- // Skip empty or owner ACEs
- if (!$this->hasGrantOption() || sizeof($v[4]) == 0) {
- continue;
- }
+ // Skip empty or owner ACEs
+ if (!$this->hasGrantOption() || sizeof($v[4]) == 0) {
+ continue;
+ }
- // Change user if necessary
- if ($this->hasGrantOption() && $v[3] != $t->fields['relowner']) {
- $grantor = $v[3];
- $this->clean($grantor);
- $sql .= "SET SESSION AUTHORIZATION '{$grantor}';\n";
- }
+ // Change user if necessary
+ if ($this->hasGrantOption() && $v[3] != $t->fields['relowner']) {
+ $grantor = $v[3];
+ $this->clean($grantor);
+ $sql .= "SET SESSION AUTHORIZATION '{$grantor}';\n";
+ }
- $sql .= 'GRANT ' . join(', ', $v[4]) . " ON \"{$t->fields['relname']}\" TO ";
- switch ($v[0]) {
- case 'public':
- $sql .= 'PUBLIC';
+ $sql .= 'GRANT '.join(', ', $v[4])." ON \"{$t->fields['relname']}\" TO ";
+ switch ($v[0]) {
+ case 'public':
+ $sql .= 'PUBLIC';
- break;
- case 'user':
- case 'role':
- $this->fieldClean($v[1]);
- $sql .= "\"{$v[1]}\"";
+ break;
+ case 'user':
+ case 'role':
+ $this->fieldClean($v[1]);
+ $sql .= "\"{$v[1]}\"";
- break;
- case 'group':
- $this->fieldClean($v[1]);
- $sql .= "GROUP \"{$v[1]}\"";
+ break;
+ case 'group':
+ $this->fieldClean($v[1]);
+ $sql .= "GROUP \"{$v[1]}\"";
- break;
- default:
- // Unknown privilege type - fail
- return null;
- }
- $sql .= " WITH GRANT OPTION;\n";
+ break;
+ default:
+ // Unknown privilege type - fail
+ return null;
+ }
+ $sql .= " WITH GRANT OPTION;\n";
- // Reset user if necessary
- if ($this->hasGrantOption() && $v[3] != $t->fields['relowner']) {
- $sql .= "RESET SESSION AUTHORIZATION;\n";
- }
+ // Reset user if necessary
+ if ($this->hasGrantOption() && $v[3] != $t->fields['relowner']) {
+ $sql .= "RESET SESSION AUTHORIZATION;\n";
}
}
- // Add a newline to separate data that follows (if any)
- $sql .= "\n";
+ return $sql;
+ }
+
+ /**
+ * Dumps a create.
+ *
+ * @param \PHPPgAdmin\ADORecordSet $tblfields table fields object
+ * @param string $sql The sql sentence generated so far
+ * @param string $cleanprefix set to '-- ' to avoid issuing DROP statement
+ * @param mixed $fields
+ *
+ * @return string original $sql plus appended strings
+ */
+ private function _dumpCreate($fields, $sql, $cleanprefix)
+ {
+ // Set schema search path
+ $sql .= "SET search_path = \"{$tblfields->fields['nspname']}\", pg_catalog;\n\n";
+
+ // Begin CREATE TABLE definition
+ $sql .= "-- Definition\n\n";
+ // DROP TABLE must be fully qualified in case a table with the same name exists
+ $sql .= $cleanprefix.'DROP TABLE ';
+ $sql .= "\"{$tblfields->fields['nspname']}\".\"{$tblfields->fields['relname']}\";\n";
+ $sql .= "CREATE TABLE \"{$tblfields->fields['nspname']}\".\"{$tblfields->fields['relname']}\" (\n";
return $sql;
}
@@ -481,7 +579,7 @@ trait TableTrait
SELECT
c.relname, n.nspname, ';
- $sql .= ($this->hasRoles() ? ' coalesce(u.usename,r.rolname) ' : ' u.usename') . " AS relowner,
+ $sql .= ($this->hasRoles() ? ' coalesce(u.usename,r.rolname) ' : ' u.usename')." AS relowner,
pg_catalog.obj_description(c.oid, 'pg_class') AS relcomment,
pt.spcname AS tablespace
FROM pg_catalog.pg_class c
@@ -489,7 +587,7 @@ trait TableTrait
LEFT JOIN pg_catalog.pg_user u ON u.usesysid = c.relowner
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace ";
- $sql .= ($this->hasRoles() ? ' LEFT JOIN pg_catalog.pg_roles r ON c.relowner = r.oid ' : '') .
+ $sql .= ($this->hasRoles() ? ' LEFT JOIN pg_catalog.pg_roles r ON c.relowner = r.oid ' : '').
" WHERE c.relkind = 'r'
AND n.nspname = '{$c_schema}'
AND n.oid = c.relnamespace
@@ -704,7 +802,7 @@ trait TableTrait
if ($indexes->RecordCount() > 0) {
$sql .= "\n-- Indexes\n\n";
while (!$indexes->EOF) {
- $sql .= $indexes->fields['inddef'] . ";\n";
+ $sql .= $indexes->fields['inddef'].";\n";
$indexes->moveNext();
}
@@ -739,7 +837,7 @@ trait TableTrait
if ($rules->RecordCount() > 0) {
$sql .= "\n-- Rules\n\n";
while (!$rules->EOF) {
- $sql .= $rules->fields['definition'] . "\n";
+ $sql .= $rules->fields['definition']."\n";
$rules->moveNext();
}
@@ -967,7 +1065,7 @@ trait TableTrait
}
}
if (count($primarykeycolumns) > 0) {
- $sql .= ', PRIMARY KEY (' . implode(', ', $primarykeycolumns) . ')';
+ $sql .= ', PRIMARY KEY ('.implode(', ', $primarykeycolumns).')';
}
$sql .= ')';
@@ -1290,7 +1388,7 @@ trait TableTrait
$sql = "TRUNCATE TABLE \"{$f_schema}\".\"{$table}\" ";
if ($cascade) {
- $sql = $sql . ' CASCADE';
+ $sql = $sql.' CASCADE';
}
$status = $this->execute($sql);
@@ -1390,7 +1488,7 @@ trait TableTrait
// Actually retrieve the rows
if ($oids) {
- $oid_str = $this->id . ', ';
+ $oid_str = $this->id.', ';
} else {
$oid_str = '';
}
@@ -1531,7 +1629,7 @@ trait TableTrait
$params[] = "autovacuum_vacuum_cost_limit='{$vaccostlimit}'";
}
- $sql = $sql . implode(',', $params) . ');';
+ $sql = $sql.implode(',', $params).');';
return $this->execute($sql);
}