本文整理汇总了PHP中erLhcoreClassInstance::instanceChat方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassInstance::instanceChat方法的具体用法?PHP erLhcoreClassInstance::instanceChat怎么用?PHP erLhcoreClassInstance::instanceChat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类erLhcoreClassInstance
的用法示例。
在下文中一共展示了erLhcoreClassInstance::instanceChat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setupInstance
public static function setupInstance($db)
{
$parts = explode('.', $_SERVER['HTTP_HOST']);
$subdomain = array_shift($parts);
$items = erLhcoreClassModelInstance::getList(array('filter' => array('address' => $subdomain)));
if (!empty($items)) {
erLhcoreClassInstance::$instanceChat = array_shift($items);
$cfg = erConfigClassLhConfig::getInstance();
$db->query('USE ' . $cfg->getSetting('db', 'database_user_prefix') . erLhcoreClassInstance::$instanceChat->id);
} else {
$cfg = erConfigClassLhConfig::getInstance();
header('Location: ' . $cfg->getSetting('site', 'seller_url'));
exit;
}
}
示例2: setupInstance
public static function setupInstance($db)
{
if (isset($_SERVER['HTTP_HOST'])) {
$cfg = erConfigClassLhConfig::getInstance();
$subdomain = str_replace('.' . $cfg->getSetting('site', 'seller_domain'), '', $_SERVER['HTTP_HOST']);
$session = erLhcoreClassInstance::getSession();
$q = $session->createFindQuery('erLhcoreClassModelInstance');
$q->where($q->expr->eq('address', $q->bindValue($subdomain)) . ' OR (full_domain = 1 AND ' . $q->expr->eq('address', $q->bindValue($_SERVER['HTTP_HOST'])) . ')');
$items = $session->find($q);
if (!empty($items)) {
erLhcoreClassInstance::$instanceChat = array_shift($items);
$db->query('USE ' . $cfg->getSetting('db', 'database_user_prefix') . erLhcoreClassInstance::$instanceChat->id);
} else {
header('Location: ' . $cfg->getSetting('site', 'seller_url'));
exit;
}
}
}