本文整理匯總了PHP中UserDAO::isUserInDBByName方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserDAO::isUserInDBByName方法的具體用法?PHP UserDAO::isUserInDBByName怎麽用?PHP UserDAO::isUserInDBByName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserDAO
的用法示例。
在下文中一共展示了UserDAO::isUserInDBByName方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: header
session_start();
if (!isset($_SESSION['user'])) {
header("Location: /session/login.php");
}
// set up
chdir("..");
require_once 'config.webapp.inc.php';
ini_set("include_path", ini_get("include_path") . PATH_SEPARATOR . $INCLUDE_PATH);
require_once "init.php";
$db = new Database($TWITALYTIC_CFG);
$conn = $db->getConnection();
$ud = new UserDAO($db);
$fd = new FollowDAO($db);
$id = new InstanceDAO($db);
$td = new TweetDAO($db);
if (isset($_REQUEST['u']) && $ud->isUserInDBByName($_REQUEST['u']) && isset($_REQUEST['i'])) {
$user = $ud->getUserByName($_REQUEST['u']);
$i = $id->getByUsername($_REQUEST['i']);
if (isset($i)) {
$cfg = new Config($i->twitter_username, $i->twitter_user_id);
$s = new SmartyTwitalytic();
if (!$s->is_cached('user.index.tpl', $i->twitter_username . "-" . $user['user_name'])) {
$s->assign('profile', $user);
$s->assign('user_statuses', $td->getAllTweets($user['user_id'], 20));
$s->assign('sources', $td->getStatusSources($user['user_id']));
$s->assign('cfg', $cfg);
$s->assign('instance', $i);
$exchanges = $td->getExchangesBetweenUsers($cfg->twitter_user_id, $user['user_id']);
$s->assign('exchanges', $exchanges);
$s->assign('total_exchanges', count($exchanges));
$mutual_friends = $fd->getMutualFriends($user['user_id'], $i->twitter_user_id);
示例2: testIsUserInDBByName
function testIsUserInDBByName()
{
$udao = new UserDAO($this->db, $this->logger);
$this->assertTrue($udao->isUserInDBByName('jack'));
$this->assertTrue(!$udao->isUserInDBByName('gina'));
}