« first day (2238 days earlier)      last day (2716 days later) » 

12:00 PM
If anything, go there as a contractor. They take literally anyone who can throw buzzwords around, even if they don't know OOP
 
Aye the guy I know started with PHP and now basically does Node...
 
@Leigh 7.0 I suppose (look at zend_compile_func_strlen)
 
Is his name Patrick by any chance Jimbo?
 
Nope
 
12:15 PM
@bwoebi hmmm wouldn't it be better to do things like this during an AST pass? If it was reduced to ZEND_AST_CONST then things like strlen(CONST_A) + strlen(CONST_B) + 1 could be fully reduced.
 
@Leigh why? when we compile + we can reduce it to a constant znode when all ops are constant too
 
Anonymous
@Leigh I'll give it a miss ;) thanks though
 
Do we do it at the opcode level too? Ok... that sounds more complicated though. Also if it was done in an AST pass you could have constant expressions where functions aren't normally allowed.
class Test {
    const HEADER_VAL_A = 'stuff';
    const HEADER_VAL_B = 'more stuff';
    const HEADER_LEN = strlen(HEADER_VAL_A) + strlen(HEADER_VAL_B);
}
 
I think opcache predates AST in PHP, that is probably the reason why there's optimizations mostly on opcode level
 
@nikita2206 In opcache, yes.
@Leigh We're doing it on the intermediate znode representation in compiler
 
12:30 PM
Yea I see how it's being done now I read through more, checking the result of zend_compile_expr
 
Hello folks
hello leigh
bwoebi, would you kill me if i asked a question unrelated to php ?
 
Anyone know if this is possible? ShibRequestSetting requireSession %{ENV:somevar}
 
Anonymous
@bassxzero ooo shibboleth, what a gem that is
 
@JayIsTooCommon i've been debuging my htaccess file for 2 days straight... i hate my life
 
Anonymous
@bassxzero what's the issue?
 
12:39 PM
@JayIsTooCommon long or short version?
 
Anonymous
go wild, long
 
@Joseph people do it all the time, I don't think any of them have been actually killed
 
Per the spec HTTP protocol seamlessly follows redirects. This is a problem when the user's session timesout because I'm using JQuery to create Ajax request.
 
i don't want to be hated by every one in here
XD
 
@Joseph no worry, it's hard to compete with @PeeHaa
although secretly we all love our little rascal
 
Anonymous
12:42 PM
@bassxzero What behaviour are you experiencing? You can't authenticate, no redirect, no request data etc. ?
 
When the Ajax request tries to follow the redirect I get blocked by the browser due to cross domain issues
 
Anonymous
So the URL your requesting though AJAX requires shib auth?
 
And the Jquery/Ajax handlers I set for the Ajax request don't return error messages that I can use to figure out if the session timedout
@JayIsTooCommon yes "the URL your requesting though AJAX requires shib auth"
 
@Gordon , @Leigh this then codepen.io/jey/pen/jmClJ , lines 221 and 222 in the js are causing my mouse to twitch on hover and giving me these two errors
 
@Joseph I hate you
 
12:44 PM
Error in parsing value for ‘top’.  Declaration dropped.
Error in parsing value for ‘left’.  Declaration dropped.
 
Anonymous
@Joseph you're the worst
 
Anonymous
@bassxzero And you don't want it to require auth or you do?
 
