« first day (2202 days earlier)      last day (2968 days later) » 

12:03
@bwoebi where is the libuv http parser thing? I can find no reference to it anywhere :-S
@DaveRandom ignore it.
works for me
@bwoebi can I just nuke it from the config.w32 then?
like get rid of the arg etc entirely?
@DaveRandom and the config.m4 and all the code related to it, yes.
There's a bunch of dead code there
I am not even going to attempt to modify m4sh
That will not end well for me
@bwoebi what about the debug stuff?
@DaveRandom leave that in
I sometimes needed it
12:06
@bwoebi Well I ask because the windows one doesn't have it, I'm struggling to work out what it does though, just symbols?
I think that the global --enable-debug-pack would cover that on win, although not 100% certain about that
@DaveRandom It's just a #define for a bit debug output
Oh OK, I will have to figure out how to do that in the windows build system, will ignore for now
Anonymous
github.com/Room-11/Jeeves/issues/110 We don't need this anymore #brexit
d:\build\php\build\7.0\x64\pecl\php-uv\php_uv.h(227): fatal error C1083: Cannot open include file: 'libuv/src/ares/inet_net_pton.h': No such file or directory (compiling source file ..\pecl\php-uv\php_uv.c)
d:\build\php\build\7.0\x64\pecl\php-uv\php_uv.h(227): fatal error C1083: Cannot open include file: 'libuv/src/ares/inet_net_pton.h': No such file or directory (compiling source file ..\pecl\php-uv\uv.c)
wtf @bwoebi do I need the source as well??
you need libuv header files, yes
12:12
I have those
Or, well, at least I have these:
uv.h uv-errno.h uv-threadpool.h uv-version.h uv-win.h tree.h
That's what come with the "official" windows builds
That looks like it's trying to include something from the libuv src which is expected to be bundled in the extension dir?
> The Zend OPcache provides faster PHP execution through opcode caching and optimization. It improves PHP performance by storing precompiled script bytecode in the shared memory.
does that mean it lives indepedent from php (for lack of a better way of phrasing it)? which shared memory does it refer to?
@DaveRandom it should only need uv.h
no it lives within the php process
it allocates shared memory itself
in big-ish chunks and "manages" it ...
you want more of an explanation than that @Gordon ?
I see in php-lxr.adamharvey.name/source/xref/PHP-7.0/ext/opcache/… that it uses system dependent semaphores. can I somehow access these outside of php?
@bwoebi Right, which it is finding otherwise configure would fail
will do some hacking around
12:21
it doesn't really use semaphores
I am wondering if one could build an opcache monitor with anything else than php
it's calling the shared lock, which it implements as a file lock a semaphore, which it sort of is, when the word in used in the general sense, but it doesn't use semaphores as you understand it
@DaveRandom also, in libuv repo I see no ares dir??
@JoeWatkins I dont understand semaphores so that is correct :)
I know it's weird
12:22
anyway, you can't access the shared memory from any process that is not a child of the process that mapped it
Evenings
/* TODO: remove these macro when libuv provides uv_inet_ntop & uv_inet_pton */
#ifdef PHP_WIN32
# include "libuv/src/ares/inet_net_pton.h"
# include <Ws2tcpip.h>
# define uv_inet_pton ares_inet_pton
# define uv_inet_ntop ares_inet_ntop
#else
# include <arpa/inet.h>
# define uv_inet_pton inet_pton
# define uv_inet_ntop inet_ntop
#endif
That's clearly some acient legacy @bwoebi
@JoeWatkins hmm, so restarting an fpm master will render any existing opcache inaccessible?
@DaveRandom probably… can you test whether always just having the #else branch works too?
unless the file cache is enabled, yes
12:25
or whatever the fix is :-D @DaveRandom
@bwoebi the functions themselves may exist by now, will play with it
@JoeWatkins I see. thanks.
that doesn't mean you can't write your monitor, it means you need to write it so that it spawns with php
ah, yes, I get what you mean
TIL: looks like TekSyndicate imploded two months ago
12:29
@bwoebi I just nuked that whole block there and it builds, docs.libuv.org/en/v1.x/… - can you do the same and just check that it builds in *nix?
Don't have a build env handy for that
@JoeWatkins so let's say I start fpm. then fpm would somehow need to start my monitor. lets say its a java program. as long as the fpm runs, that java program could access the shared memory with the opcache data? right?
well in theory yes, but that's extraordinarily complicated
welcome to my life
@JoeWatkins That's what she said?
complex to the point of impossible to do anything with it, you can pass the address of shared memory, but you have no idea what is in it, and it isn't structured in a way that yo ucan find out
a better idea might be to write a shared memory handler: php-lxr.adamharvey.name/source/xref/PHP-7.0/ext/opcache/…
12:33
Typing in a phone is hard .....
which wraps the configured one (probably mmap), that way you can track allocations and releases as they occur
Guys can you help me with segfaulting on Travis? github.com/php/php-src/pull/2080#issuecomment-256326444
@JoeWatkins that was the stuff I was looking at which led to my assumption that I can "just" use whatever handler is there from outside php
@DaveRandom works, fixed and pushed
you'd write a new one, that calls the old one, you'd have to patch opcache to make it work, but if you can make it work, I think we could PR the feature that opcache requires ...
that's still difficult, but not impossible, or useless ...
12:36
D:\build\php\build\7.0\x64\pecl>php -i | grep uv
uv
PHP libuv Extension
libuv Support => enabled
libuv Version => 1.9
\o/
@bwoebi @PeeHaa ^
:-)
I shall now attempt to start @Jeeves...
@DaveRandom \o/ sexy
@JoeWatkins let me dig deeper into it. then I decide if I'm up to it. but definitely thanks so far
> PHP Fatal error: uv_poll_init(): uv_poll_init failed in D:\Projects\Jeeves\vendor\amphp\amp\lib\UvReactor.php on line 397
\o/
12:38
lol
you might still have the problem that although you can instrument allocation, you have no idea what called the allocator - it's not called with reference to the script it is caching or anything like that
that was fast
I shall deal with that in a minute
Pretty sure you are the first one to run it on windows :P
12:40
Does anyone understand how index and try_files interact in Nginx? particular for this:
  index  index.php index.html index.htm;

  location / {
    try_files $uri /index.php$is_args$args;
  }
