Reputation: 159
I am having a project, that contains several Controllers, Views and Helpers (The original developer, from whom I overtook the job, didn't bother to use Models). In one of the Controllers (Iframes.php), there is (of course) a function __construct(), an index() and a function called view(). In the construct, there is a $this->load->helper('iframes'); No other helpers are being loaded.
The website is being accessed by address https://website.ext/iframes/view/1234567890
In the iframes_helper.php, there is no reference to another helper file soever. But the iframes_helper.php is calling a function called get_loans(). That function only exists in one file: loans_helper.php
There are OTHER Controllers that load the loans_helper.php (by its normal way).
If I rename the loans_helper.php (to loans_helper.php1), the system won't load, stating a file is missing. It doesn't tell me WHERE there is being referred to the missing file.
I've searched through all the files for
load->helper('loans')
even for
load->helper('loans
and
('loans')
but there is nowhere a referral to the loans_helper file. At least not in Controllers that are being used in the Iframes Controller or files belonging to it.
But the function get_loans is still accessible. How can this be? Or rather: how do I find out where the helper is being loaded?
Albert
Please tell me, if I need to add some code.
Upvotes: 1
Views: 276
Reputation: 2614
You should also search for variants of 'loan' using double quotes, "loan
, since that's also valid.
At the top of the loans_helper.php
file, add debug_print_backtrace(); die;
, which will output some useful information about the execution path. Note that if you're testing in a browser, that you should view the source of the page, to get a more usable format. From the backtrace you'll be able to determine how the file is being included (i.e. via CI's loader system, or directly via include
or require
).
Here's PHP's documentation on debug_print_backtrace()
.
Lastly, here are a couple other thoughts on where such a file could be included:
autoload.php
config file. There's an item for autoloading helper files.include
or require
.Upvotes: 2