From bc753866dbf3acb3b7363b3cafeceae5022ee7c5 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Thu, 3 May 2012 07:56:14 -0400 Subject: [PATCH] misc updates --- README.md | 2 + docs/classes.svg | 508 +- docs/classes/DB.html | 2 +- docs/classes/DB_PDO.html | 2 +- docs/classes/DB_Reg.html | 2 +- docs/classes/DB_SQL.html | 2 +- docs/classes/DB_Util.html | 2 +- docs/classes/Firebird.html | 2 +- docs/classes/Firebird_Result.html | 2 +- docs/classes/Firebird_SQL.html | 2 +- docs/classes/Firebird_Util.html | 2 +- docs/classes/JSCompilerContext.html | 167 - docs/classes/JSParser.html | 335 - docs/classes/JSTokenizer.html | 331 - docs/classes/MM.html | 2 +- docs/classes/MM_Controller.html | 2 +- docs/classes/MM_Model.html | 2 +- docs/classes/MM_Output.html | 2 +- docs/classes/MM_Page.html | 2 +- docs/classes/MySQL.html | 2 +- docs/classes/MySQL_SQL.html | 2 +- docs/classes/MySQL_Util.html | 2 +- docs/classes/ODBC.html | 2 +- docs/classes/ODBC_SQL.html | 2 +- docs/classes/ODBC_Util.html | 2 +- docs/classes/Page.html | 504 - docs/classes/PgSQL.html | 2 +- docs/classes/PgSQL_SQL.html | 2 +- docs/classes/PgSQL_Util.html | 2 +- docs/classes/Query_Builder.html | 2 +- docs/classes/R.html | 850 -- docs/classes/SQLite.html | 2 +- docs/classes/SQLite_SQL.html | 2 +- docs/classes/SQLite_Util.html | 2 +- docs/classes/Settings.html | 2 +- docs/classes/Welcome.html | 2 +- docs/classes/Welcome_Model.html | 2 +- docs/classes/miniMVC.html | 2 +- docs/deprecated.html | 2 +- docs/errors.html | 2 +- docs/graph_class.html | 2 +- docs/index.html | 2 +- docs/markers.html | 2 +- docs/namespaces/default.html | 2 +- docs/packages/.html | 2 +- docs/packages/Default.html | 2 +- docs/packages/Query.Drivers.html | 2 +- docs/packages/Query.Helper Classes.html | 2 +- docs/packages/Query.Query.html | 2 +- docs/packages/Query.html | 2 +- docs/packages/miniMVC.App.html | 2 +- docs/packages/miniMVC.System.html | 2 +- docs/packages/miniMVC.html | 2 +- docs/structure.xml | 912 +- phpdoc.dist.xml | 4 +- sys/common.php | 2 +- sys/db/.gitignore | 5 + sys/db/.travis.yml | 13 + sys/db/README.md | 83 + sys/db/autoload.php | 86 + sys/db/classes/db_pdo.php | 429 + sys/db/classes/db_reg.php | 89 + sys/db/classes/db_sql.php | 165 + sys/db/classes/db_util.php | 98 + sys/db/classes/query_builder.php | 1343 +++ sys/db/classes/settings.php | 258 + sys/db/docs/classes.svg | 275 + sys/db/docs/classes/DB_PDO.html | 684 ++ .../db/docs/classes/DB_Reg.html | 153 +- sys/db/docs/classes/DB_SQL.html | 274 + .../db/docs/classes/DB_Util.html | 170 +- sys/db/docs/classes/Firebird.html | 838 ++ sys/db/docs/classes/Firebird_Result.html | 509 + sys/db/docs/classes/Firebird_SQL.html | 302 + sys/db/docs/classes/Firebird_Util.html | 217 + sys/db/docs/classes/MySQL.html | 874 ++ sys/db/docs/classes/MySQL_SQL.html | 286 + .../db/docs/classes/MySQL_Util.html | 223 +- sys/db/docs/classes/ODBC.html | 876 ++ sys/db/docs/classes/ODBC_SQL.html | 286 + sys/db/docs/classes/ODBC_Util.html | 208 + sys/db/docs/classes/PgSQL.html | 876 ++ sys/db/docs/classes/PgSQL_SQL.html | 302 + sys/db/docs/classes/PgSQL_Util.html | 213 + sys/db/docs/classes/Query_Builder.html | 1227 +++ sys/db/docs/classes/SQLite.html | 891 ++ sys/db/docs/classes/SQLite_SQL.html | 286 + sys/db/docs/classes/SQLite_Util.html | 213 + sys/db/docs/classes/Settings.html | 249 + sys/db/docs/classes/Standard_SQL.html | 348 + sys/db/docs/classes/pgSQL.html | 852 ++ sys/db/docs/classes/pgSQL_SQL.html | 302 + sys/db/docs/css/bootstrap-responsive.css | 567 + sys/db/docs/css/bootstrap-responsive.min.css | 3 + sys/db/docs/css/bootstrap.css | 3365 ++++++ sys/db/docs/css/bootstrap.min.css | 610 ++ sys/db/docs/css/jquery.iviewer.css | 91 + sys/db/docs/css/prettify.css | 1 + sys/db/docs/css/template.css | 500 + sys/db/docs/deprecated.html | 72 + sys/db/docs/errors.html | 98 + sys/db/docs/graph_class.html | 69 + sys/db/docs/img/apple-touch-icon-114x114.png | Bin 0 -> 28338 bytes sys/db/docs/img/apple-touch-icon-72x72.png | Bin 0 -> 12751 bytes sys/db/docs/img/apple-touch-icon.png | Bin 0 -> 8358 bytes sys/db/docs/img/favicon.ico | Bin 0 -> 1150 bytes .../docs/img/glyphicons-halflings-white.png | Bin 0 -> 4352 bytes sys/db/docs/img/glyphicons-halflings.png | Bin 0 -> 4352 bytes sys/db/docs/img/icons/arrow_down.png | Bin 0 -> 606 bytes sys/db/docs/img/icons/arrow_right.png | Bin 0 -> 628 bytes sys/db/docs/img/icons/class.png | Bin 0 -> 395 bytes sys/db/docs/img/icons/constant.png | Bin 0 -> 496 bytes sys/db/docs/img/icons/favicon.ico | Bin 0 -> 1150 bytes sys/db/docs/img/icons/file-php.png | Bin 0 -> 4017 bytes sys/db/docs/img/icons/file.gif | Bin 0 -> 110 bytes sys/db/docs/img/icons/folder.gif | Bin 0 -> 106 bytes sys/db/docs/img/icons/function.png | Bin 0 -> 338 bytes .../docs/img/icons/icon-folder-open-big.png | Bin 0 -> 232 bytes sys/db/docs/img/icons/icon-th-big.png | Bin 0 -> 106 bytes sys/db/docs/img/icons/icon_template.svg | 93 + sys/db/docs/img/icons/interface.png | Bin 0 -> 281 bytes sys/db/docs/img/icons/method.png | Bin 0 -> 377 bytes sys/db/docs/img/icons/ok.png | Bin 0 -> 3685 bytes sys/db/docs/img/icons/property.png | Bin 0 -> 360 bytes sys/db/docs/img/icons/search.gif | Bin 0 -> 152 bytes sys/db/docs/img/icons/variable.png | Bin 0 -> 829 bytes sys/db/docs/img/icons/view_source.png | Bin 0 -> 603 bytes sys/db/docs/img/icons/visibility_private.png | Bin 0 -> 3433 bytes .../docs/img/icons/visibility_protected.png | Bin 0 -> 764 bytes sys/db/docs/img/icons/visibility_public.png | Bin 0 -> 3451 bytes sys/db/docs/img/iviewer/grab.cur | Bin 0 -> 1150 bytes sys/db/docs/img/iviewer/hand.cur | Bin 0 -> 1150 bytes .../docs/img/iviewer/iviewer.rotate_left.png | Bin 0 -> 1493 bytes .../docs/img/iviewer/iviewer.rotate_right.png | Bin 0 -> 1482 bytes sys/db/docs/img/iviewer/iviewer.zoom_fit.png | Bin 0 -> 1252 bytes sys/db/docs/img/iviewer/iviewer.zoom_fit2.gif | Bin 0 -> 95 bytes sys/db/docs/img/iviewer/iviewer.zoom_in.png | Bin 0 -> 1420 bytes sys/db/docs/img/iviewer/iviewer.zoom_in2.gif | Bin 0 -> 90 bytes sys/db/docs/img/iviewer/iviewer.zoom_out.png | Bin 0 -> 1416 bytes sys/db/docs/img/iviewer/iviewer.zoom_out2.gif | Bin 0 -> 69 bytes sys/db/docs/img/iviewer/iviewer.zoom_zero.png | Bin 0 -> 1091 bytes .../docs/img/iviewer/iviewer.zoom_zero2.gif | Bin 0 -> 98 bytes sys/db/docs/img/loader.gif | Bin 0 -> 4726 bytes sys/db/docs/js/SVGPan.js | 232 + sys/db/docs/js/bootstrap.js | 1722 +++ sys/db/docs/js/bootstrap.min.js | 1 + sys/db/docs/js/jquery-1.4.2.min.js | 154 + sys/db/docs/js/jquery-1.7.1.min.js | 9270 +++++++++++++++++ sys/db/docs/js/jquery-ui-1.8.2.custom.min.js | 1012 ++ sys/db/docs/js/jquery.cookie.js | 104 + sys/db/docs/js/jquery.iviewer.js | 1045 ++ sys/db/docs/js/jquery.iviewer.min.js | 42 + sys/db/docs/js/jquery.mousewheel.min.js | 13 + sys/db/docs/js/jquery.panzoom.js | 467 + sys/db/docs/js/jquery.splitter.js | 228 + sys/db/docs/js/jquery.tools.min.js | 115 + sys/db/docs/js/jquery.treeview.js | 256 + sys/db/docs/js/menu.js | 31 + sys/db/docs/js/prettify/lang-apollo.js | 2 + sys/db/docs/js/prettify/lang-clj.js | 18 + sys/db/docs/js/prettify/lang-css.js | 2 + sys/db/docs/js/prettify/lang-go.js | 1 + sys/db/docs/js/prettify/lang-hs.js | 2 + sys/db/docs/js/prettify/lang-lisp.js | 3 + sys/db/docs/js/prettify/lang-lua.js | 2 + sys/db/docs/js/prettify/lang-ml.js | 2 + sys/db/docs/js/prettify/lang-n.js | 4 + sys/db/docs/js/prettify/lang-proto.js | 1 + sys/db/docs/js/prettify/lang-scala.js | 2 + sys/db/docs/js/prettify/lang-sql.js | 2 + sys/db/docs/js/prettify/lang-tex.js | 1 + sys/db/docs/js/prettify/lang-vb.js | 2 + sys/db/docs/js/prettify/lang-vhdl.js | 3 + sys/db/docs/js/prettify/lang-wiki.js | 2 + sys/db/docs/js/prettify/lang-xq.js | 3 + sys/db/docs/js/prettify/lang-yaml.js | 2 + sys/db/docs/js/prettify/prettify.min.js | 28 + sys/db/docs/js/sidebar.js | 45 + sys/db/docs/js/template.js | 185 + sys/db/docs/markers.html | 74 + sys/db/docs/namespaces/default.html | 288 + .../db/docs/packages/.html | 9 +- .../db/docs/packages/Default.html | 78 +- sys/db/docs/packages/Query.Drivers.html | 216 + .../docs/packages/Query.Helper Classes.html | 102 + sys/db/docs/packages/Query.Query.html | 120 + sys/db/docs/packages/Query.html | 321 + sys/db/docs/structure.xml | 5233 ++++++++++ sys/db/drivers/firebird/firebird_driver.php | 285 + sys/db/drivers/firebird/firebird_result.php | 290 + sys/db/drivers/firebird/firebird_sql.php | 242 + sys/db/drivers/firebird/firebird_util.php | 194 + sys/db/drivers/mysql/mysql_driver.php | 73 + sys/db/drivers/mysql/mysql_sql.php | 151 + sys/db/drivers/mysql/mysql_util.php | 190 + sys/db/drivers/odbc/odbc_driver.php | 71 + sys/db/drivers/odbc/odbc_sql.php | 145 + sys/db/drivers/odbc/odbc_util.php | 91 + sys/db/drivers/pgsql/pgsql_driver.php | 81 + sys/db/drivers/pgsql/pgsql_sql.php | 213 + sys/db/drivers/pgsql/pgsql_util.php | 180 + sys/db/drivers/sqlite/sqlite_driver.php | 141 + sys/db/drivers/sqlite/sqlite_sql.php | 158 + sys/db/drivers/sqlite/sqlite_util.php | 198 + sys/db/phpdoc.dist.xml | 18 + sys/db/tests/core/core.php | 73 + sys/db/tests/core/db_qb_test.php | 430 + sys/db/tests/core/db_test.php | 68 + sys/db/tests/core/settings.php | 91 + .../tests/databases/firebird/firebird-qb.php | 38 + sys/db/tests/databases/firebird/firebird.php | 221 + sys/db/tests/databases/mysql/mysql-qb.php | 54 + sys/db/tests/databases/mysql/mysql.php | 195 + sys/db/tests/databases/pgsql/pgsql-qb.php | 54 + sys/db/tests/databases/pgsql/pgsql.php | 213 + sys/db/tests/databases/sqlite/sqlite-qb.php | 33 + sys/db/tests/databases/sqlite/sqlite.php | 203 + sys/db/tests/index.php | 64 + .../HELP_MY_TESTS_DONT_WORK_ANYMORE | 399 + sys/db/tests/simpletest/LICENSE | 502 + sys/db/tests/simpletest/README | 102 + sys/db/tests/simpletest/VERSION | 1 + sys/db/tests/simpletest/arguments.php | 224 + sys/db/tests/simpletest/authentication.php | 237 + sys/db/tests/simpletest/autorun.php | 101 + sys/db/tests/simpletest/browser.php | 1144 ++ sys/db/tests/simpletest/collector.php | 122 + sys/db/tests/simpletest/compatibility.php | 166 + sys/db/tests/simpletest/cookies.php | 380 + sys/db/tests/simpletest/default_reporter.php | 163 + sys/db/tests/simpletest/detached.php | 96 + .../docs/en/authentication_documentation.html | 378 + .../docs/en/browser_documentation.html | 501 + sys/db/tests/simpletest/docs/en/docs.css | 121 + .../docs/en/expectation_documentation.html | 476 + .../docs/en/form_testing_documentation.html | 351 + .../docs/en/group_test_documentation.html | 252 + .../docs/en/mock_objects_documentation.html | 870 ++ sys/db/tests/simpletest/docs/en/overview.html | 487 + .../docs/en/partial_mocks_documentation.html | 457 + .../docs/en/reporter_documentation.html | 616 ++ .../docs/en/unit_test_documentation.html | 442 + .../docs/en/web_tester_documentation.html | 588 ++ .../docs/fr/authentication_documentation.html | 372 + .../docs/fr/browser_documentation.html | 500 + sys/db/tests/simpletest/docs/fr/docs.css | 84 + .../docs/fr/expectation_documentation.html | 451 + .../docs/fr/form_testing_documentation.html | 363 + .../docs/fr/group_test_documentation.html | 265 + .../docs/fr/mock_objects_documentation.html | 933 ++ sys/db/tests/simpletest/docs/fr/overview.html | 321 + .../docs/fr/partial_mocks_documentation.html | 475 + .../docs/fr/reporter_documentation.html | 630 ++ .../docs/fr/unit_test_documentation.html | 447 + .../docs/fr/web_tester_documentation.html | 570 + sys/db/tests/simpletest/dumper.php | 407 + sys/db/tests/simpletest/eclipse.php | 307 + sys/db/tests/simpletest/encoding.php | 649 ++ sys/db/tests/simpletest/errors.php | 267 + sys/db/tests/simpletest/exceptions.php | 226 + sys/db/tests/simpletest/expectation.php | 984 ++ .../simpletest/extensions/pear_test_case.php | 196 + .../tests/simpletest/extensions/testdox.php | 53 + .../simpletest/extensions/testdox/test.php | 107 + sys/db/tests/simpletest/form.php | 361 + sys/db/tests/simpletest/frames.php | 592 ++ sys/db/tests/simpletest/http.php | 628 ++ sys/db/tests/simpletest/invoker.php | 139 + sys/db/tests/simpletest/mock_objects.php | 1641 +++ sys/db/tests/simpletest/page.php | 542 + sys/db/tests/simpletest/php_parser.php | 1054 ++ sys/db/tests/simpletest/recorder.php | 101 + sys/db/tests/simpletest/reflection_php4.php | 136 + sys/db/tests/simpletest/reflection_php5.php | 386 + sys/db/tests/simpletest/remote.php | 115 + sys/db/tests/simpletest/reporter.php | 445 + sys/db/tests/simpletest/scorer.php | 875 ++ sys/db/tests/simpletest/selector.php | 141 + sys/db/tests/simpletest/shell_tester.php | 330 + sys/db/tests/simpletest/simpletest.php | 391 + sys/db/tests/simpletest/socket.php | 312 + sys/db/tests/simpletest/tag.php | 1527 +++ .../tests/simpletest/test/acceptance_test.php | 1729 +++ sys/db/tests/simpletest/test/adapter_test.php | 50 + sys/db/tests/simpletest/test/all_tests.php | 13 + .../tests/simpletest/test/arguments_test.php | 82 + .../simpletest/test/authentication_test.php | 145 + sys/db/tests/simpletest/test/autorun_test.php | 23 + .../tests/simpletest/test/bad_test_suite.php | 10 + sys/db/tests/simpletest/test/browser_test.php | 802 ++ .../tests/simpletest/test/collector_test.php | 50 + .../simpletest/test/command_line_test.php | 40 + .../simpletest/test/compatibility_test.php | 87 + sys/db/tests/simpletest/test/cookies_test.php | 227 + .../tests/simpletest/test/detached_test.php | 15 + sys/db/tests/simpletest/test/dumper_test.php | 88 + sys/db/tests/simpletest/test/eclipse_test.php | 32 + .../tests/simpletest/test/encoding_test.php | 240 + sys/db/tests/simpletest/test/errors_test.php | 229 + .../tests/simpletest/test/exceptions_test.php | 183 + .../simpletest/test/expectation_test.php | 317 + sys/db/tests/simpletest/test/form_test.php | 344 + sys/db/tests/simpletest/test/frames_test.php | 549 + sys/db/tests/simpletest/test/http_test.php | 492 + .../tests/simpletest/test/interfaces_test.php | 137 + .../test/interfaces_test_php5_1.php | 14 + sys/db/tests/simpletest/test/live_test.php | 47 + .../simpletest/test/mock_objects_test.php | 985 ++ sys/db/tests/simpletest/test/page_test.php | 166 + .../simpletest/test/parse_error_test.php | 9 + sys/db/tests/simpletest/test/parsing_test.php | 642 ++ .../tests/simpletest/test/php_parser_test.php | 489 + .../tests/simpletest/test/recorder_test.php | 23 + .../simpletest/test/reflection_php5_test.php | 263 + sys/db/tests/simpletest/test/remote_test.php | 19 + sys/db/tests/simpletest/test/shell_test.php | 38 + .../simpletest/test/shell_tester_test.php | 42 + .../tests/simpletest/test/simpletest_test.php | 58 + sys/db/tests/simpletest/test/site/file.html | 6 + sys/db/tests/simpletest/test/socket_test.php | 25 + .../test/support/collector/collectable.1 | 0 .../test/support/collector/collectable.2 | 0 .../test/support/empty_test_file.php | 3 + .../simpletest/test/support/failing_test.php | 9 + .../simpletest/test/support/latin1_sample | 1 + .../simpletest/test/support/passing_test.php | 9 + .../test/support/recorder_sample.php | 14 + .../simpletest/test/support/spl_examples.php | 15 + .../support/supplementary_upload_sample.txt | 1 + .../tests/simpletest/test/support/test1.php | 7 + .../simpletest/test/support/upload_sample.txt | 1 + sys/db/tests/simpletest/test/tag_test.php | 554 + .../simpletest/test/test_with_parse_error.php | 8 + .../simpletest/test/unit_tester_test.php | 61 + sys/db/tests/simpletest/test/unit_tests.php | 49 + sys/db/tests/simpletest/test/url_test.php | 515 + .../tests/simpletest/test/user_agent_test.php | 348 + sys/db/tests/simpletest/test/visual_test.php | 495 + .../tests/simpletest/test/web_tester_test.php | 155 + sys/db/tests/simpletest/test/xml_test.php | 187 + sys/db/tests/simpletest/test_case.php | 658 ++ sys/db/tests/simpletest/tidy_parser.php | 382 + sys/db/tests/simpletest/unit_tester.php | 413 + sys/db/tests/simpletest/url.php | 550 + sys/db/tests/simpletest/user_agent.php | 328 + sys/db/tests/simpletest/web_tester.php | 1532 +++ sys/db/tests/simpletest/xml.php | 647 ++ sys/miniMVC.php | 4 +- sys/output.php | 8 + 349 files changed, 89470 insertions(+), 3275 deletions(-) delete mode 100644 docs/classes/JSCompilerContext.html delete mode 100644 docs/classes/JSParser.html delete mode 100644 docs/classes/JSTokenizer.html delete mode 100644 docs/classes/Page.html delete mode 100644 docs/classes/R.html create mode 100644 sys/db/.gitignore create mode 100644 sys/db/.travis.yml create mode 100644 sys/db/README.md create mode 100644 sys/db/autoload.php create mode 100644 sys/db/classes/db_pdo.php create mode 100644 sys/db/classes/db_reg.php create mode 100644 sys/db/classes/db_sql.php create mode 100644 sys/db/classes/db_util.php create mode 100644 sys/db/classes/query_builder.php create mode 100644 sys/db/classes/settings.php create mode 100644 sys/db/docs/classes.svg create mode 100644 sys/db/docs/classes/DB_PDO.html rename docs/classes/JSMinPlus.html => sys/db/docs/classes/DB_Reg.html (57%) create mode 100644 sys/db/docs/classes/DB_SQL.html rename docs/classes/Output.html => sys/db/docs/classes/DB_Util.html (53%) create mode 100644 sys/db/docs/classes/Firebird.html create mode 100644 sys/db/docs/classes/Firebird_Result.html create mode 100644 sys/db/docs/classes/Firebird_SQL.html create mode 100644 sys/db/docs/classes/Firebird_Util.html create mode 100644 sys/db/docs/classes/MySQL.html create mode 100644 sys/db/docs/classes/MySQL_SQL.html rename docs/classes/JSNode.html => sys/db/docs/classes/MySQL_Util.html (51%) create mode 100644 sys/db/docs/classes/ODBC.html create mode 100644 sys/db/docs/classes/ODBC_SQL.html create mode 100644 sys/db/docs/classes/ODBC_Util.html create mode 100644 sys/db/docs/classes/PgSQL.html create mode 100644 sys/db/docs/classes/PgSQL_SQL.html create mode 100644 sys/db/docs/classes/PgSQL_Util.html create mode 100644 sys/db/docs/classes/Query_Builder.html create mode 100644 sys/db/docs/classes/SQLite.html create mode 100644 sys/db/docs/classes/SQLite_SQL.html create mode 100644 sys/db/docs/classes/SQLite_Util.html create mode 100644 sys/db/docs/classes/Settings.html create mode 100644 sys/db/docs/classes/Standard_SQL.html create mode 100644 sys/db/docs/classes/pgSQL.html create mode 100644 sys/db/docs/classes/pgSQL_SQL.html create mode 100644 sys/db/docs/css/bootstrap-responsive.css create mode 100644 sys/db/docs/css/bootstrap-responsive.min.css create mode 100644 sys/db/docs/css/bootstrap.css create mode 100644 sys/db/docs/css/bootstrap.min.css create mode 100644 sys/db/docs/css/jquery.iviewer.css create mode 100644 sys/db/docs/css/prettify.css create mode 100644 sys/db/docs/css/template.css create mode 100644 sys/db/docs/deprecated.html create mode 100644 sys/db/docs/errors.html create mode 100644 sys/db/docs/graph_class.html create mode 100644 sys/db/docs/img/apple-touch-icon-114x114.png create mode 100644 sys/db/docs/img/apple-touch-icon-72x72.png create mode 100644 sys/db/docs/img/apple-touch-icon.png create mode 100644 sys/db/docs/img/favicon.ico create mode 100644 sys/db/docs/img/glyphicons-halflings-white.png create mode 100644 sys/db/docs/img/glyphicons-halflings.png create mode 100644 sys/db/docs/img/icons/arrow_down.png create mode 100644 sys/db/docs/img/icons/arrow_right.png create mode 100644 sys/db/docs/img/icons/class.png create mode 100644 sys/db/docs/img/icons/constant.png create mode 100644 sys/db/docs/img/icons/favicon.ico create mode 100644 sys/db/docs/img/icons/file-php.png create mode 100644 sys/db/docs/img/icons/file.gif create mode 100644 sys/db/docs/img/icons/folder.gif create mode 100644 sys/db/docs/img/icons/function.png create mode 100644 sys/db/docs/img/icons/icon-folder-open-big.png create mode 100644 sys/db/docs/img/icons/icon-th-big.png create mode 100644 sys/db/docs/img/icons/icon_template.svg create mode 100644 sys/db/docs/img/icons/interface.png create mode 100644 sys/db/docs/img/icons/method.png create mode 100644 sys/db/docs/img/icons/ok.png create mode 100644 sys/db/docs/img/icons/property.png create mode 100644 sys/db/docs/img/icons/search.gif create mode 100644 sys/db/docs/img/icons/variable.png create mode 100644 sys/db/docs/img/icons/view_source.png create mode 100644 sys/db/docs/img/icons/visibility_private.png create mode 100644 sys/db/docs/img/icons/visibility_protected.png create mode 100644 sys/db/docs/img/icons/visibility_public.png create mode 100644 sys/db/docs/img/iviewer/grab.cur create mode 100644 sys/db/docs/img/iviewer/hand.cur create mode 100644 sys/db/docs/img/iviewer/iviewer.rotate_left.png create mode 100644 sys/db/docs/img/iviewer/iviewer.rotate_right.png create mode 100644 sys/db/docs/img/iviewer/iviewer.zoom_fit.png create mode 100644 sys/db/docs/img/iviewer/iviewer.zoom_fit2.gif create mode 100644 sys/db/docs/img/iviewer/iviewer.zoom_in.png create mode 100644 sys/db/docs/img/iviewer/iviewer.zoom_in2.gif create mode 100644 sys/db/docs/img/iviewer/iviewer.zoom_out.png create mode 100644 sys/db/docs/img/iviewer/iviewer.zoom_out2.gif create mode 100644 sys/db/docs/img/iviewer/iviewer.zoom_zero.png create mode 100644 sys/db/docs/img/iviewer/iviewer.zoom_zero2.gif create mode 100644 sys/db/docs/img/loader.gif create mode 100644 sys/db/docs/js/SVGPan.js create mode 100644 sys/db/docs/js/bootstrap.js create mode 100644 sys/db/docs/js/bootstrap.min.js create mode 100644 sys/db/docs/js/jquery-1.4.2.min.js create mode 100644 sys/db/docs/js/jquery-1.7.1.min.js create mode 100644 sys/db/docs/js/jquery-ui-1.8.2.custom.min.js create mode 100644 sys/db/docs/js/jquery.cookie.js create mode 100644 sys/db/docs/js/jquery.iviewer.js create mode 100644 sys/db/docs/js/jquery.iviewer.min.js create mode 100644 sys/db/docs/js/jquery.mousewheel.min.js create mode 100644 sys/db/docs/js/jquery.panzoom.js create mode 100644 sys/db/docs/js/jquery.splitter.js create mode 100644 sys/db/docs/js/jquery.tools.min.js create mode 100644 sys/db/docs/js/jquery.treeview.js create mode 100644 sys/db/docs/js/menu.js create mode 100644 sys/db/docs/js/prettify/lang-apollo.js create mode 100644 sys/db/docs/js/prettify/lang-clj.js create mode 100644 sys/db/docs/js/prettify/lang-css.js create mode 100644 sys/db/docs/js/prettify/lang-go.js create mode 100644 sys/db/docs/js/prettify/lang-hs.js create mode 100644 sys/db/docs/js/prettify/lang-lisp.js create mode 100644 sys/db/docs/js/prettify/lang-lua.js create mode 100644 sys/db/docs/js/prettify/lang-ml.js create mode 100644 sys/db/docs/js/prettify/lang-n.js create mode 100644 sys/db/docs/js/prettify/lang-proto.js create mode 100644 sys/db/docs/js/prettify/lang-scala.js create mode 100644 sys/db/docs/js/prettify/lang-sql.js create mode 100644 sys/db/docs/js/prettify/lang-tex.js create mode 100644 sys/db/docs/js/prettify/lang-vb.js create mode 100644 sys/db/docs/js/prettify/lang-vhdl.js create mode 100644 sys/db/docs/js/prettify/lang-wiki.js create mode 100644 sys/db/docs/js/prettify/lang-xq.js create mode 100644 sys/db/docs/js/prettify/lang-yaml.js create mode 100644 sys/db/docs/js/prettify/prettify.min.js create mode 100644 sys/db/docs/js/sidebar.js create mode 100644 sys/db/docs/js/template.js create mode 100644 sys/db/docs/markers.html create mode 100644 sys/db/docs/namespaces/default.html rename docs/packages/miniMVC.Assets.html => sys/db/docs/packages/.html (91%) rename docs/classes/JSToken.html => sys/db/docs/packages/Default.html (53%) create mode 100644 sys/db/docs/packages/Query.Drivers.html create mode 100644 sys/db/docs/packages/Query.Helper Classes.html create mode 100644 sys/db/docs/packages/Query.Query.html create mode 100644 sys/db/docs/packages/Query.html create mode 100644 sys/db/docs/structure.xml create mode 100644 sys/db/drivers/firebird/firebird_driver.php create mode 100644 sys/db/drivers/firebird/firebird_result.php create mode 100644 sys/db/drivers/firebird/firebird_sql.php create mode 100644 sys/db/drivers/firebird/firebird_util.php create mode 100644 sys/db/drivers/mysql/mysql_driver.php create mode 100644 sys/db/drivers/mysql/mysql_sql.php create mode 100644 sys/db/drivers/mysql/mysql_util.php create mode 100644 sys/db/drivers/odbc/odbc_driver.php create mode 100644 sys/db/drivers/odbc/odbc_sql.php create mode 100644 sys/db/drivers/odbc/odbc_util.php create mode 100644 sys/db/drivers/pgsql/pgsql_driver.php create mode 100644 sys/db/drivers/pgsql/pgsql_sql.php create mode 100644 sys/db/drivers/pgsql/pgsql_util.php create mode 100644 sys/db/drivers/sqlite/sqlite_driver.php create mode 100644 sys/db/drivers/sqlite/sqlite_sql.php create mode 100644 sys/db/drivers/sqlite/sqlite_util.php create mode 100644 sys/db/phpdoc.dist.xml create mode 100644 sys/db/tests/core/core.php create mode 100644 sys/db/tests/core/db_qb_test.php create mode 100644 sys/db/tests/core/db_test.php create mode 100644 sys/db/tests/core/settings.php create mode 100644 sys/db/tests/databases/firebird/firebird-qb.php create mode 100644 sys/db/tests/databases/firebird/firebird.php create mode 100644 sys/db/tests/databases/mysql/mysql-qb.php create mode 100644 sys/db/tests/databases/mysql/mysql.php create mode 100644 sys/db/tests/databases/pgsql/pgsql-qb.php create mode 100644 sys/db/tests/databases/pgsql/pgsql.php create mode 100644 sys/db/tests/databases/sqlite/sqlite-qb.php create mode 100644 sys/db/tests/databases/sqlite/sqlite.php create mode 100644 sys/db/tests/index.php create mode 100644 sys/db/tests/simpletest/HELP_MY_TESTS_DONT_WORK_ANYMORE create mode 100644 sys/db/tests/simpletest/LICENSE create mode 100644 sys/db/tests/simpletest/README create mode 100644 sys/db/tests/simpletest/VERSION create mode 100644 sys/db/tests/simpletest/arguments.php create mode 100644 sys/db/tests/simpletest/authentication.php create mode 100644 sys/db/tests/simpletest/autorun.php create mode 100644 sys/db/tests/simpletest/browser.php create mode 100644 sys/db/tests/simpletest/collector.php create mode 100644 sys/db/tests/simpletest/compatibility.php create mode 100644 sys/db/tests/simpletest/cookies.php create mode 100644 sys/db/tests/simpletest/default_reporter.php create mode 100644 sys/db/tests/simpletest/detached.php create mode 100644 sys/db/tests/simpletest/docs/en/authentication_documentation.html create mode 100644 sys/db/tests/simpletest/docs/en/browser_documentation.html create mode 100644 sys/db/tests/simpletest/docs/en/docs.css create mode 100644 sys/db/tests/simpletest/docs/en/expectation_documentation.html create mode 100644 sys/db/tests/simpletest/docs/en/form_testing_documentation.html create mode 100644 sys/db/tests/simpletest/docs/en/group_test_documentation.html create mode 100644 sys/db/tests/simpletest/docs/en/mock_objects_documentation.html create mode 100644 sys/db/tests/simpletest/docs/en/overview.html create mode 100644 sys/db/tests/simpletest/docs/en/partial_mocks_documentation.html create mode 100644 sys/db/tests/simpletest/docs/en/reporter_documentation.html create mode 100644 sys/db/tests/simpletest/docs/en/unit_test_documentation.html create mode 100644 sys/db/tests/simpletest/docs/en/web_tester_documentation.html create mode 100644 sys/db/tests/simpletest/docs/fr/authentication_documentation.html create mode 100644 sys/db/tests/simpletest/docs/fr/browser_documentation.html create mode 100644 sys/db/tests/simpletest/docs/fr/docs.css create mode 100644 sys/db/tests/simpletest/docs/fr/expectation_documentation.html create mode 100644 sys/db/tests/simpletest/docs/fr/form_testing_documentation.html create mode 100644 sys/db/tests/simpletest/docs/fr/group_test_documentation.html create mode 100644 sys/db/tests/simpletest/docs/fr/mock_objects_documentation.html create mode 100644 sys/db/tests/simpletest/docs/fr/overview.html create mode 100644 sys/db/tests/simpletest/docs/fr/partial_mocks_documentation.html create mode 100644 sys/db/tests/simpletest/docs/fr/reporter_documentation.html create mode 100644 sys/db/tests/simpletest/docs/fr/unit_test_documentation.html create mode 100644 sys/db/tests/simpletest/docs/fr/web_tester_documentation.html create mode 100644 sys/db/tests/simpletest/dumper.php create mode 100644 sys/db/tests/simpletest/eclipse.php create mode 100644 sys/db/tests/simpletest/encoding.php create mode 100644 sys/db/tests/simpletest/errors.php create mode 100644 sys/db/tests/simpletest/exceptions.php create mode 100644 sys/db/tests/simpletest/expectation.php create mode 100644 sys/db/tests/simpletest/extensions/pear_test_case.php create mode 100644 sys/db/tests/simpletest/extensions/testdox.php create mode 100644 sys/db/tests/simpletest/extensions/testdox/test.php create mode 100644 sys/db/tests/simpletest/form.php create mode 100644 sys/db/tests/simpletest/frames.php create mode 100644 sys/db/tests/simpletest/http.php create mode 100644 sys/db/tests/simpletest/invoker.php create mode 100644 sys/db/tests/simpletest/mock_objects.php create mode 100644 sys/db/tests/simpletest/page.php create mode 100644 sys/db/tests/simpletest/php_parser.php create mode 100644 sys/db/tests/simpletest/recorder.php create mode 100644 sys/db/tests/simpletest/reflection_php4.php create mode 100644 sys/db/tests/simpletest/reflection_php5.php create mode 100644 sys/db/tests/simpletest/remote.php create mode 100644 sys/db/tests/simpletest/reporter.php create mode 100644 sys/db/tests/simpletest/scorer.php create mode 100644 sys/db/tests/simpletest/selector.php create mode 100644 sys/db/tests/simpletest/shell_tester.php create mode 100644 sys/db/tests/simpletest/simpletest.php create mode 100644 sys/db/tests/simpletest/socket.php create mode 100644 sys/db/tests/simpletest/tag.php create mode 100644 sys/db/tests/simpletest/test/acceptance_test.php create mode 100644 sys/db/tests/simpletest/test/adapter_test.php create mode 100644 sys/db/tests/simpletest/test/all_tests.php create mode 100644 sys/db/tests/simpletest/test/arguments_test.php create mode 100644 sys/db/tests/simpletest/test/authentication_test.php create mode 100644 sys/db/tests/simpletest/test/autorun_test.php create mode 100644 sys/db/tests/simpletest/test/bad_test_suite.php create mode 100644 sys/db/tests/simpletest/test/browser_test.php create mode 100644 sys/db/tests/simpletest/test/collector_test.php create mode 100644 sys/db/tests/simpletest/test/command_line_test.php create mode 100644 sys/db/tests/simpletest/test/compatibility_test.php create mode 100644 sys/db/tests/simpletest/test/cookies_test.php create mode 100644 sys/db/tests/simpletest/test/detached_test.php create mode 100644 sys/db/tests/simpletest/test/dumper_test.php create mode 100644 sys/db/tests/simpletest/test/eclipse_test.php create mode 100644 sys/db/tests/simpletest/test/encoding_test.php create mode 100644 sys/db/tests/simpletest/test/errors_test.php create mode 100644 sys/db/tests/simpletest/test/exceptions_test.php create mode 100644 sys/db/tests/simpletest/test/expectation_test.php create mode 100644 sys/db/tests/simpletest/test/form_test.php create mode 100644 sys/db/tests/simpletest/test/frames_test.php create mode 100644 sys/db/tests/simpletest/test/http_test.php create mode 100644 sys/db/tests/simpletest/test/interfaces_test.php create mode 100644 sys/db/tests/simpletest/test/interfaces_test_php5_1.php create mode 100644 sys/db/tests/simpletest/test/live_test.php create mode 100644 sys/db/tests/simpletest/test/mock_objects_test.php create mode 100644 sys/db/tests/simpletest/test/page_test.php create mode 100644 sys/db/tests/simpletest/test/parse_error_test.php create mode 100644 sys/db/tests/simpletest/test/parsing_test.php create mode 100644 sys/db/tests/simpletest/test/php_parser_test.php create mode 100644 sys/db/tests/simpletest/test/recorder_test.php create mode 100644 sys/db/tests/simpletest/test/reflection_php5_test.php create mode 100644 sys/db/tests/simpletest/test/remote_test.php create mode 100644 sys/db/tests/simpletest/test/shell_test.php create mode 100644 sys/db/tests/simpletest/test/shell_tester_test.php create mode 100644 sys/db/tests/simpletest/test/simpletest_test.php create mode 100644 sys/db/tests/simpletest/test/site/file.html create mode 100644 sys/db/tests/simpletest/test/socket_test.php create mode 100644 sys/db/tests/simpletest/test/support/collector/collectable.1 create mode 100644 sys/db/tests/simpletest/test/support/collector/collectable.2 create mode 100644 sys/db/tests/simpletest/test/support/empty_test_file.php create mode 100644 sys/db/tests/simpletest/test/support/failing_test.php create mode 100644 sys/db/tests/simpletest/test/support/latin1_sample create mode 100644 sys/db/tests/simpletest/test/support/passing_test.php create mode 100644 sys/db/tests/simpletest/test/support/recorder_sample.php create mode 100644 sys/db/tests/simpletest/test/support/spl_examples.php create mode 100644 sys/db/tests/simpletest/test/support/supplementary_upload_sample.txt create mode 100644 sys/db/tests/simpletest/test/support/test1.php create mode 100644 sys/db/tests/simpletest/test/support/upload_sample.txt create mode 100644 sys/db/tests/simpletest/test/tag_test.php create mode 100644 sys/db/tests/simpletest/test/test_with_parse_error.php create mode 100644 sys/db/tests/simpletest/test/unit_tester_test.php create mode 100644 sys/db/tests/simpletest/test/unit_tests.php create mode 100644 sys/db/tests/simpletest/test/url_test.php create mode 100644 sys/db/tests/simpletest/test/user_agent_test.php create mode 100644 sys/db/tests/simpletest/test/visual_test.php create mode 100644 sys/db/tests/simpletest/test/web_tester_test.php create mode 100644 sys/db/tests/simpletest/test/xml_test.php create mode 100644 sys/db/tests/simpletest/test_case.php create mode 100644 sys/db/tests/simpletest/tidy_parser.php create mode 100644 sys/db/tests/simpletest/unit_tester.php create mode 100644 sys/db/tests/simpletest/url.php create mode 100644 sys/db/tests/simpletest/user_agent.php create mode 100644 sys/db/tests/simpletest/web_tester.php create mode 100644 sys/db/tests/simpletest/xml.php diff --git a/README.md b/README.md index a7ab5af..5b16f0f 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ miniMVC is a minimalistic Modular MVC framework, with built-in minifier, and pur * `__call()` method allows the dynamic addition of callable closure objects Eg. `$this->foo = function($baz){}` is callable as `$this->foo()`, with the current object as the last argument + +* `MM` class extends ArrayObject, and all the main classes extend this class. Functions begining with `array_` are callable on object from this class. E.g. `$this->array_keys()` will return a list of the class properties. #### Database class is an extension of PHP's PDO class. diff --git a/docs/classes.svg b/docs/classes.svg index dbe0c09..3b992cc 100644 --- a/docs/classes.svg +++ b/docs/classes.svg @@ -19,8 +19,260 @@ + +\\DB_Reg + + +DB_Reg + + + +\\Settings + + +Settings + + + +\\DB_SQL + + +«abstract» +DB_SQL + + + +\\DB_PDO + + +«abstract» +DB_PDO + + + +\\PDO + +\PDO + + +\\DB_PDO->\\PDO + + + + +\\Query_Builder + + +Query_Builder + + + +\\DB_Util + + +«abstract» +DB_Util + + + +\\PgSQL_SQL + + +PgSQL_SQL + + + +\\PgSQL_SQL->\\DB_SQL + + + + +\\PgSQL_Util + + +PgSQL_Util + + + +\\PgSQL_Util->\\DB_Util + + + + +\\PgSQL + + +PgSQL + + + +\\PgSQL->\\DB_PDO + + + + +\\ODBC_Util + + +ODBC_Util + + + +\\ODBC_Util->\\DB_Util + + + + +\\ODBC_SQL + + +ODBC_SQL + + + +\\ODBC_SQL->\\DB_SQL + + + + +\\ODBC + + +ODBC + + + +\\ODBC->\\DB_PDO + + + + +\\MySQL_Util + + +MySQL_Util + + + +\\MySQL_Util->\\DB_Util + + + + +\\MySQL + + +MySQL + + + +\\MySQL->\\DB_PDO + + + + +\\MySQL_SQL + + +MySQL_SQL + + + +\\MySQL_SQL->\\DB_SQL + + + + +\\SQLite_Util + + +SQLite_Util + + + +\\SQLite_Util->\\DB_Util + + + + +\\SQLite + + +SQLite + + + +\\SQLite->\\DB_PDO + + + + +\\SQLite_SQL + + +SQLite_SQL + + + +\\SQLite_SQL->\\DB_SQL + + + + +\\Firebird_SQL + + +Firebird_SQL + + + +\\Firebird_SQL->\\DB_SQL + + + + +\\Firebird_Result + + +Firebird_Result + + + +\\PDOStatement + +\PDOStatement + + +\\Firebird_Result->\\PDOStatement + + + + +\\Firebird + + +Firebird + + + +\\Firebird->\\DB_PDO + + + + +\\Firebird_Util + + +Firebird_Util + + + +\\Firebird_Util->\\DB_Util + + + -\\MM_Model +\\MM_Model MM_Model @@ -34,262 +286,10 @@ -\\MM_Model->\\miniMVC +\\MM_Model->\\miniMVC - -\\DB_Reg - - -DB_Reg - - - -\\Settings - - -Settings - - - -\\DB_SQL - - -«abstract» -DB_SQL - - - -\\DB_PDO - - -«abstract» -DB_PDO - - - -\\PDO - -\PDO - - -\\DB_PDO->\\PDO - - - - -\\Query_Builder - - -Query_Builder - - - -\\DB_Util - - -«abstract» -DB_Util - - - -\\PgSQL_SQL - - -PgSQL_SQL - - - -\\PgSQL_SQL->\\DB_SQL - - - - -\\PgSQL_Util - - -PgSQL_Util - - - -\\PgSQL_Util->\\DB_Util - - - - -\\PgSQL - - -PgSQL - - - -\\PgSQL->\\DB_PDO - - - - -\\ODBC_Util - - -ODBC_Util - - - -\\ODBC_Util->\\DB_Util - - - - -\\ODBC_SQL - - -ODBC_SQL - - - -\\ODBC_SQL->\\DB_SQL - - - - -\\ODBC - - -ODBC - - - -\\ODBC->\\DB_PDO - - - - -\\MySQL_Util - - -MySQL_Util - - - -\\MySQL_Util->\\DB_Util - - - - -\\MySQL - - -MySQL - - - -\\MySQL->\\DB_PDO - - - - -\\MySQL_SQL - - -MySQL_SQL - - - -\\MySQL_SQL->\\DB_SQL - - - - -\\SQLite_Util - - -SQLite_Util - - - -\\SQLite_Util->\\DB_Util - - - - -\\SQLite - - -SQLite - - - -\\SQLite->\\DB_PDO - - - - -\\SQLite_SQL - - -SQLite_SQL - - - -\\SQLite_SQL->\\DB_SQL - - - - -\\Firebird_SQL - - -Firebird_SQL - - - -\\Firebird_SQL->\\DB_SQL - - - - -\\Firebird_Result - - -Firebird_Result - - - -\\PDOStatement - -\PDOStatement - - -\\Firebird_Result->\\PDOStatement - - - - -\\Firebird - - -Firebird - - - -\\Firebird->\\DB_PDO - - - - -\\Firebird_Util - - -Firebird_Util - - - -\\Firebird_Util->\\DB_Util - - - \\DB diff --git a/docs/classes/DB.html b/docs/classes/DB.html index d784e86..657391c 100644 --- a/docs/classes/DB.html +++ b/docs/classes/DB.html @@ -1583,7 +1583,7 @@ for complex select queries
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/DB_PDO.html b/docs/classes/DB_PDO.html index 9f96802..178f5c1 100644 --- a/docs/classes/DB_PDO.html +++ b/docs/classes/DB_PDO.html @@ -679,7 +679,7 @@ the connection/database
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/DB_Reg.html b/docs/classes/DB_Reg.html index 94e5cbb..dcd614a 100644 --- a/docs/classes/DB_Reg.html +++ b/docs/classes/DB_Reg.html @@ -152,7 +152,7 @@ and organizes database connections