oh :(
 
@JayIsTooCommon So I've been trying to update my htaccess file to detect the case where "header X-Requested-With" is set, and the user doesn't have a shibboleth session, so It can prevent the redirect and just return a 403
 
i knew i shouldn't have
 
Anonymous
12:46 PM
@bassxzero hmm
 
Anonymous
@bassxzero Are you going by <Location> in your htaccess ?
 
@JayIsTooCommon by URI
@JayIsTooCommon media.clemson.edu/humanres/00/HT.txt
 
Anonymous
Can I see htaccess ?
 
Anonymous
pastebin
 
@JayIsTooCommon pastebin.com/DFYk3aN5
 
12:56 PM
posted on December 01, 2016 by nikic

### Fixed * Fixed handling of nested `list()`s: If the nested list was unkeyed, it was directly included in the list items. If it was keyed, it was wrapped in `ArrayItem`. Now nested `List_` nodes are always wrapped in `ArrayItem`s. (#321)

 
Anonymous
@bassxzero I gtg lunch but will take a look when back
 
@JayIsTooCommon TY
 
@Gordon besides hating me, can you advise ?
 
@Joseph with JS? hahahahaha
 
I said feel free to ask, not expect an answer :P
 
12:59 PM
ouch
least i tried
 
Indeed. And for what it's worth, I had a look, I see the problem, but I don't know anything about D3.js
 
it's not even my js, it does what i want to do, i am just adapting it and while at it , trying to fix this issue
 
Anonymous
@Joseph there's a JS room, not sure if active though but may be more helpful
 
they are, i tried but they just go like google it, well i did, i wouldn't be asking any of you if i haven't tried solving it first .
But sometimes you can spend hours on a dumb thing that is so obvious
 
D3.js and obvious doesnt mix
I mean, it's an awesome lib and does everything, but I also find it incredibly hard to grok
 
1:07 PM
oh dear. Poor me then
 
BTW @JoeWatkins. Do you have a problem when I create a way to run ssh (optionally) even on first boot?
Mostly because bitches love headless
 
Hi all, have anyone thought about including libraries packed into PHAR's instead of including them from files (eg. in vendor's dir)? The difference is that libraries have plenty of files which need to be copied sometimes at deployment or creating some packed artifact and PHAR archive per library would much reduce files count, in some cases this doesn't need high limits for number of open files per process at runtime.
 
> in some ways this doesn't need hight limits for number of open files per process at runtime.
 
I was thinking why anyone hasn't been using PHAR for this, even Composer supports zip, vcs, etc. but not PHAR
 
huh?
 
1:20 PM
*high
 
Yes huh?
:P
 
fixed
 
I really don't get where the high number of open files come from?
Or how phar fixes that
 
!!uptime
 
@bwoebi I have been running for 1 day, 17 hours, 27 minutes and 53 seconds, since 2016-11-29 19:53:50
 
1:21 PM
Comparing PHAR to JAR (which is often compared) there is manifest and AFAIK there is no need to additional autoloading
 
@Jeeves please finally crash so that I can investigate you…
 
@brzuchal How does that relate to open files?
 
@PeeHaa wait a moment
 
k
 
Hi
 
1:25 PM
@PeeHaa so you're saying requiring files from phar consumes ulimit the same way as requiring normal files?
@PeeHaa Even if why nobody uses it for packing libraries? It's much simplier to manage few files in project if each would be packed in single phar file.
 
@brzuchal I don't know. Are you hitting the ulimit of sane systems in your applications?
 
Yes I had to increase it to 65k
 
wat
 
There were more than 10k files in project
 
And I have 100k in my project
For my normal request -> done projects I don't hit the limit
Either way imho you are trying to workaround something in a really weird way
 
1:29 PM
Ok, but why phar isn't wide used for packing libraries?
Lets put away ulimit for rnow
 
I think because it adds complexity
 
That's what package managers are
 
What is?
 
There could be also some alternative way to put autoload information into phar and register phar autolaoder somehow magically
 
Alternative to what?
 
1:34 PM
I mean package managers like Composer do the job with putting library in some directory and generate autolaoder to it
 
Is there a reason why this is a bad question, Im trying to improve my ways of asking questions: stackoverflow.com/questions/40911823/…
 
@brzuchal What's wrong with that?
 
@PeeHaa There is still a thousand of files in filesystem, using about 50 libraries there would be only 50 files that are phar's rather than 50k files in vendor directories
 
so what there are thousand of files?
 
It's ugly :)
 
1:37 PM
Putting it into a zip and opening the zip at runtime is the wrong solution for an imo non problem
 
Anonymous
@bwoebi pervert
 
