Reputation: 185
I have a class to manage files and I use the method url () below
class Stored_File {
public $id;
public $extension;
public $mime;
public $filename;
public $source;
public function url()
{
return static::url_from_filename($this->filename);
}
. . .
to have the path and use it. How can I check if the method url() for an instance has been called somewhere?I need to know if url is called because if not, means that the file is not used and I can delete it.
Upvotes: 0
Views: 84
Reputation: 167
If this is just for debugging purposes, you could try inserting debug_backtrace() within your url() function to see where it is getting called from.
Checkout this link for some documentation about that method: http://php.net/manual/en/function.debug-backtrace.php
Upvotes: 1