« first day (3315 days earlier)      last day (1615 days later) » 

2:03 AM
Gosh this CSS Parser thing is taking way longer than I thought
I'm just getting close to finishing the lexer D:
Well that's for tomorrow at least
 
Wes
2:23 AM
that reminds me i never finished my css parser
it's 99% complete
what is wrong with me
i never finish anything
 
 
1 hour later…
3:35 AM
Method signature types strictly enforced - should allow subclasses – #78807
 
 
1 hour later…
4:52 AM
\o
 
 
2 hours later…
6:32 AM
o/
 
6:42 AM
Does anyone know how to access previous git commit with PHP? I would like to find if a specific string from file X in line Y has changed or not. Doing Google search seems impossible. Searching for "php git search" gives a ton of results that have nothing to do with what I am trying to do :D
 
7:18 AM
@Adam sesrch without php find command solution and It into shell_exec()
Git has no api, you need to call the program directöy and parse output
 
git has an api
there's also a php extension, I dunno what state it's in ...
it looks really shiny now too ...
seems like a nice ffi candidate for php8 ...
 
7:43 AM
@JoeWatkins amazing! Thanks for the link, will check it out. Never heard of it although libgi2 is 10 years old and the php-convert-repository is 6 years old.
 
yeah, but last time I looked the docs didn't look so shiny, and the ref didn't look so extensive ...
 
When building an Composer package with FFI interface like for the libgit2 hot to restrict to specific libgit2 version?
Is it even possible?
 
morns
 
8:01 AM
@brzuchal yes, this should be possible via github.com/lisachenko/z-engine
 
8:17 AM
@lisachenko thanks for the link, I was looking at your package yesterday looks impressive, but what I was really asking is when using FFI hot to connect things together
 
@brzuchal composer can't restrict the version of libgit2, but you can with ffi ... your "boot" routine should include first loading access to this ...
 
@JoeWatkins Ok, that's more I wanted to see
 
@JoeWatkins thanks for correcting me :)
 
@beberlei I dunno if it was a correction, I realised after you might have been talking about the git command having some sort of api ...
 
Next question header files - I should create a header file which includes libgit2 header files and that one should be used in FFI, right?
 
8:20 AM
well no, you can't include, the header file you load only supports a subset of c preprocessing, and should include the actual definitions you wish to call/use/whatever ...
you basically have to copy paste and dance around a bit ... also look at ffime, it makes it somewhat easier but may be a bit hit and miss (only tested on a few major libraries afaik)
 
@brzuchal afaik from anthonys experiments, ffi header files have a lot of restrictions (no macros for example), so you probably need to copy the parts you want to use into your own header and adjust them accordingly
 
@beberlei @JoeWatkins got it found an example here github.com/chopins/php-libui/blob/master/src/include/libui.h
 
good mornings
 
And usage of it here github.com/chopins/php-libui/blob/master/src/UI.php#L429-L473 so I need to do that to eventually check against libgit2 version using it's function to retrieve the version number, right? and this is my starting point
 
yeah basically, the first cdef wants to just declare the version function, then call that and proceed however ...
you could then go on to load different headers for different versions ...
or throw
 
8:35 AM
I understand now, thank you
If supposedly PHP would get struct types will that be beneficial to FFI and eventually how? Sort of mapping C structs into PHP structs would be hard cause of missing pointers, right?
 
cmb
not only missing pointer support, but also different int sizes/signedness, bitfields etc.
 
So it would require additional metadata for eg in sort of annotations which FFI can read and apply casting rules or something like that, right?
I think I already asked about that last month
 
lacuna a gap or missing part, as in a manuscript, series, or logical argument; hiatus.
 
 
1 hour later…
user12236643
9:53 AM
0
Q: Undefined variable: _get in

devI get the following error: Undefined variable: _get in ... this is the part of the code that is causing it: $search = $_get[search]; $option = $_POST[option]; $period = $_POST[period]; $datefrom = $_POST[datefrom]; $dateto = $_POST[dateto]; How to fix it?

 
@dev looks like there are valid responses
I don't remember when using $_GET or $_POST :/
 
10:17 AM
o/
 
[LMDB] MDB_MAP_FULL: Environment mapsize limit reached – #78808
 
user10141648
Can someone explain or give me a good tutorial how I make sure that my collaborators can not push their database config file with .gitignore ?
 
