Reverse Engineering database structure to ...
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexCVS Info
Author Message
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3676
Location: Melbourne, AU

PostPost subject: Reverse Engineering database structure to ...
Posted: Fri Jul 09, 2010 1:16 pm
Reply with quote

Reverse Engineering database structure to ... DragonflyCMS installer compatible file!

Developers may use this new function found in admin -> database to port their module tables structure to DragonflyCMS installer file format.

Will save a copy into the cache folder, just copy and paste into cpg_inst.php.

The module installer is also reworked again and work is still in progress.

preview: dragonflycms.org/cvs/h....php?v=1.2


By enabling pre_ and post_ functions they will be executed, when? function name is auto explanatory Very Happy

_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
MySQL 5.1 / PHP 5.3 / NextGen()
Back to top
View user's profile Visit poster's website
layingback
Forum Admin


Joined: Apr 19, 2004
Posts: 953

PostPost subject: Re: Reverse Engineering database structure to ...
Posted: Fri Jul 09, 2010 1:23 pm
Reply with quote

Sounds good. Been waiting for this. But will it be able to handle updates for existing users? Ie.
if ($prev_version <= '3.3.1.1') {
stuff

_________________
Pro_News: The complete module for Dragonfly - now available as version 3.3

layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6 - 3.6 / 1.3.42 - 2.2.12 / 5.0.92 - 5.1.37 - 5.1.54 / 4.4.49 - 5.2.17 - 5.3 / 9.2.1
Back to top
View user's profile Visit poster's website
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3676
Location: Melbourne, AU

PostPost subject: Re: Reverse Engineering database structure to ...
Posted: Fri Jul 09, 2010 1:37 pm
Reply with quote

The new installer makes thinks a bit harder when you need to create the database structure using the new (4 years old) standards.
This is why I've just created this tool. Help me and everyone else to get started.

It will be supported inside inside each function ... but lets the fun start.
Possibilities are infinite and explain them all will take a while.

You or anyone else with a question, shoot me a detailed example about a process you may want to run inside an upgrade and I will show you, luckily, how simple its going to be when using the new installer structure.

Otherwise I'll be aware about issues before it's too late Very Happy

_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
MySQL 5.1 / PHP 5.3 / NextGen()
Back to top
View user's profile Visit poster's website
greenday2k
Forum Admin


Joined: Aug 11, 2005
Posts: 484
Location: CO

PostPost subject: Re: Reverse Engineering database structure to ...
Posted: Fri Jul 09, 2010 3:59 pm
Reply with quote

mmm multistage installer, interesting but where is the "install" function ? ;D
what the "install" function does?

Or the install process is just pre and post functions?
are those functions only to be used to send and receive data from the database?
o let create interaction with the user?

Code:
function pre_install() {

        // get data of the site:
        // Let the user choose some installing options
        $response = 'Welcome '.$sitename;
        $response = 'Please choose a name for your module';
        return true;

    }


   function post_install() {

        // fill the database?
        // activate the module?
        // delete temporal tables / data ?  
        return true;

    }

_________________
www.greenday2k.net



greenday2k's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website MSN Messenger Yahoo Messenger
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3676
Location: Melbourne, AU

PostPost subject: Re: Reverse Engineering database structure to ...
Posted: Fri Jul 09, 2010 4:51 pm
Reply with quote

The install is fully automated, just provide a $tables structure within cpg_inst or in a data.inc file inside the same directory and the installer will load and install it for you.

pre_ and post_ are ran respectively before and after the installer creates tables and insert data .. same for upgrade and uninstall. Just optional functions.

Interactive? No.
However module name can be changed easily by renaming the folder, the class name and $this->modname to have a uniform name displayed everywhere.

Some more details:
If you add a new column, a new key, a new table ... you will not need to do anything else then update $tables and change $this->version to a higher version number.

That is it, installer will then see an different version, prompt for the upgrade and perform all operation necessary to match your provided $tables with the actual database table ... compatible with MySQL and PostgreSQL.

_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
MySQL 5.1 / PHP 5.3 / NextGen()
Back to top
View user's profile Visit poster's website
layingback
Forum Admin


Joined: Apr 19, 2004
Posts: 953

PostPost subject: Re: Reverse Engineering database structure to ...
Posted: Fri Jul 09, 2010 7:05 pm
Reply with quote

What version did this first appear? Ie. at what version can we drop the old way?

Can I have 2 installers? I want to switch to the new system - I hate messing with the installer - but what about my users who are on 9.1.2.1 or even 9.0.6.1 - how should I handle those?

_________________
Pro_News: The complete module for Dragonfly - now available as version 3.3

layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6 - 3.6 / 1.3.42 - 2.2.12 / 5.0.92 - 5.1.37 - 5.1.54 / 4.4.49 - 5.2.17 - 5.3 / 9.2.1
Back to top
View user's profile Visit poster's website
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3676
Location: Melbourne, AU

PostPost subject: Re: Reverse Engineering database structure to ...
Posted: Sat Jul 10, 2010 2:31 am
Reply with quote

Been used from DragonflyCMS 9.1.0.1.

No, only one single installer.

9.0.6.1 they should really upgrade.
I personally managed to upgrades 8.x websites, some had issues due mod and hacks and user errors and ... improving the installer.

For example the user delete hack screwed up otherwise easy upgrades, had to modify the installer again.

_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
MySQL 5.1 / PHP 5.3 / NextGen()
Back to top
View user's profile Visit poster's website
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3676
Location: Melbourne, AU

PostPost subject: Re: Reverse Engineering database structure to ...
Posted: Sat Jul 10, 2010 6:32 am
Reply with quote

Now admin cache support viewing and deleting installer type cached files.
_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
MySQL 5.1 / PHP 5.3 / NextGen()
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexCVS Info All times are GMT
Page 1 of 1


Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Dedicated Server & Bandwidth Sponsored by DedicatedNOW
User Info [x]

Welcome Anonymous

Nickname
Password
(Register)

Last CVS commits [x]

Languages [x]

Community [x]

Support for DragonflyCMS in a other languages:

Deutsch
Español

X-links [x]
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

Preview theme [x]
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.


You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
This page generated in 0.5224 seconds with 16 DB Queries in 0.0887 seconds
Memory Usage: 2.93 MB
Interactive software released under GNU GPL, Code Credits, Privacy Policy