phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-developers] Attention all app developers!


From: Miles Lott
Subject: Re: [Phpgroupware-developers] Attention all app developers!
Date: Wed, 02 Jan 2002 10:56:55 -0600

"Dan Kuykendall (Seek3r)" wrote:
> Milosch will followup with an example of how to deal with the upgrade
> and the syntax involved.
> 

The best example at the moment is in the api/setup/tables_update.inc.php
file.  This was added today:

    $test[] = '0.9.13.016';
    function phpgwapi_upgrade0_9_13_016()
    {
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_hooks
(hook_appname,hook_location,hook_filename) VALUES
('admin','acl_manager','hook_acl_manager.inc.php')");
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_hooks
(hook_appname,hook_location,hook_filename) VALUES
('admin','add_def_pref','hook_add_def_pref.inc.php')");

...

As you can see, these are all just INSERTs to the phpgw_hooks table. 
Check your own install to see what is in this table for your
application.  Compare this to your current setup.inc.php and to your
app/inc/hook_XXX.inc.php files.

For example, if your setup.inc.php only lists hooks for preferences and
admin:

        $setup_info['yourapp']['hooks'][] = 'preferences';
        $setup_info['yourapp']['hooks'][] = 'admin';

and yourapp/inc/ directory contains:

address@hidden inc]$ ls hook*
hook_admin.inc.php         hook_config.inc.php        
hook_manual.inc.php
hook_prefences.inc.php     hook_deleteaccount.inc.php

Then you will need to add this to your setup.inc.php:

        $setup_info['yourapp']['hooks'][] = 'config';
        $setup_info['yourapp']['hooks'][] = 'deleteaccount';
        $setup_info['yourapp']['hooks'][] = 'manual';

and you will need to add an upgrade routine to your app:

        $test[] = '0.0.4';
        function your_app_upgrade0_0_3()
        {
                $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_hooks
(hook_appname,hook_location,hook_filename) VALUES
('yourapp','config','hook_config.inc.php')");
                $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_hooks
(hook_appname,hook_location,hook_filename) VALUES
('yourapp','deleteaccount','hook_deleteaccount.inc.php')");
                $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_hooks
(hook_appname,hook_location,hook_filename) VALUES
('yourapp','manual','hook_manual.inc.php')");

                $GLOBALS['setup_info']['yourapp']['currentver'] = '0.0.4';
                return $GLOBALS['setup_info']['yourapp']['currentver'];
        }

and make sure to increment your application version in setup.inc.php:

        $setup_info['yourapp']['version']   = '0.0.4';

We might eventually convert these to hooks class calls, but for now this
is the easiest way.

-- 

Miles Lott - http://milosch.net
phpGroupWare - http://www.phpgroupware.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]