« first day (2780 days earlier)      last day (2150 days later) » 

1:31 AM
@DaveRandom and still better than "I am legend".
 
Wes
i liked i am legend
 
1:50 AM
finished Torchwood, I'm running out of Doctor Who things to watch that I don't have to pay for
other than my prime sub
I guess I should start Sherlock
 
2:07 AM
@Tiffany Yes! Sherlock!
 
Wes
which one
 
@tereško LOL- I know that feeling. I quit doing tech work. It made me hate working on computers. Are you nice to your Mom or is there a lot of eye rolling? = P
The BBC Sherlock @Wes
Did they get your net back up?
 
Wes
yes, ish
sometimes it hangs but works for the most part
 
That’s good. You said you thought it might be Monday.
 
Wes
2:23 AM
yep, i was surprised
 
 
3 hours later…
5:13 AM
mornin
 
Wes
@kelunik i like how you made the amphp's site look :P
 
@Wes you live in Italy, right?
 
 
3 hours later…
8:43 AM
mornings
 
@Wes A singleton TV sounds terrible
If you have 2 TVs, and you switch channel in one, it gets changed everywhere
 
9:20 AM
A singleton tv should only have one single channel, so technically there is no channel switching.
 
9:50 AM
Hello!
 
hello
jacob
is there anyone who knows how to remove the php file extension without mod rewrite?
 
Have a look at this, Nerva: php.net/manual/en/security.hiding.php
2
 
Any of you using Mysql 8 yet? Building a new project, should I try with 8 or stay with stable 5.7?
 
Mornings
His fault @Wes?
 
10:15 AM
@Darius or you could instead try PostgreSQL
 
Never tried it, much of a learning curve?
I'll look it up and do a bit of learning.
 
According to the SRP, should a class that implements a SerializationStrategy be responsible for both serializing the data and persisting it, or should the Context (who calls the serialization instance) be the one who persists it?
 
10:39 AM
@hakre What makes you say that?
It'd be a global TV, so that all TVs in the house (universe?) would be the same TV
That doesn't mean it can only have one channel in its state.
@Darius When you already know MySQL? Nah
The more advanced features might take a bit of learning, but nothing too complicated
 
Seems uber moved back to mysql and others saying postgre falls apart after scaling due to lack of being able to find people that know what they're doing. (not that I know abouy scaling really...) Yeah mysql it is for me.
 
Okay you're right, w/ picture in picture it can have two channels.
but it has only one display.
so it remains: as it only has one display and all TVs share the same channel they display, there is only one channel.
a consumer of the display can not proof via empiricism that there is more than one channel. it could be the same channel that looks like as if it switched (that interactive tv channel that displays the channel-switching program).
It's also irrelevant for the user, as there is only one channel to display at a time. even if there would be multiple channels, there is only one of them displayed.
somehow it makes not much sense to have a composite as singleton.
maybe for a quick and dirty implementation upfront.
nah, even then not.
 
