Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database layer #399

Merged
merged 95 commits into from May 17, 2013
Merged

Database layer #399

merged 95 commits into from May 17, 2013

Conversation

norv
Copy link
Contributor

@norv norv commented May 14, 2013

Implements #398


static function htmltrim($string)
{
global $smcFunc, $modSettings;
Copy link
Member

Choose a reason for hiding this comment

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

$smcFunc isn't used here, coud be removed..same applies for most of the other static functions

norv added 29 commits May 14, 2013 22:37
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
…ass...

Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
…ed for compat).

Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
norv added 3 commits May 14, 2013 22:45
Signed-off-by: Norv <a.w.norv@gmail.com>
… it to be used.

Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
@norv
Copy link
Contributor Author

norv commented May 14, 2013

Overview of changes from SMF: https://github.com/elkarte/Elkarte/wiki/Database-layer

norv added 20 commits May 15, 2013 01:31
… what it is.

Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>

Conflicts:
	sources/database/Db-mysql.class.php
	sources/database/Db.class.php

Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
…d stuff)

Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
…access.

Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
Signed-off-by: Norv <a.w.norv@gmail.com>
@norv
Copy link
Contributor Author

norv commented May 16, 2013

Update:

  • db_extend() should no longer be necessary at all
  • the database classes implement everything that was in $smcFunc (and the lone Util class keeps the rest). They should be stable
  • replaced the functions calls to 'packages', 'extra', or 'search' former $smcFunc, and removed compatibility for them
  • started to remove a few of the $smcFunc from core layer

So, this refactoring is in the stage: replace the rest of the calls, all through the codebase, from $smcFunc to the new methods. (them bugs excepted and that.)

I haz a question. Merge now, or do more of them replacements?
Until now, I'd say that only rarely used functions were replaced. The widely used query() and such, are still as $smcFunc, and files weren't touched - mostly.

norv added a commit that referenced this pull request May 17, 2013
@norv norv merged commit d6c6a46 into elkarte:master May 17, 2013
@norv
Copy link
Contributor Author

norv commented May 17, 2013

After this step:

  • we have no more backwards compatibility for a number of (rather rarely used) $smcFunc. We still have for most of core db functions, and for the small utility functions.
  • up to you when you want us to make the rest of replacements. For now, things should work both ways. So for newer code from this point, I'd hope we can make with calls through the 'new' api.
  • there are redundancies introduced in code by this PR, in particular in the initialization mechanism. (some slightly weird code in database subs, and of course the $smcFunc itself: it exists now only to redirect to the database objects methods). They're to be removed when we're certain a better way works for everything.
  • this merge should allow us to update /tools and other external applications.

@norv
Copy link
Contributor Author

norv commented May 17, 2013

And an important bit:
This PR has removed SQLite dependencies from Elk core. In installer script, maintenance, and a few other.
norv@84fc6d1
(If there are problems with it, it's that commit that did it.)
Further discussion: http://www.elkarte.net/index.php?topic=361.0

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.

None yet

2 participants