本文整理汇总了PHP中Crawler::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Crawler::init方法的具体用法?PHP Crawler::init怎么用?PHP Crawler::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Crawler
的用法示例。
在下文中一共展示了Crawler::init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Config
// 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";
$cfg = new Config();
$db = new Database($THINKTANK_CFG);
$s = new SmartyThinkTank();
$c = new Crawler();
$conn = $db->getConnection();
// instantiate data access objects
$ud = new UserDAO($db);
$fd = new FollowDAO($db);
$td = new TweetDAO($db);
$c->init();
//TODO error checking here, is tweet in db, etc
$status_id = $_REQUEST['t'];
$s->assign('tweet', $td->getTweet($status_id));
$s->assign('replies', $td->getPublicRepliesToTweet($status_id));
$s->assign('cfg', $cfg);
# clean up
$db->closeConnection($conn);
echo $s->fetch('replies.public.tpl');
/*
$root_path = "../uar/includes/";
include $root_path.'environment.php'; # Determine relevant paths
include $root_path.'status_messages.php'; # Turn error code into message
include $root_path.'validate_data.php'; # Validate application data
include $root_path.'api_config.php'; # Configuring the API connection
include $root_path.'database.php'; # Connection to the database