{"action":"created","issue":{"url":"https://api.github.com/repos/trntv/yii2-starter-kit/issues/266","labels_url":"https://api.github.com/repos/trntv/yii2-starter-kit/issues/266/labels{/name}","comments_url":"https://api.github.com/repos/trntv/yii2-starter-kit/issues/266/comments","events_url":"https://api.github.com/repos/trntv/yii2-starter-kit/issues/266/events","html_url":"https://github.com/trntv/yii2-starter-kit/issues/266","id":102134069,"number":266,"title":"PDO Error - Null sent to Probe","user":{"login":"dbd5","id":9496750,"avatar_url":"https://avatars.githubusercontent.com/u/9496750?v=3","gravatar_id":"","url":"https://api.github.com/users/dbd5","html_url":"https://github.com/dbd5","followers_url":"https://api.github.com/users/dbd5/followers","following_url":"https://api.github.com/users/dbd5/following{/other_user}","gists_url":"https://api.github.com/users/dbd5/gists{/gist_id}","starred_url":"https://api.github.com/users/dbd5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbd5/subscriptions","organizations_url":"https://api.github.com/users/dbd5/orgs","repos_url":"https://api.github.com/users/dbd5/repos","events_url":"https://api.github.com/users/dbd5/events{/privacy}","received_events_url":"https://api.github.com/users/dbd5/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-20T13:02:15Z","updated_at":"2015-08-24T10:59:43Z","closed_at":null,"body":"Hi,\r\n\r\nI've got a curious error I can't figure out. \r\n\r\nI get  the following error when I click system-information from the backend control panel\r\n\r\n'Argument 1 passed to probe\\provider\\AbstractProvider::getDbType() must be an instance of PDO' , null given, called in /var/localhost/backend/views/system-information/index.php on line 116 and defined.\r\n\r\nThe offending code seems to be the following;\r\n\r\n                        <dt><?php echo Yii::t('backend', 'DB Type') ?></dt>\r\n                        <dd><?php echo $provider->getDbType(Yii::$app->db->pdo) ?></dd>\r\n\r\n                        <dt><?php echo Yii::t('backend', 'DB Version') ?></dt>\r\n                        <dd><?php echo $provider->getDbVersion(Yii::$app->db->pdo) ?></dd>\r\n\r\nMy DB connection code is as follows;\r\n\r\n    'components' => [\r\n        'db' => [\r\n            'class' => 'yii\\db\\Connection',\r\n            'dsn' => getenv('DB_DSN'), // Disable this and enable the next line for codeception tests\r\n            // 'dsn' => 'mysql:host=localhost;dbname=eng1_tests',\r\n            'username' => getenv('DB_USERNAME'),\r\n            'password' => getenv('DB_PASSWORD'),\r\n            'tablePrefix' => getenv('DB_TABLE_PREFIX'),\r\n            'charset' => 'utf8',\r\n            'enableSchemaCache' => YII_ENV_PROD,\r\n        ], \r\n    ....\r\n\r\nAccording to the manual (http://www.yiiframework.com/doc-2.0/guide-db-dao.html), once a DB connection is made as an application component, you can access it using Yii::$app->db\r\n\r\nAlso Yii::$app->db has a pdo object, it's not clear why the expression returns null.\r\n\r\nAny help will be appreciated\r\n\r\nRegards,\r\n\r\nAdam\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/trntv/yii2-starter-kit/issues/comments/134149371","html_url":"https://github.com/trntv/yii2-starter-kit/issues/266#issuecomment-134149371","issue_url":"https://api.github.com/repos/trntv/yii2-starter-kit/issues/266","id":134149371,"user":{"login":"dbd5","id":9496750,"avatar_url":"https://avatars.githubusercontent.com/u/9496750?v=3","gravatar_id":"","url":"https://api.github.com/users/dbd5","html_url":"https://github.com/dbd5","followers_url":"https://api.github.com/users/dbd5/followers","following_url":"https://api.github.com/users/dbd5/following{/other_user}","gists_url":"https://api.github.com/users/dbd5/gists{/gist_id}","starred_url":"https://api.github.com/users/dbd5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbd5/subscriptions","organizations_url":"https://api.github.com/users/dbd5/orgs","repos_url":"https://api.github.com/users/dbd5/repos","events_url":"https://api.github.com/users/dbd5/events{/privacy}","received_events_url":"https://api.github.com/users/dbd5/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T10:59:43Z","updated_at":"2015-08-24T10:59:43Z","body":"Hi @rowasc,\r\n\r\nThe results of var_dump(Yii::$app->db->pdo); \r\nobject(PDO)[72]\r\n\r\nProbe Version\r\n0.2\r\n\r\nNot sure repo version. I installed with the usual \r\ncomposer create-project --prefer-dist --stability=dev trntv/yii2-starter-kit\r\n\r\nRegards,\r\n\r\nAdam\r\n\r\n "}}