Skip to content

[PHPBB3-11015] Make DBAL classes autoloadable#908

Closed
igorw wants to merge 31 commits intophpbb:developfrom
igorw:ticket/11015
Closed

[PHPBB3-11015] Make DBAL classes autoloadable#908
igorw wants to merge 31 commits intophpbb:developfrom
igorw:ticket/11015

Conversation

@igorw
Copy link
Copy Markdown
Contributor

@igorw igorw commented Jul 21, 2012

The full diff is really hard to review, so look at the individual commits. Also, manually diff includes/db/dbal.php against includes/db/driver/driver.php, as git did not detect it as a rename.

Ticket: http://tracker.phpbb.com/browse/PHPBB3-11015

igorw added 4 commits July 21, 2012 18:11
PHPBB3-11015

This allows us to just create the object without having to include the
driver first. However, it also means that users must specify the full
class name in config.php
* develop:
  [ticket/11012] Fix php_ext change in mock_extension_manager
  [ticket/11012] Normalize $phpEx member vars to $php_ext
  [ticket/11002] Use translating option to rename the Etc/GMT options

Conflicts:
	phpBB/includes/extension/manager.php
@travisbot
Copy link
Copy Markdown

This pull request fails (merged 83bdf3e into cc0aa90).

@travisbot
Copy link
Copy Markdown

This pull request fails (merged cb102c6 into cc0aa90).

@travisbot
Copy link
Copy Markdown

This pull request fails (merged c34ca32 into cc0aa90).

@travisbot
Copy link
Copy Markdown

This pull request passes (merged 0971d3f into cc0aa90).

@p
Copy link
Copy Markdown
Contributor

p commented Jul 26, 2012

Note #865 uses db tools in sphinx.

@p
Copy link
Copy Markdown
Contributor

p commented Jul 26, 2012

Looks good, I approve.

For the config change, we could do the following:

Assuming no db class will be at the top level, and therefore all valid class names would contain at least one underscore, if a class name with no underscore is given prefix it with phpbb_db_ (or whatever the correct prefix is).

@igorw
Copy link
Copy Markdown
Contributor Author

igorw commented Jul 26, 2012

Note: db_tools is not affected by this PR.

@bantu
Copy link
Copy Markdown
Collaborator

bantu commented Sep 13, 2012

Why was copyright bumped?

@imkingdavid
Copy link
Copy Markdown
Contributor

@igorw What is the status of this? It looks good, but it looks like it needs a rebase.

* upstream/develop: (666 commits)
  [ticket/11077] Remove code from old global announcements system
  [ticket/11189] Replace DEBUG_EXTRA with DEBUG
  [ticket/11189] Always log critical errors when in cron or in image output
  [ticket/11187] Added a blank array to fix errors in functional tests
  [ticket/10780] Make L_COLON available in the installer.
  [ticket/11183] Remove $load_extensions and weird dl() calls
  [ticket/10970] Added extra documentation to parse_dynamic_path.
  [ticket/10939] Added documentation for phpbb_request::file
  [ticket/10865] Use code tags for install/database_update.php.
  [ticket/10865] Should have been a slash.
  [ticket/10780] Use L_COLON on LDAP page.
  [ticket/10780] Use L_COLON on search backend ACP pages.
  [ticket/10780] Use L_COLON for "download all attachments".
  [ticket/10780] Use colon from language in ucp_pm_compose.php where possible.
  [ticket/10780] Replace colons in phpBB/adm/style/acp_ext_details.html.
  [ticket/10780] Replace colon usage in adm template output with {L_COLON}
  [ticket/10780] Replace colon usage in template output with {L_COLON}
  [ticket/11181] Bump PHP requirement to 5.3.3 (from 5.3.2) [develop-olympus]
  [ticket/11181] Bump PHP requirement to 5.3.3 (from 5.3.2)
  [ticket/10172] Show prosilver birthday list even if there are no birthdays.
  ...

Conflicts:
	phpBB/common.php
	phpBB/download/file.php
	phpBB/includes/db/dbal.php
	phpBB/includes/db/firebird.php
	phpBB/includes/db/mssql.php
	phpBB/includes/db/mssql_odbc.php
	phpBB/includes/db/mssqlnative.php
	phpBB/includes/db/mysql.php
	phpBB/includes/db/mysqli.php
	phpBB/includes/db/oracle.php
	phpBB/includes/db/postgres.php
	phpBB/includes/db/sqlite.php
	phpBB/includes/extension/manager.php
	phpBB/install/database_update.php
