本文整理汇总了PHP中create_context函数的典型用法代码示例。如果您正苦于以下问题:PHP create_context函数的具体用法?PHP create_context怎么用?PHP create_context使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了create_context函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
parent::Controller();
$this->load->library('unit_test');
$this->load->helper('unit_test');
$this->load->library('type/Type');
create_context(TRUE);
}
示例2: __construct
/**
* 預先載入相關的library
*
* 如果還有用到其他的library,請在此載入
*/
function __construct()
{
parent::Controller();
$this->load->helper('url');
$this->load->helper('web_apps');
$this->load->config('kals');
create_context();
}
示例3: Ut_webpage
function Ut_webpage()
{
parent::Controller();
$this->load->library('unit_test');
$this->load->helper('unit_test');
$this->load->library('kals_resource/Webpage');
create_context(TRUE);
}
示例4: ut_scope_anchor_text
function ut_scope_anchor_text()
{
parent::Controller();
$this->load->library('unit_test');
$this->load->helper('unit_test');
$this->load->library('scope/Scope_anchor_text');
create_context(TRUE);
}
示例5: Ut_user
function Ut_user()
{
parent::Controller();
$this->load->library('unit_test');
$this->load->helper('unit_test');
$this->load->library('kals_actor/User');
$this->load->database();
create_context(TRUE);
}
示例6: __construct
function __construct()
{
parent::Controller();
$this->load->library('unit_test');
$this->load->helper('unit_test');
$this->load->library('type/Annotation_type_factory');
$this->factory = $this->annotation_type_factory;
create_context(TRUE);
}
示例7: __construct
function __construct()
{
parent::Controller();
$this->load->library('unit_test');
$this->load->helper('unit_test');
$this->load->library('kals_actor/User');
create_context(TRUE);
$this->unit->set_benchmark('Construc Complete');
}
示例8: __construct
function __construct()
{
parent::Controller();
$this->load->library('unit_test');
$this->load->helper('unit_test');
$this->load->library('kals_resource/Annotation');
$this->load->library('recommend/Annotation_recommend');
create_context(TRUE);
$this->unit->set_benchmark('Construc Complete');
}
示例9: __construct
function __construct()
{
parent::Controller();
$this->load->library('unit_test');
$this->load->helper('unit_test');
$this->load->library('fuzzy/Output_language_variable_collection');
$this->coll = $this->output_language_variable_collection;
create_context(TRUE);
$this->unit->set_benchmark('Construc Complete');
}
示例10: __construct
function __construct()
{
parent::Controller();
$this->load->library('unit_test');
$this->load->helper('unit_test');
$this->load->library('scope/Annotation_scope');
$this->load->library('scope/Annotation_scope_collection');
$this->scope = $this->annotation_scope;
$this->coll = $this->annotation_scope_collection;
create_context(TRUE);
$this->unit->set_benchmark('First Unit Test');
}
示例11: __construct
function __construct()
{
parent::Controller();
$this->load->library('unit_test');
$this->load->helper('unit_test');
$this->load->library('scope/Annotation_scope_collection');
$this->load->library('scope/Annotation_scope');
$this->load->library('kals_resource/Annotation');
$this->load->library('kals_actor/User');
create_context(TRUE);
//set_ignore_authorize(TRUE);
$this->unit->set_benchmark('Construc Complete', 47);
}
示例12: __construct
function __construct()
{
parent::Controller();
$this->load->helper('url');
$this->load->helper('web_apps');
$this->load->config('kals');
if ($this->controller_enable_cache) {
$this->_enable_cache();
}
create_context();
if ($this->login_require === TRUE) {
login_require(true);
}
}
示例13: index
function index()
{
//log區
$array_data = array('ip' => get_client_ip(), 'browser' => $_SERVER['HTTP_USER_AGENT'], 'request_uri' => $_SERVER["REQUEST_URI"]);
create_context();
$user = get_context_user();
$user_id = NULL;
if (isset($user)) {
$user_id = $user->get_id();
}
$action = 28;
kals_log($this->db, $action, array('memo' => $array_data, 'user_id' => $user_id));
$this->load->view('help/index');
}
示例14: index
function index()
{
// $url = 'http://www.lib.nccu.edu.tw/?m=1109&sn=54&id=92&mm=1101';
// $host = 'http://www.lib.nccu.edu.tw/';
// $title = '政治大學圖書館網站';
$url = 'http://pulipuli.blogspot.com/2010/07/2010711.html';
$host = 'http://pulipuli.blogspot.com/';
$title = '布丁布丁吃?';
//以下才是正是的測試開始
create_context(TRUE);
$this->load->library('kals_resource/Domain');
$domain2 = new Domain();
$domain2->set_field('url', $url);
$domain2->update();
$this->unit->run($domain2->get_field("url"), $host, '以new建立domain2,測試get_field("url")');
$domain = $this->domain->create($url);
$domain_id = $domain->get_id();
$this->unit->run($domain_id, 'is_int', '用ctreate()來建立Domain,看看是否有id');
$test_domain = $this->domain->create($url);
$test_domain_id = $test_domain->get_id();
//echo $test_domain_id;
$this->unit->run($test_domain->get_field("url"), $host, '測試get_host');
$this->unit->run($domain_id != NULL, TRUE, '測試test_domain是不是真的find到domain');
$this->unit->run($domain_id, $test_domain_id, '測試test_domain是不是真的find到domain');
$this->unit->run($test_domain->get_id(), $domain_id, '用ctreate()以同樣的url來建立Domain,看看是否有id');
$this->unit->run($test_domain->get_field('title'), $title, '再建立時,是否就能找到title?');
$id = $test_domain->get_id();
$test_domain = new Domain($id);
$this->unit->run($test_domain->get_id() != NULL, TRUE, '測試用id來find Domain');
$this->unit->run($test_domain->get_field('url'), $host, '測試用id來find Domain 測試get_host');
$this->unit->run($test_domain->get_field('title'), $title, '測試title');
$domains = $this->domain->find_all();
$this->unit->run(count($domains) > 0, TRUE, '測試find_all是否有找到東西');
$domains = $this->domain->find_all(array('domain_id' => $id));
$this->unit->run(count($domains), 1, '測試find_all加上條件,是否能找到測試時建立的domain');
$this->unit->run($domains[0]->get_id(), $id, '測試find_all中能不能get_id()');
$this->unit->run($domains[0]->get_host(), $host, '測試find_all中能不能get_host()');
$test_domain->delete();
$this->unit->run($test_domain->get_id(), NULL, '測試刪除之後,Domain ID還在不在這件事情');
$domain_deleted = $this->domain->find($url);
$this->unit->run($domain_deleted, NULL, '測試刪除之後,Domain還能不能找到這件事情');
//context_complete();
//context_abort();
unit_test_report($this);
//destory_context();
}
示例15: __construct
function __construct()
{
parent::Controller();
$this->load->library('unit_test');
$this->load->helper('unit_test');
$this->load->library('recommend/Tip');
$this->load->library('recommend/Tip_speech');
$this->load->library('recommend/Tip_location');
$this->load->library('recommend/Tip_length');
$this->load->library('recommend/Tip_collection');
$this->load->library('kals_resource/Annotation');
$this->load->library('kals_resource/Webpage');
$this->load->library('kals_actor/User');
$this->load->library('scope/Annotation_scope_collection');
$this->load->library('scope/Annotation_scope');
create_context(TRUE);
$this->unit->set_benchmark('Construc Complete');
}