milo / XDebugTracePanel

XDebug Trace panel for Nette 2.0 framework
14 stars 1 forks source link

Nette 2.1 compatibility? #3

Closed tmysik closed 10 years ago

tmysik commented 10 years ago

I have two issues with Nette 2.1:

(1) if I use your neon configuration, I get Unexpected indentation on line 26

24:            extensions:
25:                xtrace: Panel\XDebugTraceExtension
26:                    traceFile: %tempDir%/trace_file.xt
27:                    onCreate: InitHelpers::setupXTracePanel
28:                    statistics: TRUE # TRUE or sort them by deltaTime: [TRUE, deltaTime]

(2) if I comment lines 26, 27 and 28, I get Declaration of Panel\XDebugTraceExtension::afterCompile() should be compatible with Nette\DI\CompilerExtension::afterCompile(Nette\PhpGenerator\ClassType $class)

Sorry if I am missing something obvious...

Thanks a lot!

milo commented 10 years ago

I'll take a look on it in few days, i guess I know where the problem is.

tmysik commented 10 years ago

Perfect, thanks a lot!

milo commented 10 years ago

@tmysik 1) HOWTO updated 2) Could you try update? I pushed some fixes to master.

tmysik commented 10 years ago

I will check it tomorrow and let you know. Thanks!

tmysik commented 10 years ago

A bit better now :) Now the error is:

call_user_func() expects parameter 1 to be a valid callback, class 'Helpers' not found

It fails on line 575:

572:        public function createServiceXtrace()
573:        {
574:            $service = new Panel\XDebugTrace('/home/gapon/public_html/worx/nette-skeleton/www/../temp/trace_file.xt');
575:            call_user_func('Helpers::setupXTracePanel', $service);
576:            $service->enableStatistics(TRUE, NULL);
577:            return $service;
578:        }

I grep-ed sources and there is no setupXTracePanel method anywhere...

Just to be sure that I am doing it properly - both sections (extensions and xtrace) are directly underneath the common section - is this OK? I am asking because in Nette 2.0, the xtrace section was underneath common > nette - can you confirm this?

Thanks.

milo commented 10 years ago

That's because you must write your own helper. It is optional and helps you to adjust the panel. Doc is not perfect in this way.

Sections in neon are OK.

tmysik commented 10 years ago

That's because you must write your own helper. It is optional and helps you to adjust the panel. Doc is not perfect in this way.

Aha, I see now :)

Sections in neon are OK.

Thanks for confirmation.

BTW off-topic: perhaps you could add @method annotation for callStart() etc. methods to the Panel\XDebugTrace class.

So, all issues are resolved now. Thanks for your work!