* upstream/develop: (31 commits)
  [ticket/11194] Service tag data is stored in an array so access it correctly
  [ticket/11193] Instantiate a single collection_pass for all collections
  [ticket/11152] Basic tests for the container functions
  [ticket/11152] Compile the install container
  [ticket/11152] Throw error if services.yml is missing
  [ticket/11152] Remove old container processor calls
  [ticket/11152] Use realpath in container extensions consistently
  [ticket/11152] Rename collection to collection_pass
  [ticket/11152] Remove @api docblocks
  [ticket/11152] Create separate function for debug-dependent container
  [ticket/11152] Change phpbb_di_pass_cron to generic phpbb_di_pass_collection
  [ticket/11152] Convert cron_task_collection to generic di_service_collection
  [ticket/11152] Use relative root path in container, one dumped container per path
  [ticket/11152] Move container functions to a separate function file
  [feature/compiled-dic] Rename $phpEx to $php_ext in new code
  [feature/compiled-dic] Use an absolute path for core.root_path parameter
  [feature/compiled-dic] Update the composer.lock file
  [feature/compiled-dic] Purge cache to make ext services available right away
  [feature/compiled-dic] Fix root path when container is created after install
  [feature/compiled-dic] Remove old test
  ...
@igorw
Copy link
Copy Markdown
Contributor Author

igorw commented Nov 12, 2012

Updated to latest develop.

@imkingdavid
Copy link
Copy Markdown
Contributor

Looks good

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe not, fixing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add compatibility code to make the old style work, as otherwise bisecting etc. will become unnecessarily painful.

