Skip to content

Commit e65b066

Browse files
committed
pdo also inside Telegram.php
1 parent c743843 commit e65b066

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/DB.php

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public static function initialize(array $credentials, $table_prefix = null)
6565
}
6666

6767
self::$pdo = $pdo;
68+
return self::$pdo;
6869
}
6970

7071
/**

src/Telegram.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ class Telegram
8787
* @var boolean
8888
*/
8989
protected $mysql_enabled = false;
90+
/**
91+
* PDO object
92+
*
93+
* @var \PDO
94+
*/
95+
protected $pdo;
9096

9197
/**
9298
* Commands config
@@ -148,7 +154,7 @@ public function __construct($api_key, $bot_name)
148154
*/
149155
public function enableMySQL(array $credential, $table_prefix = null)
150156
{
151-
DB::initialize($credential, $table_prefix);
157+
$this->pdo = DB::initialize($credential, $table_prefix);
152158
$this->mysql_enabled = true;
153159
}
154160

0 commit comments

Comments
 (0)