Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the constructor public #32

Open
levani opened this issue May 2, 2013 · 2 comments
Open

Make the constructor public #32

levani opened this issue May 2, 2013 · 2 comments

Comments

@levani
Copy link

levani commented May 2, 2013

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...

@ccampbell
Copy link
Owner

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.

@hakre
Copy link

hakre commented Sep 14, 2014

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants