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

Fix composer autoload #79

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

thomas-topway-it
Copy link

@thomas-topway-it thomas-topway-it commented Jan 8, 2024

Fixes #76

This file is part of the SemanticMetaTags extension, it is not a valid entry point

  • Moves extension autoload from composer.json to extension.json
  • Remove redundant semantic-media-wiki require to allow running composer in the extension folder

@codecov-commenter
Copy link

codecov-commenter commented Jan 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.28%. Comparing base (4f1cce3) to head (b9a38a1).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##             master      #79   +/-   ##
=========================================
  Coverage     97.28%   97.28%           
  Complexity       67       67           
=========================================
  Files             6        6           
  Lines           184      184           
=========================================
  Hits            179      179           
  Misses            5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -28,11 +28,9 @@
},
"require": {
"php": ">=7.1",
"composer/installers": "1.*,>=1.0.1",
"mediawiki/semantic-media-wiki": "~3.1|~4.0"
"composer/installers": "1.*,>=1.0.1"
Copy link
Member

Choose a reason for hiding this comment

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

@thomas-topway-it Out of curiosity: How does the extension know it requires SMW hard?

Copy link
Author

Choose a reason for hiding this comment

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

@kghbln hello Karsten, from SemanticMetaTags.php

   public static function onExtensionFunction() {

   	if ( !defined( 'SMW_VERSION' ) ) {

   		if ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' ) {
   			die( "\nThe 'Semantic Meta Tags' extension requires 'Semantic MediaWiki' to be installed and enabled.\n" );
   		} else {
   			die(
   				'<b>Error:</b> The <a href="https://www.semantic-mediawiki.org/wiki/Extension:Semantic_Meta_Tags">Semantic Meta Tags</a> ' .
   				'extension requires <a href="https://www.semantic-mediawiki.org/wiki/Semantic_MediaWiki">Semantic MediaWiki</a> to be ' .
   				'installed and enabled.<br>'
   			);
   		}
   	}

(if I understood correctly the question)

Copy link
Member

@kghbln kghbln Jan 29, 2024

Choose a reason for hiding this comment

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

Yeah, you did understand correctly. I was asking out of curiosity since other extensions still do it even both in https://github.com/SemanticMediaWiki/SemanticExtraSpecialProperties/blob/master/extension.json#L18 and https://github.com/SemanticMediaWiki/SemanticExtraSpecialProperties/blob/master/composer.json#L48 though that particular extension does no longer have a SemanticExtraSpecialProperties.php to be able to check this information.

Copy link
Author

Choose a reason for hiding this comment

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

the main reason I've removed it, it is for testing purposes to allow installing the required libraries (mainly easyRdf and json-ld, see here #80 ) in the extension's folder. Therefore once that #80 will be merged the SMW require in composer could be restored back. (if deemed necessary, for this actually we should check the strategy followed by all similar extensions dependent on SMW)

@kghbln
Copy link
Member

kghbln commented Mar 20, 2024

@thomas-topway-it Is this still a work in progress? If not, your changes should be reviewed and merged for a new release.

@thomas-topway-it
Copy link
Author

thomas-topway-it commented Mar 26, 2024

I'm sorry, I have to fix the tests before

@kghbln
Copy link
Member

kghbln commented Mar 26, 2024

No worries.

@thomas-topway-it
Copy link
Author

so now it should work. @kghbln and @gesinn-it-gea are you able to test/check it together with #80 ? once that the 2 PRs will be merged or verified, we could also restore the loading through composer, also if in my opinion is not necessary

@kghbln
Copy link
Member

kghbln commented Apr 6, 2024

I currently do not have the time to test.

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.

This file is part of the SemanticMetaTags extension, it is not a valid entry point.
3 participants