Symphony CMS: the Export Ensemble Extension
Building installers for the various versions of Symphony was a complex undertaking that delayed releases of the core code before version 2.0. However, for the beta versions of 2.0, a new extension was developed to overcome this issue: the Export Ensemble extension. From that point on, an installer could be created with the click of a button.
The term “Ensemble” obviously carries on the pattern of musical terms associated with the Symphony CMS project—although there have been “concerted” efforts to minimize the overuse of these terms since they don't properly express the features these tools provide. In the case of “Ensembles”, the term refers to a collection of components required to create a working install of Symphony.
Generally, an ensemble is a customized Symphony installer, created by clicking the Export Ensemble button, producing and downloading a ZIP archive of an existing Symphony site.
The Symphony Installer
The Symphony installer is an ensemble. It contains:
- The Symphony core in the
symphonydirectory and the main
index.phpfile, which handles all server requests
- The core
- Files for installing and updating
- Files for documentation
workspacedirectory, containing the files required to install the default Symphony theme. If the
workspaceis omitted during installation, this will create a clean install of Symphony with a blank workspace. The workspace will contain the minimum required folder structure for a working Symphony install:
The Symphony Workspace
In theory, the workspace directory contains everything that is customized for a specific Symphony install. So, by swapping the workspace, it would be possible to install a different theme. For Symphony, the workspace does not work in the way people have come to expect themes to work in other systems, like WordPress. Because Symphony can be customized to such a great extent, the database structure can be completely different, making it impossible to construct themes that can be easily swapped. For this reason, the Symphony workspace cannot be swapped after installation.
In practice, though, there are many customizations that exist outside of the workspace directory, specifically, the
.htaccess file, the
manifest directory and the
extensions directory, which contains the scripts and assets that can be installed by Symphony to extend the capabilities of the core. Also, ensembles do not track the sensitive or site-specific data stored in the database, being careful to exclude authors, cache and sessions data.
The Symphony installation process involves a one-page installer, which collects the server, database and primary user login data used to initialize the MySQL database, write the
.htaccess files and configure the system by creating the
manifest directory and the configuration directories and files it contains.
Limitations of the Export Ensemble Extension
Alistair Kearney, who created the original extension, and the other Symphony core developers (at that time), Scott Hughes and Allen Chang, had always wanted to add more capabilities to those offered by the Export Ensemble extension, but for lack of time, were never able to realize their ideas.
And, for the longest time, it had been impossible to use the Export Ensemble extension for anything but the most basic Symphony sites, since the extension provided no functionality for storing additional configuration settings and database modifications made by extensions beyond the core Symphony extensions.
Updates to the Export Ensemble Extension
Alistair was able to add one important update: the ability to include the database files in version control. The specific SQL, describing customizations added to a clean install of Symphony, were separated out into two
install.sql files: one in the root directory of the Symphony install, and another in the
Alistair is no longer a Symphony core developer, so the continued development of his extension would have to fall to someone else. Since no one else seemed to be as interested in the feature, it seemed logical that it should fall to the one who was using it the most, even if he wasn't really a self-professed PHP programmer: me.
So, I took on the changes I needed to be able to use the Export Ensemble extension with the Members extension for the Domain7 intranet, among many other projects I have been working on that often start as reusable and extensible ensembles. So, as of the Symphony 2.2.2 release and the 1.15 release of the Export Ensemble extension, I have been a core extension developer.
The changes I have made include the following:
- Updates to allow the inclusion of custom database tables added by extensions
- Add a second button to allow overwriting the existing install files for easier integration into a Git workflow (version control)
- Remove the requirement for the ZipArchive class
- Error handling for overwriting install files
A Note About Site Migrations
Be aware of the limitations of the Export Ensemble extension. It does not solve the problem of site migrations between servers. This is still an outstanding issue, unless you want to try deploying Symphony with Capistrano, or implementing Nick Dunn's workflow using the DB Sync extension, or deploying Symphony to your DTAP environments with Remie Bolte's Continuous Database Integration (CDI) extension.
At the moment, I'm still more comfortable using Nils Werner's Dump DB extension, where I only make structural database changes to the live site, then sync the staging and development environments with the production server by importing a complete dump of the live data, which is tracked as a private Git repository.
Creating Symphony Ensembles
This is one article in my series on using Symphony in my everyday work as a web developer and designer. Next, I'll detail my process on creating Symphony ensembles, such as the Bootstrap ensemble I just released.