+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/DB_SQL.html b/docs/classes/DB_SQL.html index eef5fb8..713a489 100644 --- a/docs/classes/DB_SQL.html +++ b/docs/classes/DB_SQL.html @@ -269,7 +269,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/DB_Util.html b/docs/classes/DB_Util.html index be04eb8..f33275e 100644 --- a/docs/classes/DB_Util.html +++ b/docs/classes/DB_Util.html @@ -209,7 +209,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/Firebird.html b/docs/classes/Firebird.html index 710d93b..76890d3 100644 --- a/docs/classes/Firebird.html +++ b/docs/classes/Firebird.html @@ -833,7 +833,7 @@ the last query executed
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/Firebird_Result.html b/docs/classes/Firebird_Result.html index 75798cf..b7e5bc5 100644 --- a/docs/classes/Firebird_Result.html +++ b/docs/classes/Firebird_Result.html @@ -504,7 +504,7 @@ the query
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/Firebird_SQL.html b/docs/classes/Firebird_SQL.html index 8561bfe..80b9930 100644 --- a/docs/classes/Firebird_SQL.html +++ b/docs/classes/Firebird_SQL.html @@ -297,7 +297,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/Firebird_Util.html b/docs/classes/Firebird_Util.html index fd02a56..9a40f4a 100644 --- a/docs/classes/Firebird_Util.html +++ b/docs/classes/Firebird_Util.html @@ -212,7 +212,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/JSCompilerContext.html b/docs/classes/JSCompilerContext.html deleted file mode 100644 index 2312c74..0000000 --- a/docs/classes/JSCompilerContext.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - - -miniMVC » \JSCompilerContext - - - - - - - - - - -
- -
- -
-
-

