« first day (1341 days earlier)      last day (3832 days later) » 

16:00
/me is out, catch ya later
see ya @DaveRandom
@DaveRandom pecl.php.net/package/pthreads see I done the exact same thing with 0.1.0 when I thought stable ... but I was told I was wrong ... which I hate ...
lata @DaveRandom
me 2 actually chaps, catch ya lata :)
user924016
later
Hello everyone! I am trying include a file using require_once and kinda clueless if I am doing it wrong or not. Allow me a moment till I form my question.
> htdocs (Folder)
googleapitest.php
> GoogleClientApi (Folder)
> src (Folder)
> Google (Folder)
Client.php
> Service
Analytics.php
from googleapitest.php I am trying to include Client.php and Anlytics.php using this code:

require_once(__DIR__.'/GoogleClientApi/src/Google/Service/Analytics.php’);

I read several questions on main site and I understand __DIR__ will get me current directory. Any help would be appreciated.
@JoeWatkins wiki.php.net/rfc/peclversioning/solution1 wiki.php.net/rfc/peclversioning/solution2 both of those state that for stable you should have an 1.0.0 version at least
16:14
yep. i.imgur.com/fXf7c2E.gif hammer time.
AFAIK we never officially accepted/approved those
user924016
Those websockets are crazy
but as Pierre is the author of the second version and he was the most active peclweb dev/admin that time, he tend to say that it is the approved way of versioning
personally I think that part makes sense
//god help us now, the HAMMER has been unleashed.
//break it down, stop. HAMMER TIME!
as a fello coder you'd understand what these two lines mean - right?
My head's already laughing with the hacky javascript i'll have to write to glue the whole shit together.
16:33
hmmm, this feels sooo gooood: uncrunched.com/2014/06/17/…
user895378
@Ocramius nice.
user924016
16:49
Anyone know any libs/scripts (in any language) for copying of a .git/ that a dev left in the public. I am asking because I wrote a crap php script that does that long ago and considered tidying it abit up and releasing it
user895378
$ cp -R .git /path/to/new/location
user895378
?
is -R needed?
user924016
more like www.hello.com/.git/index
user924016
like when a cowboy develops right on the production server and forgets about that he left the .git readable
16:54
@Fabien for copy, yes
for move, no
hmmm. Guess I've yet to copy anything except for a single file. Nice to know. Cheers @ircmaxell
user924016
let me copy my old crap script
Dniproavia ERJ-145 hijacked by bees at Kiev. The airline says its staff "attempted to negotiate" but were chased off. http://t.co/FboVt0LK9W
user924016
I meant like this gist.github.com/RonnieSkansing/cac6f9eeca8cdc232d4f aaand sorry about the logic/style, it was written in a blaze to explain someone the files could be picked out one by one from the object files
user924016
and for automating it..
16:59
@LeviMorrison I have a moment, but if it's going to be longer than that, another time might be better.
If it's feedback about a PR, doing it async on github might be best.
user924016
So it works fine if directory traversel is off due to fetching the index file and rebuilding the structure local and finding the objects and reverting them into files. The most familiar thing I can find is github.com/evilpacket/DVCS-Pillage/blob/master/gitpillage.sh
17:14
@Danack Another time then.
Any tor users?
user1596138
^

RUJordan sucks at PHP

5 mins ago, 19 seconds total – 2 messages, 2 users, 0 stars

Bookmarked 6 secs ago by Florian Margaine

lol
0
Q: Tor sometimes manages to connect, sometimes couldn't resolve host

Madara UchihaThis is a followup of Can Tor be configured to run on all outgoing connections on a server? I've successfully placed Tor as a transparent proxy over my system, however, I'm getting some trouble. I am trying with curl http://icanhazip.com Sometimes, it returns an IP which is different from th...

17:37
@SecondRikudo DNS
@copy So I'm told. What can I do about it?
Not use tor
I think a VPN would work better for you
@copy Been there, done that. Won't work.
I need to change my IP every couple of minutes or so. a VPN has its own set of problems
17:39
Ok. Well, tor is routed through some random servers. If one of them is too slow or doesn't feel like it, DNS can fail
@copy The behavior is pretty consistant though
If I wait a while, it'll say "Couldn't resolve host" and then if I try again it will succeed.
Oh, then you might get an answer
What you describe sounds possibly illegal, by the way
@copy Been through this a couple times in this room (you can lookup the history). It's all legal and no TOS are being violated.
Oh, right
The Tor site seems pretty dead
Which is why I resolve to asking here in chat.
17:54
anyone here has XP with behat/mink?
lol
18:18
What are the file permissions required to use file_get_contents()?
There isn't much documentation on this.
18:32
It seems as if read-only permissions are not enough. I've seen people use execute right up to the directory, but this didn't work for me.
Not sure - have you thought about using CURL instead @HelpingHand?
I ran into a permissions problem with fopen recently, and just used the CURL equivalent instead.
10
Q: PHP : how can use curl instead file_get_contents

NuLLeRI use file_get_contents function to get and show external link on my specific page. In local everything is OK but my server doesn't support file_get_contents function. I try to use cURL with this code: function file_get_contents_curl($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT...

@Daniel I've refrained from using curl so far and it sounds a little meticulous. I'm trying to view the apache error.log using file_get_contents().
The function has always worked for me in the past.
Ah okay, yeah not sure what the permission problem would be then
@HelpingHand read permissions are sufficient
@HelpingHand because there isn't much needed. If the file is readable, it'll work. If it's not readable (or you've configured PHP to not let you read it), it won't
@ircmaxell the file is not readable when I run is_readable on php. The user is root on both the file and php.
18:40
and the permissions of the file and folder (and all folders up the stack)?
also, are openbasedir restrictions on?
Hey PHP bros and bro-ettes
I've got a question but I am not quite sure what I am asking for here, so if anyone could give me a hint that would be great....
I have the following
      <?php $header = "$" . "col" . $j . "header";?>