@Merdin what else do you want to know except adding a file called .gitignore which contains the path / filename that you want ignored?
@Merdin you could look at man git-check-ignore
 
user10141648
10:35 AM
I have a file database/dbconnect.php

I added it to my .gitignore file and pushed it.
How can someone else now change the username/password and doesn't have the file shown in their commit/push window
 
user10141648
So when they make other changes they don't have to undo/deselect the dbconnect.php file everytime
 
user10141648
In my project for work it works fine. The filename is orange (i use phpstorm btw)
 
bahahahaha
 
@Merdin First of all .gitignore purpose is to exclude from commits files which should not be committed and the next thing is committing username/password - database credentials into repository is highly non-secure and should be handled by environment variables or sort of KV storage for security reasons
 
user10141648
10:45 AM
@brzuchal I know that it is unsecure.
 
@Merdin Good
 
user10141648
@brzuchal it works now, thanks :)
 
yw
 
11:01 AM
@kelunik Can you remind me, what is the name of the person who was working on async that disappeared and also had his repo vanish?
 
@Ekin thanks.
 
np. it's very sad that both the author and the repo suddenly disappeared
 
11:21 AM
I'd like to execute an ansible step only if there is a specific git version installed. Anyone has practical experience with that?
 
11:37 AM
guys are "launch" and "release" the same?
 
If in the sense of "publish" then yes
 
ah ok thx
 
But a launch is typically only the first "major" version
 
my understanding is release - tag new version of software which sometimes is automatically deployed on CD then launch probably is the same
 
AS in initial launch
 
11:44 AM
I see
 
@hakre most ansible steps can take a when condition. If you have that version on a var, you should be able to compare
 
 
2 hours later…
cmb
1:28 PM
Any thoughts about the charater set/encoding mess of PHPTs? Would it be generally useful if either the character set/encoding of a PHPT would be explicitly specified (e.g. introducing a respective section), or if all tests would be written in UTF-8? Ofc, that wouldn't make a real difference when running the tests with run-tests.php, but it would make it easier to read and write the PHPTs in an editor, and would also be helpful for other test runners (e.g. PFTT).
 
1:38 PM
Yes
I'm all for it :)
 
@pmmaga Yes, something in that direction I also thought about, but I wondered how stable that is as I think I need to fetch the git version with a shell command. I could "hotfix" with allowing failure and now im raison about how to actually express the expectations. Thanks.
 
2:27 PM
@cmb everything should be utf-8 unless it needs to be something else
 
2:39 PM
/me waves @NikiC
 
@ircmaxell hey
 
Sitting outside the auditorium
 
in the hotel ^^ any plans?
 
I'm heading back to the hotel for a call at 16:30, and am busy until about 20:30
but outside of those, I am good
 
@ircmaxell ping
 
2:46 PM
@Girgias which SDK specifically?
 
and you just want to get review on a PR? Or what's the question more specifically
(on multiple PRs it looks)
@Girgias ^^?
I found someone internally I can reach out to about it, just let me know what to advocate for ;)
 
@ircmaxell if it's still actively maintained
 
cmb
@NikiC, nothing needs to be anything else than UTF-8 though; one always could work-around with, say, bin2hex(), or convert to UTF-8 finally.
 
@LeviMorrison i had a quick chat with nikita and here are the notes: github.com/SammyK/php-8-tracing-hooks/issues/3 - @NikiC please correct me if i misrepresented some points
 
2:57 PM
Because I don't mind pouring some more hours into it to get a version 6 out (which seems to have been postponed for like 3 years), but if I need to wait 3 months to get feedback, it's slight annoying :p
 
we also got attacked by pigeons in the course of that talk and saw how they devoured an old plate of food on a neighouring table in a horde :)
almost attacked :)
 
@beberlei Using our own stack is only as reliable as the delivery of end/exception. I suppose as long as those things are reliable and bug free it could work, but I still think it's the wrong idea, as it forces allocations that would otherwise be unnecessary.
Not sure I followed the method portion.
 
yeah let me reorder that
 
I was imagining the instrument API would track exactly which handlers need called per function/method, rather than just calling all extension handlers blindly. Haven't worked that out in my head, but if it's blind and I have extension A and B, then they will both need to determine "should I trace this?" and a lot of that code is going to be the same.
 
@Girgias pinged, will let you know
 
3:10 PM
Cheers
 
