本文整理汇总了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'));
}