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

Book metadata support #3

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

Book metadata support #3

wants to merge 4 commits into from

Conversation

teran
Copy link
Owner

@teran teran commented Nov 24, 2018

No description provided.

@@ -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
Copy link
Owner Author

Choose a reason for hiding this comment

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

Book template?:)

Copy link

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
Copy link
Owner Author

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']);
}
}*/
Copy link
Owner Author

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.

Copy link

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

Copy link
Owner Author

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();
Copy link
Owner Author

Choose a reason for hiding this comment

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

Book::getInstance();

Copy link

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

Copy link
Owner Author

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

Copy link

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?

Copy link
Owner Author

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.

Copy link

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…

Copy link
Owner Author

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.

Copy link

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 :(

Copy link
Owner Author

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 ;)

Hooks.php Show resolved Hide resolved
@@ -38,6 +38,12 @@ public static function onBeforePageDisplay(OutputPage &$out, Skin &$skin) {
$event = Event::getInstance();
$event->render($out);
}

if($wgGoogleRichCardsAnnotateBooks) {
$book = Event::getInstance();
Copy link
Owner Author

Choose a reason for hiding this comment

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

Book::getInstance()

Copy link

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…

Book.php Show resolved Hide resolved
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",
Copy link
Owner Author

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

Copy link

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 :(

Copy link
Owner Author

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>
Copy link
Owner Author

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 :-)

Copy link

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?

Copy link
Owner Author

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>
Copy link

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",
Copy link

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 :(

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.

3 participants