本文整理汇总了PHP中midcom_core_context::get_key方法的典型用法代码示例。如果您正苦于以下问题:PHP midcom_core_context::get_key方法的具体用法?PHP midcom_core_context::get_key怎么用?PHP midcom_core_context::get_key使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类midcom_core_context
的用法示例。
在下文中一共展示了midcom_core_context::get_key方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run_handler
public function run_handler($topic, array $args = array())
{
if (is_object($topic)) {
$component = $topic->component;
} else {
$component = $topic;
$topic = $this->get_component_node($component);
}
$context = new midcom_core_context(null, $topic);
$context->set_current();
$context->set_key(MIDCOM_CONTEXT_URI, midcom_connection::get_url('self') . $topic->name . '/' . implode('/', $args) . '/');
// Parser Init: Generate arguments and instantiate it.
$context->parser = midcom::get('serviceloader')->load('midcom_core_service_urlparser');
$context->parser->parse($args);
$handler = $context->get_handler($topic);
$context->set_key(MIDCOM_CONTEXT_CONTENTTOPIC, $topic);
$this->assertTrue(is_a($handler, 'midcom_baseclasses_components_interface'), $component . ' found no handler for ./' . implode('/', $args) . '/');
$result = $handler->handle();
$this->assertTrue($result !== false, $component . ' handle returned false on ./' . implode('/', $args) . '/');
$data =& $handler->_context_data[$context->id]['handler']->_handler['handler'][0]->_request_data;
if (is_object($result) && $result instanceof midcom_response) {
$data['__openpsa_testcase_response'] = $result;
}
$data['__openpsa_testcase_handler'] = $handler->_context_data[$context->id]['handler']->_handler['handler'][0];
$data['__openpsa_testcase_handler_method'] = $handler->_context_data[$context->id]['handler']->_handler['handler'][1];
// added to simulate http uri composition
$_SERVER['REQUEST_URI'] = $context->get_key(MIDCOM_CONTEXT_URI);
return $data;
}