* upstream/develop: (22 commits)
  [ticket/11206] Remove includes to non-existent files from download/file.php
  [ticket/11205] Fix merge conflict in readme.html.
  [ticket/11202] Check response success before content assertions.
  [ticket/11204] Reindent.
  [ticket/11198] Remove additional asterix as /** is doc-block only
  [ticket/11200] Add a reminder comment.
  [ticket/11202] Custom message does not make sense here, delete it.
  [ticket/11202] Check response success before content assertions.
  [ticket/11202] Add a heuristic function to check for response success.
  [ticket/11200] Make cache available during container construction
  [ticket/11199] Match cache purge container files against container_*
  [ticket/11199] Purge dumped container correctly on cache purge.
  [ticket/11199] Revert merge of 'marc1706/ticket/11199' into develop
  [ticket/11199] Cache purge does not remove dumped container
  [ticket/11198] Store the swapping partners in vars and simplify the logic
  [ticket/11198] Correctly set links after an item is moved up/down with AJAX
  [ticket/11197] Prefix the css classes for the small arrow with "arrow"
  [ticket/10879] Remove arrow icon from attachment link in editor
  [ticket/11195] Condense logic, remove improperly formatted if()
  [ticket/11190-develop] Functional tests purge cache before running.
  ...

Conflicts:
	tests/test_framework/phpbb_database_test_connection_manager.php
It should allow any class name in the future, as long as that class
exists. And it should give a useful error message otherwise.

PHPBB3-11015
@p
Copy link
Copy Markdown
Contributor

p commented Nov 29, 2012

Status here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include driver name in the message please.

@p
Copy link
Copy Markdown
Contributor

p commented Dec 4, 2012

igorw#16

Functional tests are still failing.

* upstream/develop: (196 commits)
  [ticket/11219] Coding guidelines and naming consistency changes
  [ticket/10841] Revert more whitespace changes.
  [ticket/10841] Revert whitespace changes.
  [ticket/10841] adding space after if
  [ticket/10841] removing unnecessary spacing
  [ticket/10841] changing affectedrows check to COUNT in sql
  [ticket/10841] Modifying style and language selectors in UCP
  [ticket/11247] Fix wrong property reference in flock class.
  [ticket/10602] Avoid a race condition.
  [ticket/10602] Use last_queue_run for its intended purpose.
  [ticket/10716] Collect standard error from executed php process.
  [ticket/10716] Skip test if php is not in PATH.
  [ticket/10716] Exclude our dependencies from linting.
  [ticket/10103] New and improved wording.
  [ticket/10716] Only lint on php 5.3+.
  [ticket/10103] Assert with messages.
  [ticket/10103] assertLessThan/assertGreaterThan.
  [ticket/10103] Inline assignment is bad?
  [ticket/10103] $rv had too few characters.
  [ticket/10103] Correct flock class documentation.
  ...

Conflicts:
	phpBB/includes/functions.php
	tests/cache/cache_test.php
@p
Copy link
Copy Markdown
Contributor

p commented Dec 7, 2012

igorw#18 and I need #1126 merged.

igorw and others added 5 commits December 7, 2012 13:31
* upstream/develop: (101 commits)
  [ticket/10491] Make recreate_database static.
  [ticket/11088] Pass required objects in as arguments
  [ticket/11088] Globalize objects in new permission function
  [ticket/11088] Move permission creation to a function
  [ticket/11088] Copy a_styles permission for a_extensions
  [ticket/11088] Remove extraneous word from sentence in comment
  [ticket/11088] Changed "file extensions" to "attachment extensions"
  [ticket/11088] Fix the database updater to correctly manipulate the modules
  [ticket/11088] Put language pack module move below extension module creation
  [ticket/11088] Untested, progress on update script
  [ticket/11088] Fix typo (period instead of comma)
  [ticket/11088] Untested progress for update script
  [ticket/11088] Added missing comma
  [ticket/11088] Removed added space
  [ticket/11088] Move style, extension and language pack management to customise
  [ticket/11243] Show download all link on all pages of topic with attachments
  [feature/template-events] Pass arguments in correct order.
  [feature/template-events] Pass arguments in correct order.
  [ticket/10491] Install board once per test run.
  [ticket/11257] Do not require set_name() method to exist
  ...
@p
Copy link
Copy Markdown
Contributor

p commented Dec 13, 2012

igorw#19

Unit tests are fixed, functional ones are failing miserably.

@p
Copy link
Copy Markdown
Contributor

p commented Dec 13, 2012

Board install appears to not actually work with the patch applied. #1138 please.

@p
Copy link
Copy Markdown
Contributor

p commented Dec 13, 2012

p@586e8cb

@p
Copy link
Copy Markdown
Contributor

p commented Dec 13, 2012

igorw#20

Test suite is fixed. Fresh install works. Update works. Should be good to go.

@p
Copy link
Copy Markdown
Contributor

p commented Dec 13, 2012

I have not reviewed that all conversions between long and short names are correctly done.

@bantu
Copy link
Copy Markdown
Collaborator

bantu commented Dec 13, 2012

Considering patch good after reading it. Haven't tested.

@p
Copy link
Copy Markdown
Contributor

p commented Dec 13, 2012

(18:09:49) nx-: there's going to be fallout with missed cases in dbal switches
(18:11:26) nx-: and sometimes the switch is on sql layer for some reason
(18:11:31) nx-: should probably fix that
(18:12:09) nx-: there you go
(18:12:11) nx-: create schema files
(18:12:26) bantu: good catch
(18:12:31) nx-: which succeeds
(18:13:20) nx-: maybe it's fine
(18:16:03) nx-: this looks fine
(18:16:05) nx-: right now
(18:17:19) nx-: http://tracker.phpbb.com/browse/PHPBB3-11267
(18:18:41) nx-: there is no way i can catch missing dbms conversions
(18:20:34) nx-: convertor i really have no idea
(18:20:56) nickvergessen: convertor is a magic box really
(18:21:08) nickvergessen: I guess no one of us knows how its working
(18:21:10) nx-: http://tracker.phpbb.com/browse/PHPBB3-11031
(18:21:24) nx-: that should catch whatever we break here
(18:23:11) nx-: my test config still uses short names so that's fine
(18:24:21) nx-: + case 'phpbb_db_driver_mysql4':
(18:24:26) nx-: there is no way that's right?
(18:24:39) nx-: was that something that existed earlier?
(18:25:26) bantu: way earlier
(18:25:33) bantu: sounds like a switch on layer
(18:25:44) nx-: it switches on dbms though
(18:25:52) nx-: well ok
(18:25:55) nx-: i approve
(18:28:34) nx-: http://tracker.phpbb.com/browse/PHPBB3-11268

Merged as #1135.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants