« first day (3262 days earlier)      last day (1676 days later) » 

12:17 AM
anyone here good with ssl certificates and stuff like that?
 
Depends on what you need
 
I am trying to send mail from a Laravel Forge managed server that has an EasyEncrypt certificate
The SMTP connection fails without modifying 'verify_peer', 'verifiy_peer_name' and 'allow_self_signed' - basically everyone says that this is not recommended etc.
 
They're right
 
But I cannot figure out if the problem is with my certificate or the SMTP certificate
 
Presumably the SMTP certificate if you have to disable verify_peer etc.
 
12:21 AM
As the sending fails I get these warnings:
PHP Warning: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in [...]
PHP Warning: stream_socket_client(): Failed to enable crypto in [...]
These warnings point to SwiftMailers StreamBuffer class to a line where @stream_socket_client(...) gets called
 
without knowing more about where you're sending it etc, and if that cert root is in your ca-cert.pem etc, it's neigh impossible to know
but id suggest you check if you can connect to the mailserver using some other application first
 
Well the problem is that I only have two servers running and both have the same setup
The cert root of the SMTP server?
 
Yes
 
Where is it usually located?
 
Sorry, that is beyond my ability to answer
 
12:34 AM
And would you elaborate a bit if that's a master file?
Because I found plenty of .pem files
 
you'll usually have a ca-cert.pem file (check your phpinfo to see its location) that is used to check for the root of any SSL certificates.
If your SSL cert isn't rooted in one of the ones in there, it wont work
 
Amongst which is one that matches my root CA and one for the SMTP root CA
oor
if I tried to openssl s_client -connect to the server and it gives me a verification error:
depth=0 CN = *.[SMTP_SERVER]
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 CN = *.[SMTP_SERVER]
verify error:num=21:unable to verify the first certificate
verify return:1
SSL handshake has read 2356 bytes and written 461 bytes
Verification error: unable to verify the first certificate
 
Afraid I can't offer anything else, i'm about to head to bed
 
Alright, thanks anyway
 
1:43 AM
!!should I claim my freebie pizza tonight or wait until tomorrow
 
You should claim your freebie pizza tonight.
 
Thanks Jeeves
 
 
6 hours later…
7:19 AM
morning
 
7:36 AM
morning
 
I've been trying to write the same blog post for two days now ...
also moin
 
mornin joe
 
8:00 AM
misprision neglect or wrong performance of official duty
 
8:22 AM
o/
 
8:38 AM
Hi all! Sorry if it is a dumb question... I have recently encounter an issue using blade and vue js. If normally php runs first and just print a static document (so...without any {{}}) at server level rendering... why it conflicts with vue js interpolation that is a frontend side render?
I mean, {{123}} would be 123 on js time, but it seems that vue still find some tags there. Thanks!
 
9:02 AM
@LeviMorrison I would advice to keep a C extension, and have a composer installable library on top of it — if you want to mix them. Don't try to be clever running PHP code from RINIT, it's going to end up in tears when supporting users.
 
Parsing of DateTime strings is VERY inconsistent – #78578
 
9:32 AM
@Derick Joe had a proof of concept for shipping PHP code as part of an extension....which would be nice for some things. Though yeah, shipping through packagist is probably better.
 
10:11 AM
how would i progress with this bugfix that should target 7.2? github.com/php/php-src/pull/4731 i already wrote rob and asked for a review, should I ping sara + remi then? Can I just apply it myself?
 
So Google have reached quantum supremacy... Shit
 
cmb
@beberlei, if you're confident that the fix is correct, and doesn't break other stuff, just commit it to PHP-7.2 and merge upward to master.
 
Anyone can help me with the problem I outlined above regarding ssl and SMTP?
 
11:13 AM
Morngins
 
@PeeHaa twitter.
 
I clicked it last night before falling asleep. Let me actually read it this time :-)
 
@beberlei Much like @cmb said, if you get no response within a reasonable timeframe (your call), and you are confident that the fix is correct then go ahead. Continuing to do so and people will most likely start to refer to you for fixes to ext/dom xD
 
11:44 AM
@JoeWatkins what about?
 
11:55 AM
why array prints sql preparement select as binding not value in foreach loop?
 
@ircmaxell repeating myself, but now with a decent example, one problem with any possible vision statement, is that people doing stuff like that ^^, are going to be outside of what some people think people should be using PHP for.
 
