0
votes

I can't for the live of me figure out where a certain vendor is loaded in CakePHP.

Somewhere in this script, the vendor folder tcpdf is being run. I can't find any App:import() in the relevant files which are run.

Somehow the view-file got the value $pdf which is an initiated tcpdf class somewhere which I can't find. It doesn't seem to be in any controller nor model which is run on that page. Can't find the word 'pdf' in any of the config-files either.

So there's something somewhere that is being run without my knowledge. Any ideas where?

I'm new to CakePHP and mostly used with Codeigniter, and am positioned to work with an already created and functional CakePHP site.

The really wierd thing here is that I changed the name of the vendor folder and the script still runs without any configurations changed ! The path should be lost but it isn't. Which I guess means all the vendor files are searched through via a php script or something?

This is driving me insane, so please let me get all ideas to where to even look after the $pdf = new TCPDF();

Edit: What I'm trying to do is simply to update the tcpdf version, however I can't find where to do that. Replacing current files seems risky.

Moar Edit: I ran that debug and got this:

require - APP/vendors/tcpdf_oldz/tcpdf.php, line 1
App::__load() - CORE/cake/libs/configure.php, line 956
App::__find() - CORE/cake/libs/configure.php, line 934
App::import() - CORE/cake/libs/configure.php, line 861
require - APP/views/helpers/pdf.php, line 2
App::__load() - CORE/cake/libs/configure.php, line 956
App::__find() - CORE/cake/libs/configure.php, line 934
App::import() - CORE/cake/libs/configure.php, line 861
RequestHandlerComponent::renderAs() - CORE/cake/libs/controller/components/request_handler.php, line 569
RequestHandlerComponent::startup() - CORE/cake/libs/controller/components/request_handler.php, line 193
Component::startup() - CORE/cake/libs/controller/component.php, line 100
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 229
[main] - APP/webroot/index.php, line 90

I've checked up relevant files, but I can't find any connection to where is all starts and how it can load the same file even though I change the name of the folder.

1

1 Answers

0
votes

Try temporarily sticking a trace call at the top of the file or at top of the appropriate function to trace where it's being included from:

pr( Debugger::trace() ); exit;