- Methods

-
-

__construct() -

-
__construct($inFunction) 
-
-
-

-

Parameters

-
-

$inFunction

- -
-
-
-

- Properties

- 
-

$bracketLevel

-
$bracketLevel 
-
-

-
- 
-

$curlyLevel

-
$curlyLevel 
-
-

-
- 
-

$ecmaStrictMode

-
$ecmaStrictMode 
-
-

-
- 
-

$funDecls

-
$funDecls 
-
-

-
- 
-

$hookLevel

-
$hookLevel 
-
-

-
- 
-

$inForLoopInit

-
$inForLoopInit 
-
-

-
- 
-

$inFunction

-
$inFunction 
-
-

-
- 
-

$parenLevel

-
$parenLevel 
-
-

-
- 
-

$stmtStack

-
$stmtStack 
-
-

-
- 
-

$varDecls

-
$varDecls 
-
-

-
-
-
-
-
-
- - diff --git a/docs/classes/JSParser.html b/docs/classes/JSParser.html deleted file mode 100644 index 6589f0d..0000000 --- a/docs/classes/JSParser.html +++ /dev/null @@ -1,335 +0,0 @@ - - - - - -miniMVC » \JSParser - - - - - - - - - - -
- -
- -
-
-

- Methods

-
-

__construct() -

