« first day (1957 days earlier)      last day (3217 days later) » 

20:01
@bwoebi no, the session handler has to ensure that it's cached only privately.
@kelunik well, then you can put the session handler before the middleware which serves Sendfile headers
but IMHO are sendfile headers somewhat of a Hack
We should just have a function returning a Generator which serves from a specific file
@bwoebi sendfile is served by a responder, no middleware can do that.
@kelunik sure, but you can call Root::__invoke($request, $response) (on a custom instance with appropriate cache settings)
but well… you can just set Cache-control: private in the session middleware? @kelunik
like (new Aerys\Host)->use($session)->use($responder)->use($root);
(note that middlewares are retained, even when your responder is yielding control to another responder outside of Router for example)
@kelunik well, fine then
20:13
@bwoebi hm?
If your session middleware is only set somewhere inside Router and the responder doesn't start a response, the fallback responder will still be routed through the middleware (basically: your code will work in any case)
@kelunik Shall we tag an 0.1.0 for aerys-session now?
@bwoebi I think I did that already.
@kelunik oh. :-D
Will tag v0.1.1 tomorrow probably.
@kelunik I just need some advice on how to shape the API to get the body … currently we have Aerys\Request::getBody() … now … getBody() is bound to certain limits (which you can set in Options) … by default these are fine, but you might want to allow larger uploads for authenticated users … so … I'm envisaging something like getBody($size = null) (null for default … or -1?) … I'm just not sure how to handle repeated calls to getBody() … shall we allow them with different sizes?
e.g. first allow getBody(131072) and then still allow getBody(262144) or require all subsequent Body sizes to be equal to 131072 (first call) or null? … The main point is … what handling exactly do we want when body sizes get exceeded?
user5516789
20:36
okay then @kodeart tryed reinstalling wamp didn work still getting error 500
user5516789
CC @Charles
@bwoebi Do we allow multiple calls currently?
user5516789
im thinkin im gonna make an tag text instead so it dosnt fail
o/
@kelunik currently it just always returns the body instance (and has no parameters) … which is also quite weird as the body is pretty much one-way … you can consume the Body only once after all (at least when you use the PromiseStream mechanism and don't yield it)
20:41
@bwoebi Yes, that's why I asked.
@kelunik yea… but I'm not sure what to do about that…
@bwoebi allow the call only once?
What obviously would be easiest is just allowing one call … but not sure if that fulfills all needs …
@kelunik yeah, sure, I'm just not sure whether that's good enough.
Possibly @Danack has advice on this?
You're asking me an API design question? You must be desperate....
@Danack I'm not asking you an API design question directly, but rather whether you can see benefit in getBody() being callable multiple times
dunno why I'm asking you, my gut told me you were the right one…
20:50
That sounds weird....I can't think of a case where I'd definitely need to get the body multiple times....but there must be some somewhere.
@Danack There could be multiple layers, but I think you should just passed the buffered body in that case.
That would mean that the layers would need to know about each other....which I think I disagree with.
@Danack I guess with buffered Body he means a pure string
But multiple responders could actually be a problem.
posted on February 24, 2016 by kelunik

Initial release.

20:55
@kelunik good point… but then we have this problem with partially consumed bodies anyway?
Yup, it would require buffering it always.
So the only real solution actually is forbidding more than one call
Though that thing is weird too …
if (!$res->getBody() instanceof NullBody) {
    yield from handleRes($res); /* function calling getBody() */
}
@kelunik ^ :-/
class FooImpl {
    public function __construct() {
    }
}

$fn = 'FooImpl::__construct';
$fn();
> Call to undefined function FooImpl::__construct()
Does anyone know of a reason why constructors aren't callable? Except through their silly syntax...
constructors must be called on an instance?
class FooImpl {
    public function __construct() {
    }
}

$fn = [new FooImpl, '__construct'];
$fn();
@Danack ^ perfectly works
@Danack Because constructors are actually just initializers, they don't construct the object.
21:01
k - ta.
actually - let me rephrase then; is there any reason why there is no way to have 'construct this object' as a callable in PHP?
Reflection?
Basically - there's some complication that could be removed from Auryn, if this was possible:
@Danack I understand the sentiment and agree it should be easier.
$injector->share('FooInterface');
$injector->delegate('FooInterface', 'FooImpl::__construct');
$fn = [new ReflectionClass('FooImpl'), 'newInstance'];
21:04
function make($type, ...$args) {
    return new $type(...$args);
}
^ This is really not that complicated, though.
No but 'FooImpl::__construct' - can sit in a plain text config file.
The php code equivalent can't.
Maybe use a different format?
Or add semantics?
'FooImpl::__construct' - can also sit inside the property of a class:
class FooFactory {
    private $constructMethod = 'FooImpl::__construct';
}
Nothing can be called there.
you have an uncanny ability to war with constructors
I'm going to add that to the top of my C.V., "Dan Ackroyd, pissed off by constructors".
21:13
I always though it'd be nice if constructors returned $this.
And implicitly allocated/constructed the object before "initializing"
    public function __construct() {
        $this->foo = 1;
    }

    // were actually something like \/

    public function __construct() {
        $this = allocate_object();
        $this->foo = 1;
        return $this;
    }
missing a static there - but yes.
$foo = call_user_func(['Foo', '__construct'])
@Danack Oh, sure. Static, yes.
Also, I think rather than being context specific just a function that takes the class name, of new($classname);
$classname::new()
$foo = Foo::new(); $foo = [Foo::class, 'new']();
21:37
@Danack You could special case it probably.
Yeah....or probably it's got to already have a special case to prevent it from being called, now.
21:55
@Danack no good reason
/am writing another RFC that has a higher than average number of words beginning with 'C'
Wes
Wes
22:24
evenings @Danack do you know what yasuo means with that last message in the deprecations thread :\ ?
I think he just means that some of the stuff in the 'deprecation' RFC is covered in his mandatory session RFC.
huh, what? I thought Yasuo had only talked about precision
Wes
Wes
"mandatory" :P
@Andrea asked about deprecating anything related to passing the session id within urls rather than just cookies, it's insecure and old. but apparently they are mandatory for the ext to work correctly
@Wes ohhh that email
It's correct to describe 'new' as a language construct?
Or is there a better way to describe it, than just magic.gif.
22:37
@Danack yes
@Danack sure
it's factory for everything
new could be described as an operator, even, though I'm not sure if that quite fits
@iroegbu Except ints/floats/strings.....which is a problem for another time...
22:41
@Danack one of the ideas I've had in the past is having a Foo::new function you could define, to define a constructor, not initialiser... is that what was discussed earlier?
@Andrea no, I was just thinking about allowing the current __construct to be called via a callable variable, rather than only being invokable through new $classname
@Danack that's fair too
"to define a constructor, not initialiser" - not sure what you mean there.
__construct is just a function, it should be callable directly. you can do it for parent::.
@Danack so you could return an existing object if you wanted to
class Character
{
    private static $cache = [];
    public static function new(string $char) {
        if (isset(self::$cache[$char])) {
            return self::$cache[$char];
        } else {
            return self::$cache[$char] = new self($char);
        }
    }
}
I'm guessing that would mostly be used to implement singletons......
22:45
@Fabor Hey Fab, long time, how are you?
@Danack ick
also we should be able to define uninheritable static members
class Point
{
    private function __construct(...) { ... }
    public static nonhereditary function newFromFoo(...): self { ... }
}
other options: noinherit, uninheritable
@Andrea I think that it is too late for that. I think, just not having inheritance of any static properties or methods would have been the correct choice, but it would break too much code to change now.
@Danack unfortunately we can't fix that, yes, but for future code...
Wes
Wes
23:08
class Bar{ self function baz(){} }
but it's useless effort. like many i've abused statics, now i realize they shouldn't even exist
@Andrea i'd like that only if it was transparent. basically so that new Character("a") === new Character("a")
@Wes they should.....they are useful as they allow a function to be written that has access to class private properties......the only problem is the screaming insanity that is 'static' 'inheritance'.
@NikiC I had to actually look at the commit to figure out what AO meant :-/ … Could you just write it out in future, please? thanks!
Wes
Wes
@Danack but you could have privileged visibility other ways, like... "namespace-protected" stuff
Even then, class visibility levels are nice.
Wes
Wes
23:19
idk. it's rare that you have a class alone. classes within the same namespace knowing each other is legit too
@bwoebi There's a length limit
@NikiC I know… but :x
@bwoebi lol that's how you can tell someones an artist and not a developer jkjk
I wouldn't have time for that
@bwoebi And for the record, ArrayObject is crap
@NikiC crap implementation wise, concept wise or both?
23:29
I was working on some tangentially related stuff, looked at some ArrayObject code and ended up fixing 8 different bugs
@NikiC why such the huge version number jump in PHP?
@NikiC it needs to be made final and yes it's godawful
@NikiC who ever thought it was a good idea to make ArrayObject use its properties hashtable for the array
we should switch to a specialised version of zend_hash for symtables, purely to break ArrayObject for good
@Andrea It doesn't ... usually
@NikiC ogodwat
Only if you do ($ao = new ArrayObject)->exchangeArray($ao), then it will start using its own properties
23:38
huh
@OliverQueen Because PHP 7 is so awesome, a single version increment just wasn't enough
@NikiC sigh
@NikiC - what happened to unicode support?
I though that was up next...I might be mistaken though
And don't get me wrong, I love PHP7
@OliverQueen It was defenestrated
Is that anything like castrat...oh...nevermind..
Well drat...I was hoping to get better compatibility with unicode
maybe in the future
23:41
Basically PHP 6 was the one with unicode support, but it didn't work out. So instead you get PHP 7, which supports performance in place of unicode ^^
I do like it's benchmarks
*its
Wes
Wes
@OliverQueen the major issue is defining a decent api (you can help here github.com/krakjoe/ustring)
Obligatory link to the PHP6 postmortem slide deck: slideshare.net/andreizm/…
The useful bits start around like slide 50 or something, but it's all worth it.
@Wes Frankly, that's a minor issue
RFC early draft: Callable constructors
Wes
Wes
23:43
@NikiC what's the major issue then?
I find it really hard to make an argument for something, when I think "durr, just do it" should suffice.
@Danack So would this allow __construct to be called multiple times, or after new?
@Wes Essentially it comes down to a) Unicode is fucking complicated and b) handling it everywhere is often slow and memory intensive
Wes
Wes
you can call construct multiple times already @Charles
@Charles it'd be an implicit new call
23:44
@Charles there would be no change to that - 3v4l.org/5NUWe
Aaaaaaaa
I hate PHP.
The issue b) was exacerbated by PHP 6 stupidly trying to store strings in UTF-16
Wes
Wes
@NikiC just using icu would help?
@Danack I really need to stop assuming that PHP ever does a sane thing by default without actually testing it.
23:46
@NikiC 8? Not bad for eyeballing.
Wes
Wes
@Charles you can even call __clone() explicitly now :D
Yes. Not "trust but verify" but "verify and then keep one eye open".
2
@Wes PHP6 used ICU. Check out the slide deck.
@Wes Oh my head.
Wes
Wes
it's not a tragedy tbh
@NikiC The 2 byte format or the variable one?
23:50
both are bad
@LeviMorrison You mean UCS2?
No idea, whatever ICU uses presumably
RIP in piece PHP6
@Wes The ustring api is missing locale parameters
23:56
Why are certain names in italics?
Are you guys mods?
@bwoebi There is only one true encoding
@NikiC yes. Utf-32, I know.
I still wish PHP was unicode compatible
Wes
Wes
@NikiC on which functions?
@bwoebi :P
I also like WTF-8, just because of the name ^^
@OliverQueen room owners. mods are in blue
@Wes things like tolower
23:58
Ahh dope.
simonsapin.github.io/wtf-8 <---for reference
@NikiC lol, that's even a thing…
@NikiC can we please just have 32 bits in a byte? That'd solve all our encoding problems ever… (well, until we'll have 2 billion unicode code points…)

« first day (1957 days earlier)      last day (3217 days later) »