本文整理汇总了PHP中hd_print函数的典型用法代码示例。如果您正苦于以下问题:PHP hd_print函数的具体用法?PHP hd_print怎么用?PHP hd_print使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hd_print函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle_user_input
public function handle_user_input(&$user_input, &$plugin_cookies)
{
hd_print('Vod favorites: handle_user_input:');
foreach ($user_input as $key => $value) {
hd_print(" {$key} => {$value}");
}
if ($user_input->control_id == 'popup_menu') {
if (!isset($user_input->selected_media_url)) {
return null;
}
$media_url = MediaURL::decode($user_input->selected_media_url);
$movie_id = $media_url->movie_id;
$is_favorite = $this->vod->is_favorite_movie_id($movie_id);
$add_favorite_action = UserInputHandlerRegistry::create_action($this, 'add_favorite');
$caption = 'Add to My Movies';
$menu_items[] = array(GuiMenuItemDef::caption => $caption, GuiMenuItemDef::action => $add_favorite_action);
return ActionFactory::show_popup_menu($menu_items);
} else {
if ($user_input->control_id == 'add_favorite') {
if (!isset($user_input->selected_media_url)) {
return null;
}
$media_url = MediaURL::decode($user_input->selected_media_url);
$movie_id = $media_url->movie_id;
$is_favorite = $this->vod->is_favorite_movie_id($movie_id);
if ($is_favorite) {
return ActionFactory::show_title_dialog('Movie already resides in My Movies');
} else {
$this->vod->add_favorite_movie($movie_id, $plugin_cookies);
return ActionFactory::show_title_dialog('Movie has been added to My Movies');
}
}
}
return null;
}
示例2: handle_user_input
public function handle_user_input(&$user_input, &$plugin_cookies)
{
hd_print('Vod search: handle_user_input:');
foreach ($user_input as $key => $value) {
hd_print(" {$key} => {$value}");
}
if ($user_input->action_type === 'apply') {
$control_id = $user_input->control_id;
if ($control_id === 'pattern') {
$pattern = $user_input->pattern;
$plugin_cookies->vod_search_pattern = $pattern;
hd_print("Vod search: applying pattern '{$pattern}'");
$defs = $this->do_get_control_defs($plugin_cookies);
return ActionFactory::reset_controls($defs, ActionFactory::open_folder($this->vod->get_search_media_url_str($pattern), $pattern));
}
} else {
if ($user_input->action_type === 'confirm') {
$control_id = $user_input->control_id;
$new_value = $user_input->{$control_id};
if ($control_id === 'pattern') {
$pattern = $user_input->pattern;
if (preg_match('/^\\s*$/', $pattern)) {
return ActionFactory::show_error(false, 'Pattern should not be empty');
}
}
}
}
return null;
}
示例3: set_default
public function set_default($key, $value)
{
if (!isset($this->data[$key])) {
hd_print("Warning: no value for key '{$key}'. Using default: '{$value}'");
$this->data[$key] = $value;
}
}
示例4: handle_user_input
public function handle_user_input(&$user_input, &$plugin_cookies)
{
hd_print('Entry handler: handle_user_input:');
foreach ($user_input as $key => $value) {
hd_print(" {$key} => {$value}");
}
if (!isset($user_input->entry_id)) {
return null;
}
$add_params = array('entry_id' => $user_input->entry_id);
if ($user_input->entry_id === 'setup' || $user_input->entry_id === 'tv') {
$res = $this->session->apply_subscription($plugin_cookies, $user_input);
if ($res !== false) {
if (!isset($res['action'])) {
return ActionFactory::close_dialog_and_run(ActionFactory::open_folder());
}
return $res['need_close_dialog'] ? ActionFactory::close_dialog_and_run($res['action']) : $res['action'];
} else {
if ($this->session->is_logged_in()) {
return ActionFactory::open_folder();
}
if (!isset($plugin_cookies->user_name) || $plugin_cookies->user_name === '') {
return $this->session->do_get_edit_subscription_action($plugin_cookies, $this, $add_params);
}
return ActionFactory::open_folder();
}
}
return null;
}
示例5: hd_error_handler
function hd_error_handler($error_type, $message, $file, $line)
{
static $map = array(E_ERROR => 'E_ERROR', E_WARNING => 'E_WARNING', E_PARSE => 'E_PARSE', E_NOTICE => 'E_NOTICE', E_CORE_ERROR => 'E_CORE_ERROR', E_CORE_WARNING => 'E_CORE_WARNING', E_COMPILE_ERROR => 'E_COMPILE_ERROR', E_COMPILE_WARNING => 'E_COMPILE_WARNING', E_USER_ERROR => 'E_USER_ERROR', E_USER_WARNING => 'E_USER_WARNING', E_USER_NOTICE => 'E_USER_NOTICE', E_STRICT => 'E_STRICT', E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR', E_DEPRECATED => 'E_DEPRECATED', E_USER_DEPRECATED => 'E_USER_DEPRECATED');
if (isset($map[$error_type])) {
hd_print("[{$file}:{$line}] [{$map[$error_type]}] {$message}");
}
}
示例6: call_plugin_impl
protected function call_plugin_impl($call_ctx)
{
static $plugin;
if (is_null($plugin)) {
try {
hd_print('Instantiating plugin...');
$plugin = $this->create_plugin();
hd_print('Plugin instance created.');
} catch (Exception $e) {
hd_print('Error: can not instantiate plugin (' . $e->getMessage() . ')');
return array(PluginOutputData::has_data => false, PluginOutputData::plugin_cookies => $call_ctx->plugin_cookies, PluginOutputData::is_error => true, PluginOutputData::error_action => ActionFactory::show_error(true, T::t('title_application_error'), array(T::t('msg_plugin_init_failed'))));
}
}
$out_data = null;
try {
$out_data = $this->invoke_operation($plugin, $call_ctx);
} catch (DuneException $e) {
hd_print("Error: DuneException caught: " . $e->getMessage());
return array(PluginOutputData::has_data => false, PluginOutputData::plugin_cookies => $call_ctx->plugin_cookies, PluginOutputData::is_error => true, PluginOutputData::error_action => $e->get_error_action());
} catch (Exception $e) {
hd_print("Error: Exception caught: " . $e->getMessage());
return array(PluginOutputData::has_data => false, PluginOutputData::plugin_cookies => $call_ctx->plugin_cookies, PluginOutputData::is_error => true, PluginOutputData::error_action => ActionFactory::show_error(true, T::t('title_application_error'), array(T::t('msg_unhandled_plugin_error'))));
}
$plugin_output_data = array(PluginOutputData::has_data => !is_null($out_data), PluginOutputData::plugin_cookies => $call_ctx->plugin_cookies, PluginOutputData::is_error => false, PluginOutputData::error_action => null);
if ($plugin_output_data[PluginOutputData::has_data]) {
$plugin_output_data[PluginOutputData::data_type] = $this->get_out_type_code($call_ctx->op_type_code);
$plugin_output_data[PluginOutputData::data] = $out_data;
}
return $plugin_output_data;
}
示例7: call_plugin_impl
protected function call_plugin_impl($call_ctx)
{
static $plugin;
if (is_null($plugin)) {
try {
hd_print('Instantiating plugin...');
$plugin = $this->create_plugin();
hd_print('Plugin instance created.');
} catch (Exception $e) {
hd_print('Error: can not instantiate plugin (' . $e->getMessage() . ')');
return array(PluginOutputData::has_data => false, PluginOutputData::plugin_cookies => $call_ctx->plugin_cookies, PluginOutputData::is_error => true, PluginOutputData::error_action => ActionFactory::show_error(true, 'System error', array('Can not create PHP plugin instance.', 'Call the PHP plugin vendor.')));
}
}
// assert($plugin);
$out_data = null;
try {
$out_data = $this->invoke_operation($plugin, $call_ctx);
} catch (DuneException $e) {
hd_print("Error: DuneException caught: " . $e->getMessage());
return array(PluginOutputData::has_data => false, PluginOutputData::plugin_cookies => $call_ctx->plugin_cookies, PluginOutputData::is_error => true, PluginOutputData::error_action => $e->get_error_action());
} catch (Exception $e) {
hd_print("Error: Exception caught: " . $e->getMessage());
return array(PluginOutputData::has_data => false, PluginOutputData::plugin_cookies => $call_ctx->plugin_cookies, PluginOutputData::is_error => true, PluginOutputData::error_action => ActionFactory::show_error(true, 'System error', array('Unhandled PHP plugin error.', 'Call the PHP plugin vendor.')));
}
// Note: change_tv_favorites() may return NULL even if it's completed
// successfully.
$plugin_output_data = array(PluginOutputData::has_data => !is_null($out_data), PluginOutputData::plugin_cookies => $call_ctx->plugin_cookies, PluginOutputData::is_error => false, PluginOutputData::error_action => null);
if ($plugin_output_data[PluginOutputData::has_data]) {
$plugin_output_data[PluginOutputData::data_type] = $this->get_out_type_code($call_ctx->op_type_code);
$plugin_output_data[PluginOutputData::data] = $out_data;
}
return $plugin_output_data;
}
示例8: get_screen_by_id
protected function get_screen_by_id($screen_id)
{
if (isset($this->screens[$screen_id])) {
return $this->screens[$screen_id];
}
hd_print("Error: no screen with id '{$screen_id}' found.");
throw new Exception('Screen not found');
}
示例9: handle_user_input
public function handle_user_input(&$user_input, &$plugin_cookies)
{
// hd_print(__METHOD__);
hd_print(print_r($user_input, true));
$media_url = MediaURL::decode($user_input->selected_media_url);
if ($user_input->control_id == 'pop_up') {
}
}
示例10: __set
public function __set($name, $value)
{
$this->{$name} = $value;
hd_print("{$name}={$name} value=" . is_array($value) ? print_r($value, true) : $value);
if ($name == "folder_views") {
hd_print("folder_view");
$this->set_default_folder_view_index_attr_name();
}
}
示例11: get_mac_addr
public static function get_mac_addr()
{
static $mac_addr = null;
if (is_null($mac_addr)) {
$mac_addr = str_replace(':', '-', HD::get_mac_addr());
hd_print("API: macaddr '{$mac_addr}'");
}
return $mac_addr;
}
示例12: getDetailedInfo
public function getDetailedInfo(SimpleXMLElement &$node)
{
hd_print(__METHOD__);
$info = (string) $node->attributes()->title;
// 'Serie:' . (string)$c->attributes()->grandparentTitle . ' || ' .
// 'Episode Name :' . (string)$c->attributes()->title. ' || ' .
// 'EP:' . 'S'.(string)$c->attributes()->parentIndex . 'E'. (string)$c->attributes()->index . '||' .
// 'summary:'. str_replace('"', '' , (string)$c->attributes()->summary);
return $info;
}
示例13: run
private static function run($op, $args = array())
{
$cmd = dirname(__FILE__) . self::ARESCAM_CTL . ' ' . $op;
foreach ($args as $name => $value) {
$value = escapeshellarg($value);
$cmd .= " {$name} {$value}";
}
$out = system($cmd, $rc);
hd_print("DAEMON: cmd '{$cmd}'; rc {$rc}; output '{$out}'");
return (object) array('output' => $out, 'rc' => $rc);
}
示例14: get_out_type_code
public function get_out_type_code($op_code)
{
static $map = null;
if (is_null($map)) {
$map = array(PLUGIN_OP_GET_FOLDER_VIEW => PLUGIN_OUT_DATA_PLUGIN_FOLDER_VIEW, PLUGIN_OP_GET_NEXT_FOLDER_VIEW => PLUGIN_OUT_DATA_PLUGIN_FOLDER_VIEW, PLUGIN_OP_GET_REGULAR_FOLDER_ITEMS => PLUGIN_OUT_DATA_PLUGIN_REGULAR_FOLDER_RANGE, PLUGIN_OP_HANDLE_USER_INPUT => PLUGIN_OUT_DATA_GUI_ACTION, PLUGIN_OP_GET_TV_INFO => PLUGIN_OUT_DATA_PLUGIN_TV_INFO, PLUGIN_OP_GET_DAY_EPG => PLUGIN_OUT_DATA_PLUGIN_TV_EPG_PROGRAM_LIST, PLUGIN_OP_GET_TV_PLAYBACK_URL => PLUGIN_OUT_DATA_URL, PLUGIN_OP_GET_TV_STREAM_URL => PLUGIN_OUT_DATA_URL, PLUGIN_OP_GET_VOD_INFO => PLUGIN_OUT_DATA_PLUGIN_VOD_INFO, PLUGIN_OP_GET_VOD_STREAM_URL => PLUGIN_OUT_DATA_URL, PLUGIN_OP_CHANGE_TV_FAVORITES => PLUGIN_OUT_DATA_GUI_ACTION);
}
if (!isset($map[$op_code])) {
hd_print("Error: get_out_type_code(): unknown operation code: '{$op_code}'.");
throw new Exception("Uknown operation code");
}
return $map[$op_code];
}
示例15: setFileToArchive
public function setFileToArchive($fileName, $fileUrl)
{
hd_print(__METHOD__ . ': useCache = ' . EmplexerConfig::getInstance()->getUseCache());
//no cache
if (EmplexerConfig::getInstance()->getUseCache()) {
// hd_print( __METHOD__ . ': Entrou.... ' );
//hd_print(__METHOD__ . " fileName=$fileName, fileUrl=$fileUrl");
$this->urls[$fileName] = $fileUrl;
EmplexerFifoController::getInstance()->downloadToCache($fileName, $fileUrl);
} else {
// hd_print( __METHOD__ . ': Não Entrou.... ' . $fileUrl);
}
}