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

Feature/resource channel #18

Merged
merged 34 commits into from
Apr 18, 2024
Merged

Feature/resource channel #18

merged 34 commits into from
Apr 18, 2024

Conversation

sitepark-veltrup
Copy link
Member

@sitepark-veltrup sitepark-veltrup commented Apr 8, 2024

A resource channel is a closed area in which the IES publishes its pages. This can be a live or preview area, for example.
The ResourceChannel is required to be able to read publication area-specific values. This can be the anchor of the publication area, for example.

Multi-language support is also included in this pull request.

src/Loader/CachedResourceLoader.php Outdated Show resolved Hide resolved
src/Loader/SiteKitLoader.php Outdated Show resolved Hide resolved
src/ResourceChannel.php Outdated Show resolved Hide resolved
src/ResourceChannel.php Show resolved Hide resolved
src/Loader/SiteKitLoader.php Outdated Show resolved Hide resolved
src/Loader/SiteKitLoader.php Outdated Show resolved Hide resolved
src/ResourceHierarchyWalker.php Outdated Show resolved Hide resolved
Copy link
Member

@sitepark-schaeper sitepark-schaeper left a comment

Choose a reason for hiding this comment

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

the lang, language and locale namings are very confusing to me. is it, that a lang/language is just "de" or "en" and a locale would be "de_DE"/"en_US"? or can they also include an encoding lik "en_EN.UTF-8"?
either way, I believe this should be cleaned up and made clear, as currently everything is just a string (some of which even default to '').

I've seen a couple of occurences of using "/" in paths - did you consider using DIRECTORY_SEPARATOR? I don't really know which one is better - This will probably never be executed on windows and even if, for file paths "/" should work too. Is there a specific reason you chose to do it this way?

src/ResourceLoader.php Outdated Show resolved Hide resolved
src/ResourceChannel.php Outdated Show resolved Hide resolved
src/ResourceChannel.php Outdated Show resolved Hide resolved
src/Loader/SiteKitLoader.php Outdated Show resolved Hide resolved
src/Loader/SiteKitLoader.php Outdated Show resolved Hide resolved
src/Loader/ServerVarResourceBaseLocator.php Outdated Show resolved Hide resolved
src/SiteKitResourceChannelFactory.php Outdated Show resolved Hide resolved
src/SiteKitResourceChannelFactory.php Outdated Show resolved Hide resolved
src/SiteKitResourceChannelFactory.php Outdated Show resolved Hide resolved
Copy link
Member

@sitepark-schaeper sitepark-schaeper left a comment

Choose a reason for hiding this comment

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

necessary comment to be able to submit the code review

@sitepark-veltrup
Copy link
Member Author

sitepark-veltrup commented Apr 18, 2024

  • I have now introduced a ResourceLanguage and ResourceLocation class
  • ResourceChannel now contains $resourceDir and $baseDir and is passed directly to the SiteKitLoader
  • The ResourceBaseLocator is no longer needed and has been removed.
  • I took the opportunity to smooth out the Resource class and removed the getter methods
  • The init values from the Resource are now placed directly in DataBag and no longer below init. $resource->data->getString('init.anchor') was not so good.

Copy link
Member

@sitepark-schaeper sitepark-schaeper left a comment

Choose a reason for hiding this comment

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

Good stuff!

src/Loader/SiteKitResourceHierarchyLoader.php Outdated Show resolved Hide resolved
src/ResourceHierarchyWalker.php Outdated Show resolved Hide resolved
@sitepark-veltrup sitepark-veltrup merged commit c89df86 into main Apr 18, 2024
2 checks passed
@sitepark-veltrup sitepark-veltrup deleted the feature/resource-channel branch April 18, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants