-
Notifications
You must be signed in to change notification settings - Fork 97
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
Single source revcheck code/data #174
Conversation
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.
@jimwins as you have been working on doc-web, mind keeping an eye on this?
Yes, I'm ready to take a look when it is past the draft stage, and move over the systems side of doc.php.net to stop running |
If switching over to |
I finished the rewriting of There are two cosmetic modifications that i would like to make, namely:
This won't change any data or structure, but will make the generated HTML differ, and so I may wait for |
Seems fine to me. What I'd like to see is a way to pass a list of languages to check to |
That would be a partial rewrite of require_once "path/to/doc-base/scripts/translation/lib/all.php";
foreach( $langs as $lang ) {
$revcheck = new RevcheckRun( $lang );
generateSql( $revcheck->revData );
} By the way, the database output appears to me to be overly complicated, using 8 tables (and some indexes) where is only really necessary 3 tables: After this alternative is installed, running and generating a simplified db, it would only be necessary to modify the SELECTs on HTML generating pages to use the new db/tables, with no joining necessary. For this last part I ask someone else to volunteer, before starting this alternative |
The script for generating the database should live in the |
So, instead of cross-repo code including, I can write an The proposed syntax would be: Invoked from a directory above $LANG checkouts, that is afaik the same convention of |
That sounds good. But the path to the SQLite database may be an absolute path, too. |
Pushed with a new script named Reviews and tests are welcome. Runs in about 28s on 14y old CPU and SSD for |
Haven't played around with the resulting database and might not have time to do today, but it looks like it works for me, at least. It would be preferable to specify languages as individual arguments instead of one argument that you explode on One thing I did notice is that the intros in the languages table are wrapped in the
|
Changed.
It does not affect rendering, but is certainly invalid HTML. Working with DOMDocumentFragment or detaching root-less XML is always awkward. Piecewise XML node saving is no prettier, but generates way less code. Fixed. |
I am now confident this PR produces identical results in most cases, and near identical in a few cases, comparing counts and listings of old and lib versions of revcheck. For example, And with other PRs in place (listed above), I think it's time to push for this. I plan to:
This new "lib revcheck" code is somewhat future proofed, in the sense that the modifications above only generate exchanged data, and no further changes in database or HTML generating would be necessary. |
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.
LGTM.
Merged. Further issues/PRs will consider this as baseline. Is necessary to comment/notify the PRs of system and web-doc, above? |
All handled now, new data is live on https://doc.php.net/. |
Yay! Let's celebrate. No more duplicated revcheck code in various
repositories.
I will treat myself with a good wine tonight.
|
I spoke to soon. The pt_BR translation is not shown, other are ok. See: https://doc.php.net/revcheck.php?lang=pt_br |
This PR is a work in progress to concentrate revcheck code and generation of revcheck data into a single place.
In
doc-base
(this PR):doc-base/scripts/revcheck.php
to use revcheck lib;doc-base/scripts/translations/genrevdb.php
. (proposed)In
web-doc
(other PRs)genrevdb.php
; (systens 54)web-doc/scripts/rev.php
. (ditto)This PR does not try to fix the issues reported on #133 or #132, for now. The priority is removing code duplication, and after that to possibly change revcheck semantics of
[skip-revcheck]
(and other possible issues)Reviews are welcome. Cosmetic changes delayed in favor of resolving issues found.