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?
@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
@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)
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;
}
@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
@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
__constructis 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);
}
}
}
@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.
@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'.