@sby05922 wat
 
1
Q: Array inside array doesnt show value of database preparement

sby05922I try to create circle and get data for that from database. But it doesnt show values, It prints bindings. function circle() { $sql = "SELECT count(projects.id) AS count, projects.status as status FROM user_projects INNER JOIN projects ON projects...

 
12:41 PM
@sby05922 I think you mean prepared statement, not preparement
 
yes
 
So I'm just gaming out some doc changes in my head (just a prototype) and I'm wondering if translations need to include example code, or if that can all just be in english?
 
oh wow this group is still alive
same people since years
 
What can you do when Intermediate certificate of an SMTP provider is not provided by the server.
I've looked it up, added it to my certificates directory and ran update-ca-certificates
 
You typically bundle them with the main cert
 
12:56 PM
The root or the leaf?
 
The leaf. You merge the intermediaries with your server-specific one to create the entire chain up to the root in one file.
 
mb_decode_numericentity: args number inconsistency – #78579
 
1:20 PM
What's the fastest way to syntax check a few thousand .php files?
executing php -l 4000 times is slow
I found some function php_syntax_check() in the manual, but apparently it has been removed in PHP 5.0.5 :-D
 
scandir them all and then do opcache_compile_file
 
apcu_dec, apcu_inc: missing parameter – #78580
 
@MarkR Thanks for the help with the certificates. At least I knew what to search for. I finally got it working by creating a pem containing the SMTP cert as well as the intermediate one.
 
Glad you got it sorted
 
I think it's safe to assume the fault is with their server for not sending the entire chain, right?
 
1:24 PM
@PeeHaa
 
Most don't. They'll usually give you the main cert, and a URL to a package of intermediates and leave it up to you to decide how to chain them
 
Really? But this is a shared hosting provider. I doubt those would provide SMTP service that doesn't run out of the box
 
morns
 
dude, what happens when I create a file with name readfile.php, and using require with it. Does it shadow readfile native function ?
sorry for my laziness, my friend asked this and I'm currently far away from any laptop / vm
 
@MarkR Not usable :-( It actually compiles the function definitions and then complains with cannot redeclare...
@NikiC I wonder whether that's actually a bug that opcache_compile_file() loads function definitions into the global table…
at least according to docs it should not have that type of side effects
@MarkR And I cannot catch these E_COMPILE_ERRORs there...
 
1:41 PM
hmm, unless you can use an IDE to syntax check them all, might just be s tuck with invoking the binary each time then
 
@MarkR no, it's to be run on the server and delays of hundreds of seconds are not acceptable :-(
 
ci/cd pipeline I assume?
 
yes
 
phpstan maybe?
 
@JayIsTooCommon .
 
1:44 PM
if phpstan is achieving something, I can achieve it myself as well… just … how?
 
Using Nikic's phpparser I assume
 
sigh
 
If you want to validate your PHP from scratch, you must first invent the universe
 
that's stupid sort of...
 
what's preventing you from using phpstan?
 
1:51 PM
@MarkR I want to catch for example usage of 7.1+ features because it needs to be deployable to 7.0 targets
(which has been sort of a common occurrence here)
 
@bwoebi It's not obvious what constraints you're operating in. If it's part of a CI/CD system, isn't it going to be running alongside a whole load of unit tests? Are you measuring the time taken in that environment or locally?
 
@Danack hint: there are no unit tests
 
According to the phpstan docs, it assumes it'll be run on the same version as what the binary being used is
 
and: time in that environment
@MarkR and phpstan requires 7.1
 
1:56 PM
seems other people are also using: github.com/overtrue/phplint - but yeah.....no tests...no bueno.
 
Can't Psalm check for validity on various PHP versions?
 
A full tool like that's almost guaranteed to be slower than a basic linter.
 
Pretty sure it can tell you if the code would run on PHP 5.6 or 7.0 even though Psalm is running on a later version
Ah yeah true, forgot the speed requirement
 
@Danack eih, tried to set a too high of parallelism and accidentally invoked the oom-killer ... :-D
 
2:12 PM
No mention of <?= other than in the chagelog of the PHP tags doc page – #78581
 
cmb
2:23 PM
@Girgias, the "language specification" category is about git.php.net/?p=php-langspec.git;a=summary ; use "documentation problem" if it's about the php.net manual. :)
 
Ah mb
@cmb do you think that this paragraph would do the job
   <para>
    PHP includes a short echo tag <literal>&lt;?=</literal> which is a
    short-hand to the more verbose
    <code>&lt;?php echo "String"; ?&gt;</code>. Prior to PHP 5.4 this
    tag was bundled with the
    <link linkend="ini.short-open-tag">short_open_tag</link> &php.ini;
    configuration.
   </para>
 
cmb
yes, think that's okay
 
Okay will commit that as a fix :)
 
2:40 PM
@bwoebi That does sound like a bug to me
@bwoebi Also we should make php -l accept multiple files
You're not the first person complaining about that...
 
Is there a way to include an external config file inside /etc/php-fpm.d/www.conf?
like: include /etc/environment
 
@Girgias Your non-shorthand example should just be for <?php echo. I'd also suggest dropping the bit about the INI option, the changelog section on that page is sufficient. :)
 
@salathe well let me push a second commit then, but thanks for the feedback :D
So do I remove the bit about priot to PHP 5.4 then ?
 
pretty old FR
@NikiC basically we just need to empty the global tables from user input (i.e. user functions / classes and such) and then we can run compiler as often as we want without issue? (for php -l with multiple files)
at least since we don't bail out but always throw in compiler
 
@bwoebi probably easiest is to just request startup + shutdown for each file
 
2:53 PM
yep
@NikiC but not sure about overhead
 
is fairly cheap
Should be <1ms
 
fairly cheap is always relative to what's happening … if it has less than 20% overhead for parsing short files 20~50 lines typically, then it's fine
 
3:56 PM
I really should move my video production/rendering to my big box
 
@Danack I've maybe got an idea on how to do a file watcher for SVN/git in PHP
Oh hi @Derick
 
hi hi
 
@Girgias oh really?
 
It's maybe a whack idea
But basically parse the output of the SVN checkout/git pull and look for the prefix of the files that have been added/removed/modified
Meaning this could solve one thing with revchecks for the documentation
And always use a DB, @MarkR would be happy
 
I've spent the past few hours thinking of a schema actually
I came up with two options...

The first would be an XML-like (but probably JSON) recursive node based structure that could handle multiple languages in one file, with a UI to edit them, and fallback to English with metadata for updates.

The second would be to say balls to politics, write the entire thing into a database
 
4:03 PM
@MarkR well if everything is in a DB you don't get the same advantages of a VCS
 
True, but you get rid of a fair few challenges in the process.
 
Isn't that the fun part? /s
 
No :P workarounds suck
 
Tbf I'm not sure if my idea is that much of a workaround
 
gist.github.com/marandall/a5b8f234cf9e621e0c8ba398f1a04614 This is what I meant about combining all languages into one file.
 
4:08 PM
Pretty sure it could be useful for other stuff (maybe that's wishful thinking)
 
^ That's just an idea, but having written translation systems before, it saves a fair amount of time.
 
Possible
It's going to be a fun little project/lib lol
 
is there any way to get cause and description from this code.?
https://3v4l.org/eva46
 
ahhhh burn it with fire
@Exception Not sure what you're asking... it's already printing them, is that not what you want?
 
returning from a constructor is in 99% places wrong. Like here?
 
4:26 PM
You can't return from a constructor really.
 
its obviously not very helpful or good to use.
 
Point = Missed
@Girgias Do example code blocks usually get translated (comments?) or are they just left as-is?
 
Comments do get translated usually
 
you guys are talking about the docs site?
 
Yes and no
But also the structure of the docs and their translation
 
4:34 PM
right, I think I saw some of a related convo the other day
IMO on a site like that a DB isnt the worst solution, but the key thing is to take the DB out of the critical path for viewing the site. Either have a SSG pull from that DB, or have a good caching layer in front of it (at the local layer, not a CDN) so that a live request from a person reading the docs, never hits the dynamic backend (and thus the DB)
 
I'm working on a way to statically generate doc.php.net (the tooling/tutorial site) and the "pain point" is revcheck
Which actually uses a DB
But regenerates it everyday from what I understand
 
revcheck, as in checking for updated revisions in a repo?
 
I can just re-read the chat above if you've explained all this before.
 
And it's corresponding tools
Nah I didn't really explain it
Besicaly revcheck is a database which hold the status of the translations as a whole and each individual file
 
4:40 PM
I see, so it doesn't store the content, just the metadata (status, size, by the looks of it?)
 
Yeah
The file is here if you want to have a look at it : github.com/php/web-doc/blob/master/scripts/rev.php
 
I see, so the DB is updated daily, but then requests are live calls, to that DB, is that how it works?
 
Well the main benefit to the database is that you've got easy live editing and live transformations, and most importantly, easy access to context dependent hooks.

The downside to the database is you need to re-create certain elements like versioning, and copying something requires replicating an entire tree
Option 3 is allowing editing of XML/JSON files and store them in git or svn, but REQUIRE them to be edited via an online UI
 
@Stephen yeah, well the graphs are generated statically so
Not everything hits the live DB anyway
@MarkR the problem is the UI is shit, and I feel my idea still allows to use the online editor, not using it, and not needing to rebuild the database everyday
 
Why would you need to rebuild the DB every day if it's all done by a live DB in the first place?
 
4:48 PM
There are many files in the docs. Rebuilding it constantly is difficult, as each page can refer to entities in any other XML file.
 
@Danack the DB is currently rebuilt everyday from my understanding
 
the files come from a repo, correct?
 
Yeah
 
yeah, I meant - @MarkR "easy live editing and live transformations," currently doing that is the problem, as it's far too slow...
 
and there's something doing svn update periodically to get them on that machine? or does it do it as part of that daily thing?
 
4:50 PM
Right, so if this needs fixing, what's the thing causing it to be slow and what would we need to do to eliminate it.
 
(or git pull if that stuff moved over too)
 
Sep 4 at 10:34, by Danack
@Jasny-ArnoldDaniels I have most of the stuff needed for CI on docuementation here: https://github.com/Danack/PHPDocTool
Sep 4 at 10:34, by Danack
However this is one of the use-cases where the slow speed of the filesystem of Docker on OSX is actually a problem. It takes too long imo to rebuild.
Sep 4 at 10:36, by Danack
The code that is currently used to do a partial rebuild of the manual is .....not really good enough as it does some quite impressive hacks to only rebuild very few parts, but that doesn't cover quite a few of the edits you'd want to do.
Sep 4 at 10:37, by Danack
The problem is solving that properly would involve a file-system watcher, that would need to watch all of the files in the manual. And for Docker on OSX that grinds the host machine to be very slow, so I got depressed/annoyed.
The rebuild of the server time is fine, it's just the editing -> feedback cycle that is far too slow.
It needs to be in the order of a couple seconds at most. It was far longer than that.
Tbh, if I look again - I think just loading all the files into memory would be a saner choice.
 
By editing -> Feedback, do you mean the length of time between submitting an update and it becoming available to view?
 
'submitting' yes. What that link above does is setup a little server that allows you to edit the files, renders them, and then renders them in a webpage that refreshes itself.
So people can you use an editor they like rather than online. But still the problem is that the time for save-> refresh is huge.
 
Hmm so if I'm understanding this right, it's not actually a live database per-se? More like it's just a static dump combined into a DB that gets re-done a few times a day?
 
5:01 PM
Can you look for those answers in here: github.com/Danack/PHPDocTool or I can write up what needs to be done elsewhere if you're going to spend time looking at it, but otherwise I'm too annoyed at Docker slowness to talk about it.
 
I assume you're trying to probe all the files for slowness?
 
I haven't looked how the docs are generated but I suppose that it just runs php doc-base/configure --lang=all one per day to regenerate the doc
But for rev check yeah it's mostly static
 
Oh I see you're using git to check for modified files. Might I suggest if you're going through a web server to view them, you use the open method to know when files might start being edited and maintain a list? Heck of a lot faster to just do stat on half a dozen files than it is to do several thousand
You could potentially even use the same style that git itself and chrontab use:

<user command>
<opens editor.exe with particular file and waits until it closes>
<runs checks on that file and applies anything>
 
cmb
@Girgias, php doc-base\configure just builds doc-base\.manual.xml (basically all files merged into one)
 
Oh, so how does it generate the website?
 
cmb
5:07 PM
the actual rendering is done with git.php.net/?p=phd.git;a=summary
 
Is that DocGen ?
 
cmb
PhD
 
Ah yeah that's the name
I think I used the once to check my sprintf changes
But didn't have any CSS on it
 
cmb
When I use it, I use --format xhtml which is not quite the same as the Website, but good enough.
 
Good to know :)
 
heh, sounds like my first programming job
It was only 15 clients but it was some of the worst code you could possibly imagine
About 5 months into it I was able to reliably demonstrate that you could write arbitrary data to _SESSION through query parameters.
 
oh dear
 
We had a SQL statement that was constructed in the browser with JS, sent through AJAX and then blindly executed on the database.
 
If some people drove their cars, the same way they write their code, they would be disqualified or imprisoned.
 
When I arrived there was a password and password_hash database columns. It was the worst
 
6:23 PM
There really ought to be some kind of better professional certification in programming IMHO. A crappy or incompetant programmer can cause much more damage than a doctor, and they're required to have huge amounts of additional education
 
While I tend to agree with you I also wonder at its efficacy. At least for this story let's take the JS SQL example which I think we can all agree is objectively bad code.
The developer that implemented it was a good developer, in that they could have easily passed whatever certifications you put in front of them to at least get a job. The code wound up getting implemented the way it did for a variety of factors; business pressures, timeline demands, tremendous amount of technical debt
I'm not excusing it
 
It's a fair point.
 
6:39 PM
Wanted to edit in, "but also a bad decision on the part of the developer"
While there were a lot of factors that was one of them and you're right it could/may have had disastrous consequences particularly given the type of information being stored in the particular database
 
LaraArret – #78582
 
6:56 PM
this topic came up before, and ended up on s/o meta stackoverflow.com/questions/7074391/…
in that case specifically my view is still the same as when I answered
if you know the situations where its safe to do this shit, you shouldn't be asking on stack overflow if/how you need to encode/escape values in the request
 
Yea, I agree with you and I think it is irresponsible that the accepted answer actually shows how to do this
 
more abstractly, most rules have exceptions, but you better be able to speak at length about why your case is the exception if you want people to agree with you.
 
Once I discovered it in the codebase I was working on at the time I fixed it and spoke with the other dev about it and he agreed it was bad and didn't really have a good excuse. Because, honestly, there is never a good excuse for constructing SQL in JS and executing it on the server.
 
> it's friday and the client wants it done.
 
that the accepted answer is prefaced with "don't use this unless you're sure you know what you're doing" - right, because someone understands all the security risks of client side SQL over http, but apparently doesn't understand how to escape/encode special characters in that request.
 
7:01 PM
@Danack Knowing the culture of that place it wouldn't surprise me if it was a business stakeholder standing over the dev as they implemented it demanding that it be done now.
 
ive lost track the batshit crazy things I've seen on projects I inherited.
 
Fortunately the last 2 jobs I have worked at have had reasonably sane, fairly well-tested code
 
@CharlesSprayberry so nobody inventing their own ad-hoc encoding of variables that's essentially CSV, but with pipes instead of commas, and guesswork to identify the meaning of each 'variable' in each place its used?
 
@Stephen Shit no and I would reject that PR during code review so hard
 
literally 1|foo|true|Hello world|2|33|4|false stuff
@CharlesSprayberry haha PR. code review.
 
7:05 PM
We have a small team at my current job but you just can't merge anything into master without somebody else having looked at it and say that it is ok
 
admittedly it was a while ago
 
Yea, this job was several years ago but it still scares me sometimes when I think about it
 
I'm quite lucky that I've spent most of my professional life working by myself, if you can call that lucky.
When I get exposed to third party code I often need a week off to recover
 
And that stuff is just the tip of the iceberg. That company was genuinely insane I can't believe they are/were "successful"
 
@MarkR at the time I was working for an agency but I was usually the guy they called onto a project when something went to shit.
 
7:16 PM
Success is such an odd metric
Like... if you lose 100 million passport numbers but still turn a profit, are you successful
 
@MarkR Depends on what level of capitalism you're on. Apparently we're on lvl 9000 here so, uh, yea
 
Aye... as long as the brunt of the cost is borne by other people I guess
Personally I'd have put the executives of Equifax to death
Well, maybe not death, but I'd have taken every cent they had
 
Yea, I don't want them to die but I would have been ok with some jail time and a much harsher financial penalty.
 
 
4 hours later…
11:39 PM
Aye I've got some templated graph working for my rewrite of doc.php.net :D doc.php.gpb.moe/tools/revcheck/ar/graph.html
 
I've been playing about with a UI but it'll be an hour or two yet
 

« first day (3262 days earlier)      last day (1676 days later) »