-
__construct($minifier) 
-
-
-

-

Parameters

-
-

$minifier

- -
-
-
-
-

parse() -

-
parse($s, $f, $l) 
-
-
-

-

Parameters

-
-

$s

- -
-
-

$f

- -
-
-

$l

- -
-
-
-
-

Block() -

-
Block($x) 
-
-
-

-

Parameters

-
-

$x

- -
-
-
-
-

Expression() -

-
Expression($x, $stop) 
-
-
-

-

Parameters

-
-

$x

- -
-
-

$stop

- -
-
-
-
-

FunctionDefinition() -

-
FunctionDefinition($x, $requireName, $functionForm) 
-
-
-

-

Parameters

-
-

$x

- -
-
-

$requireName

- -
-
-

$functionForm

- -
-
-
-
-

ParenExpression() -

-
ParenExpression($x) 
-
-
-

-

Parameters

-
-

$x

- -
-
-
-
-

Script() -

-
Script($x) 
-
-
-

-

Parameters

-
-

$x

- -
-
-
-
-

Statement() -

-
Statement($x) 
-
-
-

-

Parameters

-
-

$x

- -
-
-
-
-

Statements() -

-
Statements($x) 
-
-
-

-

Parameters

-
-

$x

- -
-
-
-
-

Variables() -

-
Variables($x) 
-
-
-

-

Parameters

-
-

$x

- -
-
-
-
-

nest() -

-
nest($x, $node, $end) 
-
-
-

-

Parameters

-
-

$x

- -
-
-

$node

- -
-
-

$end

- -
-
-
-
-

reduce() -

-
reduce($operators, $operands) 
-
-
-

-

Parameters

-
-

$operators

- -
-
-

$operands

- -
-
-
-

- Properties

- 
-

$minifier

-
$minifier 
-
-

-
- 
-

$opArity

-
$opArity 
-
-

-
- 
-

$opPrecedence

-
$opPrecedence 
-
-

-
- 
-

$t

-
$t 
-
-

-
-
-
-
-
-
- - diff --git a/docs/classes/JSTokenizer.html b/docs/classes/JSTokenizer.html deleted file mode 100644 index 5b269fa..0000000 --- a/docs/classes/JSTokenizer.html +++ /dev/null @@ -1,331 +0,0 @@ - - - - - -miniMVC » \JSTokenizer - - - - - - - - - - -
- -
- -
-
-

- Methods

-
-

__construct() -

-
__construct() 
-
-

-
-
-

currentToken() -

-
currentToken() 
-
-

-
-
-

get() -

-
get($chunksize) 
-
-
-

-

Parameters

-
-

$chunksize

- -
-
-
-
-

getInput() -

-
getInput($chunksize) 
-
-
-

-

Parameters

-
-

$chunksize

- -
-
-
-
-

init() -

-
init($source, $filename, $lineno) 
-
-
-

-

Parameters

-
-

$source

- -
-
-

$filename

- -
-
-

$lineno

- -
-
-
-
-

isDone() -

-
isDone() 
-
-

-
-
-

match() -

-
match($tt) 
-
-
-

-

Parameters

-
-

$tt

- -
-
-
-
-

mustMatch() -

-
mustMatch($tt) 
-
-
-

-

Parameters

-
-

$tt

- -
-
-
-
-

newSyntaxError() -

-
newSyntaxError($m) 
-
-
-

-

Parameters

-
-

$m

- -
-
-
-
-

peek() -

-
peek() 
-
-

-
-
-

peekOnSameLine() -

-
peekOnSameLine() 
-
-

-
-
-

unget() -

-
unget() 
-
-

-
-

- Properties

- 
-

$filename

-
$filename 
-
-

-
- 
-

$lineno

-
$lineno 
-
-

-
- 
-

$lookahead

-
$lookahead 
-
-

-
- 
-

$scanNewlines

-
$scanNewlines 
-
-

-
- 
-

$scanOperand

-
$scanOperand 
-
-

-
- 
-

$tokenIndex

-
$tokenIndex 
-
-

-
- 
-

$tokens

-
$tokens 
-
-

-
- 
-

$assignOps

-
$assignOps 
-
-

-
- 
-

$cursor

-
$cursor 
-
-

-
- 
-

$keywords

-
$keywords 
-
-

-
- 
-

$opRegExp

-
$opRegExp 
-
-

-
- 
-

$opTypeNames

-
$opTypeNames 
-
-

-
- 
-

$source

-
$source 
-
-

-
-
-
-
-
-
- - diff --git a/docs/classes/MM.html b/docs/classes/MM.html index 7323100..82b8cbb 100644 --- a/docs/classes/MM.html +++ b/docs/classes/MM.html @@ -434,7 +434,7 @@ dynamic methods
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/MM_Controller.html b/docs/classes/MM_Controller.html index 639945b..cf78b8e 100644 --- a/docs/classes/MM_Controller.html +++ b/docs/classes/MM_Controller.html @@ -764,7 +764,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/MM_Model.html b/docs/classes/MM_Model.html index f6f61f9..a2fe050 100644 --- a/docs/classes/MM_Model.html +++ b/docs/classes/MM_Model.html @@ -728,7 +728,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/MM_Output.html b/docs/classes/MM_Output.html index 75eef04..c045023 100644 --- a/docs/classes/MM_Output.html +++ b/docs/classes/MM_Output.html @@ -640,7 +640,7 @@ Used for outputing HTML
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/MM_Page.html b/docs/classes/MM_Page.html index 0db936b..401d604 100644 --- a/docs/classes/MM_Page.html +++ b/docs/classes/MM_Page.html @@ -972,7 +972,7 @@ supports

+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/MySQL.html b/docs/classes/MySQL.html index 7ad8c63..847affc 100644 --- a/docs/classes/MySQL.html +++ b/docs/classes/MySQL.html @@ -869,7 +869,7 @@ the connection/database
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/MySQL_SQL.html b/docs/classes/MySQL_SQL.html index 606673e..6c68964 100644 --- a/docs/classes/MySQL_SQL.html +++ b/docs/classes/MySQL_SQL.html @@ -281,7 +281,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/MySQL_Util.html b/docs/classes/MySQL_Util.html index 23bdec8..019ef03 100644 --- a/docs/classes/MySQL_Util.html +++ b/docs/classes/MySQL_Util.html @@ -208,7 +208,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/ODBC.html b/docs/classes/ODBC.html index f47ba9e..2af6190 100644 --- a/docs/classes/ODBC.html +++ b/docs/classes/ODBC.html @@ -871,7 +871,7 @@ the connection/database
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/ODBC_SQL.html b/docs/classes/ODBC_SQL.html index a768ec5..0d57739 100644 --- a/docs/classes/ODBC_SQL.html +++ b/docs/classes/ODBC_SQL.html @@ -281,7 +281,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/ODBC_Util.html b/docs/classes/ODBC_Util.html index 2db109f..7e771ca 100644 --- a/docs/classes/ODBC_Util.html +++ b/docs/classes/ODBC_Util.html @@ -203,7 +203,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/Page.html b/docs/classes/Page.html deleted file mode 100644 index 1be8619..0000000 --- a/docs/classes/Page.html +++ /dev/null @@ -1,504 +0,0 @@ - - - - - -miniMVC » \Page - - - - - - - - - - -
- -
- -
-
-

Class for building pages

-
-

All methods are chainable, with the exception of the constructor, -build_header(), build_footer(), and _headers() methods.

- - - - - - - - - -
packageminiMVC
subpackageSystem
-

- Methods

-
-

Set up the page class

-
__construct() : void
-
-

-
- -
-

Sets custom page header

-
build_header(bool $html5) : \Page
-
-
-

-

Parameters

-
-

$html5

-bool -
-

Returns

- -
-
-
-

Output String

-
output_string(string $string) 
-
-
-

Similar to render(), this is a shortcut -to output a string in the body of the -page.

-

Parameters

-
-

$string

-string -
-
-
-
-

Redirect 303

-
redirect_303(string $url) 
-
-
-

Shortcut function for 303 redirect

-

Parameters

-
-

$url

-string -
-
-
-
-

Render

-
render(string $view, array $data) 
-
-
-

Shortcut function for building a page

-

Parameters

-
-

$view

-string -
-
-

$data

-array -
-
-
-
-

Sets custom base href

-
set_base(string $href) : \Page
-
-
-

-

Parameters

-
-

$href

-string

href

-

Returns

- -
-
-
-

Sets custom body class

-
set_body_class(string $class) : \Page
-
-
-

-

Parameters

-
-

$class

-string -
-

Returns

- -
-
-
-

Sets custom body id

-
set_body_id(string $id) : \Page
-
-
-

-

Parameters

-
-

$id

-string -
-

Returns

- -
-
-
-

Sets a minified css group

-
set_css_group(string $group) : \Page
-
-
-

-

Parameters

-
-

$group

-string -
-

Returns

- -
-
-
-

Sets custom css tags

-
set_css_tag(string $name, bool $domain, string $media) : \Page
-
-
-

-

Parameters

-
-

$name

-string -
-
-

$domain

-bool -
-
-

$media

-string -
-

Returns

- -
-
-
-

Sets a minified javascript group for the page footer

-
set_foot_js_group(string $group, bool $debug) : \Page
-
-
-

-

Parameters

-
-

$group

-string -
-
-

$debug

-bool -
-

Returns

- -
-
-
-

Sets minified javascript group in header

-
set_head_js_group(string $group, bool $debug) : \Page
-
-
-

-

Parameters

-
-

$group

-string -
-
-

$debug

-bool -
-

Returns

- -
-
-
-

Sets a custom tag in the header

-
set_head_tag(string $tag) : \Page
-
-
-

-

Parameters

-
-

$tag

-string -
-

Returns

- -
-
-
-

Set Message

-
set_message(string $type, string $message, $return) : void
-
-
-

Adds a message to the page

-

Parameters

-
-

$type

-string -
-
-

$message

-string -
-
-

$return

- -
-
-
-
-

Set Meta

-
set_meta(array $meta) : \Page
-
-
-

Sets meta tags, with codeigniter native meta tag helper

-

Parameters

-
-

$meta

-array -
-

Returns

- -
-
-
-

Sets html title string

-
set_title(string $title) : \Page
-
-
-

-

Parameters

-
-

$title

-string -
-

Returns

- -
-
-
-

Sets server headers and doctype

-
_headers(bool $html5) : \Page
-
-
-

Also sets page mime type, based on if sent as -html or xhtml, and what the target browser -supports

-

Parameters

-
-

$html5

-bool -
-

Returns

- -
-
- -
-

Private helper function to generate meta tags

-
_meta(array $params) : string
-
-
-

-

Parameters

-
-

$params

-array -
-

Returns

-
string
-
-
-
-

Script Tag

-
script_tag(string $js, bool $domain) : string
-
-
-

Helper function for making script tags

-

Parameters

-
-

$js

-string -
-
-

$domain

-bool -
-

Returns

-
string
-
-
-

- Properties

- 
-

Base tag

-
$base : string
-
-

-
- 
-

Class(es) to apply to the main body tag

-
$body_class : string
-
-

-
- 
-

Id to apply to the body tag

-
$body_id : string
-
-

-
- 
-

CSS tags for the page

-
$css : string
-
-

-
- 
-

JS tags for the footer

-
$foot_js : string
-
-

-
- 
-

JS tags for the header

-
$head_js : string
-
-

-
- 
-

Additional header tags

-
$head_tags : string
-
-

-
- 
-

Meta tags

-
$meta : string
-
-

-
- 
-

Page title

-
$title : string
-
-

-
-
-
-
-
-
-
- - diff --git a/docs/classes/PgSQL.html b/docs/classes/PgSQL.html index a64b9e4..6c1bc9c 100644 --- a/docs/classes/PgSQL.html +++ b/docs/classes/PgSQL.html @@ -871,7 +871,7 @@ the connection/database
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/PgSQL_SQL.html b/docs/classes/PgSQL_SQL.html index ba2331a..ea50b5d 100644 --- a/docs/classes/PgSQL_SQL.html +++ b/docs/classes/PgSQL_SQL.html @@ -297,7 +297,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/PgSQL_Util.html b/docs/classes/PgSQL_Util.html index f8cc97d..fd38d4b 100644 --- a/docs/classes/PgSQL_Util.html +++ b/docs/classes/PgSQL_Util.html @@ -208,7 +208,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/Query_Builder.html b/docs/classes/Query_Builder.html index 0ab6a10..fbf59e3 100644 --- a/docs/classes/Query_Builder.html +++ b/docs/classes/Query_Builder.html @@ -1222,7 +1222,7 @@ for complex select queries
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/R.html b/docs/classes/R.html deleted file mode 100644 index 70439af..0000000 --- a/docs/classes/R.html +++ /dev/null @@ -1,850 +0,0 @@ - - - - - -miniMVC » \R - - - - - - - - - - -
- -
-
-
- -
- -
-
-
-

Class for examining other classes

-
-

- - - - - - - - - -
packageminiMVC
subpackageSystem
-

- Methods

-
-

Attempt to run static functions in non-static context

-
__call(string $name, array $args) : mixed
-
-
-

-

Parameters

-
-

$name

-string -
-
-

$args

-array -
-

Returns

-
mixed
-
-
-
-

ReflectionClass Constructor

-
__construct(mixed $var) 
-
-
-

-

Parameters

-
-

$var

-mixed -
-
-
-
-

__toString() -

-
__toString() 
-
-
-

- - - -
inherited_fromReflectionClass::__toString()
-
-
-
-

export() -

-
export() 
-
-
-

- - - -
inherited_fromReflectionClass::export()
-
-
-
-

getConstant() -

-
getConstant() 
-
-
-

- - - -
inherited_fromReflectionClass::getConstant()
-
-
-
-

getConstants() -

-
getConstants() 
-
-
-

- - - -
inherited_fromReflectionClass::getConstants()
-
-
-
-

getConstructor() -

-
getConstructor() 
-
-
-

- - - -
inherited_fromReflectionClass::getConstructor()
-
-
-
-

getDefaultProperties() -

-
getDefaultProperties() 
-
-
-

- - - -
inherited_fromReflectionClass::getDefaultProperties()
-
-
-
-

getDocComment() -

-
getDocComment() 
-
-
-

- - - -
inherited_fromReflectionClass::getDocComment()
-
-
-
-

getEndLine() -

-
getEndLine() 
-
-
-

- - - -
inherited_fromReflectionClass::getEndLine()
-
-
-
-

getExtension() -

-
getExtension() 
-
-
-

- - - -
inherited_fromReflectionClass::getExtension()
-
-
-
-

getExtensionName() -

-
getExtensionName() 
-
-
-

- - - -
inherited_fromReflectionClass::getExtensionName()
-
-
-
-

getFileName() -

-
getFileName() 
-
-
-

- - - -
inherited_fromReflectionClass::getFileName()
-
-
-
-

getInterfaceNames() -

-
getInterfaceNames() 
-
-
-

- - - -
inherited_fromReflectionClass::getInterfaceNames()
-
-
-
-

getInterfaces() -

-
getInterfaces() 
-
-
-

- - - -
inherited_fromReflectionClass::getInterfaces()
-
-
-
-

getMethod() -

-
getMethod() 
-
-
-

- - - -
inherited_fromReflectionClass::getMethod()
-
-
-
-

getMethods() -

-
getMethods() 
-
-
-

- - - -
inherited_fromReflectionClass::getMethods()
-
-
-
-

getModifiers() -

