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
David Sevilla Martín
@datitisev
Problem is, I never see the test1 measure... for some reason
And sometimes I see the fired logs, and sometimes I don't
I don't really know why.
Ok, now i see them in the logs :P storage/logs/flarum.log https://i.imgur.com/7bXieTB.png
Daniël Klabbers
@Luceos
does the code execute completely nevertheless?
what is your php memory limit configured at?
David Sevilla Martín
@datitisev
Um....
I don't know
Daniël Klabbers
@Luceos
php -i | grep memory_limit
David Sevilla Martín
@datitisev
128M
I mean, the log gets executed
If I put another log after the measures, it does get executed
That one event is from outside the Collector class (this is EventCollector extending TimeDataColector)
Daniël Klabbers
@Luceos
i can't see what addmeasure is
David Sevilla Martín
@datitisev
That's from Debugbar itself
Daniël Klabbers
@Luceos
so can't tell why it doesnt do anything as i dont know what it should do
David Sevilla Martín
@datitisev
Well, you see the same code as this:
$debugbar["event"]->addMeasure('test1', microtime(true), microtime(true));
just executing it from inside itself
the code right above is executed on ConfigureWebApp event, and it does get added
but not the one on the collector itself
Daniël Klabbers
@Luceos
you are loading that debug bar events property in the construct of the listener?
not sure if that's what you meant
Daniël Klabbers
@Luceos
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
@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