[QUESTION] MOD sql-installer w/o UMIL

Discussion forum for MOD Writers regarding MOD Development.
Locked
User avatar
m157y
Registered User
Posts: 482
Joined: Mon Apr 30, 2007 9:39 am
Location: Russia, Moscow, Khimki
Contact:

[QUESTION] MOD sql-installer w/o UMIL

Post by m157y » Mon Feb 22, 2010 5:47 pm

When most MOD developers switching to UMIL, i'm prefer to still independent from anything that doesn't contributing with phpBB by default. And as some of you knows Karma MOD has own installer. Currently Karma MOD`s installer switching to phpbb_db_tools, which used by phpBB`s database updater and contributed with phpBB by default. It doesn't using hardcoded sql-schemas like this:

Code: Select all

CREATE TABLE sometable (
	somefield mediumint(8) UNSIGNED NOT NULL auto_increment,
	....
	PRIMARY KEY (somefield)
) CHARACTER SET `utf8` COLLATE `utf8_bin`;

ALTER TABLE someanothertable
	ADD someanotherfield mediumint(8) DEFAULT '0' NOT NULL;
So i have a question to MOD developers. Someone wants be independent from UMIL and don't want spend time for installer development? I thinks about sharing it with little documentation for simplification your mod installation.
Some information about this installer:
  • support installing and updating db from version to version including all between version, so all changes will be completed.
  • support some configuration, so you can add basic configuration to installer before your mod will be installed.
  • can add acp/ucp/mcp modules
  • can add new imageset data
  • purge cache for template/sql-config
  • uses phpbb`s functions
  • can be translated
  • asks admin access
  • checks phpbb minimum version
  • based on original phpbb`s installer, but modified for coding guidelines
  • passes mpv checks
And one little problem, i'm currently finishing it, but it works perfectly.
Oh, sorry, two problems :roll: currently it hardcoded for karma mod :mrgreen: but if it'll be needed to somebody i'll answer on all questions ;)

Edit reason: Oops, i forgot about modules installing.
Edit reason #2: Also i forgot about imageset and cache.
Last edited by m157y on Mon Feb 22, 2010 5:54 pm, edited 3 times in total.
m157y aka Misty
NO SUPPORT VIA PM
KarmaMOD for phpBB 3.0.x | bbAJAX
Follow me on twitter

User avatar
m157y
Registered User
Posts: 482
Joined: Mon Apr 30, 2007 9:39 am
Location: Russia, Moscow, Khimki
Contact:

Re: [QUESTION] MOD sql-installer w/o UMIL

Post by m157y » Mon Feb 22, 2010 5:48 pm

And for example schema for this installer:
create new table:

Code: Select all

	KARMA_RANKS_TABLE => array(
		'COLUMNS' => array(
			'rank_id'			=> array('UINT', null, 'auto_increment'),
			'rank_title'	=> array('VCHAR', ''),
			'rank_min'		=> array('INT:8', 0),
			'rank_image'	=> array('VCHAR', ''),
		),
		'PRIMARY_KEY' => array(
			'rank_id',
		),
	),
add columns to posts_table

Code: Select all

	'add_columns' => array(
		POSTS_TABLE	=> array(
			'post_karma'				=> array('INT:8', 0),
			'post_karma_powered'=> array('INT:8', 0),
			'post_karma_count'	=> array('UINT', 0),
			'post_karma_search'	=> array('INT:8', 0),
			'post_karma_search_powered'	=> array('INT:8', 0),
		),
	),
m157y aka Misty
NO SUPPORT VIA PM
KarmaMOD for phpBB 3.0.x | bbAJAX
Follow me on twitter

User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: [QUESTION] MOD sql-installer w/o UMIL

Post by igorw » Mon Feb 22, 2010 6:46 pm

I don't see why you want to go without UMIL, since it provides all (or most) of the things you are looking for. Anyway, here's a file I created a while ago that has some concepts also present in UMIL: phpbbmodders_lib/functions_install.php. You may be particularly interested in the process_install() function.
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three

User avatar
m157y
Registered User
Posts: 482
Joined: Mon Apr 30, 2007 9:39 am
Location: Russia, Moscow, Khimki
Contact:

Re: [QUESTION] MOD sql-installer w/o UMIL

Post by m157y » Mon Feb 22, 2010 7:00 pm

Main reasons why i don't like UMIL, it's because it need installation by user, i think that mod must be fully independent from other mods, of course, if it's not addon for anything.
And about your functions_install.php some parts of modules-routine is good, at other... load_schema() is function from which i'm moved to subject of this topic. And your using of phpbb_db_tools class is has not needed iterations, but it's because this class already updated and your file, as i think, not.
Possible, i'll use some modules routine, if you'll agree.
m157y aka Misty
NO SUPPORT VIA PM
KarmaMOD for phpBB 3.0.x | bbAJAX
Follow me on twitter

User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: [QUESTION] MOD sql-installer w/o UMIL

Post by igorw » Mon Feb 22, 2010 7:07 pm

For this reason the policy is to include UMIL with the MOD. It's not the best solution, but the most user-friendly to get the MOD installed easily. Feel free to use any of the code, and yes it may very well be out of date.
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three

User avatar
m157y
Registered User
Posts: 482
Joined: Mon Apr 30, 2007 9:39 am
Location: Russia, Moscow, Khimki
Contact:

Re: [QUESTION] MOD sql-installer w/o UMIL

Post by m157y » Mon Feb 22, 2010 7:41 pm

So that`s a reason why i'm prefer self-coded installer, it doesn't need any install instructions. Just copy a folder and run. I think it very pretty, because copy actions easy for users :)

And thanks for your agreement. Some parts good. Of course, your copyright will be set at code. :)
m157y aka Misty
NO SUPPORT VIA PM
KarmaMOD for phpBB 3.0.x | bbAJAX
Follow me on twitter

Locked

Return to “[3.0.x] MOD Writers Discussion”