New file link type: scope

2019-10-11

This is a blog post aimed at developers.

Here is a scenario that keeps coming up. You install a package and want to tweak its code. If you do, you won’t be able to receive updates, but you don’t care. You are just experimenting something. You work on a throwaway project. You want to get shit done, now.

I’ve been there myself and have heard the question repeatedly on how to do this. The answer is to copy all the files from the package volume to your website and there you will be able to edit it. Except the package will have its own dependencies which will break, so make sure to copy those as well. Typically, it means you have to copy all files from /sys/packages/* within the package to the same place within your website. (And let’s hope you will have no conflicts among dependencies.)

It’s not too complicated but it is not a clean solution either. We can do better.

Boomla has landed a new file link type scope. Simply rewrite the package link to scope, save it, and baaam, the subtree is now editable.

The scope link is pretty much like a volume link except it establishes a new filesystem scope.

 

Example

Let’s say you installed the package gallery.boomla.net on the website example.com. It would be installed at:

//example.com/sys/packages/gallery.boomla.net

Now, the gallery package has its own installed packages, for example skyconfig.boomla.net:

//example.com/sys/packages/gallery.boomla.net/sys/packages/skyconfig.boomla.net

It provides several a configuration related apps, like skyconfig.boomla.net/attrStr. If the gallery package uses that as a file type, it will resolve to:

//example.com/sys/packages/gallery.boomla.net/sys/packages/skyconfig.boomla.net/attrStr

Note that skyconfig.boomla.net/attrStr is automatically searched for within /sys/packages within the current filesystem scope, that is, within:

//example.com/sys/packages/gallery.boomla.net/sys/packages

and not within:

//example.com/sys/packages

Turning the package link into a scope link will not change how paths are resolved within the mounted subtree.

This may also come handy for testing.


Cheers,

you can follow me on Twitter