I want to be able to use $header elsewhere, but I would the variable name I am making to translate, if that makes sense, is this possible, or am I going about it all wrong
Gotta question for you:

$_SERVER['HTTP_USER_AGENT']; //returns the proper string
$derp = get_browser(null, false); //false for object return //returns nothing
function_exists("get_browser"); //returns 1 (true)
Why isn't get_browser returning anything?
@RUJordan Probably 'cause of this: us2.php.net/manual/en/…
Ah shoot.
That's not good
18:52
Also, take note of the size of browscap.ini... 6 megs. 6 megs of INI parsed every time you need to use it.
Unless you know that you need the data inside of it, you're probably better off just using the user agent directly.
and consider that the info is unreliable at best (for most usages at least)
nvm figured it out, variable variables it seems.
I have a puzzle for you: Why does removing the reference on $v change the output?
$x = [0,1,2];
foreach ($x as $k => &$v) {
    print $k;
    if ($k == 0) {
        unset($x[1]);
    }
    foreach ($x as $y) { }
}
My Zend-Fu failed…
the first foreach doesn't fork the array then, it iterates in place
@Charles yeah I found a function that parses out the OS and the Browser from HTTP_USER_AGENT
Unfortunately, it looks like Twilio doesn't send a user agent that my functions detect
So thats cool
18:57
@ircmaxell oh. I had looked at that line lxr.php.net/xref/PHP_TRUNK/Zend/zend_vm_def.h#4309 before but didn't realize it was the solution…
also, HHVM behaves differently: 3v4l.org/81rl8
Is here only PHP wrong or PHP and hhvm?
I don't know
Both wrong; that's my personal opinion.
I bet that's nowhere documented… we really need a PHP spec
@LeviMorrison mine too. but not sure…
19:01
@LeviMorrison what do you think should happen?
I'm not so sure. I keep trying to reason it out, and can't really make sense of it
@ircmaxell 0202
Iterator invalidation; that's what should happen.
Well, the second one I think is right, because it should iterate on a copy of it (copy-on-write and all)
@LeviMorrison so PHP's reference behavior is correct...?
Modifying a collection when iterating over it is undefined behavior in most languages.
We've tried to make special cases of it and whatnot.
I'm not faulting us for trying; I just think it's a pointless battle.
@DaveRandom But press tab to get them.
I'm not sure if 012012 or 0202 is the best… but it should IMO one of both…
19:05
Ok I got another question -- if anybody is familiar with Twilio's browser-phone -- it seems that on Status Callback URL, the user agent is non-existant. Is there a way to pass the user agent from browser-phone.php (the page the client enters the phone number to call), so that twilio sends that to callback.php (file called upon hangup) so that I can store it in my db?
@LeviMorrison IMO foreach should take array_keys() and iterate through them and skip the ones which aren't defined anymore…
IMO foreach should take only Traversable, and array should be Traversable
that doesn't solve this problem though
Shoot, too late to remove. Ignore that question -- my boss found it
@ircmaxell True, I thought were were just wish-listing.
Though, the more well defined interface of Iterator would at least provide an order to the events, and by modifying the iterator during iteration, you'd be able to more easily rationalize what the behavior should be.
19:23
Encountering a problem that i was hoping someone could provide some assistance.
1
Q: User Uploaded Images – Blank Post – Connection reset by peer / FastCGI: incomplete headers

