Problem when using modules #48

Closed
joujou opened this Issue Feb 20, 2012 · 4 comments

Comments

Projects
None yet
2 participants
@joujou

joujou commented Feb 20, 2012

I try to use the extension in an application with modules and it doesn't work. The PHP code produced by the extension is returned in the source.
I'm not sure it's because I use modules but with another app without modules, I worked perfectly.

@malyshev

This comment has been minimized.

Show comment
Hide comment
@malyshev

malyshev Feb 20, 2012

Owner

Could you please give me your config sample? Almost of my applications is modular, and I have no problems with it.

Owner

malyshev commented Feb 20, 2012

Could you please give me your config sample? Almost of my applications is modular, and I have no problems with it.

@joujou

This comment has been minimized.

Show comment
Hide comment
@joujou

joujou Feb 20, 2012

It seems I've solved my problem:
in fact it seems the problem was in my server config, in which
phpinfo() was disabled in php.ini.
The strange thing is that some URLs could work, the ones that didn't
use a path format (index.php?r=controller/action).
I had PHP code in my final output:

....

+
                    <div class="minus">–</div>
                                    &nbsp;/usr/local/YiiFramework/framework/web/CBaseController.php(119):

require("/Dev/Web/yii-annuaire/protected/extensions/yii-debug-toolbar/vie...")

            <div class="code"><pre><span class="ln">114</span>

$data=$data;
115 if($return)
116 {
117 ob_start();
118 ob_implicit_flush(false);

119
require($viewFile);
120 return ob_get_clean();
121 }
122 else
123 require($viewFile);
124 }




.........

In case, this is my config for modules, routes and log:

'defaultController' => 'recherche/structure',

'modules'=>array(
// uncomment the following to enable the Gii tool
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'password',
'ipFilters' => array('127.0.0.1'),
'generatorPaths'=>array(
'application.gii', // a path alias
),
),
'recherche'=>array(
),
'backend'=>array(
),
),

'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'caseSensitive'=>false,
'rules'=>array(
// Gii
'gii'=>'gii',
'gii/controller:w+'=>'gii/',
'gii/controller:w+/action:w+'=>'gii//',

            // Routes generales
            '<module:\w+>/<controller:\w+>/<id:\d+>'=>'<module>/<controller>/view',
            '<module:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>'=>'<module>/<controller>/<action>',
            '<module:\w+>/<controller:\w+>/<action:\w+>'=>'<module>/<controller>/<action>',

            // Routes generales
            //'<controller:\w+>/<id:\d+>'=>'<controller>/view',
            //'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
            //'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

            // Si aucune règle validée à ce stade et action précisée, routage

action recherche
'<param_controller>/action:w+'=>'recherche/<param_controller>/',
// Si aucune règle validée à ce stade et pas d'action, routage
recherche (action par défaut)
'<param_controller>'=>'recherche/<param_controller>',
),
),
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'ext.yii-debug-toolbar.YiiDebugToolbarRoute',
'ipFilters'=>array('127.0.0.1'),
),
),

2012/2/20 Sergey Malyshev
reply@reply.github.com:

Could you please give me your config sample? Almost of my applications is modular, and I have no problems with it.


Reply to this email directly or view it on GitHub:
#48 (comment)

Cordialement,

Jean-Pierre Jounier

joujou commented Feb 20, 2012

It seems I've solved my problem:
in fact it seems the problem was in my server config, in which
phpinfo() was disabled in php.ini.
The strange thing is that some URLs could work, the ones that didn't
use a path format (index.php?r=controller/action).
I had PHP code in my final output:

....

+
                    <div class="minus">–</div>
                                    &nbsp;/usr/local/YiiFramework/framework/web/CBaseController.php(119):

require("/Dev/Web/yii-annuaire/protected/extensions/yii-debug-toolbar/vie...")

            <div class="code"><pre><span class="ln">114</span>

$data=$data;
115 if($return)
116 {
117 ob_start();
118 ob_implicit_flush(false);

119
require($viewFile);
120 return ob_get_clean();
121 }
122 else
123 require($viewFile);
124 }




.........

In case, this is my config for modules, routes and log:

'defaultController' => 'recherche/structure',

'modules'=>array(
// uncomment the following to enable the Gii tool
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'password',
'ipFilters' => array('127.0.0.1'),
'generatorPaths'=>array(
'application.gii', // a path alias
),
),
'recherche'=>array(
),
'backend'=>array(
),
),

'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'caseSensitive'=>false,
'rules'=>array(
// Gii
'gii'=>'gii',
'gii/controller:w+'=>'gii/',
'gii/controller:w+/action:w+'=>'gii//',

            // Routes generales
            '<module:\w+>/<controller:\w+>/<id:\d+>'=>'<module>/<controller>/view',
            '<module:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>'=>'<module>/<controller>/<action>',
            '<module:\w+>/<controller:\w+>/<action:\w+>'=>'<module>/<controller>/<action>',

            // Routes generales
            //'<controller:\w+>/<id:\d+>'=>'<controller>/view',
            //'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
            //'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

            // Si aucune règle validée à ce stade et action précisée, routage

action recherche
'<param_controller>/action:w+'=>'recherche/<param_controller>/',
// Si aucune règle validée à ce stade et pas d'action, routage
recherche (action par défaut)
'<param_controller>'=>'recherche/<param_controller>',
),
),
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'ext.yii-debug-toolbar.YiiDebugToolbarRoute',
'ipFilters'=>array('127.0.0.1'),
),
),

2012/2/20 Sergey Malyshev
reply@reply.github.com:

Could you please give me your config sample? Almost of my applications is modular, and I have no problems with it.


Reply to this email directly or view it on GitHub:
#48 (comment)

Cordialement,

Jean-Pierre Jounier

@joujou

This comment has been minimized.

Show comment
Hide comment
@joujou

joujou Feb 20, 2012

The problem was that phpinfo() was disabled in php.ini. The strange thing is that it seemed to work for some URLs without path format. When it didn't work, some PHP code was output in the final source code.

joujou commented Feb 20, 2012

The problem was that phpinfo() was disabled in php.ini. The strange thing is that it seemed to work for some URLs without path format. When it didn't work, some PHP code was output in the final source code.

@malyshev

This comment has been minimized.

Show comment
Hide comment
@malyshev

malyshev Dec 10, 2013

Owner

Closed as outdated. phpinfo not used anymore

Owner

malyshev commented Dec 10, 2013

Closed as outdated. phpinfo not used anymore

@malyshev malyshev closed this Dec 10, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment