本文整理汇总了PHP中Piwik\Tracker::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP Tracker::factory方法的具体用法?PHP Tracker::factory怎么用?PHP Tracker::factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Tracker
的用法示例。
在下文中一共展示了Tracker::factory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: connectPiwikTrackerDb
public static function connectPiwikTrackerDb()
{
$db = null;
$configDb = Config::getInstance()->database;
if (!isset($configDb['port'])) {
// before 0.2.4 there is no port specified in config file
$configDb['port'] = '3306';
}
$db = Tracker::factory($configDb);
$db->connect();
return $db;
}
示例2: connectPiwikTrackerDb
public static function connectPiwikTrackerDb()
{
$db = null;
$configDb = Config::getInstance()->database;
if (!isset($configDb['port'])) {
// before 0.2.4 there is no port specified in config file
$configDb['port'] = '3306';
}
/**
* Triggered before a connection to the database is established by the Tracker.
*
* This event can be used to change the database connection settings used by the Tracker.
*
* @param array $dbInfos Reference to an array containing database connection info,
* including:
*
* - **host**: The host name or IP address to the MySQL database.
* - **username**: The username to use when connecting to the
* database.
* - **password**: The password to use when connecting to the
* database.
* - **dbname**: The name of the Piwik MySQL database.
* - **port**: The MySQL database port to use.
* - **adapter**: either `'PDO_MYSQL'` or `'MYSQLI'`
*/
Piwik::postEvent('Tracker.getDatabaseConfig', array(&$configDb));
$db = Tracker::factory($configDb);
$db->connect();
return $db;
}