panoramicTo give a little background, I have a website that permits users to upload images. WordPress is used as a content management system and the posts are immediately published with the image inserted as the featured image of the post. From that point the images are displayed in a gallery style forma...

19:45
@ircmaxell The user is root for both the file and php, and the permissions for the /var/log directory are set to drwxr-x--- The group is adm however.
openbasedir? chroot jail?
@ircmaxell The user is root for /var and log, and open_basedir is off.
@ircmaxell I don't think I have chroot jail... At least I didn't set that up.
and you're sure the user is root for the php process?
@ircmaxell Hmm... Let me confirm that...
var_dump(posix_getpwuid(posix_geteuid()));
19:57
@ircmaxell ;-) thanks. What would the user be under in that array?
"name"?
I wonder what happens when you throw an exception in an iterator when using it in argument unpacking... hmm...
yes
@LeviMorrison you can use an iterator in argument unpacking? It doesn't need to be an array?
@ircmaxell I think so
At least according to the RFC a Traversable should work.
I've never actually tried it.
20:00
@ircmaxell "name" => "www-data" you were right. The user isn't root. What should I do? Changing the user would cause problems right?
@LeviMorrison exceptions will be handled as expected
that's the pleasant thing about implementing code working with traversables ... you need to check EG(exception) after every single operation :/
@ircmaxell isn't apache user www-data too? So how would it write the log? This doesn't really matter, but I'm curious of how this works, and if I could use the same method...
apache may or may not be www-data
depends on how things are configured
hi all
20:12
@ircmaxell What should I do to read this file?
/me isn't going to help anymore. I told you it was a permissions issue. You swore it wasn't. I said it was a permissions issue. you said both were root. You insisted. But back and forth. But it is a permissions issue. So, no thanks
And another tiny avatar that is
@ircmaxell Ugh... alright. Just one other question... Would setting the 'world' permissions on the domain to 'read' allow php to read it?
so... $foo = yield $bar works now
do you know what that means?!
20:20
Hi Guy I did this code and it works the way I want but now how can I display only the rows in red .
if($Total_Order < $current_fees){
$colored = "color:red";
}
else {
$colored = "color:green";
}
function foo($a, $b, $c) {
    return foo(yield $a, yield $b, yield $c);
}
@ircmaxell
it means the AST is alive and kicking
@ircmaxell can you actually do that ?
@NikiC Oh yeah? Did you build it with C++? Or did you break down and use C?
20:21
@ircmaxell it's C
user895378
@NikiC \o/
nice!
how far along are you?
@NikiC please check on my question up and c if u can assist
NikiC: A feature for 6.0 that's actually worth something \o/
user895378
I'll say it before someone else does: "now HHVM generators and PHP generators are more compatible" ;)
20:23
@ircmaxell Taxidermy: Moments In Nature Captured Forever
^^ Should be a calendar.
@ircmaxell I should have all expressions ported to use the ast soon
Will publish the code then
nice, what's the structure of the AST? a struct with an identifier for type? or...?
@ircmaxell Currently it's the same that was introduced for the constant expressions, i.e.
struct _zend_ast {
    unsigned short kind;
    unsigned short children;
    zend_ast *child[1];
};
what about statements that have different types of children? Like for statements?
mostly that works fine - a bit ugly for some things, if you need to store some extra bit of info along with children it's not so nice
@ircmaxell you just store them in different children
So init-exprs would go to child[0], cond-exprs to child[1], loop-exprs to child[2], stmts to child[3]
20:28
@NikiC ah, fair enough. So you'd introduce a for_init ast node? (or something like that)
@ircmaxell or reuse a generic expr_list node or something
And I wanted to work with @NikiC, but he didn't show me any line of code…
also: that means that any particular statement/expression is limited 2^16 (32k) children... Not saying that's a problem (I don't think it is), just saying it...
@NikiC nice. So should be easy to expose to user-land as well (either as an array structure, or as objects)... :-)
@ircmaxell yes ... currently fixed size nodes and dynamic ones use the same structure. I'd split those into two where the latter has a zend_uint children size
also the nodes need lineno
20:31
@bwoebi soon ^^
dude, sounds awesome, I can't wait to play with it
@NikiC you still need a child count for destruction… except if you really want to maintain a list for every constellation which the number of children is…
@bwoebi isn't that what unsigned short children; is for?
@ircmaxell oh, misread… he means once usinged short and once zend_uint?
that's how I read it at least
20:37
I understood as if he wanted to drop it for fixed size nodes
@ircmaxell I'm going to take a stab at the first thing you'll try: converting zend_ast to LLVM ast :)
@LeviMorrison why? I'm actually making really good progress at converting it to libjit opcodes
Oh, for static analysis.
libjit stuff would be great too.
yeah, things are actually pretty interesting on that front. Arrays need to be taclked, but math works fine so far...
Actually converting to libjit would be really easy.
(structures like arrays aside)
You just map kind to a jit operation.
Hard part becomes zval stuff.
20:43
Well, type inference is the hard part
Yeah, that's what I meant with zval stuff.
I've got type reconstruction mostly working where possible. With the exception of generalization, which I want to add in
but I'm researching how to properly do inference when I can't reconstruct...
Such as what case?
what case for which? generalization, or inference?
I'm not sure what you mean by 'generalization' here
20:46
$x = 1;
return $x + 1.5;
in that case, the optimal route is to make $x a float (which is a generalization of an int) from the start
By the way, have you toyed with the language Julia yet?
I'm amazed by its simplicity in terms of LOC it took to implement it.
Might actually try it.
@LeviMorrison played with it some time ago
to solve some ode's with runge kutta and plot the result
resen
did they really claim to be faster than C -O3 at fib()?
20:53
@ircmaxell well, look at the fortran result ... 0.26
well, fortran is fast at math...
probably they can be faster because they have additional aliasing information, or something like that
was faster than C for a very long time
though not likely true anymore today
@ircmaxell and julia is (primarily) a scientific language, so it's not unreasonable for it to be fast at math as well :D
Fortran isn't faster than C for most intents and purposes, no.
Compilers have mostly figured out the differences; sometimes they need a tad bit of user help in C but for the most part they are the same.
20:55
@LeviMorrison today. In the 90's when I first played with it, it blew C out of the water for math related things...
@ircmaxell Even the last decade, mate :)
which is why up until just a few years ago, it was still tought to engineering students
@LeviMorrison the 90's were more than 10 years ago ;-)
Right; I just meant it has been longer than 'today'
Julia uses quite a bit of fortran under the hood, it seems. Uses fortran ABI to make integration easier.
yeah, that's true
Although that actually bites them because the fortran ABI isn't as stable as C's.
That's actually surprising but true.
20:58
interesting
My goal is to get type inference to use static types wherever possible, and only resort to a "mixed" dynamic type if necessary...
Are you doing the same with arrays?
trying to determine the type of the array elements?
usually they're of the same type…
Well, I'm doing a few things
first, for parameters, I'm differentiating int[] from array, where array is a hashtable of dynamic type. And int[] is a normal array of integers (no string keys, etc)
I'd also support char*[] ?
@bwoebi string[]?
yes
21:10
@bwoebi why woulnd't we?
for internal arrays (declared inside a function, and not returned or passed), I'm going to staticly determine if it's an array or a hash table, and if it's an array, simply "fake it" by creating new scope variables...
that's my plan anyway
that only works with "packed" arrays? (continuous interger keys) (what they've done in phpng?)
@bwoebi yup. wherever we can, I want to try to do that
@bwoebi fyi packed arrays only need in-order integer keys, not necessarily continuous ;)
there's some overhead in the conversion, but I think that'll be saved in the ability to directly reference the element
and what do you do with dynamically sized arrays? for ($i = 0; $i < count($array2); $i++) $array[] = $array2[$i] * 2; do you recognize here directly that the $array will be of size count($array2) or you constantly reallocating the array?
21:16
for now, the plan is to constantly reallocate the array
but the way the engine is built, if you can write a rule, that can be added in
one by one or multiplying with two or how?
@bwoebi that part isn't written yet. so not really sure yet
okay
so the theory is there are several "transforms" that operate on the AST. All of the type re-construction happens on visitors to the normal AST (annotating it, and converting nodes as necessary)
then the compiler takes the AST (which is annotated) and turns it into instructions
for example, the compiler doesn't know how to do an assign op (+=), instead, there's a rule to convert $a += 1 into $a = $a + 1
the big question, is how far do we want to take it
how much code should run on it.
01
21:26
@ircmaxell I think you can still extend it later… so first make everything work, then do everything else.
Yeah, but then there are questions. Like should the compiler be plugable (meaning should there be a clear separation between the analyzer and the compiler). Which would allow an LLVM compiler to be inserted (or whatever other jit compiler, or static compiler if you really wanted)...
and should a custom AST tree be built, or should I stick with dynamic additions to Nikic's parser's AST...
etc
Morningi!
Spain == HHVM. Looks good on paper. Sucks in practice.
There, I have said it
:-)
@bwoebi yeah, that's what we're doing :-)
21:32
@PeeHaa sounds like you're watching fifa when you're not coding :)
Netherlands == PHP. Looks like shit and inconsistent as shit. Gets the job done either way.
;-)
I might have had a couple too many zerman beers
US == VB. Nobody expects it to work. Nobody thinks about it. But somehow, sometimes, it manages to pull one off
@ircmaxell :D
I'm out, laterz
"US == VB. Nobody expects it to work. Nobody thinks about it. But somehow, sometimes, it manages to pull one off" ™ -@ircmaxell
WTF is there also a @ircmaxwell ?
:P
@ircmaxwell
1 tweets, 7 followers, following 1 users
@ircmaxell later
21:51
@webarto Do you watch the world cup?
@PeeHaa Of course, I'm not American :)
:P Makes me wonder. Do you prefer any team?
Yes, I prefer the Erdinger one.
heheheheh
Bosnia, but just because I live there :)
Not really, maybe Germany, and Holland, of course :P
21:54
!
You've just earned your free pass to come work over here :)
Yay!!!
If you're happy and you know it: image not found
Yeah, facebook and tokens.
lol @ dawg
My doge and Eyezill (Özil).
21:55
:D
s/doge/rat
:D
I made him feel bad, so he would sit.
hehehehehehehehhehe
I hope the Netherlands win a little bit. But if I support them they will lose.
Sexy and I know it.
He's seen more of the World than some people.
I once said that he traveled more than neighbours kid, so they didn't want to talk to me after that.
I was just saying, make your kid more active.
21:58
How old is he?
6 years now, passed too fast :(
@Fabien Meh you can support them the next game. It's pretty safe :)
@webarto Woah. That is young
Did you try feeding it?
:P
One moment room. I am in serious need of beeeeer
WARSTEINER BECAUSE WELTMEISTER

« first day (1341 days earlier)      last day (3832 days later) »