Skip to content

Instantly share code, notes, and snippets.

<?php
class DB {
private static $_instance = null; // to use in getInstance function (we can use static keyword)
private $_pdo, $_query, $_error = false, $_results, $_count = 0;
private function __construct() {
try {
$this->_pdo = new PDO("mysql:host=" . Config::get('mysql/host') .
<?php
use Rockwood\Entity\User; // add this line
use Rockwood\Service\UserService;
class UserServiceTest extends \Codeception\TestCase\Test
{
/**
* @var \UnitTester
*/
<?php
namespace Rockwood\Service;
use Rockwood\Entity\User;
class UserService
{
public function createFromArray(array $data){
2017-11-06T04:11:43.426284Z 0 [Note] Giving 0 client threads a chance to die gracefully
2017-11-06T04:11:43.426341Z 0 [Note] Shutting down slave threads
2017-11-06T04:11:43.426351Z 0 [Note] Forcefully disconnecting 0 remaining clients
2017-11-06T04:11:43.426362Z 0 [Note] Event Scheduler: Purging the queue. 0 events
2017-11-06T04:11:43.589629Z 0 [Note] Binlog end
2017-11-06T04:11:43.886067Z 0 [Note] Shutting down plugin 'ngram'
2017-11-06T04:11:43.982321Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2017-11-06T04:11:43.982366Z 0 [Note] Shutting down plugin 'partition'
2017-11-06T04:11:43.982374Z 0 [Note] Shutting down plugin 'ARCHIVE'
2017-11-06T04:11:43.982380Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2017-11-06T04:11:43.426284Z 0 [Note] Giving 0 client threads a chance to die gracefully
2017-11-06T04:11:43.426341Z 0 [Note] Shutting down slave threads
2017-11-06T04:11:43.426351Z 0 [Note] Forcefully disconnecting 0 remaining clients
2017-11-06T04:11:43.426362Z 0 [Note] Event Scheduler: Purging the queue. 0 events
2017-11-06T04:11:43.589629Z 0 [Note] Binlog end
2017-11-06T04:11:43.886067Z 0 [Note] Shutting down plugin 'ngram'
2017-11-06T04:11:43.982321Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2017-11-06T04:11:43.982366Z 0 [Note] Shutting down plugin 'partition'
2017-11-06T04:11:43.982374Z 0 [Note] Shutting down plugin 'ARCHIVE'
2017-11-06T04:11:43.982380Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
[Illuminate\Database\QueryException]
SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas
sword: YES) (SQL: select * from information_schema.tables where table_schem
a = questionbank and table_name = migrations
[Illuminate\Database\QueryException]
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_s
chema.tables where table_schema = questionbank and table_name = migrations)
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY000] [2002] Connection refused
APP_ENV=local
APP_KEY=base64:keyhere
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=www.onlineexamwala.com
DB_CONNECTION=mysql
DB_HOST=139.59.15.181
DB_PORT=3306
DB_DATABASE=questionbank
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en
Active: active (running) since Wed 2017-11-08 14:59:47 UTC; 4min 54s ago
Process: 20729 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=e
Process: 20717 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exi
Main PID: 20728 (mysqld)
Tasks: 28
Memory: 151.3M
CPU: 499ms
CGroup: /system.slice/mysql.service
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateQuestionsTable extends Migration
{
/**
* Run the migrations.
*