Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • Jan 01 2016 11:35
    @tobscure banned @flame05
not sure if that's what you meant
Daniël Klabbers
ah i see
Hmmm.... maybe this isn't worth it
There's like 100 events every time I create a post
wait, they aren't all flarum... they were supposed to be
David Sevilla Martín
It seems to run out of memory when I do
if (!strpos($name, 'Flarum\Event')) {
it doesn't return a response
wait nvm... this confuses me so much lol
Well, this isnot necessary. I may come back to it. Not important.
datitisev @datitisev sighs
Daniël Klabbers
@datitisev two things i'd do
a) use a ReflectionClass and it's namespace method or property to check
b) cache the reflection class (static property or something) based on the event name/class
and 128mb is quite high, but for dev you can easily increase it
David Sevilla Martín
I see
What's a ReflectionClass? I saw it on the code but didn't understand it.
Ah, good.
Daniël Klabbers
it explains the class to you
the method it has
the properties
David Sevilla Martín
David Sevilla Martín
thanks! :D
aah i have light theme enabled
this is reminding me of some crappy java code i found on wednesday
David Sevilla Martín
$reflection = new \ReflectionClass($name);
causes an error
this is very confusing
so the class select *... doesn't exist., but i never entered that
it's an Object of class Flarum\Extension\ExtensionServiceProvider this time
I have to go soon anyway. Thanks for the help, tho, Luceos
Daniël Klabbers
@datitisev events can also be queries, simply do a class_exists($name) first
David Sevilla Martín
Ok, thanks!
I wasn't able to use that because, for some reason, whenever I did if (is_string($name) && !get_class($name)) return it kept erroring that get_class wasn't receiving a string
Oh well. I fixed by ignoring all strings, and then using get_class($name) for the ReflectionClass instance, then getting its namespace name and checking it contains Flarum\Event, etc
Still doesn't add the measures, tho
David Sevilla Martín
Hm.. it seems like it adds all events after the function to get them is called
David Sevilla Martín
Well, not necessary. I give up for now. :P Thanks anyway for the help, Luceos
Daniël Klabbers
@datitisev is_object($name) || (is_string($name) && class_exists($name))
not sure how the measures work from those few snippets :)
you'll have to trace it into the code of the debugbar then
Florian Arndt
Hey there, does anyone know the JS event when Mithril.js is done rendering?
Daniël Klabbers
@flowli morning
there's init for constructor and config when it's done and you can add listeners and the like
does that help @flowli ?
Kevin Wiesmüller
Hey there!
Have you already thought about a docker image? If not, I would like to try this using one (and create one myself)
Franz Liedke
There are several community-created ones.