10:56 AM
@hakre No, there's only one display, but you can switch a channel, there can only ever be one channel displayed to all users at any one time, but assuming it's not an access limited method, all users can switch the channel for themselves and all other users
The singletonness of the TV has no bearing on the number of channels it has available to it.
If the Channel were to be a Singleton, I'd agree with you.
(PS. I love that we're having a serious discussion about this :D)
 
well how can a user proof that pressing the remote is not some interactivity on the current channel (that looks like switching a channel)?
:D
no other person on a different (of that singleton) TV can for example report she/he is having a different channel (which would be a proof that there is more than one channel).
 
@Darius yeah, and a lot of people called bullshit on that
I suspect it's more likely that they had made the project for mysql and then tried to fit a square peg in a round hole (while only having developers, who know mysql)
but sure, do what you want
 
@MadaraUchiha removed?
 
Nooooooooooo :(
Here's a replacement meme
 
11:06 AM
sad message, right? I find imgur is so not inclusive lately.
 
snort imgur, inclusive?
 
I just thought a replacement meme actually is a meme about replacement.
 
Have you been to imgur in the past few years?
 
just deleting images they don't like.
or somebody has a different opinion over copyright.
 
@Jimbo sftp......
 
12:04 PM
lateritious of the color of brick; brick-red.
 
12:32 PM
www.site.com/index.php/api/abc
www.site.com/api/abc
is it possible to ommit index.php like that?
 
@Nerva michaelshadle.com/2010/08/20/… if you're using nginx. The key phrase for that stuff is "front controller".
 
@Danack thank you very much!
 
 
1 hour later…
1:36 PM
how come FallbackResource prints the content of index?
if I do this /api/index ? instead of /api/index.php ?
 
 
1 hour later…
Wes
3:03 PM
@ircmaxell :D
 
@Wes Saying the truth.
 
Wes
3:29 PM
yep
 
4:07 PM
What is the jQuery method to get the file input and put it in a variable? Would val() work in this case too?! (e.g: var chFile = $('#fileInput').val();)
Oops It's working sorry for asking. Chrome Inspect helped to find the silly mistake.
 
4:22 PM
There are many different-looking guides on the internet about uploading images using Ajax(jQuery), would you point me to a reliable/up to date guide? For example, Here's one(formget.com/ajax-image-upload-php) but doesn't work for me, Chrome inspection detects this line (data: new FormData(this)) as an error(maybe it's deprecated, I have no idea...)
 
4:34 PM
@Wes who posted it?
 
Wes
@rightfold
do you have the talk link @ircmaxell ?
 
Wes
thanks
 
4:54 PM
There's no way to override conversion to Boolean, yet SimpleXMLElement does it – #76382
 
Guys, WordPress question (I know, I know)
 
moin
 
Say I want to develop a plugin for WordPress, and say that I want to make it modern and nice, and not terrible and WordPress-y. The plugin has dependencies on 3rd party open source libraries
Is there a way for me to provide them without packaging the whole thing into the plugin I upload the the WP plugin repo?
Can I leverage composer or some other similar thing, so that the plugin itself doesn't come with all the dependencies already bundled?
I'm asking because WordPress does support composer for plugins
Just no mention of it for dependencies
 
if it supports composer for plugins, that implies that the plugin would have it's own composer.json (?) and thus would work like any other dep
 
@DaveRandom Right but from what I read, it works one way but not the other
i.e. you upload the plugin to the WordPress repo, and the WordPress repo automagically publishes it as a composer package
 
4:59 PM
can you elaborate on that? and/or link to what you read?
 
No mention if it works the other way around
 
@MadaraUchiha oic
 
I can think of a couple of hacks that would definitely work regardless, but it seems like that thing should support deps for the things it exposes
 
@DaveRandom I think the interesting question is whether I can publish to wpackagist myself
 
5:02 PM
like it should be pretty trivial to just read the composer.json that I include in my plugin and determine the deps that way
 
Instead of it having mirrored the plugin from the plugin store
Doesn't look like it
 
@MadaraUchiha in many ways I don't see why you would need to do that anyway. The fact that it is a thing says that WP admins are modifying composer.json files and running composer install, either directly or via something it wp-admin, so presumably it will also look at regular packagist?
maybe
in any case, I assume it's possible to exec() stuff during a plugin install process?
if so, the "hacky" solution is to simply put a composer.json in a subdir and run composer install within that dir during installation, although that is hacky and dangerous and crappy in many, many ways
I feel like if it doesn't support deps inferred from some metadata in plugins in the store, that would be pretty trivial to add and could maybe be PR'd
I'm sure I would regret opening code to find out though...
 
@DaveRandom In fact, the composer thing seems to be the easy part
Composer seems to have full support for WordPress via github.com/composer/installers
It's the other way around that's problematic. If I want users to be able to install it from the WordPress store, I'd probably still need to somehow bundle the dependencies with the final "binary" I send to WordPress plugin repo.
 
@MadaraUchiha I think that sort of limitation is inherent when trying to support an old system that is arguably no longer fit for purpose - i.e. the store. Take solace in the fact that they seem to be attempting to migrate to something better :-P
I would hope that the logic for the wpackagist mirror is intelligent enough to ignore the vendor/ dir in the object in the store
 
Afternoon all!
 
5:15 PM
@MadaraUchiha why's avoiding that something worth worrying about?
 
May I ask you guys what technology combination you use with PHP for an asynchronous image upload? (Ajax+XML+jQuery)/(Ajax+XML+JS)/(Ajax+JSON+jQuery)/(Ajax+JSON+JS)/None of these :)
 
I used this fantastic technology called "delegation". It's really simple to use, you just find another dev and make it their problem.
10
 
@DaveRandom I wanted to put it among the options, but I didn't like anyone choose it ;D
 
to be completely honest, what I would probably do is find a jQuery plugin that has good examples and just make do with that, but then I am not a front-end-y person
 
@Danack Because how would I do it without adding those third party dependencies to my source code and/or using git submodules?
 
5:25 PM
@DaveRandom Merci
 
@Simon.B Browser support?
 
JQuery produces some beautifully, elegant tools and pages.
The few I use I love.
 
Actually, it doesn't really matter. Use fetch with a polyfill if you need older browsers.
 
@MadaraUchiha Support for older browsers is not needed.
 
Definitely fetch then
 
5:28 PM
@MadaraUchiha Reference/Guide/...? I don't even know what it is. Is that for JS?
 
@Simon.B It's the API which supersedes XMLHttpRequest in JavaScript
 
err no
 
You can find reference on MDN
!!mdn fetch
 
3 messages moved to Trash
 
I think it found the same result
 
5:28 PM
:(
 
I don't know how that lookup works, I didn't make it, I'm guessing it doesn't use google though
 
@MadaraUchiha :thumb-up:
 
I have never used that fetch API thing, is it good? I am so often disappointed by "modern" browser APIs
 
@DaveRandom It's nicer than XMLHttpRequest, for sure
It also natively supports FormData and Blob objects, which is nice.
soon(?) it should also support async iterators for reading the buffer for responses
 
where "async" == Promises/A+?
 
5:34 PM
@DaveRandom no, async iterators are pull streams
Think of a normal iterator (even in PHP), where the methods return Promise<V> instead of V (where V is the type of the value)
Think of a construct like this
 
foreach ($iterator as await $value)?
 
@DaveRandom Yes
 
cool
 
$fileIterator = new FileAsyncIterator('/path/to/file');
foreach ($fileIterator as await $chunk) {
  doStuffWith($chunk);
}
 
I really hope C# 8 gets something like that
 
5:36 PM
This is already a thing in Node
Specifically with files
Any read stream implements the async iterator interface now
Really nice stuff.
 
@MadaraUchiha for things like that, I would like to have a separate build repository that holds the built version of the library.
 
@Danack Which means it's up to you to synchronize the "nice" repo and "naughty" repo.
Which is doable, don't get me wrong, but just a bit meh
 
@MadaraUchiha travis ci has cron jobs now....
could be automated.
 
hmm, that actually sounds good
And add the legendary /* AUTO-GENERATED. DO NOT TOUCH */ comment at the top :D
 
@Danack eh, why not just have a build script? something like that should have a committed composer.lock anyway
 
5:39 PM
@MadaraUchiha you ought to check it's needed though - as I've not heard of people needing to do that.
@DaveRandom makes it harder for wordpress to manage the installed plugins.
 
@Danack 100% of the people I've met that worked with WordPress complained how miserable their lives were and how they had to deal with FTP and code-in-database and stuff
And I had to remind them that all of that is preventable.
I think that WordPress suffers from the broken window fallacy
"Everything is shit, so I'll perpetuate the shit because I didn't think there could be another way"
 
@MadaraUchiha yes, yes, the people who use Wordpress keep throwing themselves through windows and breaking them.
 
Or rather, WordPress devs suffer from it
@Danack :D
Reminds me of a question in another chat
> Any Drupal experts here?
No, I believe they all hanged themselves somewhere around 2011
 
> In accordance with section 3.1 of [RFC6839], the syntax and semantics of fragment identifiers specified for any +json media type SHOULD be as specified for "application/json". (At publication of this document, there is no fragment identification syntax defined for "application/json".)
 
6:30 PM
php -r '$a = 1; $g = array_map(function($x) { return $x; }, $GLOBALS); var_dump($g["a"]); $a = 2; var_dump($g["a"]);'
ehm wtf?
int(1)
int(2)
is this retaining the indirects through the mapping op or what
differs between PHP 5.6 and PHP 7...
 
6:55 PM
bob$ ~/php-src-X/sapi/cli/php -r '$a = 1; array_map(function($x) { var_dump(gettype($x));  return $x; }, $GLOBALS);'
string(5) "array"
string(5) "array"
string(5) "array"
string(5) "array"
string(5) "array"
string(7) "integer"
string(5) "array"
string(5) "array"
string(12) "unknown type"
definitely buggy, returning unknown type :-D
 
7:16 PM
evening bob
the way inspector works is incompatible with opcache
 
can't tell without seeing code
 
I think the only way to do this is implement the executor loop ...
it's all online ...
 
ah it now is, then I'll give it a look tomorrow morning
 
I was under the impression that opcache copied opcodes out of shm, it does not, so we cannot change them ...
well ... that is to say we can't change the opcodes that opcache produces ...
we could overwrite the opcodes it has produced (optimized/cached) with a locally allocated copy that we can change ...
 
@JoeWatkins uh, isn't xdebug also using user opcodes?
 
7:22 PM
but I'm unsure what kind of effect this will have on performance ...
it uses extended opcodes for profiling
 
@JoeWatkins we can easily change it just in time, when needed
 
no we can't, not the code in shared memory ...
 
nah, I meant change to a locally allocated copy
 
what do you mean by just-in-time ?
 
@JoeWatkins at the point where we set a breakpoint on an op_array, then do the copy
 
7:24 PM
yeah that's what I just suggested :)
2 mins ago, by Joe Watkins
we could overwrite the opcodes it has produced (optimized/cached) with a locally allocated copy that we can change ...
 
:-)
uhm
 
nah, should be fine, as long as the very few points into the opcode arrays are updated too (e.g. EG(opline_before_exception), EG(opline))
 
copying opcodes is not so cheap ...
 
@JoeWatkins what's the problem?
 
7:26 PM
undo pass two, math, redo pass two, mallocs, hashtable updates ...
can we think of no other way ?
 
@JoeWatkins why do we have to undo pass two?
it doesn't use pointers, just relative offsets instead of absolute offsets
 
you have to undo pass two and redo it because of jump targets, constants ...
 
@JoeWatkins jump targets is not using pointers
 
they are
 
nope
 
7:33 PM
!!lxr ZEND_PASS_TWO_UPDATE_JMP_TARGET
 
[ /Zend/zend_compile.h#581 ] `# define ZEND_PASS_TWO_UPDATE_JMP_TARGET(op_array, opline, node) do { `
 
ah
 
yep :)
 
it has two defs
#if ZEND_USE_ABS_JMP_ADDR
 
yeah
 
7:33 PM
was looking at the #else block it seems
nobody wants to support 32 bit!
 
same deal for constants ... ZEND_USE_ABS_CONST_ADDR
 
not sure about the timings with opcache, but couldn't you use zend_extension's op_array_handler_func_t to manipulate it?
 
@pmmaga we want runtime manpulation
 
zend_extensions are a bit of a mess, there's no way to even depend on another zend extension, no way for a module to depend on a zend_extension ... I avoid them mostly ...
 
aha.. i see :)
 
7:37 PM
@JoeWatkins yeah, I don't think there's a real way around copying the op_arrays
it'll be some code to write, though you can simply copy it from opcache here ;-)
 
I've written it ten times over for a bunch of stuff ...
crappy
although copying is much faster :D
 
Wes
8:04 PM
so they tried to form a brexit kind of government today in italy, and our president of the republic (which is not the first minister, works kinda like the supreme court in the usa) was like "you wish" and shut down the whole thing, months of "work"... in like 30 seconds. my new hero
 
you have a president?
tbf all I know about Italy is Berlusconi
and I live like 2h away by car from Italy
maybe 3
 
@Wes Sounds like a lack of separation of powers.
 
Wes
president of the republic is not the first minister... he is an old dude that checks that the kids are playing fair
 
Good in this instance but if it was the other way around what...?
AH- my mistake then.
I skimmed over that part.
 
@bwoebi what about file support, we can't replace the main script just in time ?
 
8:30 PM
@JoeWatkins what do you mean?
 
 
2 hours later…
10:34 PM
posted on May 27, 2018

New Cyanide and Happiness Comic

 
Wes
10:44 PM
@kelunik for the daas thingy. if i am referencing a third party symbol and i have not defined a remote documentation url, what should it do?
 
@Wes Don't link it.
 
Wes
i could create the documentation for it, if it's in vendor
documentation that is not linked anywhere else except from where the symbol is referenced
 
You need to be careful with importing documentation from other packages due to their different license.
 
Wes
hm
 
array_map on $GLOBALS returns IS_INDIRECT – #76383
 
10:57 PM
bob$ ~/php-src-X/sapi/cli/php -r '$a = 0; var_dump(array_product($GLOBALS));'
Assertion failed: (0), function convert_to_double, file /Users/Bob/php-src-X/Zend/zend_operators.c, line 439.
Abort trap: 6
passing $GLOBALS into inappropriate contexts is fun
 
11:09 PM
Actually, indirect values are quite nice, they allow manipulating values without an explicit reference
 
I can't seem to find any decent instructions on how to use PHPUnit to test classes that rely on a dependency injector such as Aruyn? Or is this not how tests are done?
 
bob$ ~/php-src-X/sapi/cli/php -r '${0} = 1; var_dump($GLOBALS[0]);'
NULL
meh
obviously in the variables table it's all strings :-D
unless, obviously, you are getting the values ...
~/php-src-X/sapi/cli/php -r '$tmp = 1; var_dump(end(array_chunk($GLOBALS, 1))[0]);'
UNKNOWN:0
 
11:29 PM
@NikiC meh, that's so broken, these IS_INDIRECTs and will require checks at many places... do we really need to add them all? :-/
another fun one is array_chunk on $GLOBALS, as we have assumptions that arrays with indirects must not be packed
@Ocramius Did you ever wish to have a blackbox variable, which you cannot read from, write to or output directly, can be passed around, is not type-checkable and is not a reference or an object
 
11:55 PM
// guess the code preceding the following code snippet :-D
unset($spooky);
$spooky = $magic; // note, it's not a reference ;-)
var_dump(current([$spooky])); // int(1)
$x = ["a" => $magic];
$x["a"] = 2;
var_dump(current([$spooky])); // int(2)
 

« first day (2780 days earlier)      last day (2150 days later) »