@LeviMorrison you need that code anyways, since it would be a single callback for entry and exit per extension
this is how do we get for where we are to a better solution in short way, i believe everything else would not necessarily off the table, but someone has to provide the implementation
 
@beberlei I didn't follow the reasoning.
 
@LeviMorrison you register "datadog_userland_function_entry" (+exit). so at that point you need to make a decision on what exact callback should be invoked for entry of PDOStatement::execute for example, so at that point you could also find out that you don't have a handler regitered (so it must be from another extension instrumenting that call) and just ignore it.
 
Ah, I think I get what you mean now. I don't see the point of such a model; it should be higher level. Every extension should not have to re-implement the same things over and over.
Plus, if we have to go looking for things, it's going to require more maintenance and opens the surface area for bugs.
Doing a call into an extension API to see if anyone wants to instrument the function at function emission time does seem like an alternative model than registering everything up front; this way you might be able to have richer information and make a better decision than "always instrument".
So that bit is a really good idea. It just needs to be more than a flag, I think.
 
3:40 PM
Would be a bit difficult to backport that to PHP 7, though. Would have to use zend_compile_file and reimplement a lot of parsing, maybe?
 
maybe iterating over all newly defined zend_function entries after a file was included :)
 
Seems better. Still have to deal with ordering issues with opcache either way, though. IIRC there is some bit about opcache not calling the other hooks if it loads it from cache or something.
 
 
2 hours later…
5:19 PM
Hi
I have a CentOS 7 server. I am trying to give permission to a folder:
 [root@srv1 cliente]# chmod -R 0777 templates_c
Returns this error:
chmod: changing permissions of ‘templates_c/550b816f211107d8872ecfd99c61d84a06bfaae8_0.file.contact.tpl.php’: Operation not permitted
How can I solve this?
 
I think I was hit by it before and you already answered, but I don't know how to fix this bad boy @Trowski @kelunik:
<?php declare(strict_types=1);

require_once __DIR__ . '/../vendor/autoload.php';

\Amp\Loop::run(function () {
    /** @var \Amp\Socket\EncryptableSocket $socket */
    $socket = yield \Amp\Socket\connect('tcp://mx2.privateemail.com:587');

    yield $socket->read();

    yield $socket->write("EHLO test\r\n");

    yield $socket->read();

    yield $socket->setupTls();
});
> PHP Fatal error: Uncaught Amp\Socket\TlsException: Can't enable TLS without configuration. If you used Amp\Socket\listen(), be sure to pass a ServerTlsContext within the BindContext in the second argument, otherwise set the 'ssl' context option to the PHP stream resource. in D:\Web\async-smtp-client\vendor\amphp\socket\src\ResourceSocket.php:96
Does that mean I cannot use the connect function?
or do I have to pass something into the connectcontext even though the connect phase is already finished?
 
hello
who is provide me a nameserver? domain provider or hosting provider?
 
domain provider
hosting just hosts and serves your data
 
okey
so in godaddy DNS setting i go my nameserver
i need to put that nameserver with my hosting right?
 
No
What are you trying to do?
 
5:33 PM
my domain provider is godady
 
nameservers resolves "web" addresses to ip addresses
 
and hosting provider is different
 
That did not answer my question
 
I need to point domain with hosting
 
Go to your dns panel in godaddy and fill in the ip of the server
 
5:34 PM
IP Address of hosting panel right?
 
ip address if whatever your website is being served from
 
okey
 
@NikiC Thanks Nikita. I'm creating a talk about PHP 7.4 new features and I've notice this nice improvement :)
 
thank PeeHaa
 
np
 
5:37 PM
@Wes Was just an example of line reporting instead of class. But yes, bad example hahaha
 
22 mins ago, by Tiago
I have a CentOS 7 server. I am trying to give permission to a folder:
Can someone help me?
 
which folder?
 
templates_c
[root@srv1 cliente]# chmod -R 0777 templates_c
Returns this error:
chmod: changing permissions of ‘templates_c/550b816f211107d8872ecfd99c61d84a06bfaae8_0.file.contact.tpl.php’: Operation not permitted
 
sudo chmod -R 777 templates_c
use superuser to change permission
 
I was already rooted
 
5:47 PM
chmod -R a+X templates_c
 
same error as above
 
ls -al
check user
 