@brzuchal becuase it comes with a performance hit when you use it
 
Anonymous
@bassxzero Ok, you do it completely different from me so not sure I can be much help. However, the noauth=1 works, right ?
 
@JayIsTooCommon Are you really sympathizing with @Jeeves?!? You are the pervert here then!
 
at least it used to be slower than unphared code when it was added to php. idk if it was improved since then
 
Anonymous
1:39 PM
@bwoebi he's just misunderstood
 
I think you are missing the difference between composer checking out / downloading code and phars
 
@Gordon Code is slower or opcache is slower or..? can you remember?
 
One does its magic at runtime
 
@JayIsTooCommon if you mean does setting the environment variable "noauth" to 1, then yes it works. How do you do it?
 
@PeeHaa I know phar are usefull to pack whole app cli or web into one phar file and deliver it with single file
 
1:40 PM
@JayIsTooCommon Stop it. That's inexcusable!
 
@brzuchal Yes exactly
That's the exact benefit of it
 
@LeviMorrison cant
 
I imagine any benefit of zip is the same with .tar.gz
 
@PeeHaa I was just looking for another usage analog to JAR's
 
But tar alone doesn't have individual files on the fs - it's all allocated as one thing.
 
1:42 PM
@brzuchal It is somewhat analogous. Hell IIRC it's inspired by it
 
@brzuchal jars are loaded into the jvm and stay there. they are not unpacked on each request
 
But if having opcache it could be packed into one file loaded to shm and then even hadn't to check for file changes and code could live in shm that should be fast isn't it ?
 
We already have opcache support for phars.
 
^ that
 
morning all
 
1:43 PM
So it should not slowdown?
 
what we could have is the opcache codes dumped to file as a precompile step and then load that into another opcache on deploy
 
@Gordon like that ^^
It would be some sort of assembly in one file whole library code
 
@Gordon we have that.
 
@bwoebi into one file there or there where code exists ?
 
Or... you could use FastCGI and load it only once per process...
 
1:45 PM
@brzuchal no, not into a file
 
@bwoebi We do??
 
@JayIsTooCommon do you have an example of how you do htaccess?
 
Anonymous
@bassxzero I do it by location, so i'd direct them to a location depending on URI and then on that location require auth, not sure if it's the right way though. So when you enable noauth, does it correctly not ask for shib ?
 
We have only opcache dumping to directory structure with directory prefix somewhere in fs
 
@bwoebi not really. you can use opcache.file_cache and then manually prime your code into that file and transfer it, but does that work with a running fpm?
 
1:47 PM
Normally when i want to print the value of an array i do it like print_r($test['key']) can the part inside [] be a POST request? for example print_r($test[$_POST['myfield']]) ?
 
@Gordon no
 
Ideally would be when opcache dumped files fill be dumped there where original file exists and some way to merge whole library files into one huge dump
 
@bwoebi yeah, so that's why we prime the opcache after deploy on the prod machine, instead of as a predeploy step
 
yeah
 
And then source code would not be needed on deployment machine
 
1:48 PM
@JayIsTooCommon yes when I enable noauth it doesn't ask for shib
 
Anonymous
@bassxzero So why don't you use /rest in your AJAX request?
 
Anonymous
assuming it's requesting from your rest api?
 
@brzuchal Don't you want to use cryptographically signed phars in production?
 
And then ideally would be to use include "dumped.opchache.file.php";
I don't need signing, they still can be read
The only thing is they can be verified AFAIK
 
@JayIsTooCommon rest is just a placeholder for a future api, but I didn't want to explicitly write a php script to return a 403 and exit. What I wanted was for Apache to just return the forbidden response
 
1:52 PM
@LeviMorrison They can be read still don't they?
 
@brzuchal If they pass verification check, yeah. But that's what you want...
You don't want to trustfully just load some arbitrary bytecode.
Check the phar, make sure it is correct, then proceed with regular opcache, yes?
 
Anonymous
@bassxzero Not sure I follow, I thought you wanted your AJAX request to bypass shib?
 
