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

Something wrong with class loader ? #6795

Closed
Rikcon opened this issue Jan 8, 2015 · 7 comments
Closed

Something wrong with class loader ? #6795

Rikcon opened this issue Jan 8, 2015 · 7 comments

Comments

@Rikcon
Copy link

Rikcon commented Jan 8, 2015

Hello everyone, i have an issue with yii2 class loader.
The problem is it somehow messes up class name, i get following error when i edit config/web.php to show debug toolbar for my ip :

Class Aii\debug\Module does not exist

So the problem is it REPLACES first letter of class name from Yii to Aii, i did fresh install with composer several times, on two independent hardware (vagrant VM and my VPS).
It will replace ANY first letter.

I can provide any info about my setup if you ask.

Here is what i added to config/web.php :
(lines i added surrounded by *)

// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = 'yii\debug\Module';
*$config['modules']['debug']['allowedIPs'] = ['*'];*
$config['bootstrap'][] = 'gii';    
$config['modules']['gii'] = 'yii\gii\Module';
*$config['modules']['gii']['allowedIPs'] = ['*'];*

If i add $config['modules']['gii']['allowedIPs'] = ['*']; the same error appears but for gii class.

@mdmunir
Copy link
Contributor

mdmunir commented Jan 8, 2015

$config['modules']['debug'] = [
    'class'=>'yii\debug\Module',
    'allowedIPs'=>'*'
];

@samdark samdark closed this as completed Jan 8, 2015
@Rikcon
Copy link
Author

Rikcon commented Jan 8, 2015

Thank you, but yii expects allowedIPs to be an array.
So working code look like this

$config['modules']['debug'] = [
    'class'=>'yii\debug\Module',
    'allowedIPs'=>['*']
];

@sau00
Copy link

sau00 commented May 13, 2015

Same happens when I'm trying to load gii module.

Class Aii\gii\Module does not exist

@mdmunir
Copy link
Contributor

mdmunir commented May 13, 2015

@sau00 do you read the comments?

@sau00
Copy link

sau00 commented May 13, 2015

@mdmunir aww, sry, I've fixed it for Debug, but haven't fixed it for Gii module.

Thanks.

@Sir-Magic
Copy link

the 'AllowedIPs' is not the thing what's wrong

Add the class to the modules => ['class']
(Or use the different syntax as suggested above)

// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug']['class'] = 'yii\debug\Module';
$config['modules']['debug']['allowedIPs'] = ['*'];
$config['bootstrap'][] = 'gii';    
$config['modules']['gii']['class'] = 'yii\gii\Module';
$config['modules']['gii']['allowedIPs'] = ['*'];

@pragmas
Copy link

pragmas commented Aug 5, 2015

Thx Sir-Magic. Why this issue is closed? Basic and advanced templates should be updated accordingly! They are still buggy.

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

6 participants