Skip to content

Dev notes #1

brendo edited this page Sep 12, 2011 · 2 revisions

Dev Notes #1

Symphony 2.3 development has been rocketing ahead since the last post, and there has been some important breaking changes that extension developers need to be aware of. These changes aim to remove some of the legacy code that has been in Symphony for some time and improve performance and increase their usefulness.

Manager cleanup

Symphony has a number of Managers that are used to retrieve information about various objects. In Symphony 2.3, I'm happy to say that all Managers are now static, and no longer need to be initialised.

Where you previously might of had:

$entryManager = new EntryManager(Symphony::Engine());
$entries = $entryManager->fetch(1);

This can now be done as:

$entries = EntryManager::fetch(1);

The same goes for all functions of the DatasourceManager, EntryManager, EmailGatewayManager, EventManager, FieldManager, SectionManager and TextFormatterManager.

Cleanup!

Some developers will be familiar with $this->_Parent, and hopefully more are familiar with Symphony::Engine() because in Symphony 2.3, $this->_Parent no longer exists. This is only one of a number of things have been cleaned up for this release. Most of the removed properties or functions were previously deprecated in Symphony 2.2, but there are a couple that have been overlooked, so he's a complete list to prevent any confusion:

Properties

  • Administration and Frontend classes no longer have $this->Database, $this->Configuration or $this->ExtensionManager properties, these can all be accessed via Symphony::Database(), Symphony::Configuration() or Symphony::ExtensionManager().
  • Symphony's $Configuration, $Database, $ExtensionManager, $Log and $Profiler properties are now all private, two new accessors have been created, Symphony::Log() and Symphony::Profiler() to allow access to the latter two.
  • The AdministrationPage and FrontendPage classes no longer require the $parent be passed and consequently no longer have the $this->_Parent property. Additionally the FrontendPage class no longer has $this->ExtensionManager, $this->DatasourceManager or $this->EventManager properties
  • The Datasource and Event classes no longer have $this->_Parent. At the moment the first parameter passed when creating a new Datasource or Event is ignored.
  • The EntryManager class no longer have $this->_Parent, $this->FieldManager, $this->TextFormatterManager or $this->SectionManager properties.
  • The Entry class no longer have $this->_engine or $this->_Parent, use Symphony::Engine() instead, (it also no longer requires a parameter to initialise).
  • The Field class no longer have $this->_Parent, $this->_engine or $this->Database properties.
  • The Section class no longer have $this->_Parent, or $this->_fieldManager properties.
  • The SectionManager and TextFormatter classes no longer have $this->_Parent, nor require a parameter to initialise.
  • The $context passed to any delegate callback no longer includes a parent key

Functions

  • The AdministrationPage class no longer has the wrapFormElementWithError function, use Widget::wrapFormElementWithError instead.
  • The Author class no longer contains the loadAuthorFromUsername, loadAuthor and verifyToken functions.
  • General class no longer contains filemtimeSort, fileSort or fileSortR functions. These were unused by Symphony and were quite ironically quite specific.
  • The fieldDate class no longer contains the buildSimpleFilterSQL function.

This is just the first of many dev notes that we're hoping to release as Symphony 2.3 development progresses, enjoy!