if it weren't for the requirement that you want to use another language, then I would say the most reasonable approach to a decent monitor is to give opcache a better php API ... possibly you could go down that road, and then you only have the problem of invoking some zend functions directly ...
@DaveRandom congrats
When a user requests /foo/bar/ is the try_files meant to try /foo/bar/index.php, /foo/bar/index.html etc?
@DaveRandom Set a breakpoint on line 6138 and get the error code
@Danack Gut feeling says no
12:42
@bwoebi k
@bwoebi actually that could be a challenge because debugging C in VS is hard (read: I Have No Idea What I'm Doing), however I will try
One quick question: I saw a piece of code with a class ParentClass with static method parseAbc() which is only called from child classes ChildAClass ChildBClass. Why would someone make it a static method if it is only called by classes which are in class hierarchy?
@abstraction Because the child class also contains static methods?
@PeeHaa it certainly doesn't appear to...
@abstraction Because people are scared of writing bare functions.
@Danack For some reason I actually never thought about it. I think I don't even set in index in servers
I dont get it. Do I need fresh air?
12:49
Using password_hash and password_verify right next to each other works, pasting password_hash into the database row and then running verify on it doesn't. :/
check if db is truncating the hash...
Anonymous
@PeeHaa Jeeves?
It's not, something is overwriting the password field at runtime, wtf.
@JayIsTooCommon ?
oh no
The uv ext
Anonymous
oic
Anonymous
12:51
I have an issue with reading up
You're doing your best. We cannot expect more from you
ThW
ThW
@peehaa: here is the class example you asked for: github.com/ThomasWeinert/php-extension-sample/blob/class/…
Anonymous
thanks :B
@ThW Nice! tnx
ThW
ThW
Here is another branch with a method, too
12:55
Was just scrolling through the branches :)
@Wes Genius one for Gordon :P
ThW
ThW
@PeeHaa the list grows :-)
Wes
Wes
:D
Indeed
Wes
Wes
hey, i've even managed to write some code today
what a productive day
it's just 20 lines, but still better than yesterday
13:06
first things first, that definitely works
github.com/bwoebi/php-uv/pull/11/… … lol… did I remove the wrong line… args lol
Yes, but it needs to be a --with anyway
And also I added stuff to support ,shared
and merged anyway
And throw up at the start if sockets is missing
just general make it make more sense :-P
@DaveRandom why should it throw up if sockets is missing?
13:08
@bwoebi Apparently it depends on it, according to that script. Is that not the case any more?
I didn't bother to actually check if that was true...
I believe it's a soft dependency… wait
#if !defined(PHP_WIN32) && !defined(HAVE_SOCKETS)
huh
#if !defined(PHP_WIN32) && !defined(HAVE_SOCKETS)
        {
                zend_module_entry *sockets;
                if ((sockets = zend_hash_str_find_ptr(&module_registry, ZEND_STRL("sockets")))) {
                        if (sockets->handle) { // shared
                                php_sockets_le_socket = (int (*)(void)) DL_FETCH_SYMBOL(sockets->handle, "php_sockets_le_socket");
                                if (php_sockets_le_socket == NULL) {
                                        php_sockets_le_socket = (int (*)(void)) DL_FETCH_SYMBOL(sockets->handle, "_php_sockets_le_socket");
there's that code…
did @DaveRandom bite @bwoebi?
@Tiffany yes…
ahhh.
@bwoebi I don't get what that is doing
13:13
@DaveRandom dynamically loading the php_sockets_le_socket symbol from ext/sockets, if it's shared
...why?
Where else is it used?
@DaveRandom where is what used?
php_sockets_le_socket
Anonymous
@DaveRandom got an interview with that code sample, thanks for your advice. The pints of coke I owe you are building up.
There's no point, presumably, in loading it if it's not used for something
13:14
@DaveRandom at some places, to support socket resources in ext/uv
Anonymous
@Tiffany seductively
Wes
Wes
pints... of coke?
@bwoebi OK... what happens when it's not defined?
it ought to be a soft dependency @DaveRandom
@DaveRandom if it's not defined, then there never will be socket resources passed to ext/uv and thus it's no issue anyway
@JayIsTooCommon Hot? I think?
Anonymous
13:16
Yeah pretty hot.
Anonymous
@Wes tiffany too - Not sure if you've seen happy tree friends, but would be good for inspiration
@JayIsTooCommon @DaveRandom is somewhat hot, yes … He just needs to touch some water then it immediately boils.
Wes
Wes
i do know happy tree friends. do they still exist?
@bwoebi Right I got it, took me a while
Anonymous
@Wes I hope so
Wes
Wes
13:17
me too
Anonymous
@bwoebi You big flirt
@DaveRandom I'm confused about why that code is exempting win32
@JayIsTooCommon If I'd flirt, I wouldn't be that sarcastic.
Anonymous
:P
@bwoebi me too, maybe it was WIP
@DaveRandom (I wrote that code long ago… btw. but I really don't know why today^^)
13:20
Oh that's not chobie?
Hey guys, how to print out a timestamp that looks like: 1138683600000 ?
@DaveRandom back then ext/sockets was an actual hard dependency
!!> echo time();
[ hhvm-3.12.0 - 3.14.4 ] could not allocate 218103807 bytes for translation cache <br/><i>Process exited with code <b>1</b>.</i>
lolhhvm
@bwoebi that will be why it's in the config.w32 then, I will have a play around with it when I've made it actually do something
13:22
@DaveRandom it's not lolhhvm, but some buggy install at 3v4l^^
@DaveRandom probably yes
@DaveRandom but echo time() doesn't produce 13 digit timestamp..
@bushdiver well, append 5 zeroes
!!> echo microtime(true) * 10000;
[ 7.0.10, 7.1.0RC4 ] 14774883480037
[ 5.6.9, 7.0.7, 7.1.0RC3 ] 14774883480063
[ 7.0.12, 7.1.0RC2 ] 14774883480039
[ 7.1.0RC1 ] 14774883480060
drop a zero and cast to int
13:27
@JayIsTooCommon @Wes seen Don't Hug Me I'm Scared?
I'm trying to use the result with javascript: new Date($time); doesn't seem to be accurate
Wes
Wes
nop
@bushdiver It's the difference between seconds and milliseconds
Surely you can do the math based on that
It worked by appending 0s, thanks guys
13:30
@Tiffany wth did I just watch?
@Naruto watch the whole thing?
unfortunately I did
I found waldo!
It's weird. The others are weird too
I love you all guys <3
I guess they hired drug addicts to make stuff like that?
so that makes @PeeHaa qualified ^^
I wouldn't be surprised if drugs were involved in the creation, but I doubt they were "hired" ... probably just some art students creating something.
hmmm should I click?
On one hand I love drugs. On another I hate art
"Friends have been telling me my rate is too cheap for web work." "How much do you charge?" "£15 an hour"
I would hire that
13:36
Just a tiny tiny bit too cheap. Just a tad
@PeeHaa it's like Sesame Street + morbid weird
DID SOMEONE SAY DRUGS ?
@Tiffany I'm pretty sure I know that
drugs
Anonymous
@JoeWatkins GO BACK TO BED JOE, YOU'RE DRUNK
13:37
@PeeHaa Oh yeah I suck. I need to redo it. 2 min job, will get it sorted tonight.
Anonymous
@Tiffany maybe, not sure. At work so can't click :P
@JayIsTooCommon booo, I'm at work too :P
@Sean Yeah I commented before reading the PR thread proper. You already noticed you fucked that one up in a glorious way
@JayIsTooCommon Sure you can still click
Anonymous
you reb
@Sean How did that happen btw?
13:38
Merging sucks.
:P
It's kinda impressive
:D
The old PR was wayy out of date. Still had plugins in /chat/plugins
So I tried to merge it, and of course it hit conflicts with the tiny amount of work I did in Rebecca
So it just bundled everything into a merge conflict fix commit.
As said. I am impressed :D
13:42
@bwoebi ENOTSOCK :-S
lol. I need that label for my tshirt drawer
I threw in the towel with trying to make the debugger work and just printf()d it because I am a terrible person
13:53
@Leigh Torvald thinks that tabs are good for indentation. I an't trust him about anything else regarding coding practices
@tereško When I write for the kernel, I also use tabs.
well ... you dont
I don't what?
@bwoebi Didn't you add something to PHP 7.1 that makes readable events on raw sockets possible?
@kelunik what's a raw socket in this context?
14:00
Uhh, you can already read raw sockets, that's how you write packet sniffers in PHP
@kelunik You mean socket_export_stream()?
@bwoebi Yes, there's nothing about it in UPGRADING, shouldn't that be there?
@Leigh You can read, yes, but you can't have readable events with stream_select.
@kelunik no. Because it was added in 7.0.7
what is the URL where we can test our php code in different php versions ?
@Exception 3v4l.org
14:07
@bwoebi It's still not documented.
@kelunik that may be true
@Leigh I would always forget the name of that site until it finally clicked (more recently than what I'm willing to admit) that it's just 1337 speak for "eval"
aye :)
@pmmaga :P
i would be clueless without autocomplete.. 3l4? no.. 4v3? no... DAMNIT!
:P
14:11
@pmmaga it's "eval" in l33t (i.e. 3v4l) and such
@bwoebi yup yup, but it took me way too long to realise it :P
hehe
Anonymous
@bwoebi well shit
@Leigh thanks
14:23
OK @bwoebi I'm getting somewhere with this. I suspect that the best solution here will be to throw out uv_poll_init_socket() and handle it transparently underneath, at the moment we have a userland check for $this->isWindows but it should be doable entirely with #ifdef PHP_WIN32 I think
uv_poll_init_socket() does nothing extra if you aren't on windows anyway, and the extension should be able to figure out which one is appropriate
atm I think the underlying uv_poll_init_socket() will always be what you want on window, because poll only supports sockets on windows atm
@PeeHaa the DateTime object expects a string ?
The constructor?
can I type something like new DateTime($month, $year)
No you can not
!!docs datetime::construct
[ The DateTimeInterface interface ] DateTimeInterface is meant so that both DateTime and DateTimeImmutable can be type hinted for. It is not possible to implement this interface with userland classes.
14:30
your example is perfect but I need to use variables for days months and year
[ DateTime::__construct ] Returns new DateTime object
@Riccardo So? Use variable for it :P
You can just concatenate the string
and add them to the object
new DateTime($month . $year) right
?
Just use my string and make the parts variable that you want
what part of your string
14:33
The part with the year and month
so I concatenate as I wrote above
!!docs datetime.createfromformat
[ DateTime::createFromFormat ] Parses a time string according to a specified format
@DaveRandom What happens when you don't pass the day?
Wait, what's the objective here?
Get the 1st of a month?
just hard code 01 as the day...
14:37
That's what I told him :P
my objective is to get the month and year
In what format?
and using cal days in month I know the amount of days in a month
all I miss here is the name of the days in a given month
the way I get the month and the year is a POST from a html select object
Right, and what do you want to actually do with the names of the days in the month?
so in php I $_POST the month and the year
and in a for loop I iterate the cal days in month function
to have all the days in a month and I succeed
all I miss is the name of the days in a month
14:41
!!docs cal_days_in_month
[ cal_days_in_month() ] Return the number of days in a month for a given year and calendar
Yes but why?
!!canon xy
963
Q: What is the XY problem?

GnomeWhat is the XY problem? When asking questions, how do I recognize when I'm falling into it? How do I avoid it? Return to FAQ index

^ this
@DaveRandom let me give you this example
14:42
I don't need an example of what you are trying to do, I want to understand why you are trying to do it, what's the bigger picture
It would be easier to me to show you what I did it's hard to me to explain you why I'm doing it
Hint: if you struggle to explain why you are doing something, step back and consider if there might be a better way
Which there might be. What is the real world problem you are trying to solve?
^ this
Also, morning. o/
Morning.
14:45
o/
pastebin.com/52zTEjSi this pastebin is an example of what I'm doing feel free to take a look at it if you want
anyway I need to calculate all the days in a month and the name of the days in a given month and I'm using cal days in month because I can handle all the exceptions of the gregorian calendar
something like what if this year is leap what if when I'm in a month of 30 or 31 days
and I repeat I succeed on almost everything all I miss is the name of the days for a given month which I get by $_POST
I'm pretty sure I already gave a snippet which doesn't look like above at all
@PeeHaa well, he copied it and it obviously didnt work
@tereško i didn't copy anything
I simply failed to make it work and so I kept the code at the point I got stuck
14:50
evenin room
@Riccardo But this is really inefficient, you are just outputting the same data 30 times with different date entries? What does that data actually represent? Why would I have asked the server for that data i.e. what did a user do to call that code?
4 hours ago, by PeeHaa
@Riccardo https://3v4l.org/U62Vp
@PeeHaa well, when he tried to copy it, it didn't work .. probably with error like "Parse error: syntax error, unexpected '<', expecting end of file in ..."
in a html page you have a list of month and year and the current month and year are automatically highlighted so when the page loads the php gets either the current month and year or what the user chose and for that choice the server responds by displaying all the days for that given month and year all I miss is the name of the days i.e. Monday Tuesdays and so forth why I'm doing it? I'm developing a signatures sheet attendance disease holidays
@DaveRandom
@Riccardo Right, but you are just returning JSON, presumably to an ajax call?
14:56
that's right
You could do all of that in Jabbascript
but I prefer to do it by separating the environments
Hi Guys.
A Quick question.
I like to use javascript for client side and php for server side
my choice
@Riccardo What you are doing is client side...
14:58
I have a payment page and after the payment is successful, the system is sending me some XML data as a response, but , I am not getting it in the resultant page(The XML Data) any guesses what would be the problem?
not exactly in javascript either when the page loads or when the user clicks a refresh button the data in the html page are sent to the server that gets them and respond doing what I wrote above
@SSJGSS Consulting a magic 8-ball would be as useful as asking us with the information given
Asking PHP for the names of the days in a month is wasting time and network resources and adding a layer of complexity that means that there is more chance something will go wrong

« first day (2202 days earlier)      last day (2968 days later) »