[07:18:08] bd808: <3 [16:02:53] Any suggestions of a "php framework" for doing some simple DB queries and such? [16:03:21] Basically wanting to make a simple "dynamic" webpage to query a ms sql database and display it as an info screen [16:03:56] I could write my own, not doing much complex with it... But might end up just copying the MW DB classes a bit ;) [16:05:34] I don't think I want to bother using the SAP SDK for it... [16:20:31] Reedy: most of the time PDO is really all you need. [16:21:35] The "slimapp" lib that I pulled out of Scholarships and Grants has a little wrapper around PDO that makes some things a bit less wordy -- https://github.com/wikimedia/wikimedia-slimapp/blob/master/src/Dao/AbstractDao.php [16:21:43] So at worst just write a simple/light wrapper around it? [16:21:59] Ah, that might be useful :) [16:22:45] an example usage is https://github.com/wikimedia/wikimedia-iegreview/blob/master/src/Dao/Proposals.php [20:24:53] bd808: (switching here because it's less noisy) [20:24:57] I'm looking at resources/src/mediawiki/mediawiki.storage.js [20:25:22] it is basically delegating all methods to mw.storage.localStorage and wrapping them in a try / catch [20:25:47] window.localStorage [20:25:49] yeah [20:26:08] we could refactor that slightly, by having the underlying storage medium be specified as an argument to a constructor [20:26:16] and then we might be able to do: [20:26:28] mw.storage = new Storage( window.localStorage ); [20:26:36] mw.storage.session = new Storage( window.sessionStorage ); [20:26:59] sounds javascripty [20:27:08] want me to submit a patch? [20:27:11] i have an idea of how to do it [20:27:14] should be easy [20:27:24] * bd808 just wants to kill this fucking evil permanent tracking token [20:27:33] me too :) [20:27:34] this will be quick [20:27:36] give me 20 mins? [20:27:45] sounds good to me [20:41:45] bd808: So I was poking pear mailing again a bit ago. I think we can lessen the amount of code we have to vendor in if we use pear-core-minimal instead of full on pear [20:42:06] (just getopt and exception in that case) [20:47:21] Should I update https://gerrit.wikimedia.org/r/#/c/231611/ ? [20:48:45] * Reedy has a go [20:49:15] We need to land my change too [20:50:02] https://gerrit.wikimedia.org/r/#/c/252386/ [20:50:07] https://pear.php.net/package/Console_Getopt [20:50:14] NET::ERR_CERT_COMMON_NAME_INVALID [20:50:15] :( [20:50:28] You can composer most actually instead of pear [20:50:37] yeah [20:50:43] that's what I was meaning [20:50:47] based on your comments :) [20:52:25] I got stuck on one package tho lemme find the issue I filed [20:53:14] https://packagist.org/packages/pear/mail_mime seems to be timing out [20:53:36] https://packagist.org/packages/pear/mail_mime [20:53:37] https://github.com/pear/Net_SMTP/issues/24 [20:53:40] Now it works [20:57:57] why is https://pear.php.net/package/Net_Socket completely broken? [20:59:04] https is hard? [20:59:51] lol [21:00:32] PEAR repository from https://pear.php.net could not be loaded. The "https://pear.php.net/channel.xml" file could not be downloaded: Peer certificate CN=`mail.cweiske.de' did not match expected CN=`pear.php.net' [21:02:11] .... [21:03:06] i uploaded the WIP patch [21:03:21] We can use them all from packagist if we use dev-master for the 2 pear ones :/ [21:08:34] All they need to do is tag the release on github, file an issue? [21:09:01] Bleh issues not open [21:10:23] :( [21:10:36] Stupid shit, really [21:10:51] Can we use a sha hash? [21:11:25] Maybe use the one that points to the branch we're wanting anyway? [21:12:08] Yeah, that's what I was wondering [21:12:54] https://github.com/pear/Net_Socket/branches [21:13:30] There's some ancient branches/"tags" [21:13:34] Yeah [21:14:04] Hmm [21:14:04] https://github.com/pear/Net_Socket/commits/master [21:14:14] so 2 commits after 1.0.14 are composery stuff [21:14:18] 1.0.14 dne? [21:14:56] :Prepare 1.0.14 release" [21:15:02] Yeah [21:15:11] tbh, based on those changes, we can just use HEAD for that repo [21:15:15] I see that, I was saying there doesn't seem to be a branch for it like there is on mail [21:15:21] Yeah, I know [21:15:29] pin it on the newest hash for now? [21:16:03] let's do it. [21:16:07] dev-master#HASHGOESHERE [21:16:11] Yep [21:16:53] Make sure to document the sha1s we choose in the commit message. [21:17:04] ja [21:19:06] yay, that's working :D [21:19:25] heh, I just heard "ori" on tv talking about the game [21:22:49] PS5 [21:22:53] * Reedy waits for jenkins [21:25:58] jenkins seems to say yes [21:28:11] I guess we need to remove php-mail(-mime(decode)?)? from the WMF servers? [21:28:39] and php-net-(smtp|socket) [21:28:52] The code I thought was already adjusted to not include() if it already was in the Autoloader. [21:29:14] Not sure [21:29:17] I'm just meaning for further cleanup [21:29:48] / Check if pear/mail_mime is already loaded (via composer) [21:29:48] if ( !class_exists( 'Mail_mime' ) ) { [21:29:48] require_once 'Mail/mime.php'; [21:29:48] } [21:30:06] yay [21:30:08] ii php-benchmark 1.2.7-5 Framework to benchmark PHP scripts or function calls [21:30:11] wtf is that? [21:30:40] heck if I know [21:30:48] seems phpunit depends on it [21:30:59] why is phpunit on tin? [21:31:02] * Reedy shrugs [21:31:44] for testing? [21:31:46] * ostriches ducks [21:32:09] * Reedy tests ostriches [21:35:41] [21:35:29] (PS1) Reedy: Remove pear php-mail related packages [puppet] - https://gerrit.wikimedia.org/r/256119 [22:40:00] Reedy: My change has to land before any others :p [22:40:06] Otherwise we'll blow up on Pear::isError() call [22:40:07] :) [22:40:11] heh [22:40:13] * Reedy looks [22:40:30] https://gerrit.wikimedia.org/r/#/c/252386/ [22:41:46] "This function is no longer deprecated, and will therefore no longer throw E_STRICT warnings." [22:41:48] haha, php [22:43:23] Wait waht [22:43:27] They undeprecated something? [22:44:04] lol, yup, is_a() was deprecated in 5.0 and undeprecated in 5.3 [22:45:27] Good thing we don't support 5.0-5.2 :p [22:45:53] I presume we're not using instanceof so we don't trigger the autoloader? [22:47:10] That was my thinking but tbh I'm probably wrong. [22:47:16] I second-guessed myself immediately. [22:47:57] Via https://www.reddit.com/r/lolphp/comments/1eieco/is_a_function_change_of_heart/ I got to http://glyphic.s3.amazonaws.com/ozone/mark/periodic/Periodic%20Table%20of%20the%20Operators%20A4%20300dpi.jpg which is awesome [22:48:32] Eh, you can do instanceof $string anyway, so it shouldn't matter. [22:49:15] Bug #55475 is_a() triggers autoloader [22:49:26] bahah [22:50:00] looks like it's fixed in 5.4 [22:51:23] I think is_a() is more future-proof anyway in case Pear errors change in the future. [22:51:30] Yeah [22:51:44] It's not like it's something new you're introduing [22:51:52] And we presumably are bumping to >=5.4 sometime soon ;) [22:55:22] Hmm, but triggering the autoloader isn't a good idea if we're not bundling pear and just pear-core-minimal. [22:55:36] Unless PEAR_Error is in Pear_Exception [22:55:56] lmao it's deprecated anyway [22:56:08] Awesome code is awesome [22:56:32] Let's see what Mail::factory() actually returns now [22:56:38] Watch it throw exceptions :p [22:57:35] PEAR::raiseError() [22:57:58] Dear lord Mail::factory() is disgusting. [22:58:05] https://github.com/pear/Mail/blob/master/Mail.php#L74 [23:00:01] Oh PEAR::isError() is included in pear-core-minimal. [23:00:08] So we're not actually saving much at all [23:01:35] Reedy: I hate pear. [23:02:19] Don't we all [23:05:05] So, the change is probably "fine" either way. It won't save much but avoiding autoloader in 5.4+ [23:05:07] Which ain't much. [23:05:13] (commented to the effect) [23:20:32] Mmm [23:29:03] " Dear lord Mail::factory() is disgusting." -- that is some seriously awesome PHP4 code [23:37:04] Is it full of PHP4 stuff literally because it isn't maintained? [23:37:58] MediaWiki is also full of PHP4 stuff. [23:38:15] I don't think there was ever a decision to migrate core PEAR classes to PHP5 for fear of breaking something somewhere in the universe [23:38:17] still tons of objects passed by reference. [23:38:23] true [23:39:13] lol [23:39:28] {{sofixit}} [23:39:58] siebrand has put up lots and lots of patches related to that over the years [23:40:17] the scarry ones are the patches that make every object member variable private [23:40:23] heh [23:40:48] * bd808 only kind of believes in encapsulation [23:42:20] Reedy: https://gerrit.wikimedia.org/r/#/c/254603/ needs a manual rebase apparently :/ [23:42:40] wonder if it's just jgit fail [23:42:50] likely [23:56:24] rebased