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

Second request to "/debug/default/index" #11034

Closed
kmergen opened this issue Mar 6, 2016 · 2 comments
Closed

Second request to "/debug/default/index" #11034

kmergen opened this issue Mar 6, 2016 · 2 comments

Comments

@kmergen
Copy link

kmergen commented Mar 6, 2016

Working on basic app version yii2 dev.
If I load a page always a second request to debug/default/index is fired with a long timeline (10 s).
chrome says the initiator is the ajax function in debug script

image

if (toolbarEl) {
        url = toolbarEl.getAttribute('data-url');

        ajax(url, {
            success: function (xhr) {
                div = document.createElement('div');
                div.innerHTML = xhr.responseText;

                toolbarEl.parentNode.replaceChild(div, toolbarEl);

                showToolbar(findToolbar());
            },
            error: function (xhr) {
                toolbarEl.innerHTML = xhr.responseText;
            }
        });
    }

Here's what I've tried but without success

  • install stable yii2 2.0.7,
  • no theme
  • delete whole runtime folders
  • switch from db to file cache

Here my composer.json

{
    "name": "yii2-basic-starter",
    "description": "An extended Yii 2 Basic Project Template",
    "keywords": ["yii2", "framework", "basic", "project template"],
    "homepage": "http://www.yiiframework.com/",
    "type": "project",
    "license": "BSD-3-Clause",
    "support": {
        "issues": "https://github.com/yiisoft/yii2/issues?state=open",
        "forum": "http://www.yiiframework.com/forum/",
        "wiki": "http://www.yiiframework.com/wiki/",
        "irc": "irc://irc.freenode.net/yii",
        "source": "https://github.com/yiisoft/yii2"
    },
    "minimum-stability": "dev",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": ">=2.0.5",
        "yiisoft/yii2-bootstrap": "*",
        "yiisoft/yii2-swiftmailer": "*",
        "yiisoft/yii2-imagine": "*",
        "dektrium/yii2-user": "0.9.*@dev",
        "rmrevin/yii2-fontawesome": "~2.9",
        "bower-asset/blueimp-file-upload": "~9.9.0",
        "perminder-klair/yii2-dropzone": "dev-master",
        "2amigos/yii2-file-upload-widget": "~1.0"
    },
    "require-dev": {
        "yiisoft/yii2-codeception": "*",
        "yiisoft/yii2-debug": "*",
        "yiisoft/yii2-gii": "*",
        "yiisoft/yii2-faker": "*"
    },
    "config": {
        "process-timeout": 1800
    },
    "scripts": {
        "post-install-cmd": [
            "yii\\composer\\Installer::postCreateProject"
        ],
        "post-create-project-cmd": [
            "yii\\composer\\Installer::postCreateProject"
        ]
    },
    "extra": {
        "yii\\composer\\Installer::postCreateProject": {
            "setPermission": [
                {
                    "runtime": "0777",
                    "web/assets": "0777",
                    "yii": "0755"
                }
            ],
            "generateCookieValidationKey": [
                "config/web.php"
            ]
        },
        "asset-installer-paths": {
            "npm-asset-library": "vendor/npm",
            "bower-asset-library": "vendor/bower"
        }
    }
}

Here my main config

<?php
$params = require(__DIR__ . '/params.php');

$config = [
    'id' => 'basic-starter',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'language' => 'de-De',
    'sourceLanguage' => 'en-US',
    'components' => [
        'request' => [
            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
            'cookieValidationKey' => 'L8KaplYpqPFlZv-B-G60X3nb3W-t34k7',
        ],
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'authManager' => [
            'class' => 'yii\rbac\DbManager'
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
        'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
            // send all mails to a file by default. You have to set
            // 'useFileTransport' to false and configure a transport
            // for the mailer to send real emails.
            'useFileTransport' => true,
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'image' => [
            'class' => 'app\components\image'
        ],
        'assetManager' => [
            'linkAssets' => false,
            'forceCopy' => YII_DEBUG ? true : true,
            'bundles' => [
                'yii\web\JqueryAsset' => [
                    'sourcePath' => null,
                    'js' => [
                        '//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js',
                    ],
                ],
            ],
        ],
        'urlManager' => [
            'class' => 'yii\web\UrlManager',
            // Disable index.php
            'showScriptName' => false,
            // Disable r= routes
            'enablePrettyUrl' => true,
            'cache' => null,
            'rules' => [
                '<controller:\w+>/<id:\d+>' => '<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
            ],
        ],
        'i18n' => [
            'translations' => [
                'app*' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'basePath' => '@app/messages',
                ],
            ],
        ],
        'view' => [
            'theme' => [
                'basePath' => '@app/themes/basic',
                //'baseUrl' => '@web/themes/basic',
                'pathMap' => [
                  //  '@app/views' => '@app/themes/basic/views',
                    '@app/modules/backend/views' => '@app/themes/adminlte/views',
                    '@dektrium/user/views' => '@app/themes/adminlte/views/user',
                ],
            ],
        ],
        'db' => require(__DIR__ . '/db.php'),
    ],
    'modules' => require(__DIR__ . '/modules.php'),
    'params' => $params,
];

if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = [
        'class' => 'yii\debug\Module',
    ];

    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
    ];
}

return $config;
@samdark
Copy link
Member

samdark commented Mar 6, 2016

AJAX request to load debug toolbar is OK. Timing isn't. Are you using virtual machine with FS sharing?

@yii-bot
Copy link

yii-bot commented Mar 6, 2016

Issue moved to yiisoft/yii2-debug#86

@yii-bot yii-bot closed this as completed Mar 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants