Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we introduced the use of Composer classmaps for autoloading in df6f5d0, we lost the ability to define custom spouts without dumping the autoloader. PSR-4 would fix this issue but at the time I came to conclusion we would have to change selfoss file structure to support it.
Since that assumption seems to be false, we are switching to PSR-4, thus having the cake and eating it too. The only caveat is the need for more strict file naming conventions.
Closes: #958
Upgrading
If you use any custom classes like spouts, make sure they follow PSR-4, namely the namespace should match the file path (even in letter case).
For example, if you have custom spout class named
PrivateSpout
inspouts\private
namespace, it will have to be located inspouts/private/PrivateSpout.php
.This also means each file can only contain a single class.
Upgrading (developers)
Once you checked for compliance, run
composer install
as described in the development section of README to switch to PSR-4 autoloader.