print Migrating from 0.2.X to 0.3.X

The Scorpio 0.3 release is an incremental update with some API changes. In many cases these are relatively small, in others though they are larger. This guide will highlight the biggest issues you may encounter from moving from 0.2.X to 0.3.

Library Updates

Several core libraries have been updated since the 0.2.6 release.

Smarty 3

Smarty has been upgraded from 2.6 to 3.0. At the time of writing Smarty 3 is a release candidate and is not yet final, however the changes and improvements Smarty 3 brings were too large to ignore. Of the many features, increased performance and better template parsing are the primary reasons for switching.

Things to watch with Smarty 3

Smarty 3 will no longer parse { some text } as a smarty function or variable. This means that you no longer need to use {literal}{/literal} around CSS and javascript in your templates. So long as there is white-space after the opening brace, Smarty 3 will ignore it.

Foreach syntax is now like PHP: {foreach $array as $key => $value}{/foreach} to access the current iteration or first of last indexes use @iteration, @first, @last on the variables inside the loop: e.g. {$key@iteration} will output the current iteration. The old syntax is still supported.

Initial parsing is slower than Smarty 2.6.X however the compiled templates are much faster. This is most noticeable in development (production = 0 in master config file) where Smarty is set to force-recompile by the Scorpio Framework.

Functions and modifiers will continue to work as is, though you should remove the & from &$smarty in your functions to be PHP 5.3 compliant.


PHPMailer is now at version 5.1. This is mostly bug fixes.

Spreadsheet Excel Writer

PEAR Spreadsheet Excel Writer has been removed (along with the dependencies, PEAR and OLE) in favour of using PHPExcel. The PEAR package was not being maintained and was only PHP4 compatible. PHPExcel offers far more features including XLSX output as well as XLS and others.

PHPExcel has been slightly modified to remove the PDF output. This was done to reduce the file size of the project. PDF output is available via fpdf. This may be changed in future.

The report XLS writer has been updated to use PHPExcel and there is now an XLSX output option. Both support styling and formatting.


Open Document Spreadsheet has been added through the ODS class. This has been slightly modified and updated for Scorpio and has it's own report writer. At this time, formatting, functions and other advanced features are not available. Style support will be added eventually but currently only basic ODS files can be output by the writer / ODS class.