Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EZP-23441: IO url decorators configuration #1028

Closed

Conversation

bdunogier
Copy link
Member

Based on #1028
EZP-23441
Specifications

Makes it possible to set the prefix for IO uris at siteaccess level. Other siteacces level variables can be used in the configuration.

Absolute prefixes to other hosts are also possible, and will work with legacy data (as long as the file is available from this uri).

Changes

Settings

Most of the changes are about the ConfigResolver:

  • allow dynamic settings in semantic config (added for a specific setting)
  • allow complex dynamic settings as services arguments ($var_dir$/$storage_dir$).

Complex settings has been added as part of the CoreBundle. Dynamic settings in semantic config is only part of the IOBundle for now, as it is a bit rough around the edges (but should be possible to move it up to the CoreBundle with a bit of work).

url_decorator services

There are now two main url decorators: the default one, and a legacy one. The legacy one is used in the Legacy Converter, via an UrlRedecorator, to convert the system's uris to the format it requires.

Configuration example

ezpublish:
  system:
    default:
      io:
        url_prefix: "http://static.site.com/$var_dir$/$storage_dir$"

TODO

  • Add specs to PR
  • url or uri ?
  • Re-issue PR to master

@bdunogier bdunogier changed the title Ezp 23441 io url decoration EZP-23441: IO url decorators configuration Oct 10, 2014
@andrerom
Copy link
Contributor

Shouldn't spec be part of PR? Also seems phpspec is added but does not seem to be used.


private function isDynamicSetting( $string )
{
return ( preg_match( "^\$[a-z0-9_\.]+(?:;[a-z0-9_\.]+){0,2}\$$", $string ) );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using DynamicSettingParser ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must be removed. I use ComplexSettingParser, that extends DynamicSettingParser.

@lolautruche
Copy link
Contributor

+1, apart interfaces claims

Bertrand Dunogier added 9 commits October 13, 2014 16:27
Complex parameter in the io.url_prefix ezpublish setting will be
parsed and resolved to the real settings in each context it is set for.
Any complex setting must be added to scopes where one of its dependencies
(dynamic variables it uses) is declared in this scope, so that it can
get its own value written.
Will convert from public url, that use the default url decorator,
to what legacy expects to store (note: it leaves the /, while legacy
doesn't want it).
Bertrand Dunogier added 3 commits October 13, 2014 19:11
XML parsing from imageStorage has been moved to the LegacyStorage image gateway,
and the legacy url redecorator injected to this service.

No manual stripping/adding / to uris manually.
@@ -0,0 +1,46 @@
# IO URL decoration

> Added in 5.4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 2014.09 ?

@bdunogier
Copy link
Member Author

All current comments fixed, closing, and re-opening against master.

@bdunogier bdunogier closed this Oct 17, 2014
@bdunogier bdunogier mentioned this pull request Oct 17, 2014
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants