Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 01 2016 11:35
    @tobscure banned @flame05
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
@datitisev
It seems to run out of memory when I do
if (!strpos($name, 'Flarum\Event')) {
  return;
}
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
@Luceos
@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
@datitisev
I see
What's a ReflectionClass? I saw it on the code but didn't understand it.
Ah, good.
Daniël Klabbers
@Luceos
it explains the class to you
the method it has
the properties
David Sevilla Martín
@datitisev
Ah...
David Sevilla Martín
@datitisev
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
@datitisev
Hm...
$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
@Luceos
@datitisev events can also be queries, simply do a class_exists($name) first
David Sevilla Martín
@datitisev
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
@datitisev
Hm.. it seems like it adds all events after the function to get them is called
David Sevilla Martín
@datitisev
Well, not necessary. I give up for now. :P Thanks anyway for the help, Luceos
Daniël Klabbers
@Luceos
@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
@flowli
Hey there, does anyone know the JS event when Mithril.js is done rendering?
Daniël Klabbers
@Luceos
@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
@kwiesmueller
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
@franzliedke
There are several community-created ones.
ganuonglachanh
@ganuonglachanh
Does anyone know why I insert post text to flatum posts.content by mysqli then it automatic insert <t> and </t> tag around the text?
Daniël Klabbers
@Luceos
@ganuonglachanh yes it's not html
it's xlst