« first day (4259 days earlier)      last day (915 days later) » 

03:10
@cmb There is a test on curl that fails on windows, This test look strange because it looks like there are hardcoded values. Not sure it's supposed to run successfully everywhere. It depends on the libcurl version it was compiled with... ( github.com/php/php-src/blob/master/ext/curl/tests/… ) Do you know the curl version running on appveyor ? If you can help on this that would be appreciated :-) Thanks !
 
3 hours later…
05:55
Have looked around but not found. What I am pondering is if there is a way to re-open STDIN in some way to read from tty when one pipe to a PHP shell script.
In relation to using readline()
If one pipe or redirect, echo foo | ./script.php or ./script.php <some_file the readline() does not work as it reads from an (empty) pipe. (Empty as in I have read the input before using readline().
I have a (bad) hack where I use bash and exec() - and that works, but would be nice to fix it in PHP.
06:25
posted on June 14, 2022

 
2 hours later…
08:54
On a php compiled in Win, does anyone know how I can specify where the DLLs are found? I used "php-sdk-binary-tools" and can see the DLLs exist somewhere under C:\php-sdk\phpdev\vs16\x64\deps for example, but when I run my compiled PHP "C:\php-sdk\phpdev\vs16\x64\php-src\x64\Debug_TS\php.exe" -m for example, I get a bunch of missing DLL errors, like "The code execution cannot proceed because libssl-1_1-x64.dll was not found...". Same with libcrypto-1_1-x64.dll, libssh2.dll, nghttp2.dll
My PHP configure is "configure --enable-debug --enable-cli --enable-sockets --with-openssl --with-curl --enable-zts" if that's any help/relevance
cmb
cmb
09:08
@Asgrim The dependency DLLs are in .\deps\bin by default (use configure --with-php-build=%DEPDIR% to change that). You need to put that directory in the PATH. Or instead of calling php.exe -m directly, run nmake run ARGS=-m.
09:25
@cmb Ahh thanks - putting it in path I think is necessary, as the built PHP I'm using to compile the extension against, so running nmake test in there needs to be able to invoke php directly as I understand it
cmb
cmb
@Asgrim nmake test (and nmake run for that matter) temporarily add that directory to the PATH. But of course, it doesn't hurt to add it manually. Also note that there is no need to build your own PHP if you want to do a phpize build of an extension.
@cmb hmm, nmake test was complaining with the same DLLs not being found unless I added to the path like you suggested. I also noticed a couple other weird things: CC="$(PHP_CL)" does not work, just comes up empty string (even though earlier in Makefile, PHP_CL=cl.exe is clearly defined), replacing it with CC="cl.exe" fixes. I also don't know how to make it use -d zend_extension=... instead of -d extension=...
I figured ZEND_EXTENSION('scoutapm', scoutapm_sources, true); would make it realise that in config.w32 but doesn't seem to be the case, so I'm just manually replacing atm heh
cmb
cmb
@Asgrim oh, I usually do configure --enable-snapshot-build and that sets up everything nicely. Possibly, some stuff is not done without it.
The problem with -d zend_extension might be that you need to pass an absolute path (-d extension is less demanding).
@Pierrick The exact dependency versions are listed in windows.php.net/downloads/php-sdk/deps/series. AppVeyor always uses -staging.txt, so packages-master-vs16-x64-staging.txt, i.e. libcurl-7.83.1. I'll update that test case.
10:37
how to execute a store procedure using php and sql server 2012
11:06
o/
RsD
RsD
11:19
Hello
how are you?
Anyone have any other simpler examples of a zend_extension that builds in Windows other than Xdebug? WIth "C:\php\\php.exe" -n -d zend_extension=Z:\\x64\Release_TS\\php_scoutapm.dll -m I'm getting Z:\\x64\Release_TS\\php_scoutapm.dll doesn't appear to be a valid Zend extension. It compiles without complaining. I'm fairly sure it's all using the same versions now (I've done away with the php-src build, now only using PHP + development pack from windows.php.net/download
My current incantation to build is in github.com/scoutapp/scout-apm-php-ext/blob/… if it helps
I'm sure it's something obvious, but I've been reading through xdebug source, and whatever I can on Windows exts, and it doesn't look like it should be too complex O_O
12:04
@cmb Thanks ! I'll know it the next time.
cmb
cmb
@Asgrim You need to export extension_version_info and zend_extension_entry. See gist.github.com/cmb69/5607d1a9632e942211d0731a61416cbb.
Good morning! Is there an "official" regex that matches use statements in PHP with all possible syntax (alias, use function, use const, grouping) ? Wanted to ask before writing my own
cmb
cmb
@CanVural Consider to use ext/tokenizer or github.com/nikic/php-ast instead.
Right, that'd be a better option. Thank you.
12:50
@cmb oh you absolute star. Thank you :)
13:23
@ramsey Thanks for the heads up, it's because I use Sara's tooling, or because I sign stuff with different emails (@php.net vs. @gmail.com) - I'll look into that for the next release cycle
Those are tags, but I raised with Sara about commits: github.com/sgolemon/php-release/issues/10
> "so he probably should really look into addressing that"

It appears that I'm doing something terrible :(
 
4 hours later…
17:31
@Asgrim why do you need it to be a zend_Extension anyways?
@beberlei I think a better question is, "why do you need to support Windows?" ;)
@LeviMorrison fair point :)
@Asgrim looking at github.com/scoutapp/scout-apm-php-ext/blob/… - you would be better off using a two dimensional array for looking up instrumentation instead of this malloc on every function call - same for the observer API.
hi btw, long time not dropped here :)
17:47
\o
hope things are well for you
they are
i saw that you have quite the plumbing incident at hand at your home, narf
Wes
Wes
mysterious sqlite errors
Unable to open database: bad parameter or other API misuse in
> @wes has an uncanny ability to break his tools
People ship applications backed by sqlite? :)
cmb
cmb
Nobody is using these, though, or do you know anybody using Firefox or Chrome? :p
Mosaic or bust
Wes
Wes
finally figured out the issue
SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE
i assumed OPEN_CREATE implied readwrite but no, it's a bitmask
Wes
Wes
18:25
yep
18:40
@PeeHaa my understanding is yes, people are realising that sqlite on an SSD is pretty performant.
> docker: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/entrypoint.sh": permission denied: unknown.
Anyone got a clue what that github error means?
19:00
ftr - use a computer that shows the file permissions correctly, and then chmod +x entrypoint.sh...
 