-
getModifiers() 
-
-
-

- - - -
inherited_fromReflectionClass::getModifiers()
-
-
-
-

getName() -

-
getName() 
-
-
-

- - - -
inherited_fromReflectionClass::getName()
-
-
-
-

getNamespaceName() -

-
getNamespaceName() 
-
-
-

- - - -
inherited_fromReflectionClass::getNamespaceName()
-
-
-
-

getParentClass() -

-
getParentClass() 
-
-
-

- - - -
inherited_fromReflectionClass::getParentClass()
-
-
-
-

getProperties() -

-
getProperties() 
-
-
-

- - - -
inherited_fromReflectionClass::getProperties()
-
-
-
-

getProperty() -

-
getProperty() 
-
-
-

- - - -
inherited_fromReflectionClass::getProperty()
-
-
-
-

getShortName() -

-
getShortName() 
-
-
-

- - - -
inherited_fromReflectionClass::getShortName()
-
-
-
-

getStartLine() -

-
getStartLine() 
-
-
-

- - - -
inherited_fromReflectionClass::getStartLine()
-
-
-
-

getStaticProperties() -

-
getStaticProperties() 
-
-
-

- - - -
inherited_fromReflectionClass::getStaticProperties()
-
-
-
-

getStaticPropertyValue() -

-
getStaticPropertyValue() 
-
-
-

- - - -
inherited_fromReflectionClass::getStaticPropertyValue()
-
-
-
-

getTraitAliases() -

-
getTraitAliases() 
-
-
-

- - - -
inherited_fromReflectionClass::getTraitAliases()
-
-
-
-

getTraitNames() -

-
getTraitNames() 
-
-
-

- - - -
inherited_fromReflectionClass::getTraitNames()
-
-
-
-

getTraits() -

-
getTraits() 
-
-
-

- - - -
inherited_fromReflectionClass::getTraits()
-
-
-
-

Retrieve as much information about the class as possible

-
get_all() 
-
-

-
-
-

hasConstant() -

-
hasConstant() 
-
-
-

- - - -
inherited_fromReflectionClass::hasConstant()
-
-
-
-

hasMethod() -

-
hasMethod() 
-
-
-

- - - -
inherited_fromReflectionClass::hasMethod()
-
-
-
-

hasProperty() -

-
hasProperty() 
-
-
-

- - - -
inherited_fromReflectionClass::hasProperty()
-
-
-
-

implementsInterface() -

-
implementsInterface() 
-
-
-

- - - -
inherited_fromReflectionClass::implementsInterface()
-
-
-
-

inNamespace() -

-
inNamespace() 
-
-
-

- - - -
inherited_fromReflectionClass::inNamespace()
-
-
-
-

isAbstract() -

-
isAbstract() 
-
-
-

- - - -
inherited_fromReflectionClass::isAbstract()
-
-
-
-

isCloneable() -

-
isCloneable() 
-
-
-

- - - -
inherited_fromReflectionClass::isCloneable()
-
-
-
-

isFinal() -

-
isFinal() 
-
-
-

- - - -
inherited_fromReflectionClass::isFinal()
-
-
-
-

isInstance() -

-
isInstance() 
-
-
-

- - - -
inherited_fromReflectionClass::isInstance()
-
-
-
-

isInstantiable() -

-
isInstantiable() 
-
-
-

- - - -
inherited_fromReflectionClass::isInstantiable()
-
-
-
-

isInterface() -

-
isInterface() 
-
-
-

- - - -
inherited_fromReflectionClass::isInterface()
-
-
-
-

isInternal() -

-
isInternal() 
-
-
-

- - - -
inherited_fromReflectionClass::isInternal()
-
-
-
-

isIterateable() -

-
isIterateable() 
-
-
-

- - - -
inherited_fromReflectionClass::isIterateable()
-
-
-
-

isSubclassOf() -

-
isSubclassOf() 
-
-
-

- - - -
inherited_fromReflectionClass::isSubclassOf()
-
-
-
-

isTrait() -

-
isTrait() 
-
-
-

- - - -
inherited_fromReflectionClass::isTrait()
-
-
-
-

isUserDefined() -

-
isUserDefined() 
-
-
-

- - - -
inherited_fromReflectionClass::isUserDefined()
-
-
-
-

newInstance() -

-
newInstance() 
-
-
-

- - - -
inherited_fromReflectionClass::newInstance()
-
-
-
-

newInstanceArgs() -

-
newInstanceArgs() 
-
-
-

- - - -
inherited_fromReflectionClass::newInstanceArgs()
-
-
-
-

newInstanceWithoutConstructor() -

-
newInstanceWithoutConstructor() 
-
-
-

- - - -
inherited_fromReflectionClass::newInstanceWithoutConstructor()
-
-
-
-

setStaticPropertyValue() -

-
setStaticPropertyValue() 
-
-
-

- - - -
inherited_fromReflectionClass::setStaticPropertyValue()
-
-
-
-
-
-
-
-
- - diff --git a/docs/classes/SQLite.html b/docs/classes/SQLite.html index 695d1aa..f67184a 100644 --- a/docs/classes/SQLite.html +++ b/docs/classes/SQLite.html @@ -886,7 +886,7 @@ method if the database does not support 'TRUNCATE';
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/SQLite_SQL.html b/docs/classes/SQLite_SQL.html index 0e83946..6279cc9 100644 --- a/docs/classes/SQLite_SQL.html +++ b/docs/classes/SQLite_SQL.html @@ -281,7 +281,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/SQLite_Util.html b/docs/classes/SQLite_Util.html index 53bfd26..aea9d99 100644 --- a/docs/classes/SQLite_Util.html +++ b/docs/classes/SQLite_Util.html @@ -208,7 +208,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/Settings.html b/docs/classes/Settings.html index 833c7cd..baa675b 100644 --- a/docs/classes/Settings.html +++ b/docs/classes/Settings.html @@ -244,7 +244,7 @@ directly - the settings should be safe!
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/Welcome.html b/docs/classes/Welcome.html index 0d8495d..fba39c8 100644 --- a/docs/classes/Welcome.html +++ b/docs/classes/Welcome.html @@ -906,7 +906,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/Welcome_Model.html b/docs/classes/Welcome_Model.html index a010c33..47f2c03 100644 --- a/docs/classes/Welcome_Model.html +++ b/docs/classes/Welcome_Model.html @@ -846,7 +846,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/classes/miniMVC.html b/docs/classes/miniMVC.html index 0a96754..16de8b2 100644 --- a/docs/classes/miniMVC.html +++ b/docs/classes/miniMVC.html @@ -615,7 +615,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/deprecated.html b/docs/deprecated.html index 682a071..d4f7a30 100644 --- a/docs/deprecated.html +++ b/docs/deprecated.html @@ -67,7 +67,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/errors.html b/docs/errors.html index 7ed242f..814446b 100644 --- a/docs/errors.html +++ b/docs/errors.html @@ -106,7 +106,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/graph_class.html b/docs/graph_class.html index 77f7217..29c850b 100644 --- a/docs/graph_class.html +++ b/docs/graph_class.html @@ -64,7 +64,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/index.html b/docs/index.html index c2aedb1..debbe25 100644 --- a/docs/index.html +++ b/docs/index.html @@ -80,7 +80,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/markers.html b/docs/markers.html index e8406e3..f6ee4ff 100644 --- a/docs/markers.html +++ b/docs/markers.html @@ -69,7 +69,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/namespaces/default.html b/docs/namespaces/default.html index fb00058..9efdf29 100644 --- a/docs/namespaces/default.html +++ b/docs/namespaces/default.html @@ -702,7 +702,7 @@ instantiates the specific db driver

+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/packages/.html b/docs/packages/.html index b63005c..e168f14 100644 --- a/docs/packages/.html +++ b/docs/packages/.html @@ -67,7 +67,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/packages/Default.html b/docs/packages/Default.html index 8e57b99..942a391 100644 --- a/docs/packages/Default.html +++ b/docs/packages/Default.html @@ -185,7 +185,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/packages/Query.Drivers.html b/docs/packages/Query.Drivers.html index e23025d..0674a5a 100644 --- a/docs/packages/Query.Drivers.html +++ b/docs/packages/Query.Drivers.html @@ -211,7 +211,7 @@ data-fetching methods

+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/packages/Query.Helper Classes.html b/docs/packages/Query.Helper Classes.html index 42d91f8..c0ac045 100644 --- a/docs/packages/Query.Helper Classes.html +++ b/docs/packages/Query.Helper Classes.html @@ -97,7 +97,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/packages/Query.Query.html b/docs/packages/Query.Query.html index 369ac09..2767e65 100644 --- a/docs/packages/Query.Query.html +++ b/docs/packages/Query.Query.html @@ -115,7 +115,7 @@ instantiates the specific db driver

+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/packages/Query.html b/docs/packages/Query.html index e88e694..758d1a3 100644 --- a/docs/packages/Query.html +++ b/docs/packages/Query.html @@ -316,7 +316,7 @@ instantiates the specific db driver

