-
Notifications
You must be signed in to change notification settings - Fork 4
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
Book metadata support #3
base: master
Are you sure you want to change the base?
Conversation
@@ -78,3 +96,23 @@ Please note, you're free to update this template in order to setup events publis | |||
|validFrom=2018-06-01T10:00+03:00 | |||
}} | |||
``` | |||
|
|||
### Usage of Event template |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Book template?:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a detail, I'll correct when all will be ok :) I might have other things to add in ;)
### Template:Book | ||
``` | ||
|
||
### Usage of book template |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this gonna be out of triple ticks
Hooks.php
Outdated
$book = Event::getInstance(); | ||
$parser->setHook('book', [$book, 'parse']); | ||
} | ||
}*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This normally should be uncommented. The the same function using Event class(above) must not exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uncomment this lead to crash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should work properly after fixing other issues.
global $wgGoogleRichCardsAnnotateBooks; | ||
|
||
if($wgGoogleRichCardsAnnotateBooks) { | ||
$book = Event::getInstance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Book::getInstance();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure of getting it: if I use
$book = Book::getInstance();
it crashes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out logs of your HTTP server, the reason should be there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out logs of your HTTP server, the reason should be there
Where in the log?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@giby probably right after HTTP request to mediawiki pages it should appear in error log(usually HTTP servers, both of nginx and apache/httpd writes two log files: access.log and error.log). Your error/exception traceback should be there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So my hosting provider proposes me
2018-11 : web - ftp - error - out
I cheacked "web" and "error" and nothing related to mediawiki…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@giby probably your provider doesn't have logs verbose enough for that, give me some time to check it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made crach my wiki, and get a 504 error :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@giby So simply restore the extension :) I hope you used it right from git, so you could easily switch between exact commits.
Btw, for development I would like to suggest you to use Docker, which will bring you fast local development workflow no matter if you are using macOS or Windows. To deploy wiki+database for development it will take about 1 minute with that workflow.
PS. Development right on running project(i.e. production) is not such a good idea ;)
@@ -38,6 +38,12 @@ public static function onBeforePageDisplay(OutputPage &$out, Skin &$skin) { | |||
$event = Event::getInstance(); | |||
$event->render($out); | |||
} | |||
|
|||
if($wgGoogleRichCardsAnnotateBooks) { | |||
$book = Event::getInstance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Book::getInstance()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least it does not lead to a crash, but then, i obtain a event instead of a book…
extension.json
Outdated
@@ -16,6 +16,7 @@ | |||
"MediaWiki\\Extension\\GoogleRichCards\\Hooks": "Hooks.php", | |||
"MediaWiki\\Extension\\GoogleRichCards\\Article": "Article.php", | |||
"MediaWiki\\Extension\\GoogleRichCards\\Event": "Event.php", | |||
"MediaWiki\\Extension\\GoogleRichCards\\Book": "Book.php", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep code style while adding something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see the difference with mine :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably about ident characters to use by your text editor. Please set it up according to the way file is formatted.
Book.php
Outdated
* | ||
* @category Extension | ||
* @package GoogleRichCards | ||
* @author Igor Shishkin <me@teran.ru> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File author should be here :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already what is there, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you created the file so you're the author :)
Book.php
Outdated
* | ||
* @category Extension | ||
* @package GoogleRichCards | ||
* @author Igor Shishkin <me@teran.ru> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already what is there, no?
extension.json
Outdated
@@ -16,6 +16,7 @@ | |||
"MediaWiki\\Extension\\GoogleRichCards\\Hooks": "Hooks.php", | |||
"MediaWiki\\Extension\\GoogleRichCards\\Article": "Article.php", | |||
"MediaWiki\\Extension\\GoogleRichCards\\Event": "Event.php", | |||
"MediaWiki\\Extension\\GoogleRichCards\\Book": "Book.php", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see the difference with mine :(
No description provided.