« first day (845 days earlier)      last day (4117 days later) » 

11:00 PM
@Lusitanian I also just found this in StreamClient:

if( !isset($extraHeaders['Content-type'] ) && $method === 'POST' & is_array($requestBody) ) {
should be &&
 
lol since the morning my blog is beeing spamed, the spammers are lossing his time xD
lol "Unbelievable how well-wtrtien and informative this was." in a atachment page with a pic
 
@igorw That is why I use AND :P
 
@Lusitanian let me know if you want pull requests
and I just ran into a really weird problem. the timeout option of stream_context_create is making the request block for 30 seconds
only setting it to 0 fixes it... wtf
 
Code?
 
let me whip together a minimal case
 
11:14 PM
You must end with \r\n\r\n afaik...
 
o_o Pandora is down...
 
public function parseHeaders($data)
{
  $headers = explode("\r\n", $data);
  foreach ($headers as $i => $header)
  {
    $value = explode(' ', $header);
    $key = $value[0];
    array_shift($value);
    $return[strtolower(trim($key, ':'))] = implode(' ', $value);
  }
  return $return;
}

public function makeHeaders($headers)
{
  $string = "GET " . $this->_path . " HTTP/1.1\r\n";
  foreach ($headers as $key => $value)
  {
    $string .= "$key: $value" . "\r\n";
  }
  $string .= "\r\n";
  return $string;
@igorw It's cool actually...
@igorw add Connection: close header...
 
user895378
@webarto FYI you also have to accept \n line endings as well as \r\n to be 1.1-compliant.
 
@rdlowrey Oh, I'm sorry :whipsmyselfontheback: :P Thanks
 
user895378
And what if the header value contains LWS (space or horizontal tab)? exploding on spaces won't work at all.
 
11:21 PM
@rdlowrey Correct, I kind of know what headers are sent because I send them :) Disregard code.
 
user895378
That implementation also allows invalid control characters that are disallowed inside header field values.
 
Ok, I got it, it sucks :P
 
user895378
I'm not trying to bang on you, just letting you know :)
 
user895378
It will also break if it receives a header like this: My:Header: value
 
@rdlowrey How is the server work going?
 
user895378
11:23 PM
It's good. I'm considering implementing SPDY as well. Unfortunately I've had to do a lot of real work lately so I haven't been able to work on it as much as I would like this week.
 
user895378
Still faster than node.js and apache, though.
 
So, you also tweaked templates like the rest of us?
Yeah, that sounds amazing actually...
Would it stand a chance IRL?
 
user895378
As compared to what?
 
Apache, let's say...
 
@rdlowrey I've thought about doing SPDY as well :)
 
user895378
11:26 PM
@webarto It's as fast as apache for serving static filesystem resources and 50% faster than mod_php for serving a dynamic php script with 10,000 concurrent connections.
 
@webarto tried that, still nothing :-/
 
@igorw Hm, very odd :\
@rdlowrey Awesome, and what about "stability" (I don't know much about servers), could it be used as a replacement for "real" server?
Software, of course.
 
user895378
@webarto That's the whole point. I'm not crazy about running your whole application + server stack through one process, though, because if your app causes a fatal error it'll bring your whole site down. I have a basic process manager working now to avoid that issue and emulate fastcgi. It's nowhere near ready though.
 
So, here is a fun question. I want to make a brief showcase of phpixie and I wanted to comission a voiceover for it, so Which one would you choose:
http://www.liz-chen.com/wp-content/uploads/2011/06/LizChenAnimation1.mp3
or
http://fiverr.com/sexyvoicegirl/record-a-professional-female-voice
 
@rdlowrey Right, you are looping, it'll crash with the script. Well, good luck to you, Sir.
@Dracony It looks like Kohana...
 
11:32 PM
yeah, it kinda does. but that's not the point
I'm more curios to the voice choice)
 
I'm not.
So, basically Kohana Slim?
 
yeah
 
@webarto you were right about connection close, I had

$extraHeaders['Connection'] = 'close';

Instead of the totally intuitive:

$extraHeaders['Connection'] = 'Connection: close';
 
@igorw And day is saved :) Works correctly now?
@Dracony Do you think it would be fair to give some credit? Just saying...
 
@webarto yes, thanks <3.
 
11:36 PM
But it's not a fork, I just keep a consistable interface, the code is totally different, basically I tend to avoid doing unnecessary stuff, like prefetching column names for ORM, not serializing things into json for file cache (my implementation works really faster for larger files) etc
I do give credit to both Kohana and CI on the benchmark page, I say there that it's mostly their grandchild.
 
@igorw <3
 
Sadly I didn't get to writing an 'About' page yet, but I'd definately mention those there
 
@Dracony Ah, OK, that would be fair IMHO in any case. And someone might mention it later when you get famous, so...
 
lol
CI is going to have grandgrandchildren
=)
 
Kill 'em, kill 'em ALL!
 
11:38 PM
@Lusitanian brace yourself, pull request incoming
 
btw, quick question
since Mysql 5.6 supports memchache api for inserts, selects (they claim it is time faster than using SQL), is that in any way supported by PHP?
I mean without calling the actual memcached API directly of course
 
I stopped browsing through it threw up a bit in my mouth at class Misc
 
well it only has like 2 methods, the first one didn't fit anywhere, nor did the second
as for testing purposes I have the find_file mocked in a Misc class mock, so unit testing works ok with it
 
"doesn't fit anywhere" is almost always a pointer to a bigger problem
 
well so I wanted a helper method that retrieves an array key, or a default value if it is not present
 
11:43 PM
@Dracony Then you've just circumvented the entire purpose of the unit test
 
why?
 
@orourkek You have a point, and it shouldn't be a class, nothing wrong with functions.php (if really needed)...
 
Misc::find_file would return a file path
what I do is this:
 
You basically threw out the logic of that method and made it return a static value... how are you testing the guts of the method?
 
Misc::$file='testfile.txt';
$out=$this->object->methods();
//..run assertions
@orourkek, Oh that''s simple. I'm testing the real Misc::find_file separately
 
11:45 PM
All that the mock "Misc" object does is let all of your other tests assume that the actual find_file method works 100% of the time
which is an anti-test
 
it is tested, just as a separate process. phpunit can do that
If i ever get at least few more methods that deal with files I'll make them in a separate class
but as far as finding files goes it's fine as a static method because it doesn't influence a global state in any way
it's as if you had a static method like this:
public static function add($a,$b){return $a+$b;}
methods like these is what the whole 'static' keyword was created for =)
 
I just don't see the purpose of putting two methods into one non-semantic class, when (at the very least) you could put each into something more semantic
 
yes, I could have File::find() and Arr::get() but that would just make more files =)
 
@Dracony Why is number of files more important than expressiveness and readability?
 
user895378
Misc and Utils are secret code words for "poor design." It was on the Rosetta Stone; even ancient peoples knew that.
 
11:54 PM
well simple, imagine that with time I have to make more helper one shots, like getDate() or prettyPrint etc
you really think it's better to add classes for each of those, each having a single static method?
 
^ yes.
or if you up the php req to 5.3, you could use namespaced functions
 
well, I'll give it a thought. It's not as if it's hard to do =)))
hm, well i'll think
btw
Kohana has a Kohana:: class for stuff like that
e.g. Kohana::config, Kohana::find_file etc
 
@Dracony Just because somebody more popular than you did it doesn't mean it is right.
 
just ppointing it out)
 

« first day (845 days earlier)      last day (4117 days later) »