Upgrading Seagull from a 0.3.x install to 0.4.x

in version 0.4 many things have changed, so if you want to port existing modules to the new cvs version, please take care of the following. Please have also a look at the CHANGELOG.txt

Base class renamed

Class Base:: is now class SGL::

for example now:

SGL::logMessage(null, PEAR_LOG_DEBUG);

Some base methods changed:

Base::logMessage(__CLASS__ . '::' . __FUNCTION__ , null, null, PEAR_LOG_DEBUG);

is now:

SGL::logMessage(null, PEAR_LOG_DEBUG);

New action Management

Yeah, this throws some errors and takes some minutes to find everything out.

Thanks to the guys at IRC for helping me.

  • Rename the aAllowedActions array into aActionsMapping
  • rewrite the $this->_aActionsMapping array to the new standard:

        $this->_aActionsMapping =  array(
            'insert' => array('insert','redirectToDefault'),
            'update' => array('update','redirectToDefault'),
            'list'   => array('list'),
            'send'   => array('send','redirectToDefault'),

Important: change function validate($req, $input) to function validate($req, &$input) (do you see this little & ?)

Change validate() parameter

Inside your module the validate() function definition must be changed to:

    function validate($req, &$input)

Note the & in front of $input parameter.

Calling DB method is different

In 0.3.xx version a DB connection was made with:

$dbh = &Base::DB();

Now, in 0.4.xx is:

$dbh = &SGL_DB::singleton();

Changing into www/*.php pages

The last line usually says:

$process->go(new SGL_HTTP_Request());

Now is just:


Move generateSelect's to templates

All calls to generateSelect were moved to template

In your managers change:

$output->aLanguages = SGL_Output::generateSelect($array)


$output->aLanguages = $array

Now place the following call in the corresponding template.

<select name="frmArticleLangs[]" multiple="multiple">

Some methods moved to /lib/SGL/Manager.php

you can delete the process() and display() methods if you don't have modified them. They are in the parent class now.

Other methods moved…

23-01-05    Created SGL_String class and moved appropriate methods to it
23-01-05    Moved all generateSelect() calls to templates
21-01-05    Renamed session DB methods more conventionally
21-01-05    Moved url-related methods into new class, SGL_Url
21-01-05    Moved SGL::getPagedData() to SGL_DB::getPagedData()

Moved SGL_Output::msgSet() to SGL::raiseMsg()

SGL_Item Changes

Moved !ArticleViewMgr::getArticleDetail() to SGL_Item::getItemDetail()
Moved !ArticleViewMgr::getArticleListByCatID to SGL_Item::getArticleListByCatID
Moved !ArticleViewMgr::getDocumentListByCatID to SGL_Item::getDocumentListByCatID
Moved !ArticleViewMgr::retrievePaginated to !SGL_Item::retrievePaginated

Adding $input->masterTemplate and removing $input->rightCol

Be sure to add $input->masterTemplate = $this->masterTemplate; and remove $input->rightCol in your validate method