Ok
drwxr-xr-x  2 hostci71 hostci71  24576 Nov 13 08:50 templates_c
 
Typed properties \o/
 
Do you know how to fix this?
@MaulikPatel
 
6:02 PM
@PeeHaa github.com/amphp/socket/blob/… Pass (new ConnectContext)->withTlsContext(...) as second argument to connect()
 
@Girgias it's not maintained by staff anymore, but by the community
 
What are everyone's thoughts on cleanliness of network switches and patch cables? Zip tied neatly and orderly but require more effort when change is needed, or loose and accessible but somewhat messy?
 
@MaulikPatel DONE
47
A: Changing Ownership: "Operation not permitted" - even as root!

kosProbably the file has the immutable flag set in its extended attributes: user@user-X550CL ~/tmp % touch immutable user@user-X550CL ~/tmp % sudo chown root:root immutable [sudo] password for user: user@user-X550CL ~/tmp % sudo chattr +i immutable user@user-X550CL ~/tmp % lsattr immutable ----i---...

 
@ircmaxell cheers for the info
So how would that work in regards to a fork?
 
6:17 PM
what do you mean?
 
Well because I needed to sign a Facebook CLA in regards to the license or something like that
 
oh gods
brace yourselves, The Great Recalculations™ have begun
 
6:32 PM
@Girgias not sure
 
6:57 PM
@kelunik Do I need to pass specific ClientTlsContext options?
 
Any input on what the right way to handle github.com/sebastianbergmann/phpunit/issues/… would be much appreciated, ideally directly as a comment on the ticket. I'm on a train and do not know how long I will have a connection.
 
@PeeHaa No, just the peer name in the constructor.
 
Would 0 be the only special value to be handled? If so, I could add a special case for it that uses === even if $checkForNonObjectIdentityis not true.
 
ok getting there
> PHP Fatal error: Uncaught Amp\Socket\TlsException: TLS negotiation failed: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number in D:\Web\async-smtp-client\vendor\amphp\socket\src\Internal\functions.php:128
I see what I did wrong maybe
\o/ tnx @kelunik
 
@PeeHaa What did you do wrong?
 
7:03 PM
@kelunik The last error was because I forgot to tell the server I was going to upgrade the connection :P
So it gave back a 550 error instead of handshake magic :-)
 
@PeeHaa And you sent some payload on the server immediately?
 
I was trying to start the handshake without telling the server I was going to do it
smtp starttls upgrades existing connections, but first you have to send the command
 
@PeeHaa @kelunik Guess maybe we need "If you used Amp\Socket\connect(), be sure to pass a ClientTlsContext within a ConnectContext…"
 
@Trowski Yup.
 
@Trowski I don't know if listen is still a thing, but if it is replaced by connect it sure should be changed :-)
 
7:07 PM
@PeeHaa Sure, listen is for servers, connect for clients.
 
But do you know what the context is at the time of throwing the exception?
 
SO is doubling upvote values to questions :D
 
Also now that I have you both here @kelunik @Trowski would it be sane if verifypeer is enabled by default in some future version?
 
must have been from the last maintenance
 
@PeeHaa It's enabled by default for clients.
 
7:11 PM
ow k
Nice then :D
 
If it wasn't, that would be insane. Amp is secure-by-default. We even raise the default security level to 2 to disable SHA-1 like browsers (if you have support for that).
 
Yeah, I was just going off by looking into ServerTLS* instead of Client
 
Uninitialized typed properties – #78809
 
@PeeHaa No, though I actually think using connect() would be more common to see that error.
 
@Jeeves sigh
@Trowski kk
 
7:21 PM
Well… that's not necessarily true… shrug
 
:P
 
7:44 PM
@cmb zend multibyte tests do at least
 
@ircmaxell well worst case I'll do a fork and get an angry email from Facebook :)
 
I have a core file for php-fpm. Even after installing debuginfos for php, no symbols in the entire backtrace are recognized. This makes me think I've got something else entirely wrong. As far as I can tell, the php versions match. Any other ideas why none of the frames would be recognized?
 
RW fetches do not throw "uninitialized property" exception – #78810
 
 
1 hour later…
Wes
9:02 PM
evenings
 
o/
 
9:24 PM
\o
 
o>
 
