Search

A new extension, "Packages" is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

Packages

What does this extension do?

When developing a website, you most of the time end up with doing the same stuff over and over again. After all, each client wants a news module, an image gallery, a contact form, a faq, etc.

This extension allows you to create a package of such a module (like a news module for example), save it as a ZIP-file with an installation script, and import it on another site to have the same logic there.

So how does this is any different of the Export Ensemble extension?

Simple: Where export ensemble creates an ensemble of a complete site, a package is a small part of a site you wish to re-use in other projects as well. It allows you to select sections, data-sources, events, utilities, pages, extensions and other resources (such as your own JavaScript- or CSS-files) to get packaged into one ZIP file, ready to be included in any other Symphony site of yours...

But wait! Doesn't that cause issues with mismatching ID's and stuff?

Nope! The installer script is not a SQL-script, but a PHP-script with various logic in it. For example:

  • When creating sections and fields, it keeps track of the ID's of the newly created items, so it works correctly in your database.
  • It uses some pretty clever regular expressions to change the datasource- and event-files to make sure any references to old section- and field-ID's are changed to their new ones.
  • It does some magic to the newly added pages so parenting is staid intact.

Sounds risky, are you sure it's fool-proof?

To be honest: I'm not entirely sure ;-). I did some tests with pages, sections, datasources, etc. and that worked pretty well. But if you want to help, please inform me with any bugs you might encounter with this one.

Wow, sounds awesome! You can be pretty sure I'll give this a try and report back.

Me likey! Looking forward to trying it out.

Very cool! The dream of modularity has become reality.

This sounds awesome Giel. I'll be sure to check it out.

Gorgeous...

Looks like a new Nick Dunn is in town :)

Pretty sure my boss would like to kiss you.

Great stuff.

I've found a bug on my first test:

I saved 4 pages. 2 of them are News and Events and each of this 2 pages has one child called Title.

News -> Title
Events -> Title

I looked inside the install script and 2 errors blinked on my screen on these lines:

$page_old_names[91] = 'events.xsl';
$page_old_parents[91] = ;

$page_old_names[90] = 'stiri.xsl';
$page_old_parents[90] = ;

I'll recreate the package to see why their values remain empty. These are the 'parent' pages. The child pages have their parent set-up fine.

$page_old_names[95] = 'events_title.xsl';
$page_old_parents[95] = 91;

$page_old_names[93] = 'news_title.xsl';
$page_old_parents[93] = 90;

EDIT in extension.driver.php on line 274 row['parent'] is empty. Checking it's integrity should do it:

274: if ( empty($row['parent']) ) { $row['parent'] = "'NULL'"; }
275: $install.='$page_old_parents['.$row['id'].'] = '.$row['parent'].";n";

EDIT2 It works fine with the fix.

After I created lots of packages, somehow it seems I broke them ... See attachment.

Does anyone have any idea why the archive breaks?

Solved

I restored the db from a back-up but the page.xsl file was missing from workspace/pages.

Attachments:
pck_error.PNG

i can't believe this just happened. i've been dreaming about something like this forever. once again, kudos! i'm looking forward to extensively testing and helping with this.

@vladG: Thanks for spotting this! fixed in this commit.

This looks very good, thanks!

@kanduvisla

Isn't there any support for page's types? I see that nothing is stored in the installer. I've lost the page types for all pages.

@vladG: aw, must have forgotten about that table. If you want you can adjust the extension to make sure page types are properly set in the installer?

I also fear that something goes wrong with the section_association-table, that's currently also ignored by the extension now. Not sure what this does or implies for the functionality of the extension.

Any help with this would be greatly appreciated.

If you want you can adjust the extension to make sure page types are properly set in the installer?

Ok, I'll play with it later in the afternoon.

@vladG: Thanks! That sure is some collaborative programming ;-)

This stuff is way to good not to use it and invest some time in it ;)

I also fear that something goes wrong with the section_association-table, that's currently also ignored by the extension now. Not sure what this does or implies for the functionality of the extension.

Well, data about Selectbox fields and other fields is stored in that table. I think it should be saved. I hope I'll make it happen.

giel, there must be a checking system for valid values.

For example, in section_associations table, if the section defined by parent_section_id has not been packed, I can't really save the data for the child section because it will be corrupted and useless (in section_associations_table). Somehow the user must be warned that the sections depend on each other and they must be saved together.

The same should be valid for child pages and parent pages.

The dependencies must be checked before any actual package is built.

What do you say?

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