Search

Hallo, pretty dumb question, how does Symphony work?
This question does not want to involve details, just the principles.

My understanding so far:

  • php converts mysql data to xml through native functions, on datasource basis, then it is mixed with xsl templates, and thus output code is created.
  • The xml feed which we see through debug is only visible in debug mode, not accessible from the frontend.
  • Plugins interfere with the normal workflow of saving/reading data through delegates and API functions.

This is what I got so far.

Thanks!

In short (as I see what symphony is)

  • a set of php scripts (don't worry about it)
  • that outputs your desired data from a mysql database (still don't worry)
  • in xml format that you can transform through xslt templates (there is the excitement)
  • you can influence the output before the xml through php (events) (for the pro's ;-))

It is like cooking, get the right ingrediënts (symphony serves it for you) and make a delicious meal (we do the templating) of it :-)

php converts mysql data to xml through native functions, on datasource basis, then it is mixed with xsl templates, and thus output code is created.

I can probably help clarify a little more on this as we don't actually use any native functions to do this. It's actually quite eye opening to know how it works and it may shed some light as to why some things in Symphony are more difficult than they are in other systems. This will potentially link to your other thread too, but let us consider a section with 3 fields as an example.

To create an entry for this section, each field has a related database table (sym_entries_data_*) so when the POST request is received by PHP, Symphony doesn't know how to convert that data into something that the database can understand. But what does? The field! Each field is responsible for creating it's own database structure when it's extension is installed (for core fields, this happens during /install).

Each field is a mini brain in Symphony, it knows how to take a raw value from your form and transform it into something the database can store, it knows how to take the data out of the database and repurpose it so it can be shown on the Publish index, on the edit entry screen, as a datasource parameter or as XML. It also is the only thing that knows how to build queries to filter or sort the data.

So back to that POST request as you create a new entry... what Symphony will do is save a parent record for the entry, this will give it an ID. It then iterates through all the fields on the section and asks "hey can you save this?", and when you do, use this Entry ID

For a datasource, it's a little bit different but much the same. Symphony asks each field to build the SQL that's relevant to it (remember, Symphony doesn't know what each of the field's table structure is!), and then executes a query that returns all the entries that match. Each field is then responsible for transforming it's raw data into XML (as XMLElement). All of this information is appended to a base XML document and then returned to the ?debug page.

I've simplified some parts, but hopefully it sheds some light on things :)

Nice explanation @brendo, thanks

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details