But if this is mine code I prefer opcache dumped because normall people can't read it
That would be something similar to Java compiled class
It's unreadable by human and that's the benefit
 
@brzuchal You can just disassemble the java stuff...
I've done it multiple times...
 
Jest but that requires some skills
 
1:55 PM
@JayIsTooCommon I only want AJAX to bypass shib if the shib session has timed out. I only want it to happen in this case because shib will return a redirect response to a location that is cross domain and the browser will block it.
 
Anonymous
@bassxzero ah
 
I've done it also but normal guy who is not programmer doesn't really know about it
 
@brzuchal So does looking in a phar ^_^
 
Ok, but there is still original source code with all those comments etc. and in opcache not
 
@LeviMorrison @brzuchal intellij does it by default. no skills needed.
 
1:56 PM
@brzuchal I think you are concerned with the wrong thing.
 
I've used ZendGuard later for previous PHP versions
 
I agree that we dont need this for security through obscurity reasons. there is Zend Guard for that and it works just as bad
 
Anonymous
@bassxzero well (side-note It sounds like you shouldn't be doing this, auth times out for a reason) but I'm not sure how you'll be able to differentiate between no auth and timeout :-( Can't be much help, sorry
 
But then found out ways to decrypt those files so wonder if there are other ways to deliver code unreadable by human and not paying for this
 
If you want to deploy code that customers shouldn't look at I recommend using another language ^_^
 
1:58 PM
@JayIsTooCommon thank you trying
 
Anonymous
@bassxzero sorry dude! Good luck though
 
@Gordon It still doesn't have PHP7 support after a YEAR !
 
@brzuchal IIRC they announced that they will not support PHP 7
 
Ever tried dissembling c++ that doesn't have debugging symbols and was optimized with -O3? The code is straightforward but looks nothing like the original, but sometimes it's pretty gnarly too.
 
Aka, stop f*cking using that crap
 
1:59 PM
@brzuchal because no one cares about obfuscating code
 
@LeviMorrison I don't want another language, why it can't be simply in PHP ? Are there some barierrs?
 
@brzuchal Ultimately the engine has to interpret it. That means that the task you want is essentially impossible.
All the obfuscation has to go away so that the interpreter can execute it.
 
Room 11 Advent of Code private leaderboard code: 114365-5d3b257b
4
because why not? that's why
 
@LeviMorrison But it already does in opcache it's replacing runnig code with own handler which checks for dumped opcache file and then loads it
@Gordon does it work for PHP7 ?
 
2:01 PM
@brzuchal I have no idea. I doubt it.
 
@brzuchal It's just another form. Bytecode is not that difficult to read.
 
@LeviMorrison Reading from opcache dumped file would be enough no need anything more
 
You do know that sometimes it has to be recompiled, right?
It needs the source.
 
Anonymous
@DaveRandom neerrddss
 
@LeviMorrison I doesn't need on production!
And there is no need to check if file has changed
 
2:03 PM
@brzuchal I'm telling you that's not true. Speculative optimization depends on the ability to re-compile it.
@bwoebi Nothing intrinsic that you are aware of? Just a lot of work?
 
g'morning
 
The only way to do that for now I see is to create for eg docker container with opcache dumped and then php.ini reconfigured to do not chech times and sums and cut every file to 0 length from original source path
 
@JayIsTooCommon you may also cheat if you really want to.
 
@DaveRandom What's that code for?
 
@LeviMorrison AFAIK, as said.
 
2:04 PM
@LeviMorrison Why would I need to recompile on production?
 
@brzuchal Because of speculative optimization.
 
@kelunik if you go onto the leaderboard section you can join a private one by entering that code
 
@LeviMorrison Sorry I don't get it. I don't need it.
 
@brzuchal You are aware opcache does attempt to optimize your code to run faster, right?
 
You could always have for eg. compiled files and source code in same path with different file extensions and then ability to recompile, but in other cases where there is no need for recompile there also is no need to keep source files
yes, I know
I mean I am aware
 
2:07 PM
So what if it guesses correctly 98% of the time? What's it supposed to do with the other 2%?
 
It may be sort of binary AST dump in file doesn't need to be opcache dump
 
Just fail? That's not really acceptable because your code isn't wrong, it just guessed incorrectly when optimizing. And it should optimize if it's 98% correct.
 
Anonymous
@DaveRandom I'm not clever enough, sorre
 
@LeviMorrison opcache doesn't do speculative optimization
currently ^^
 
@JayIsTooCommon disagree
 
2:13 PM
@DaveRandom Ah, thanks! Found it. Solved.
 
@kelunik there's a part 2 ;-)
 
I've those optimization arent so speculative meybe there is an option to hold compiled files without source files at all ?
 
@Tiffany someone buy her a cochlear implant
 
she's actually not deaf
I found out
she just struggles to communicate in words, but can hear just fine
but she goes to a school that deaf children go to as well, so she's learning to sign
 
Anonymous
2:28 PM
That'll help. You struggle to communicate in words so we'll send you to a deaf school O.o
 
@bwoebi also, there's Deaf culture where cochlear implants are questionable. I don't fully understand it.
 
I plan on learning to sign. One day if there's a party and like one deaf person there who can't really talk to anyone, I'd love to go over and introduce myself to them in sign :)
 
Anonymous
@DaveRandom you big flirt
 
I was going to write "if" instead of "i've"
 
@JayIsTooCommon they probably have teachers that are helping her learn speech too, but signing just helps her open up.
 
2:30 PM
@Tiffany Me neither…
 
Anonymous
@Tiffany sceptical
 
@Tiffany I doubt that…
 
morning @Tiffany
 
@JayIsTooCommon @bwoebi youtube.com/watch?v=RPcTB86aT0Y
 
@Tiffany related: babysign.co.uk
 
2:35 PM
@LeviMorrison if those optimisations are not significant is it possible to patch php to store opcache dumped files with only different extension and additionally merge such files and learn php to read those files without need to old origibal source code files?
 
        //sometimes the framework will decode JSON automatically
        if (!is_array(...
Why sometimes? Wtf is this framework...
 
Anonymous
@Tiffany Yeah I believe you about the video, just sceptical about sending her to a deaf school being a good thing. If it is a deaf school that is. I don't know enough to give a proper opinion :)
 
@JayIsTooCommon I got the implication that it was a school that deaf children went to, but not only deaf children
 
@Leigh sounds like WP
 
@JayIsTooCommon meaning, the school served all different types of children that needed help :P
 
2:37 PM
@bwoebi It's Lumen
 
@Leigh Ah, WP v2.5
 
Anonymous
@Tiffany ah I see, that would make more sense I guess
 
woot, I think I got something working that uses php for once
 
Have any of you ever been in a situation where writing unit tests for a 3rd party lib is just too complicated? And if so, do you think integration tests are okay to do instead? I'm writing unit tests for my code interacting with a RabbitMQ client. Their API is not the best and has lots of callbacks and writing a unit test for a simple case is like 30 lines of code!
The tests pass but I barely even know whats going on when I look at the tests
 
2:52 PM
@ibanore why do you write unit tests for a 3rd party lib?
 
@Gordon Not for the lib but my code which uses the lib. I have an adapter which uses the lib
 
and you want to test the adapter or some code using the adapter?
 
I want to test the adapter is using the lib correctly
 
That doesn't sound like a unit test
 
"oh tequila, I turn to you like a long lost friend. I wanna kiss my Mexican cousin once again!"
 
2:58 PM
@ibanore an integration test is okay to do instead
 
I've got my Publisher interface which lives in the app layer. In my infrastructure layer I've got a RabbitMQPublisher which implements the interface. This implementation talks to the 3rd party library. I was writing unit tests for the RabbitMQPublisher but creating stubs and executing callbacks which get passed into the 3rd party lib makes the tests pretty hard to follow.
 

« first day (2238 days earlier)      last day (2716 days later) »