chromephp icon indicating copy to clipboard operation
chromephp copied to clipboard

Make the constructor public

Open levani opened this issue 11 years ago • 2 comments

Is there any particular reason for changing the constructor method type from public to private? This class doesn't work in codeigniter unless I make the constructor public...

levani avatar May 02 '13 14:05 levani

It is designed to be a singleton (you can only ever have one instance of it). If the constructor is public and there are multiple ChromePhp instances then it could cause issues with incomplete or missing logs.

There must be a way around this in codeigniter?

ChromePhp::getInstance()

Would be how you could get an instance of the class although all of the methods should be called statically.

ccampbell avatar May 02 '13 23:05 ccampbell

@levani: You don't need to in Codeigniter. Just use it the standard way, don't use it the Codeignter way. There is no need. It's already a super-static, no need to use Codeignter to turn it first into one.

you don't need a global, you just need a super static

hakre avatar Sep 14 '14 12:09 hakre