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


  • all tasks consolidated in lib/SGL/Tasks directory


  • filter chain formalised in Front Controller
  • filters now take $output as well as $input as arguments


  • moved all blocks within their respective modules
  • moved all default templates within modules
  • renamed PageMgr? to SectionMgr?
  • SGL_UrlParser_SefStrategy::resolveArrayElems renamed to SGL_Url::querystringArrayToHash
  • in templates, any time a check was done for {if:isAdmin), i've changed it to correctly reflect the method in Output, ie, {if:isAdmin()}
  • blocks can now be passed params, see trunk/modules/block/classes/blocks/Navigation.ini for an example
  • SGL_AppController renamed to SGL_FrontController
  • SGL_HTTP_Session renamed to SGL_Session
  • SGL_HTTP::redirect(array()); cleaned up to SGL_HTTP::redirect();


  • instantiating a cache object has changed from $cache = & SGL::cacheSingleton(); to $cache = & SGL_Cache::singleton();
  • likewise, SGL::clearCache() has changed to SGL_Cache::clear()
  • added SGL_Error class in Misc.php
  • renamed lib/SGL/Other.php to Misc.php
  • added SGL_VAR_DIR, SGL_ETC_DIR and SGL_APP_ROOT to allow for a more flexible pear installation


  • the following url parsing strategies are now enabled by default, classic querystring, standard Seagull SEF, and now UrlAlias. That means the all these URLs are valid for the same page
    • http://localhost/seagull/trunk/www/index.php/publisher/articleview/frmArticleID/1/staticId/6
    • http://localhost/seagull/trunk/www/index.php?moduleName=publisher&managerName=articleview&frmArticleID=1&staticId=6
    • http://localhost/seagull/trunk/www/index.php/content-reshuffle-alias/
  • at the time of writing aliases are hard-coded in seagull/lib/data/ary.uriAliases.php but shortly they will be coming from the DB, user configurable, and cacheable


  • rewritten installer, all routines are task-based
  • global config file renamed to <host_name>.conf.php
  • only minimum required modules registered: default, user, navigation
  • blocks now displayed according to role of current user
  • all SQL-related files that used to live in seagull/etc have been moved to 'default' module as that's what they were, default
  • item* tables and data moved to publisher
  • category table and data moved to publisher
  • $this->module = 'foo' no longer need in each Manager's constructor
  • installed flag renamed from INSTALL_COMPLETE to INSTALL_COMPLETE.php and now contains a password required access installer
  • New wizard can only be accessed if admin knows password stored in seagull/var/INSTALL_COMPLETE.php. Installer is invoked automatically on first seagull install, and can be called manually by calling setup.php
  • removed constants.php and init.php so last few 'procedural' LOC are gone, now you only need AppController?.php
  • all web tests moved to their own modules
  • Moved all core classes that doubled up with other classes to reduce file loading to seagull/lib/SGL/Other.php. Currently this contains SGL_Array, SGL_Date and SGL_Inflector. Should make libs easier to find: if you don't see a file named the same as the lib you want, it will most likely be in Other.php
  • added source:trunk/lib/SGL/ServiceLocator.php, this should always be used for getting a database resource, and if you need to use multiple db resouces they should all be registered here, see SGL_Manager constructor to see how it's initialised


  • the $conf variable is always available as a class variable in all Managers as $this->conf
  • all Managers must fire their parents' constructor: parent::SGL_Manager()
  • the $dbh database resource variable is always available as a class variable in all Managers as $this->dbh
  • it is no longer possible to assign config values with the old syntax, ie, $conf['foo']['bar'] = 'baz'; you must now use: $c->set('foo', array('bar' => 'baz']; with a singleton config instance, ie $c = &SGL_Config::singleton();
  • Request object now stored in SGL_Registry ($input), along with currentUrl, config objects
  • SGL_HTTP_REQUEST renamed to SGL_Request
  • $GLOBALS_SGL?REQUEST? discontinued in favour of true singleton
  • moved resolution of $_SERVERPHP_SELF? to SGL_URL::resolveServerVars($conf) in constants.php
  • SGL_Url now uses a parser strategy and can handle seagull urls as well as traditional
  • getSignificantSegments changed to toPartialArray
  • SGL::getTime moved to SGL_Date::getTime
  • all class/method name transformations now done with SGL_Inflector, this is physically located in the seagull/lib/SGL/~Request.php file to reduce file ~I/O. Familiar methods include
    • caseFix
    • getManagerNameFromSimplifiedName
    • getSimplifiedNameFromManagerName
    • getTitleFromCamelCase
    • isMgrNameOmitted
    • isUrlSimplified
    • urlContainsDuplicates


  • optional block type that's stored in the DB

What's New

  • rewritten installer
  • a new SGL_Config class for easy loading of config files, file type discovery and data format handled silently; ini, php array and xml types currently implemented
  • an improved SGL_Request object that internally resolves HTTP and CLI request types
  • a new SGL_URL object derived from PEAR's Net_Url that abstracts and organises various url formats, classic querystring and Seagull's Search Engine Friendly format are currently supported
  • a new flexible SGL_View object that integrates with the template engine of your choice and supports customised workflow for HTML and XML output (read: easy support for PDA output). Flexy is still the default but hooks now exist for Smarty or any other OO engine.
  • customisable pre and post process pipelines discussed earlier here.
  • use of global vars almost completely eliminated