+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/packages/miniMVC.App.html b/docs/packages/miniMVC.App.html index b3634a1..1202b37 100644 --- a/docs/packages/miniMVC.App.html +++ b/docs/packages/miniMVC.App.html @@ -139,7 +139,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/packages/miniMVC.System.html b/docs/packages/miniMVC.System.html index eea59ec..ae7db51 100644 --- a/docs/packages/miniMVC.System.html +++ b/docs/packages/miniMVC.System.html @@ -137,7 +137,7 @@
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/packages/miniMVC.html b/docs/packages/miniMVC.html index 11c48c4..bebad6c 100644 --- a/docs/packages/miniMVC.html +++ b/docs/packages/miniMVC.html @@ -474,7 +474,7 @@ display them cleanly
+ generated on 2012-05-03T07:53:52-04:00.
diff --git a/docs/structure.xml b/docs/structure.xml index 9fc2bc6..9232403 100644 --- a/docs/structure.xml +++ b/docs/structure.xml @@ -1,58 +1,6 @@ - - - - Convention-based micro-framework for PHP

]]>
- - - - - -
- - MM_Model - \MM_Model - \miniMVC - - - - - - - - __construct - function - - - - - void - - - - - load_db - function - - - - - string - - - void - - - - $name - - - - - -
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -147,7 +95,7 @@ and organizes database connections

]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -349,7 +297,7 @@ directly - the settings should be safe!]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -562,7 +510,7 @@ directly - the settings should be safe!]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -1005,7 +953,7 @@ the connection/database]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -1214,1173 +1162,1173 @@ for complex select queries]]> - + select function - + - + string - + \$this - + $fields - + _select function - + - + string - + string - + string - + $field - + $as - + select_max function - + - + string - + string - + \$this - + $field - + $as - + select_min function - + - + string - + string - + \$this - + $field - + $as - + select_avg function - + - + string - + string - + \$this - + $field - + $as - + select_sum function - + - + string - + string - + \$this - + $field - + $as - + distinct function - + - + \$this - + from function - + - + string - + \$this - + $dbname - + _like function - + - + string - + mixed - + string - + string - + string - + \$this - + $field - + $val - + $pos - + $like - + $conj - + like function - + - + string - + mixed - + string - + \$this - + $field - + $val - + $pos - + or_like function - + - + string - + mixed - + string - + \$this - + $field - + $val - + $pos - + not_like function - + - + string - + mixed - + string - + \$this - + $field - + $val - + $pos - + or_not_like function - + - + string - + mixed - + string - + \$this - + $field - + $val - + $pos - + _having function - + - + mixed - + mixed - + string - + \$this - + $key - + $val - + $conj - + having function - + - + mixed - + mixed - + \$this - + $key - + $val - + or_having function - + - + mixed - + mixed - + \$this - + $key - + $val - + _where function - + - + mixed - + mixed - + array - + $key - + $val - + _where_string function - + - + mixed - + mixed - + string - + \$this - + $key - + $val - + $conj - + _where_in function - + - + mixed - + mixed - - - + + + \$this - + $key - + $val - + $in - + $conj - + where function - + - + mixed - + mixed - + \$this - + $key - + $val - + or_where function - + - + string - + mixed - + \$this - + $key - + $val - + where_in function - + - + mixed - + mixed - + \$this - + $field - + $val - + or_where_in function - + - + string - + mixed - + \$this - + $field - + $val - + where_not_in function - + - + string - + mixed - + \$this - + $field - + $val - + or_where_not_in function - + - + string - + mixed - + \$this - + $field - + $val - + set function - + - + mixed - + mixed - + \$this - + $key - + $val - + join function - + - + string - + string - + string - + \$this - + $table - + $condition - + $type - + group_by function - + - + mixed - + \$this - + $field - + order_by function - + - + string - + string - + \$this - + $field - + $type - + limit function - + - + int - + int - + string - + $limit - + $offset - + group_start function - + - + \$this - + or_group_start function - + - + \$this - + or_not_group_start function - + - + \$this - + group_end function - + - + \$this - + get function - + - - + + int - + int - + object - + $table - + $limit - + $offset - + get_where function - + - + string - + array - + int - + int - + object - + $table - + $where - + $limit - + $offset - + count_all function - + - + string - + int - + $table - + count_all_results function - + - + string - + int - + $table - + insert function - + - + string - + mixed - + mixed - + $table - + $data - + update function - + - + string - + mixed - + mixed - + $table - + $data - + delete function - + - + string - + mixed - + mixed - + $table - + $where - + __call function - + - + string - + array - + mixed - + $name - + $params - + _reset function - + - + void - + _compile function - + - + string - + string - + \$string - + $type - + $table @@ -2388,7 +2336,7 @@ in place of the get() method]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -2546,7 +2494,7 @@ in place of the get() method]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -2620,7 +2568,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -2794,7 +2742,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -2927,7 +2875,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -3032,7 +2980,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -3157,7 +3105,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -3313,7 +3261,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -3421,7 +3369,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -3554,7 +3502,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -3659,7 +3607,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -3815,7 +3763,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -3948,7 +3896,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -4107,7 +4055,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -4263,7 +4211,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -4438,7 +4386,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -4814,7 +4762,7 @@ the query]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -5130,7 +5078,7 @@ the last query executed]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -5271,7 +5219,59 @@ the last query executed]]>
- + + + + Convention-based micro-framework for PHP

]]>
+ + + + + +
+ + MM_Model + \MM_Model + \miniMVC + + + + + + + + __construct + function + + + + + void + + + + + load_db + function + + + + + string + + + void + + + + $name + + + + + +
+ Convention-based micro-framework for PHP

]]>
@@ -5282,7 +5282,7 @@ the last query executed]]>
- Query/autoload.php + db/autoload.php miniMVC.php @@ -5653,7 +5653,7 @@ display them cleanly]]>
- + Convention-based micro-framework for PHP

]]>
@@ -5717,212 +5717,212 @@ display them cleanly]]>
- + __invoke function - + - + array - + \self - + $params - + get_instance function - + - + \self - + __clone function - + - + MM \MM \ArrayObject - + - - + + - + __construct function - + - + - + $members - + __call function - + - + string - + array - + mixed - + $name - + $params - + miniMVC \miniMVC \MM - + - - + + - + $output - + - + \MM_Output - + __construct function - + - + array - + $members - + __call function - + - + string - + array - + $name - + $args - + load_class function - + - + string - + string - + void - + $name - + $type - + unload function - + - + string - + $name - + load_config function - + - + string - + $name @@ -6603,7 +6603,7 @@ page.

]]>
- + Convention-based micro-framework for PHP

]]>
@@ -6667,66 +6667,66 @@ Used for outputing HTML]]>
- + set_header function - + - + string - + string - + $key - + $val - + append_output function - + - + string - + $string - + set_output function - + - + string - + $string - + flush_headers function - + diff --git a/phpdoc.dist.xml b/phpdoc.dist.xml index aa34dfd..d837c15 100644 --- a/phpdoc.dist.xml +++ b/phpdoc.dist.xml @@ -16,10 +16,10 @@ assets app/views app/errors - sys/Query/tests + sys/db/tests tests/* assets/* - sys/Query/tests/* + sys/db/tests/* app/views/* app/errors/* diff --git a/sys/common.php b/sys/common.php index 1cf5a14..d39c0a6 100644 --- a/sys/common.php +++ b/sys/common.php @@ -393,7 +393,7 @@ function do_include($path) } // Load Database classes -require_once(MM_SYS_PATH.'Query/autoload.php'); +require_once(MM_SYS_PATH.'db/autoload.php'); // Load system libraries require_once(MM_SYS_PATH.'miniMVC.php'); diff --git a/sys/db/.gitignore b/sys/db/.gitignore new file mode 100644 index 0000000..e4c8234 --- /dev/null +++ b/sys/db/.gitignore @@ -0,0 +1,5 @@ +test_config.json +index.html +tests/db_files/* +._* +tests/settings.json \ No newline at end of file diff --git a/sys/db/.travis.yml b/sys/db/.travis.yml new file mode 100644 index 0000000..f7735a4 --- /dev/null +++ b/sys/db/.travis.yml @@ -0,0 +1,13 @@ +language: php + +php: + - 5.2 + - 5.3 + - 5.4 + +before_script: + - sh -c "psql -c 'DROP DATABASE IF EXISTS test;' -U postgres" + - sh -c "psql -c 'create database test;' -U postgres" + - sh -c "mysql -e 'create database IF NOT EXISTS test;'" + +script: php ./tests/index.php \ No newline at end of file diff --git a/sys/db/README.md b/sys/db/README.md new file mode 100644 index 0000000..67a151a --- /dev/null +++ b/sys/db/README.md @@ -0,0 +1,83 @@ +# Query + +A query builder/abstraction layer, using prepared queries for security. + +[![Build Status](https://secure.travis-ci.org/timw4mail/Query.png)](http://travis-ci.org/timw4mail/Query) + +## Requirements +* Pdo extensions for the databases you wish to use (unless it's Firebird, in which case, the interbase extension is required) +* PHP 5.2+ + +## Databases Supported + +* Firebird +* MySQL +* PostgreSQL +* SQLite +* Others, via ODBC + +## Including Query in your application + +To include Query in your PHP project, just include the `autoload.php` file. This will automatically load the classes that are supported by the current PHP installation. + + +## Connecting + +Create a connection array or object similar to this: + + 'mysql', + 'host' => 'localhost', + 'user' => 'root', + 'pass' => '', + 'port' => '3306', + 'database' => 'test_db', + + // Only required + // SQLite or Firebird + 'file' => '/path/to/db/file', + ); + + $db = new Query_Builder($params); + +The parameters required depend on the database. + +### Running Queries +Query uses the same interface as CodeIgniter's [Active Record class](http://codeigniter.com/user_guide/database/active_record.html). However, it does not implement the `insert_batch` or `update_batch` methods. + +####You can also run queries manually. + +To run a prepared statement, call +`$db->prepare_execute($sql, $params)`. + +To run a plain query, `$db->query($sql)` + +### Retrieving Results: + +An example of a moderately complex query: + + $query = $db->select('id, key as k, val') + ->from('table t') + ->where('k >', 3) + ->or_where('id !=' 5) + ->order_by('val', 'DESC') + ->limit(3, 1) + ->get(); + +This will generate a query similar to (with this being the output for a Postgres database): + + SELECT "id", "key" AS "k", "val" + FROM "table" "t" + WHERE "k" > ? + OR "id" != ? + ORDER BY "val" DESC + LIMIT 3 OFFSET 1 + + +To retreive the results of a query, use the PDO method [fetch](http://php.net/manual/en/pdostatement.fetch.php) and/or [fetchAll](http://php.net/manual/en/pdostatement.fetchall.php). + + $query = $db->get('table_name'); + + $results = $query->fetchAll(PDO::FETCH_ASSOC); \ No newline at end of file diff --git a/sys/db/autoload.php b/sys/db/autoload.php new file mode 100644 index 0000000..e95de2c --- /dev/null +++ b/sys/db/autoload.php @@ -0,0 +1,86 @@ +sql = new $class(); + + // Load the util class for the driver + $class = get_class($this)."_util"; + $this->util = new $class($this); + + $this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + } + + // -------------------------------------------------------------------------- + // ! Concrete functions that can be overridden in child classes + // -------------------------------------------------------------------------- + + /** + * Simplifies prepared statements for database queries + * + * @param string $sql + * @param array $data + * @return mixed PDOStatement / FALSE + */ + public function prepare_query($sql, $data) + { + // Prepare the sql + $query = $this->prepare($sql); + + if( ! (is_object($query) || is_resource($query))) + { + $this->get_last_error(); + return FALSE; + } + + // Set the statement in the class variable for easy later access + $this->statement =& $query; + + + if( ! (is_array($data) || is_object($data))) + { + trigger_error("Invalid data argument"); + return FALSE; + } + + // Bind the parameters + foreach($data as $k => $value) + { + if(is_numeric($k)) + { + $k++; + } + + $res = $query->bindValue($k, $value); + + if( ! $res) + { + trigger_error("Parameter not successfully bound"); + return FALSE; + } + } + + return $query; + + } + + // ------------------------------------------------------------------------- + + /** + * Create and execute a prepared statement with the provided parameters + * + * @param string $sql + * @param array $params + * @return PDOStatement + */ + public function prepare_execute($sql, $params) + { + $this->statement = $this->prepare_query($sql, $params); + $this->statement->execute(); + + return $this->statement; + } + + // ------------------------------------------------------------------------- + + /** + * Retreives the data from a select query + * + * @param PDOStatement $statement + * @return array + */ + public function get_query_data($statement) + { + $this->statement =& $statement; + + // Execute the query + $this->statement->execute(); + + // Return the data array fetched + return $this->statement->fetchAll(PDO::FETCH_ASSOC); + } + + // ------------------------------------------------------------------------- + + /** + * Returns number of rows affected by an INSERT, UPDATE, DELETE type query + * + * @param PDOStatement $statement + * @return int + */ + public function affected_rows($statement='') + { + if ( ! empty($statement)) + { + $this->statement = $statement; + } + + // Return number of rows affected + return $this->statement->rowCount(); + } + + // -------------------------------------------------------------------------- + + /** + * Return the last error for the current database connection + * + * @return string + */ + public function get_last_error() + { + list($i1, $i2, $i3) = $this->errorInfo(); + + echo "Error:
{$i1}:{$i2}\n{$i3}
"; + } + + // -------------------------------------------------------------------------- + + /** + * Surrounds the string with the databases identifier escape characters + * + * @param mixed $ident + * @return string + */ + public function quote_ident($ident) + { + if (is_array($ident)) + { + return array_map(array($this, 'quote_ident'), $ident); + } + + // If the string is already quoted, return the string + if (($pos = strpos($ident, $this->escape_char)) !== FALSE && $pos === 0) + { + return $ident; + } + + // Split each identifier by the period + $hiers = explode('.', $ident); + + // Return the re-compiled string + return implode('.', array_map(array($this, '_quote'), $hiers)); + } + + // -------------------------------------------------------------------------- + + /** + * Helper method for quote_ident + * + * @param mixed $str + * @return mixed + */ + protected function _quote($str) + { + if ( ! is_string($str) && is_numeric($str)) + { + return $str; + } + + return "{$this->escape_char}{$str}{$this->escape_char}"; + } + + // ------------------------------------------------------------------------- + + /** + * Deletes all the rows from a table. Does the same as the truncate + * method if the database does not support 'TRUNCATE'; + * + * @param string $table + * @return mixed + */ + public function empty_table($table) + { + $sql = 'DELETE FROM '.$this->quote_ident($table); + + return $this->query($sql); + } + + // ------------------------------------------------------------------------- + + /** + * Return schemas for databases that list them + * + * @return array + */ + public function get_schemas() + { + return FALSE; + } + + // ------------------------------------------------------------------------- + + /** + * Return list of tables for the current database + * + * @return array + */ + public function get_tables() + { + return $this->driver_query($this->sql->table_list()); + } + + // ------------------------------------------------------------------------- + + /** + * Return list of dbs for the current connection, if possible + * + * @return array + */ + public function get_dbs() + { + return $this->driver_query($this->sql->db_list()); + } + + // ------------------------------------------------------------------------- + + /** + * Return list of views for the current database + * + * @return array + */ + public function get_views() + { + return $this->driver_query($this->sql->view_list()); + } + + // ------------------------------------------------------------------------- + + /** + * Return list of sequences for the current database, if they exist + * + * @return array + */ + public function get_sequences() + { + return $this->driver_query($this->sql->sequence_list()); + } + + // ------------------------------------------------------------------------- + + /** + * Return list of function for the current database + * + * @return array + */ + public function get_functions() + { + return $this->driver_query($this->sql->function_list(), FALSE); + } + + // ------------------------------------------------------------------------- + + /** + * Return list of stored procedures for the current database + * + * @return array + */ + public function get_procedures() + { + return $this->driver_query($this->sql->procedure_list(), FALSE); + } + + // ------------------------------------------------------------------------- + + /** + * Return list of triggers for the current database + * + * @return array + */ + public function get_triggers() + { + return $this->driver_query($this->sql->trigger_list(), FALSE); + } + + // ------------------------------------------------------------------------- + + /** + * Retreives an array of non-user-created tables for + * the connection/database + * + * @return array + */ + public function get_system_tables() + { + return $this->driver_query($this->sql->system_table_list()); + } + + // ------------------------------------------------------------------------- + + /** + * Method to simplify retreiving db results for meta-data queries + * + * @param string $sql + * @param bool $filtered_index + * @return mixed + */ + protected function driver_query($sql, $filtered_index=TRUE) + { + if ($sql === FALSE) + { + return FALSE; + } + + $res = $this->query($sql); + + $flag = ($filtered_index) ? PDO::FETCH_NUM : PDO::FETCH_ASSOC; + $all = $res->fetchAll($flag); + + return ($filtered_index) ? db_filter($all, 0) : $all; + } + + // -------------------------------------------------------------------------- + + /** + * Return the number of rows returned for a SELECT query + * + * @return int + */ + public function num_rows() + { + return isset($this->statement) && is_object($this->statement) + ? $this->statement->rowCount() + : FALSE; + } + + // ------------------------------------------------------------------------- + // ! Abstract public functions to implement in child classes + // ------------------------------------------------------------------------- + + /** + * Empty the passed table + * + * @param string $table + * + * @return void + */ + abstract public function truncate($table); + + /** + * Connect to a different database + * + * @param string $name + * @return void + */ + abstract public function switch_db($name); +} +// End of db_pdo.php \ No newline at end of file diff --git a/sys/db/classes/db_reg.php b/sys/db/classes/db_reg.php new file mode 100644 index 0000000..2b82459 --- /dev/null +++ b/sys/db/classes/db_reg.php @@ -0,0 +1,89 @@ +get_db($key); + + // Set the current key in the registry + self::$instance[$key] = new Query_Builder($db_params); + } + + // -------------------------------------------------------------------------- + + /** + * Return exiting connections + * + * @return array + */ + public static function get_connections() + { + return array_keys(self::$instance); + } + + // -------------------------------------------------------------------------- + + /** + * Remove a database connection + * + * @param string $key + * @return void + */ + public static function remove_db($key) + { + unset(self::$instance[$key]); + } +} +// End of dbreg.php \ No newline at end of file diff --git a/sys/db/classes/db_sql.php b/sys/db/classes/db_sql.php new file mode 100644 index 0000000..30f3d18 --- /dev/null +++ b/sys/db/classes/db_sql.php @@ -0,0 +1,165 @@ +conn =& $conn; + } + + // -------------------------------------------------------------------------- + + /** + * Enable calling driver methods + * + * @param string $method + * @param array $args + */ + public function __call($method, $args) + { + if (method_exists($this->conn, $method)) + { + return call_user_func_array(array($this->conn, $method), $args); + } + + return NULL; + } + + // -------------------------------------------------------------------------- + // ! Abstract Methods + // -------------------------------------------------------------------------- + + /** + * Get database-specific sql to create a new table + * + * @abstract + * @param string $name + * @param array $columns + * @param array $constraints + * @param array $indexes + * @return string + */ + abstract public function create_table($name, $columns, array $constraints=array(), array $indexes=array()); + + /** + * Get database-specific sql to drop a table + * + * @abstract + * @param string $name + * @return string + */ + abstract public function delete_table($name); + + /** + * Return an SQL file with the database table structure + * + * @abstract + * @return string + */ + abstract public function backup_structure(); + + /** + * Return an SQL file with the database data as insert statements + * + * @abstract + * @return string + */ + abstract public function backup_data(); + +} \ No newline at end of file diff --git a/sys/db/classes/query_builder.php b/sys/db/classes/query_builder.php new file mode 100644 index 0000000..257874f --- /dev/null +++ b/sys/db/classes/query_builder.php @@ -0,0 +1,1343 @@ +db->sql + * + * @var DB_PDO + */ + private $sql; + + /** + * Query component order mapping + * for complex select queries + * + * Format: + * + * array( + * 'type' => 'where', + * 'conjunction' => ' AND ', + * 'string' => 'k=?' + * ) + * + * @var array + */ + private $query_map; + + /** + * Map for having clause + * + * @var array + */ + private $having_map; + + /** + * Convenience property for connection management + * + * @var string + */ + public $conn_name = ""; + + /** + * Constructor + * + * @param object $params - the connection parametere + */ + public function __construct($params) + { + // Convert array to object + if (is_array($params)) + { + $p = new ArrayObject($params, ArrayObject::ARRAY_AS_PROPS); + $params = $p; + } + + // Let the connection work with 'conn_db' or 'database' + if (isset($params->database)) + { + $params->conn_db = $params->database; + } + + + $params->type = strtolower($params->type); + $dbtype = ($params->type !== 'postgresql') ? $params->type : 'pgsql'; + + // Create the dsn for the database to connect to + switch($dbtype) + { + default: + $dsn = "dbname={$params->conn_db}"; + + if ( ! empty($params->host)) + { + $dsn .= ";host={$params->host}"; + } + + if ( ! empty($params->port)) + { + $dsn .= ";port={$params->port}"; + } + + break; + + case "sqlite": + $dsn = $params->file; + break; + + case "firebird": + $dsn = "{$params->host}:{$params->file}"; + break; + } + + // Create the database connection + if ( ! empty($params->user)) + { + $this->db = new $dbtype($dsn, $params->user, $params->pass); + } + else + { + $this->db = new $dbtype($dsn); + } + + // Set the connection name property, if applicable + if (isset($params->name)) + { + $this->conn_name = $params->name; + } + + + // Make things just slightly shorter + $this->sql =& $this->db->sql; + } + + // -------------------------------------------------------------------------- + // ! Select Queries + // -------------------------------------------------------------------------- + + /** + * Specifies rows to select in a query + * + * @param string $fields + * @return $this + */ + public function select($fields) + { + // Split fields by comma + $fields_array = explode(",", $fields); + $fields_array = array_map('trim', $fields_array); + + // Split on 'As' + foreach ($fields_array as $key => $field) + { + if (stripos($field, 'as') !== FALSE) + { + $fields_array[$key] = preg_split('`as`i', $field); + $fields_array[$key] = array_map('trim', $fields_array[$key]); + } + } + + // Quote the identifiers + $safe_array = array_map(array($this->db, 'quote_ident'), $fields_array); + + unset($fields_array); + + // Join the strings back together + for($i = 0, $c = count($safe_array); $i < $c; $i++) + { + if (is_array($safe_array[$i])) + { + $safe_array[$i] = implode(' AS ', $safe_array[$i]); + } + } + + $this->select_string .= implode(', ', $safe_array); + + unset($safe_array); + + return $this; + } + + // -------------------------------------------------------------------------- + + /** + * Method to simplify select_ methods + * + * @param string $field + * @param string $as + * @return string + */ + private function _select($field, $as = FALSE) + { + // Escape the identifiers + $field = $this->quote_ident($field); + + $as = ($as !== FALSE) + ? $this->quote_ident($as) + : $field; + + return "({$field}) AS {$as} "; + } + + // -------------------------------------------------------------------------- + + /** + * Selects the maximum value of a field from a query + * + * @param string $field + * @param string $as + * @return $this + */ + public function select_max($field, $as=FALSE) + { + // Create the select string + $this->select_string .= $this->sql->max().$this->_select($field, $as); + return $this; + } + + // -------------------------------------------------------------------------- + + /** + * Selects the minimum value of a field from a query + * + * @param string $field + * @param string $as + * @return $this + */ + public function select_min($field, $as=FALSE) + { + // Create the select string + $this->select_string .= $this->sql->min().$this->_select($field, $as); + return $this; + } + + // -------------------------------------------------------------------------- + + /** + * Selects the average value of a field from a query + * + * @param string $field + * @param string $as + * @return $this + */ + public function select_avg($field, $as=FALSE) + { + // Create the select string + $this->select_string .= $this->sql->avg().$this->_select($field, $as); + return $this; + } + + // -------------------------------------------------------------------------- + + /** + * Selects the sum of a field from a query + * + * @param string $field + * @param string $as + * @return $this + */ + public function select_sum($field, $as=FALSE) + { + // Create the select string + $this->select_string .= $this->sql->sum().$this->_select($field, $as); + return $this; + } + + // -------------------------------------------------------------------------- + + /** + * Adds the 'distinct' keyword to a query + * + * @return $this + */ + public function distinct() + { + // Prepend the keyword to the select string + $this->select_string = $this->sql->distinct() . $this->select_string; + return $this; + } + + // -------------------------------------------------------------------------- + + /** + * Specify the database table to select from + * + * @param string $dbname + * @return $this + */ + public function from($dbname) + { + // Split identifiers on spaces + $ident_array = explode(' ', trim($dbname)); + $ident_array = array_map('trim', $ident_array); + + // Quote the identifiers + $ident_array = array_map(array($this->db, 'quote_ident'), $ident_array); + + // Paste it back together + $this->from_string = implode(' ', $ident_array); + + return $this; + } + + // -------------------------------------------------------------------------- + // ! 'Like' methods + // -------------------------------------------------------------------------- + + /** + * Simplify 'like' methods + * + * @param string $field + * @param mixed $val + * @param string $pos + * @param string $like + * @param string $conj + * @return $this + */ + private function _like($field, $val, $pos, $like='LIKE', $conj='AND') + { + $field = $this->quote_ident($field); + + // Add the like string into the order map + $l = $field. " {$like} ?"; + + if ($pos == 'before') + { + $val = "%{$val}"; + } + elseif ($pos == 'after') + { + $val = "{$val}%"; + } + else + { + $val = "%{$val}%"; + } + + $this->query_map[] = array( + 'type' => 'like', + 'conjunction' => (empty($this->query_map)) ? ' WHERE ' : " {$conj} ", + 'string' => $l + ); + + // Add to the values array + $this->values[] = $val; + + return $this; + } + + // -------------------------------------------------------------------------- + + /** + * Creates a Like clause in the sql statement + * + * @param string $field + * @param mixed $val + * @param string $pos + * @return $this + */ + public function like($field, $val, $pos='both') + { + return $this->_like($field, $val, $pos, 'LIKE', 'AND'); + } + + // -------------------------------------------------------------------------- + + /** + * Generates an OR Like clause + * + * @param string $field + * @param mixed $val + * @param string $pos + * @return $this + */ + public function or_like($field, $val, $pos='both') + { + return $this->_like($field, $val, $pos, 'LIKE', 'OR'); + } + + // -------------------------------------------------------------------------- + + /** + * Generates a NOT LIKE clause + * + * @param string $field + * @param mixed $val + * @param string $pos + * @return $this + */ + public function not_like($field, $val, $pos='both') + { + return $this->_like($field, $val, $pos, 'NOT LIKE', 'AND'); + } + + // -------------------------------------------------------------------------- + + /** + * Generates a OR NOT LIKE clause + * + * @param string $field + * @param mixed $val + * @param string $pos + * @return $this + */ + public function or_not_like($field, $val, $pos='both') + { + return $this->_like($field, $val, $pos, 'NOT LIKE', 'OR'); + } + + // -------------------------------------------------------------------------- + // ! Having methods + // -------------------------------------------------------------------------- + + /** + * Simplify building having clauses + * + * @param mixed $key + * @param mixed $val + * @param string $conj + * @return $this + */ + private function _having($key, $val=array(), $conj='AND') + { + $where = $this->_where($key, $val); + + // Create key/value placeholders + foreach($where as $f => $val) + { + // Split each key by spaces, in case there + // is an operator such as >, <, !=, etc. + $f_array = explode(' ', trim($f)); + + $item = $this->quote_ident($f_array[0]); + + // Simple key value, or an operator + $item .= (count($f_array) === 1) ? '= ?' : " {$f_array[1]} ?"; + + // Put in the query map for select statements + $this->having_map[] = array( + 'conjunction' => ( ! empty($this->having_map)) ? " {$conj} " : ' HAVING ', + 'string' => $item + ); + } + + return $this; + } + + // -------------------------------------------------------------------------- + + /** + * Generates a 'Having' clause + * + * @param mixed $key + * @param mixed $val + * @return $this + */ + public function having($key, $val=array()) + { + return $this->_having($key, $val, 'AND'); + } + + // -------------------------------------------------------------------------- + + /** + * Generates a 'Having' clause prefixed with 'OR' + * + * @param mixed $key + * @param mixed $val + * @return $this + */ + public function or_having($key, $val=array()) + { + return $this->_having($key, $val, 'OR'); + } + + // -------------------------------------------------------------------------- + // ! 'Where' methods + // -------------------------------------------------------------------------- + + /** + * Do all the repeditive stuff for where/having type methods + * + * @param mixed $key + * @param mixed $val + * @return array + */ + private function _where($key, $val=array()) + { + $where = array(); + + // Key and value passed? Add them to the where array + if (is_scalar($key) && is_scalar($val)) + { + $where[$key] = $val; + $this->values[] = $val; + } + // Array or object, loop through and add to the where array + elseif ( ! is_scalar($key)) + { + foreach($key as $k => $v) + { + $where[$k] = $v; + $this->values[] = $v; + } + } + + return $where; + } + + // -------------------------------------------------------------------------- + + /** + * Simplify generating where string + * + * @param mixed $key + * @param mixed $val + * @param string $conj + * @return $this + */ + private function _where_string($key, $val=array(), $conj='AND') + { + $where = $this->_where($key, $val); + + // Create key/value placeholders + foreach($where as $f => $val) + { + // Split each key by spaces, in case there + // is an operator such as >, <, !=, etc. + $f_array = explode(' ', trim($f)); + + $item = $this->quote_ident($f_array[0]); + + // Simple key value, or an operator + $item .= (count($f_array) === 1) ? '= ?' : " {$f_array[1]} ?"; + + // Put in the query map for select statements + $this->query_map[] = array( + 'type' => 'where', + 'conjunction' => ( ! empty($this->query_map)) ? " {$conj} " : ' WHERE ', + 'string' => $item + ); + } + + return $this; + } + + // -------------------------------------------------------------------------- + + /** + * Simplify where_in methods + * + * @param mixed $key + * @param mixed $val + * @param string + * @param string + * @return $this + */ + private function _where_in($key, $val=array(), $in='IN', $conj='AND') + { + $key = $this->quote_ident($key); + $params = array_fill(0, count($val), '?'); + + foreach($val as $v) + { + $this->values[] = $v; + } + + $string = $key . " {$in} ".implode(',', $params).') '; + + $this->query_map[] = array( + 'type' => 'where_in', + 'conjunction' => ( ! empty($this->query_map)) ? " {$conj} " : ' WHERE ', + 'string' => $string + ); + + return $this; + } + + // -------------------------------------------------------------------------- + + /** + * Specify condition(s) in the where clause of a query + * Note: this function works with key / value, or a + * passed array with key / value pairs + * + * @param mixed $key + * @param mixed $val + * @return $this + */ + public function where($key, $val=array()) + { + return $this->_where_string($key, $val, 'AND'); + } + + // -------------------------------------------------------------------------- + + /** + * Where clause prefixed with "OR" + * + * @param string $key + * @param mixed $val + * @return $this + */ + public function or_where($key, $val=array()) + { + return $this->_where_string($key, $val, 'OR'); + } + + // -------------------------------------------------------------------------- + + /** + * Where clause with 'IN' statement + * + * @param mixed $field + * @param mixed $val + * @return $this + */ + public function where_in($field, $val=array()) + { + return $this->_where_in($field, $val); + } + + // -------------------------------------------------------------------------- + + /** + * Where in statement prefixed with "or" + * + * @param string $field + * @param mixed $val + * @return $this + */ + public function or_where_in($field, $val=array()) + { + return $this->_where_in($field, $val, 'IN', 'OR'); + } + + // -------------------------------------------------------------------------- + + /** + * WHERE NOT IN (FOO) clause + * + * @param string $field + * @param mixed $val + * @return $this + */ + public function where_not_in($field, $val=array()) + { + return $this->_where_in($field, $val, 'NOT IN', 'AND'); + } + + // -------------------------------------------------------------------------- + + /** + * OR WHERE NOT IN (FOO) clause + * + * @param string $field + * @param mixed $val + * @return $this + */ + public function or_where_not_in($field, $val=array()) + { + return $this->_where_in($field, $val, 'NOT IN', 'OR'); + } + + // -------------------------------------------------------------------------- + // ! Other Query Modifier methods + // -------------------------------------------------------------------------- + + /** + * Sets values for inserts / updates / deletes + * + * @param mixed $key + * @param mixed $val + * @return $this + */ + public function set($key, $val = NULL) + { + // Plain key, value pair + if (is_scalar($key) && is_scalar($val)) + { + $this->set_array_keys[] = $key; + $this->values[] = $val; + } + // Object or array + elseif ( ! is_scalar($key)) + { + foreach($key as $k => $v) + { + $this->set_array_keys[] = $k; + $this->values[] = $v; + } + } + + // Use the keys of the array to make the insert/update string + // Escape the field names + $this->set_array_keys = array_map(array($this->db, 'quote_ident'), $this->set_array_keys); + + // Generate the "set" string + $this->set_string = implode('=?, ', $this->set_array_keys); + $this->set_string .= '=?'; + + return $this; + } + + // -------------------------------------------------------------------------- + + /** + * Creates a join phrase in a compiled query + * + * @param string $table + * @param string $condition + * @param string $type + * @return $this + */ + public function join($table, $condition, $type='') + { + // @todo make able to handle operators without spaces + + $table = implode(" ", array_map(array($this->db, 'quote_ident'), explode(' ', trim($table)))); + //$condition = preg_replace('`(\W)`', " $1 ", $condition); + $cond_array = explode(' ', trim($condition)); + $cond_array = array_map('trim', $cond_array); + + $condition = $table . ' ON ' . $this->quote_ident($cond_array[0]) . $cond_array[1] . + ' ' . $this->quote_ident($cond_array[2]); + + $this->query_map[] = array( + 'type' => 'join', + 'conjunction' => strtoupper($type).' JOIN ', + 'string' => $condition, + ); + + return $this; + } + + // -------------------------------------------------------------------------- + + /** + * Group the results by the selected field(s) + * + * @param mixed $field + * @return $this + */ + public function group_by($field) + { + if ( ! is_scalar($field)) + { + $this->group_array = array_map(array($this->db, 'quote_ident'), $field); + } + else + { + $this->group_array[] = $this->quote_ident($field); + } + + $this->group_string = ' GROUP BY ' . implode(', ', $this->group_array); + + return $this; + } + + // -------------------------------------------------------------------------- + + /** + * Order the results by the selected field(s) + * + * @param string $field + * @param string $type + * @return $this + */ + public function order_by($field, $type="") + { + // Random case + if (stripos($type, 'rand') !== FALSE) + { + $type = (($rand = $this->sql->random()) !== FALSE ) ? $rand : 'ASC'; + } + + // Set fields for later manipulation + $field = $this->quote_ident($field); + $this->order_array[$field] = $type; + + $order_clauses = array(); + + // Flatten key/val pairs into an array of space-separated pairs + foreach($this->order_array as $k => $v) + { + $order_clauses[] = $k . ' ' . strtoupper($v); + } + + // Set the final string + $this->order_string = (empty($rand)) + ? ' ORDER BY '.implode(',', $order_clauses) + : ' ORDER BY'.$rand; + + return $this; + } + + // -------------------------------------------------------------------------- + + /** + * Set a limit on the current sql statement + * + * @param int $limit + * @param int $offset + * @return string + */ + public function limit($limit, $offset=FALSE) + { + $this->limit = $limit; + $this->offset = $offset; + + return $this; + } + + // -------------------------------------------------------------------------- + // ! Query Grouping Methods + // -------------------------------------------------------------------------- + + /** + * Adds a paren to the current query for query grouping + * + * @return $this + */ + public function group_start() + { + $this->query_map[] = array( + 'type' => 'group_start', + 'conjunction' => '', + 'string' => ' (' + ); + + return $this; + } + + // -------------------------------------------------------------------------- + + /** + * Adds a paren to the current query for query grouping, + * prefixed with 'OR' + * + * @return $this + */ + public function or_group_start() + { + $this->query_map[] = array( + 'type' => 'group_start', + 'conjunction' => '', + 'string' => ' OR (' + ); + + return $this; + } + + // -------------------------------------------------------------------------- + + /** + * Adds a paren to the current query for query grouping, + * prefixed with 'OR NOT' + * + * @return $this + */ + public function or_not_group_start() + { + $this->query_map[] = array( + 'type' => 'group_start', + 'conjunction' => '', + 'string' => ' OR NOT (' + ); + + return $this; + } + + // -------------------------------------------------------------------------- + + /** + * Ends a query group + * + * @return $this + */ + public function group_end() + { + $this->query_map[] = array( + 'type' => 'group_end', + 'conjunction' => '', + 'string' => ' ) ' + ); + + return $this; + } + + // -------------------------------------------------------------------------- + // ! Query execution methods + // -------------------------------------------------------------------------- + + /** + * Select and retrieve all records from the current table, and/or + * execute current compiled query + * + * @param $table + * @param int $limit + * @param int $offset + * @return object + */ + public function get($table='', $limit=FALSE, $offset=FALSE) + { + // Set the table + if ( ! empty($table)) + { + $this->from($table); + } + + // Set the limit, if it exists + if ($limit !== FALSE) + { + $this->limit($limit, $offset); + } + + $sql = $this->_compile(); + + // Do prepared statements for anything involving a "where" clause + if ( ! empty($this->query_map) || ! empty($this->having_map)) + { + $result = $this->prepare_execute($sql, $this->values); + } + else + { + // Otherwise, a simple query will do. + $result = $this->query($sql); + } + + // Reset for next query + $this->_reset(); + + return $result; + } + + // -------------------------------------------------------------------------- + + /** + * Convience method for get() with a where clause + * + * @param string $table + * @param array $where + * @param int $limit + * @param int $offset + * @return object + */ + public function get_where($table, $where=array(), $limit=FALSE, $offset=FALSE) + { + // Create the where clause + $this->where($where); + + // Return the result + return $this->get($table, $limit, $offset); + } + + // -------------------------------------------------------------------------- + + /** + * Retreive the number of rows in the selected table + * + * @param string $table + * @return int + */ + public function count_all($table) + { + $sql = 'SELECT * FROM '.$this->quote_ident($table); + $res = $this->query($sql); + return (int) count($res->fetchAll()); + } + + // -------------------------------------------------------------------------- + + /** + * Retrieve the number of results for the generated query - used + * in place of the get() method + * + * @param string $table + * @return int + */ + public function count_all_results($table='') + { + // Set the table + if ( ! empty($table)) + { + $this->from($table); + } + + $sql = $this->_compile(); + + // Do prepared statements for anything involving a "where" clause + if ( ! empty($this->query_map)) + { + $result = $this->prepare_execute($sql, $this->values); + } + else + { + // Otherwise, a simple query will do. + $result = $this->query($sql); + } + + // Reset for next query + $this->_reset(); + + $rows = $result->fetchAll(); + + return (int) count($rows); + } + + // -------------------------------------------------------------------------- + + /** + * Creates an insert clause, and executes it + * + * @param string $table + * @param mixed $data + * @return mixed + */ + public function insert($table, $data=array()) + { + // No use duplicating logic! + if ( ! empty($data)) + { + $this->set($data); + } + + $sql = $this->_compile("insert", $table); + + $res = $this->prepare_execute($sql, $this->values); + + $this->_reset(); + + return $res; + } + + // -------------------------------------------------------------------------- + + /** + * Creates an update clause, and executes it + * + * @param string $table + * @param mixed $data + * @return mixed + */ + public function update($table, $data=array()) + { + // No use duplicating logic! + if ( ! empty($data)) + { + $this->set($data); + } + + $sql = $this->_compile('update', $table); + + $res = $this->prepare_execute($sql, $this->values); + + $this->_reset(); + + // Run the query + return $res; + } + + // -------------------------------------------------------------------------- + + /** + * Deletes data from a table + * + * @param string $table + * @param mixed $where + * @return mixed + */ + public function delete($table, $where='') + { + // Set the where clause + if ( ! empty($where)) + { + $this->where($where); + } + + // Create the SQL and parameters + $sql = $this->_compile("delete", $table); + + $res = $this->prepare_execute($sql, $this->values); + + $this->_reset(); + + // Delete the table rows, and return the result + return $res; + } + + + // -------------------------------------------------------------------------- + // ! Miscellaneous Methods + // -------------------------------------------------------------------------- + + /** + * Calls a function further down the inheritence chain + * + * @param string $name + * @param array $params + * @return mixed + */ + public function __call($name, $params) + { + if (method_exists($this->db, $name)) + { + return call_user_func_array(array($this->db, $name), $params); + } + + return NULL; + } + + // -------------------------------------------------------------------------- + + /** + * Clear out the class variables, so the next query can be run + * + * @return void + */ + private function _reset() + { + // Only unset class variables that + // are not callable. Otherwise, we'll + // delete class methods! + foreach($this as $name => $var) + { + // Skip properties that are needed for every query + if (in_array($name, array( + 'db', + 'sql' + ))) + { + continue; + } + + // Nothing query-generation related is safe! + if ( ! is_callable($this->$name)) + { + $this->$name = NULL; + } + + // Set empty arrays + $this->values = array(); + + // Set select string as an empty string, for proper handling + // of the 'distinct' keyword + $this->select_string = ''; + } + } + + // -------------------------------------------------------------------------- + + /** + * String together the sql statements for sending to the db + * + * @param string $type + * @param string $table + * @return $string + */ + private function _compile($type='', $table='') + { + $sql = ''; + + $table = $this->quote_ident($table); + + switch($type) + { + default: + $sql = "SELECT * FROM {$this->from_string}"; + + // Set the select string + if ( ! empty($this->select_string)) + { + // Replace the star with the selected fields + $sql = str_replace('*', $this->select_string, $sql); + } + + // Set the where string + if ( ! empty($this->query_map)) + { + foreach($this->query_map as $q) + { + $sql .= $q['conjunction'] . $q['string']; + } + } + + // Set the group_by string + if ( ! empty($this->group_string)) + { + $sql .= $this->group_string; + } + + // Set the having string + if ( ! empty($this->having_map)) + { + foreach($this->having_map as $h) + { + $sql .= $h['conjunction'] . $h['string']; + } + } + + // Set the order_by string + if ( ! empty($this->order_string)) + { + $sql .= $this->order_string; + } + + // Set the limit via the class variables + if (isset($this->limit) && is_numeric($this->limit)) + { + $sql = $this->sql->limit($sql, $this->limit, $this->offset); + } + break; + + case "insert": + $param_count = count($this->set_array_keys); + $params = array_fill(0, $param_count, '?'); + $sql = "INSERT INTO {$table} (" + . implode(', ', $this->set_array_keys) . + ') VALUES ('.implode(', ', $params).')'; + break; + + case "update": + $sql = "UPDATE {$table} SET {$this->set_string}"; + + // Set the where string + if ( ! empty($this->query_map)) + { + foreach($this->query_map as $q) + { + $sql .= $q['conjunction'] . $q['string']; + } + } + break; + + case "delete": + $sql = "DELETE FROM {$table}"; + + // Set the where string + if ( ! empty($this->query_map)) + { + foreach($this->query_map as $q) + { + $sql .= $q['conjunction'] . $q['string']; + } + } + + break; + } + + //echo $sql . '
'; + + return $sql; + } +} +// End of query_builder.php \ No newline at end of file diff --git a/sys/db/classes/settings.php b/sys/db/classes/settings.php new file mode 100644 index 0000000..e087205 --- /dev/null +++ b/sys/db/classes/settings.php @@ -0,0 +1,258 @@ +current = new stdClass(); + } + else + { + $this->current = json_decode(file_get_contents($path)); + } + + // Add the DB object under the settings if it doesn't already exist + if( ! isset($this->current->dbs)) + { + $this->current->dbs = new stdClass(); + } + + } + + // -------------------------------------------------------------------------- + + /** + * Output the settings on destruct + */ + public function __destruct() + { + $file_string = (defined('JSON_PRETTY_PRINT')) + ? json_encode($this->current, JSON_PRETTY_PRINT) + : json_encode($this->current); + + file_put_contents(SETTINGS_DIR . '/settings.json', $file_string); + } + + // -------------------------------------------------------------------------- + + /** + * Magic method to simplify isset checking for config options + * + * @param string $key + * @return mixed + */ + public function __get($key) + { + return (isset($this->current->{$key}) && $key != "dbs") + ? $this->current->{$key} + : NULL; + } + + // -------------------------------------------------------------------------- + + /** + * Magic method to simplify setting config options + * + * @param string $key + * @param mixed + */ + public function __set($key, $val) + { + //Don't allow direct db config changes + if($key == "dbs") + { + return FALSE; + } + + return $this->current->{$key} = $val; + } + + // -------------------------------------------------------------------------- + + /** + * Add a database connection + * + * @param string $name + * @param array $params + */ + public function add_db($name, $params) + { + // Return on bad data + if (empty($name) || empty($params)) + { + return FALSE; + } + + if( ! isset($this->current->dbs->{$name})) + { + $params['name'] = $name; + + $this->current->dbs->{$name} = array(); + $this->current->dbs->{$name} = $params; + } + else + { + return FALSE; + } + + // Save the json + $this->__destruct(); + } + + // -------------------------------------------------------------------------- + + /** + * Edit a database connection + * + * @param string $name + * @param array $params + */ + public function edit_db($name, $params) + { + // Return on bad data + if (empty($name) || empty($params)) + { + return FALSE; + } + + if (isset($this->current->dbs->{$name}) && ($name === $params['name'])) + { + $this->current->dbs->{$name} = $params; + } + elseif ($name !== $params['name']) + { + unset($this->current->dbs->{$name}); + + if ( ! isset($this->current->dbs->{$params['name']})) + { + $this->current->dbs->{$params['name']} = $params; + } + else + { + return FALSE; + } + } + else + { + return FALSE; + } + + // Save the json + $this->__destruct(); + + return TRUE; + } + + // -------------------------------------------------------------------------- + + /** + * Remove a database connection + * + * @param string $name + */ + public function remove_db($name) + { + if( ! isset($this->current->dbs->{$name})) + { + return FALSE; + } + + // Remove the db name from the object + unset($this->current->dbs->{$name}); + + // Save the json + $this->__destruct(); + } + + // -------------------------------------------------------------------------- + + /** + * Retreive all db connections + * + * @return array + */ + public function get_dbs() + { + return $this->current->dbs; + } + + // -------------------------------------------------------------------------- + + /** + * Retreive a specific database connection + * + * @param string $name + * @return object + */ + public function get_db($name) + { + return (isset($this->current->dbs->{$name})) + ? $this->current->dbs->{$name} + : FALSE; + } + +} +// End of settings.php \ No newline at end of file diff --git a/sys/db/docs/classes.svg b/sys/db/docs/classes.svg new file mode 100644 index 0000000..bd8364c --- /dev/null +++ b/sys/db/docs/classes.svg @@ -0,0 +1,275 @@ + + + + + + +G + +cluster_default + + + + + + + + + + +\\DB_Reg + + +DB_Reg + + + +\\Settings + + +Settings + + + +\\DB_SQL + + +«abstract» +DB_SQL + + + +\\DB_PDO + + +«abstract» +DB_PDO + + + +\\PDO + +\PDO + + +\\DB_PDO->\\PDO + + + + +\\Query_Builder + + +Query_Builder + + + +\\DB_Util + + +«abstract» +DB_Util + + + +\\PgSQL_SQL + + +PgSQL_SQL + + + +\\PgSQL_SQL->\\DB_SQL + + + + +\\PgSQL_Util + + +PgSQL_Util + + + +\\PgSQL_Util->\\DB_Util + + + + +\\PgSQL + + +PgSQL + + + +\\PgSQL->\\DB_PDO + + + + +\\ODBC_Util + + +ODBC_Util + + + +\\ODBC_Util->\\DB_Util + + + + +\\ODBC_SQL + + +ODBC_SQL + + + +\\ODBC_SQL->\\DB_SQL + + + + +\\ODBC + + +ODBC + + + +\\ODBC->\\DB_PDO + + + + +\\MySQL_Util + + +MySQL_Util + + + +\\MySQL_Util->\\DB_Util + + + + +\\MySQL + + +MySQL + + + +\\MySQL->\\DB_PDO + + + + +\\MySQL_SQL + + +MySQL_SQL + + + +\\MySQL_SQL->\\DB_SQL + + + + +\\SQLite_Util + + +SQLite_Util + + + +\\SQLite_Util->\\DB_Util + + + + +\\SQLite + + +SQLite + + + +\\SQLite->\\DB_PDO + + + + +\\SQLite_SQL + + +SQLite_SQL + + + +\\SQLite_SQL->\\DB_SQL + + + + +\\Firebird_SQL + + +Firebird_SQL + + + +\\Firebird_SQL->\\DB_SQL + + + + +\\Firebird_Result + + +Firebird_Result + + + +\\PDOStatement + +\PDOStatement + + +\\Firebird_Result->\\PDOStatement + + + + +\\Firebird + + +Firebird + + + +\\Firebird->\\DB_PDO + + + + +\\Firebird_Util + + +Firebird_Util + + + +\\Firebird_Util->\\DB_Util + + + + + diff --git a/sys/db/docs/classes/DB_PDO.html b/sys/db/docs/classes/DB_PDO.html new file mode 100644 index 0000000..9a13f0e --- /dev/null +++ b/sys/db/docs/classes/DB_PDO.html @@ -0,0 +1,684 @@ + + + + + +Query » \DB_PDO + + + + + + + + + + +
+ +
+
+
+ +
+ +
+
+
+

Base Database class

+
+

Extends PDO to simplify cross-database issues

+ + + + + + + + + +
packageQuery
subpackageQuery
+

+ Methods

+
+

PDO constructor wrapper

+
__construct(string $dsn, string $username, string $password, array $driver_options) 
+
+
+

+

Parameters

+
+

$dsn

+string +
+
+

$username

+string +
+
+

$password

+string +
+
+

$driver_options

+array +
+
+
+
+

__sleep() +

+
__sleep() 
+
+
+

+ + + +
inherited_fromPDO::__sleep()
+
+
+
+

__wakeup() +

+
__wakeup() 
+
+
+

+ + + +
inherited_fromPDO::__wakeup()
+
+
+
+

Returns number of rows affected by an INSERT, UPDATE, DELETE type query

+
affected_rows(\PDOStatement $statement) : int
+
+
+

+

Parameters

+
+

$statement

+\PDOStatement +
+

Returns

+
int
+
+
+
+

beginTransaction() +

+
beginTransaction() 
+
+
+

+ + + +
inherited_fromPDO::beginTransaction()
+
+
+
+

commit() +

+
commit() 
+
+
+

+ + + +
inherited_fromPDO::commit()
+
+
+
+

Deletes all the rows from a table. Does the same as the truncate +method if the database does not support 'TRUNCATE';

+
empty_table(string $table) : mixed
+
+
+

+

Parameters

+
+

$table

+string +
+

Returns

+
mixed
+
+
+
+

errorCode() +

+
errorCode() 
+
+
+

+ + + +
inherited_fromPDO::errorCode()
+
+
+
+

errorInfo() +

+
errorInfo() 
+
+
+

+ + + +
inherited_fromPDO::errorInfo()
+
+
+
+

exec() +

+
exec() 
+
+
+

+ + + +
inherited_fromPDO::exec()
+
+
+
+

getAttribute() +

+
getAttribute() 
+
+
+

+ + + +
inherited_fromPDO::getAttribute()
+
+
+
+

getAvailableDrivers() +

+
getAvailableDrivers() 
+
+
+

+ + + +
inherited_fromPDO::getAvailableDrivers()
+
+
+
+

Return list of dbs for the current connection, if possible

+
get_dbs() : array
+
+
+

+

Returns

+
array
+
+
+
+

Return list of function for the current database

+
get_functions() : array
+
+
+

+

Returns

+
array
+
+
+
+

Return the last error for the current database connection

+
get_last_error() : string
+
+
+

+

Returns

+
string
+
+
+
+

Return list of stored procedures for the current database

+
get_procedures() : array
+
+
+

+

Returns

+
array
+
+
+
+

Retreives the data from a select query

+
get_query_data(\PDOStatement $statement) : array
+
+
+

+

Parameters

+
+

$statement

+\PDOStatement +
+

Returns

+
array
+
+
+
+

Return schemas for databases that list them

+
get_schemas() : array
+
+
+

+

Returns

+
array
+
+
+
+

Return list of sequences for the current database, if they exist

+
get_sequences() : array
+
+
+

+

Returns

+
array
+
+
+
+

Retreives an array of non-user-created tables for +the connection/database

+
get_system_tables() : array
+
+
+

+

Returns

+
array
+
+
+
+

Return list of tables for the current database

+
get_tables() : array
+
+
+

+

Returns

+
array
+
+
+
+

Return list of triggers for the current database

+
get_triggers() : array
+
+
+

+

Returns

+
array
+
+
+
+

Return list of views for the current database

+
get_views() : array
+
+
+

+

Returns

+
array
+
+
+
+

inTransaction() +

+
inTransaction() 
+
+
+

+ + + +
inherited_fromPDO::inTransaction()
+
+
+
+

lastInsertId() +

+
lastInsertId() 
+
+
+

+ + + +
inherited_fromPDO::lastInsertId()
+
+
+
+

Return the number of rows returned for a SELECT query

+
num_rows() : int
+
+
+

+

Returns

+
int
+
+
+
+

prepare() +

+
prepare() 
+
+
+

+ + + +
inherited_fromPDO::prepare()
+
+
+
+

Create and execute a prepared statement with the provided parameters

+
prepare_execute(string $sql, array $params) : \PDOStatement
+
+
+

+

Parameters

+
+

$sql

+string +
+
+

$params

+array +
+

Returns

+ +
+
+
+

Simplifies prepared statements for database queries

+
prepare_query(string $sql, array $data) : mixed
+
+
+

+

Parameters

+
+

$sql

+string +
+
+

$data

+array +
+

Returns

+
+mixedPDOStatement / FALSE
+
+
+
+

query() +

+
query() 
+
+
+

+ + + +
inherited_fromPDO::query()
+
+
+
+

quote() +

+
quote() 
+
+
+

+ + + +
inherited_fromPDO::quote()
+
+
+
+

Surrounds the string with the databases identifier escape characters

+
quote_ident(mixed $ident) : string
+
+
+

+

Parameters

+
+

$ident

+mixed +
+

Returns

+
string
+
+
+
+

rollBack() +

+
rollBack() 
+
+
+

+ + + +
inherited_fromPDO::rollBack()
+
+
+
+

setAttribute() +

+
setAttribute() 
+
+
+

+ + + +
inherited_fromPDO::setAttribute()
+
+
+
+

Connect to a different database

+
switch_db(string $name) : void
+
+
+

+

Parameters

+
+

$name

+string +
+
+
+
+

Empty the passed table

+
truncate(string $table) : void
+
+
+

+

Parameters

+
+

$table

+string +
+
+
+
+

Helper method for quote_ident

+
_quote(mixed $str) : mixed
+
+
+

+

Parameters

+
+

$str

+mixed +
+

Returns

+
mixed
+
+
+
+

Method to simplify retreiving db results for meta-data queries

+
driver_query(string $sql, bool $filtered_index) : mixed
+
+
+

+

Parameters

+
+

$sql

+string +
+
+

$filtered_index

+bool +
+

Returns

+
mixed
+
+
+

+ Properties

+ 
+

Reference to sql sub class

+
$sql : Object
+
+

+
+ 
+

Reference to util sub class

+
$util : Object
+
+

+
+ 
+

Character to escape identifiers

+
$escape_char : string
+
+

+
+ 
+

Reference to the last executed query

+
$statement : mixed
+
+

+
+
+
+
+
+
+
+ + diff --git a/docs/classes/JSMinPlus.html b/sys/db/docs/classes/DB_Reg.html similarity index 57% rename from docs/classes/JSMinPlus.html rename to sys/db/docs/classes/DB_Reg.html index df174f4..8ef392c 100644 --- a/docs/classes/JSMinPlus.html +++ b/sys/db/docs/classes/DB_Reg.html @@ -3,7 +3,7 @@ -miniMVC » \JSMinPlus +Query » \DB_Reg @@ -15,14 +15,13 @@