@Wes I remember you were one of the people who had the issue with amp/process on windows where it stops spawning new processes after a while, do you have a test case for it?
I have fallen down a serious windows hole recently around async I/O, I want to bake some stuff into PHP but I'm redoing the amp process wrapper as a single application thread to make sure I understand it properly. I think the root cause of that was basically handle exhaustion brought about by creating way too many threads
 
Guys I don't really like my while(true) here: https://paste.artemix.org/s/HulkyC but is there a way to improve while still following the algorithm defined here:
https://www.w3.org/TR/css-syntax-3/#consume-string-token ?
 
(don't shoot me) I actually think that might be a decent use case for goto...
 
9:42 PM
Yeah I was debating too earlier
Probably would look nicer
I'm also tired so I'm kinda thinking in limbo
 
3v4l.org/8KhGB @Girgias
less indentation at least
 
Yeah, thanks :)
 
Hi, new to PHP and got an incredibly basic question. Trying to parse an XML file which is structured like this <rates base="GBP" ts="1573679946">...</rates>. How am I supposed to get the value of ts. I'm struggling as the value is in the tag.
 
@JaAnTr Use the DOM luke
!!docs domdocument
 
[ DOMDocument ] Represents an entire HTML or XML document; serves as the root of the document tree.
 
9:52 PM
I got rep score increase of over 500 points for no reason, anyone know why?
 
@JaAnTr $dom = new DOMDocument(); $dom->loadXML($string); $rates = $dom->getElementsByTagName('rates'); foreach ($rates as $rate) { $rate->getAttribute('base'); $rate->getAttribute('ts');}
 
crucially though, DO NOT USE SimpleXML
XML is inherently not simple
 
i never heard anybody use or speak about simplexml for 10 years
 
@hello loooooooool I got 10K
you basically just got double rep for all your questions
there's a blog post, cba finding the link
@beberlei we get (or at least, used to get) people asking about it in here on a weekly basis
it's very tempting for newbies, and you can see why, but it's such a false economy
 
@DaveRandom I had tried that but didn't work. Seems like if I try to load the actual XML, as in loadXML('rates.xml"); it doesn't work but if I just copy it in as a string like you did then it works fine.
 
9:58 PM
oh you need the load() method for that, not loadXML()
loadXML() takes a a string containing some XML data, load() takes the path to a file
 
Ah well that's incredibly annoying, spent about 30 mins googling and had no idea why it wasn't working. Thanks so much!
 
and yes the naming is terrible
We should add loadXMLFile() as an alias for load(), if anyone can be bothered doing that
(for consistency with loadHTMLFile() and general readability/googlability reasons)
 
cmb
@NikiC, ah, zend.multibyte! Thanks. (Found ~200 tests containing invalid UTF-8; let's see)
@DaveRandom, XML is ofc. simple. xml_parse_into_struct() proves that. ;)
 
@DaveRandom Sorry, one final question. When I have XML like <rates base="GBP" ts="1573679946">
<rate code="AED" rate="4.7190899844812" live="0"/>
<rate code="AFN" rate="100.47049152188" live="0"/> </rates>how can I get the rate value where the code is equal to something? Struggling to find stuff on google as most examples have the XML structured like <code>AED</code><rate>1</rate> instead of the value like in the tag
 
@cmb error_reporting(0); // makes application work properly
!!docs domxpath
 
10:11 PM
[ DOMXPath ] Supports XPath 1.0
 
have fun with that :-P
You may also get along with thomas.weinert.info/FluentDOM
...which has a CSS selector engine buried in it somewhere
although there's nothing wrong with XPath, it's a perfectly good query language, but it's a bit alien if you don't know it, obviously
/me drives home and eats and stuff
 
Amazing thanks! I've used Xpath quite a lot in Python and Java so makes sense
 
ah ok cool
well PHP is based on libxml2 which is sadly quite unloved in recent years, but it has good support for xpath 1
there's also a PHP SAX extension somewhere but iirc it's not free (as in speech or as in beer)
/me actually out for an hour or so now
 
 
1 hour later…
11:33 PM
@DaveRandom Perhaps you mean saxonica.com/welcome/welcome.xml
There is even some PHP binding IIRC.
Nevertheless, for internet standards, better use free (as in speech, beer and all the rest) software.
I for myself finally managed to make use of git archive to create docker images: git archive --format=tgz HEAD Dockerfile www | docker build -
git archive produces reproducible tar balls as far as I have found out.
 

« first day (3315 days earlier)      last day (1615 days later) »