[00:00:36] It looks like what I'm trying to achieve might be impossible. [00:00:58] Because it requires me to do plain HTML, and it doesn't seem like I can do it from a parser hook. [00:01:06] Because the WebGL needs a canvas. [00:02:12] https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Getting_started_with_WebGL [00:26:06] https://hastebin.com/ucanacozod.xml so far.... [00:47:49] metalhead33: tag extensions let you emit raw HTML [00:48:23] nice [00:48:32] Including javascript? [00:48:48] it's recommended to make use of ResourceLoader modules if you need to add css or js to a page [00:48:57] Anyway, I have another question: can I programmatically parse a whole article (plaintext) in PHP? Or at least its url? [00:49:00] your extension could set whether or not the module is loaded on any given page [00:49:20] Because I need to parse the shader from a named article. [00:49:42] You can get the content of an arbitary page if you want [00:49:45] I am already using wfFindFile to find the files. [00:49:45] And optionally parse it [00:49:51] Okay, but how? And in PHP? [00:50:00] I need the name of the function. [00:50:02] Considering MediaWiki is written in PHP.. Yes in PHP [00:50:17] What is the function called? [00:50:43] Because I already found wfFindFile, but nothing similar for parsing a whole article. [00:50:56] You'd want a WikiPage instance (probably), and then getContent() [00:51:17] Global functions are mostly utility functions for ease [00:51:42] WikiPage::factory( $pageTitle ) ? [00:53:12] it takes a Title object [00:53:21] Wut? Not a string? [00:53:30] no [00:53:34] ugh.... [00:53:39] I need something that takes a title string. [00:53:42] Title::newFromText( $pageNameAsString ) [00:53:47] thanks [00:53:49] then pass that into WikiPage [00:56:38] https://hastebin.com/xefiwowice.php like this? [00:57:23] that is invalid PHP [00:57:27] -> is used for member access, not . [00:57:41] oh right, sorry. [00:58:18] for a real extension you'd likely want to verify if Title::newFromText returns null or not (to indicate an invalid title) or if the page actually exists before trying to pull its content [00:58:44] and your $output construction is vulnerable to XSS, never pass user input directly into HTML [00:59:08] mediawiki has helper classes to construct HTML tags with proper escaping of user input [00:59:09] To be fair, I'm not even sure if my output construction is even valid to begin with [00:59:38] And I'm not even sure how will I invoke the WebGL Javascript thingie. [00:59:49] I believe it's the Xml::* family of functions, but been a while since I've checked so that might've been deprecated and replaced with something else [00:59:59] Am I forced to write Javascript into module files, or can I just embed it into the PHP file? [01:00:20] You know, with ? [01:08:34] There is addJsConfigVars on OutputPage [01:08:37] Which you can pass stuff [01:08:58] Nice [01:13:38] Wait.... I intend to have multiple canvases per article though. Is that wise that way? [01:19:06] If I know that I will be calling the same parser hook multiple times, and it hooks into some Javascript stuff (because WebGL).... [01:31:52] Well anyway, time for me to sleep, gonna come back tomorrow morning. [11:03:53] Thanks you for the uptime. [11:59:40] hello. trying to recover my mediawiki from an imaged drive (no proper mediawiki backup as mentioned in: https://www.mediawiki.org/wiki/Manual:Backing_up_a_wiki) I basically installed everything from scratch and moved data from the image. i get this: https://controlc.com/d5b91624 [12:00:07] by moved i mean copy&paste [12:25:33] require_once: what's the issue? [12:26:03] require_once: did you run the migration script? [12:26:29] do you have the same version of mediawiki as was installed in the backup? [12:30:29] hello. no. I'm not aware of a migration script. I had mediawiki 1.27.4 on ubuntu 18.04lts. storage medium on which ubuntu was installed began to fail, so i had to image the whole drive asap. I did not have an opportunity to do a proper backup as mentioned on mediawiki. new installation features the same os - ubuntu 18.04lts and i have installed mariadb, php, apache2, mediawiki 1.27.4 (same version). [12:31:55] so you have a backup of the database? [12:33:23] I still have acces to an old LocalSettings.php, apache2.conf, mediawiki.conf, mediawiki folder from (/var/www/html/mediawiki) and mediawiki mysql database folder (/var/lib/mysql/*) but it's not a backup, just a folder. [12:34:14] /var/lib/mysql/mediawiki is still in place, i'm not sure about it's integrity. [12:38:15] I have "replicated" entire setup: created identical database, created same user, used same passwords, made sure i'm on the same network. and then i just replaced newly created folders with old ones, hoping that my entire setup will pick it up as it is. I could follow backup instructions if my image was intact, but checksum for my image is incorrect, so i cannot write my image to a drive, so all i have is plain access to old files. [17:15:13] Hi all, I'm new to mediawiki and I want to lern it. For example I want to know how a button works, where to find the method which gets triggert when it gets pushed. For example the "Go" button on https://www.mediawiki.org/wiki/Special:AllPages/Extension: How do I find the method/function? [17:18:02] hhd: /includes/specials/SpecialAllpages.php probably [17:26:24] Skizzerz do you have to know this structure how mediawiki works or can you search for it? Like I said I'm new to it and want to lern it how it works. Would you recommend starting with the "Code docs" or something else? [17:31:27] I don't know a good way to answer that. You can try starting there and see if that works for you. I personally started by looking at some of the more simple extensions and seeing how they did things, and expanded what I knew from there [17:31:55] but that was many years ago, and the code has changed significantly since then. I'm not in a good spot to give advice to someone new on how to get started [17:33:00] https://www.mediawiki.org/wiki/How_to_become_a_MediaWiki_hacker has some helpful links in it [17:34:04] hhd: The best way to get into code is to use ?uselang=qqx to find the message key, and then grep the code looking for where it's used. [17:35:23] hhd: So https://www.mediawiki.org/wiki/Special:AllPages/Extension?uselang=qqx shows that the key for the "Go" button is "allpagessubmit", which leads you to https://github.com/wikimedia/mediawiki/blob/dce7e7c38413415d2f4069c2508073d7dc872e1c/includes/specials/SpecialAllPages.php#L150 [17:35:55] Obviously, this only works for front-end code that uses interface text, but that's common for a lot of the interesting bits. [17:37:26] Skizzerz well, starting with simple extensions is a great idea. I found https://www.mediawiki.org/wiki/Extension:BoilerPlate, will look into that or you know a simpler one? [17:37:42] James_F thank you, let me check that [17:37:50] I'd suggest a real extension [17:39:39] Skizzerz ok, I will try find a simple one [17:40:23] if you're interested in how special pages work, look at one that creates a special page, such as https://www.mediawiki.org/wiki/Extension:CiteThisPage [17:41:03] built-in special pages generally follow many of the same methodologies, and are found in the /includes/specials directory of the mediawiki codebase [17:41:11] James_F sorry right know I don't get it how it works with ?uselang=qqx [17:41:22] Skizzerz great, thank you [17:41:42] need to bring my kid to sleep, brb 15min [17:59:05] Regarding my texture-supporting 3D extension thing: is including Three.js an overkill? [17:59:16] I mean, Three.js is kinda huge, an 1.5 MiB library. [18:14:31] metalhead33: It depends on your use cases for the extension. E.g. if it's mostly intended for use in a kiosk inside a museum or other controlled environment, it doesn't need to matter much. [18:22:09] I want to have multiple canvases, and support for textures. And it seems like I'm the only person on this planet, who ever considered bringing 3D to MediaWiki with texture support. [18:24:56] When discussing the 3D extension, we rejected it for Wikimedia due to the security scanning issues. [18:25:20] (Before we got to technology selection; not sure if Three.js is the best out there for that.) [18:31:19] I looked at both 3D and 3DAlloy [18:31:26] and both lack texture support [18:37:55] * James_F nods. [18:52:00] Skizzerz and James_F thank you guys. You helped me to get started. If you have more useful tips or links, I would be thankful :) [18:58:12] Mostly, just try things out. Start small. MW is insanely huge, don't try to learn it all, no-one does. [19:03:23] ok :) [19:04:38] thank you again guys and good night [19:09:39] And I have decided that I hate Javasscript. Or rather, the way the developers of those two extensions used it. [19:09:56] Because my way of coding is to have a hierarchy of abstraction. Lots of small functions calling other functions. [19:10:05] like say, createTexture, createShader, createMesh, etc. [19:26:32] So yeah, now all I need is a way to create a canvas within PHP, and tell PHP to use that canvas, and those specific arguments for texture, mesh, shader, etc.