2 hours later…
Wes
Wes
21:09
how the heck do i exec() a query in sqlite3 with prepared statements
next time you see me attempting to start a sqlite project please kick me in the shins
$stmt = $db->prepare('SELECT bar FROM foo WHERE id=:id');
$stmt->bindValue(':id', 1, SQLITE3_INTEGER);

$result = $stmt->execute();
cmb
cmb
Consider to use PDO_SQLite (next time). :)
Wes
Wes
it's like only the first query is executed, ie
$sql = "ALTER TABLE ADD COLUMN one; ALTER TABLE ADD COLUMN two;"
only the first column gets added
i should've used PDO :'(
it's prepared statement, not prepared statements.
probably
Wes
Wes
ah so that's to be expected?
... and mysql. mysql is bad but at least i kind of know it
21:15
that's my understanding.
also, I wouldn't trust prepared statements to behave when the schema for tables is being altered.
cmb
cmb
@Wes that doesn't look like valid SQL (which table should be altered?)
Wes
Wes
was just trying to be brief. the alter tables work if ran separately. as danack suggested, only the first statements gets executed
weird that you don't get an error or something for attempting to do that
when the result is used, which is the case of a prepared statement returning a resultset, only the first statement is executed
that's from sqlite_query(). might be that sqlite3 behaves the same
@beberlei thank you - yeah that would be a good call. I sorta got it working and that was "good enough" for now but as usual, things stick around longer. I'll look into it, cheers :) and IIRC it needed to be a zend_extension to hook into function calls, prior to the Observer API, and the ext supports back to PHP 7.1 currently
cmb
cmb
21:30
@Wes sqlite.org/forum/info/1aa65114ef8631dd explains the behavior of the C API; ext/sqlite3 always ignores that parameter (i.e. it passes NULL).
21:49
Can someone who already has the php-src open in front of them check something for me? Does ReflectionParameter actually implement Reflector, according to the code itself?
@Crell It does in the stubs so it should yes
@Crell github.com/php/php-src/blob/… - My understanding is "yes".
Interesting. It does according to PHPStorm, too, but PHPStan insists it does not.
Seems like a bug in the stubs PHPStan uses
Running the actual code also agrees: 3v4l.org/mFvnX
21:55
Strange. I cannot replicate this issue in phpstan's online version.
cmb
cmb
Maybe you need to update PHPStan?
But it is most definitely telling me that I cannot use Symfony's registerAttributeForAutoconfiguration() method at all. :-) And that a class doesn't exist that I am in fact loading, so...
It's a fairly recent version. TYPO3 head tracks it pretty well.
I'm going to try blasting the cache and see what happens.
Ah, wait, it's because the callback is documented as a Reflector parameter, which means it thinks I'm narrowing the type. Which, I mean, I am, but by design in this API.
OK, I think I found a workaround that keeps all the various interpreters happy. Yeesh.
Though phpstan still insists a class doesn't exist, despite the class instantiating just fine. sigh
22:41
> Tell me, doctor, what is it that's making you smile?
> You, Garak. Just how many tailors are there that can rewrite Cardassian security protocols?
> I wouldn't even venture a guess. Which reminds me those pants you wanted altered are ready to be picked up.
🤣

« first day (4259 days earlier)      last day (915 days later) »