本文整理汇总了PHP中debugPrint函数的典型用法代码示例。如果您正苦于以下问题:PHP debugPrint函数的具体用法?PHP debugPrint怎么用?PHP debugPrint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了debugPrint函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
/**
* Handle an error.
*
* @param int $errorNo Error number
* @param string $errorMsg Error message
* @param string $errorFile Error script file
* @param int $errorLine Error script line
*/
public static function handle($errorNo, $errorMsg, $errorFile, $errorLine)
{
// Build the complete error message
$mailMsg = '<b>--- ' . BRAND_NAME . ' ErrorHandler ---</b>' . PHP_EOL . PHP_EOL;
$mailMsg .= 'Date: ' . Date::format() . PHP_EOL;
$mailMsg .= 'Error number: ' . $errorNo . PHP_EOL;
$mailMsg .= 'Error type: ' . self::$errortypes[$errorNo] . PHP_EOL;
$mailMsg .= 'Error message: ' . $errorMsg . PHP_EOL;
$mailMsg .= 'Script name: ' . $errorFile . PHP_EOL;
$mailMsg .= 'Line number: ' . $errorLine . PHP_EOL;
$mailMsg .= 'Request URL: ' . URL_BASE . ltrim(REQUEST_URI, '/') . PHP_EOL;
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$mailMsg .= 'User agent: ' . $_SERVER['HTTP_USER_AGENT'];
}
// Determine whether debug mode is active
if (debugMode()) {
// In case debug mode is active, set the error message as the frontend message
debugPrint($mailMsg);
} else {
// Prepare the error mailer
Mail::addMailer(EMAIL_HOST, EMAIL_PORT, EMAIL_ERROR_FROM, EMAIL_ERROR_FROM_PASSWORD, BRAND_PRODUCT);
// Send the error email
Mail::send(EMAIL_ERROR_RECIPIENT, EMAIL_ERROR_FROM, EMAIL_ERROR_SUBJECT, nl2br($mailMsg));
// In case of a fatal error, stop execution and show the general frontend message
if ($errorNo !== E_WARNING && $errorNo !== E_NOTICE && $errorNo !== E_USER_NOTICE && $errorNo !== E_STRICT) {
debugPrint(__('An unexpected error has occured.<br>If this error keeps occuring, please contact your vendor for assistance') . __('<br>Message: %s', $errorMsg));
}
}
}
示例2: procDoNotify
function procDoNotify()
{
$oController =& getController('module');
$output = $oController->lock('commentnotify', 400);
if (!$output->toBool()) {
return;
}
$deadline = $output->get('deadline');
if (file_exists($this->cachedir . $this->cachefile)) {
FileHandler::removeFile($this->cachedir . $this->cachefile);
}
$oModel =& getModel('tccommentnotify');
$output = $oModel->GetCommentsFromNotifyQueue();
if (!$output->toBool()) {
debugPrint("Error");
debugPrint($output);
}
if ($output->data) {
foreach ($output->data as $data) {
$this->deleteFromQueue($data->comment_srl);
$this->sendCommentNotify($data->comment_srl);
}
}
$oController->unlock('commentnotify', $deadline);
}
示例3: procNmileageAdminInsertModInst
/**
* @brief 모듈 환경설정값 쓰기
**/
function procNmileageAdminInsertModInst()
{
// module 모듈의 model/controller 객체 생성
$oModuleController =& getController('module');
$oModuleModel =& getModel('module');
// 게시판 모듈의 정보 설정
$args = Context::getRequestVars();
$args->module = 'nmileage';
debugPrint('procNmileageADminInsertModInst');
debugPrint($args);
// module_srl이 넘어오면 원 모듈이 있는지 확인
if ($args->module_srl) {
$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl);
if ($module_info->module_srl != $args->module_srl) {
unset($args->module_srl);
}
}
// module_srl의 값에 따라 insert/update
if (!$args->module_srl) {
$output = $oModuleController->insertModule($args);
$msg_code = 'success_registed';
} else {
$output = $oModuleController->updateModule($args);
$msg_code = 'success_updated';
}
if (!$output->toBool()) {
return $output;
}
$this->add('module_srl', $output->get('module_srl'));
$this->setMessage($msg_code);
$returnUrl = getNotEncodedUrl('', 'module', Context::get('module'), 'act', 'dispNmileageAdminInsertModInst', 'module_srl', $this->get('module_srl'));
$this->setRedirectUrl($returnUrl);
}
示例4: send
function send($comment, $access, $uselang = 'en', $use_socialxe = false)
{
$result = new Object();
// 머리글
$lang->comment = $this->lang->comment[$uselang];
if (!$lang->comment) {
$lang->comment = $this->lang->comment['en'];
}
$lang->notify = $this->lang->notify[$uselang];
if (!$lang->notify) {
$lang->notify = $this->lang->notify['en'];
}
// 페이스북 객체 생성
$fb = new FacebookSocialXE(array("appId" => $this->app_id, "secret" => $this->app_secret, "cookie" => false));
// 세션 세팅
if (is_object($access)) {
debugPrint('facebook: (array)$access : ' . (array) $access);
$fb->setSession((array) $access, false);
}
// 얼마만큼의 길이를 사용할 수 있는지 확인
$max_length = 420;
// 실제 내용을 준비
if ($comment->content_title) {
$title = $comment->content_title;
} else {
if ($use_socialxe) {
$title = $lang->notify;
} else {
$title = $lang->comment;
}
}
$content2 = '「' . $title . '」 ' . $comment->content;
// 내용 길이가 최대 길이를 넘는지 확인
$content = $this->cut_str($content2, $max_length - 3, '...');
// 썸네일이 제공되면 그것을 사용
if ($comment->content_thumbnail) {
$image = $comment->content_thumbnail;
} else {
$image = Context::getRequestUri() . 'modules/socialxeserver/tpl/images/blank.gif';
}
// 부모 댓글이 페이스북이면 메일로 댓글 알림
if ($comment->parent && $comment->parent->provider == 'facebook') {
$reply_id = $comment->parent->comment_id;
try {
$output = $fb->api(array('method' => 'notifications.sendEmail', 'recipients' => $comment->parent->id, 'subject' => $title, 'text' => $content . ' ' . $comment->content_link));
} catch (FacebookApiException $e) {
$output->error = $e->__toString();
}
} else {
try {
$output = $fb->api($fb->getUser() . '/feed', 'POST', array('message' => $content, 'link' => $comment->content_link, 'picture' => $image));
} catch (FacebookApiException $e) {
$output->error = $e->__toString();
}
}
$result->add('result', $output);
return $result;
}
示例5: writeFile
function writeFile($filename, $content)
{
if (!($handle = fopen($filename, 'w'))) {
echo "Cannot open file ({$filename})";
exit;
}
if (fwrite($handle, $content) === FALSE) {
echo "Cannot write to file ({$filename})";
exit;
}
fclose($handle);
debugPrint('writeFile', "Success, wrote json to file ({$filename})");
}
示例6: send
function send($provider, $comment, $access, $uselang = 'en', $use_socialxe = false)
{
//debug :@kakikaki
$debugstr = '';
$debugstr .= 'provider : ' . $provider . "\n";
//$debugstr .= 'comment : ' .$comment."\n";
//$debugstr .= 'access : '.$access."\n";
//$debugstr .= 'use_socialxe : '.$use_socialxe;
debugPrint('providerManager->send() 진입함 ');
debugPrint($debugstr);
debugPrint('comment (type): ' . gettype($comment));
if (!$this->inProvider($provider)) {
return new Object(-1, 'msg_invalid_provider');
}
return $this->provider[$provider]->send($comment, $access, $uselang, $use_socialxe);
}
示例7: procLicenseAdminConfig
/**
* @brief 모듈 환경설정값 쓰기
**/
function procLicenseAdminConfig()
{
$args = Context::getRequestVars();
debugPrint($args);
// save module configuration.
$oModuleControll = getController('module');
$output = $oModuleControll->insertModuleConfig('license', $args);
$oLicenseModel =& getModel('license');
$oLicenseModel->checkLicense('nstore', $args->user_id, $args->serial_number, TRUE);
$oLicenseModel->checkLicense('nstore_digital', $args->d_user_id, $args->d_serial_number, TRUE);
$this->setMessage('success_updated');
if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) {
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', Context::get('module'), 'act', 'dispLicenseAdminConfig', 'module_srl', Context::get('module_srl'));
$this->setRedirectUrl($returnUrl);
}
}
示例8: init
function init()
{
debugPrint('authentication mobile');
$oAuthenticationModel =& getModel('authentication');
$config = $oAuthenticationModel->getModuleConfig();
if (!$config->mskin) {
$config->mskin;
}
$this->setTemplatePath($this->module_path . "m.skins/{$config->mskin}");
$oLayoutModel =& getModel('layout');
$layout_info = $oLayoutModel->getLayout($config->mlayout_srl);
if ($layout_info) {
$this->module_info->mlayout_srl = $config->mlayout_srl;
$this->setLayoutPath($layout_info->path);
}
}
示例9: procPaynotyAdminInsert
/**
* @brief saving config values.
**/
function procPaynotyAdminInsert()
{
$params = Context::gets('admin_phones','admin_emails','sender_name','sender_email','content','mail_content','module_srls','msgtype','sending_method');
$params->config_srl = Context::get('config_srl');
if ($params->config_srl)
{
// delete existences
$args->config_srl = $params->config_srl;
$output = executeQuery('paynoty.deleteConfig', $args);
if (!$output->toBool()) return $output;
$output = executeQuery('paynoty.deleteModule', $args);
if (!$output->toBool()) return $output;
}
else
{
// new sequence
$params->config_srl = getNextSequence();
}
// insert module srls
$module_srls = explode(',', $params->module_srls);
foreach ($module_srls as $srl)
{
unset($args);
$args->config_srl = $params->config_srl;
$args->module_srl = $srl;
$output = executeQuery('paynoty.insertModuleSrl', $args);
if (!$output->toBool()) return $output;
}
//$params->extra_vars = serialize($extra_vars);
debugPrint('params : ' . serialize($params));
// insert paynoty
$output = executeQuery('paynoty.insertConfig', $params);
debugPrint('insertConfig : ' . serialize($output));
if (!$output->toBool())
{
return $output;
}
$redirectUrl = getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPaynotyAdminModify','config_srl',$params->config_srl);
$this->setRedirectUrl($redirectUrl);
}
示例10: processPayment
function processPayment($args)
{
debugPrint('processPayment');
debugPrint($args);
$output = new Object();
$output->add('state', '2');
// not completed
$output->add('payment_method', 'ZP');
$output->add('payment_amount', $args->price);
$output->add('result_code', '0');
$output->add('result_message', 'success');
$output->add('pg_tid', $this->keygen());
$output->add('vact_bankname', $this->plugin_info->bank_name);
$output->add('vact_num', $this->plugin_info->account_number);
$output->add('vact_name', $this->plugin_info->account_holder);
$output->add('vact_inputname', $args->depositor_name);
return $output;
}
示例11: Connect
/**
* Connect to selected database type
*/
public function Connect()
{
if (DB_TYPE == 'mysql') {
try {
$options = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8');
$this->connection = new PDO("mysql:host=" . DB_HOST . ";dbname=" . DB_DATABASE_NAME . "", DB_USER_LOGIN, DB_USER_PASSWORD, $options);
} catch (PDOException $e) {
$message = "Error!: " . $e->getMessage() . "<br/>";
debugPrint($message);
die;
}
} elseif (DB_TYPE == 'pgsql') {
$message = "PgSQL connectivity is NOT implemented";
debugPrint($message);
die;
} else {
$message = "Unknown database type. This type " . DB_TYPE . " is NOT implemented";
debugPrint($message);
die;
}
}
示例12: dispKcpForm
/**
* @brief epay.getPaymentForm 에서 호출됨
*/
function dispKcpForm()
{
$oEpayController =& getController('epay');
$oNcartModel =& getModel('ncart');
$kcphome = sprintf(_XE_PATH_ . "files/epay/%s", $this->module_info->module_srl);
// get products info using cartnos
$reviewOutput = $oEpayController->reviewOrder();
if (!$reviewOutput->toBool()) {
return $reviewOutput;
}
debugPrint('$reviewOutput');
debugPrint($reviewOutput);
Context::set('review_form', $reviewOutput->review_form);
Context::set('item_name', $reviewOutput->item_name);
Context::set('price', $reviewOutput->price);
Context::set('transaction_srl', $reviewOutput->transaction_srl);
Context::set('order_srl', $reviewOutput->order_srl);
// payment method 변환 <-- CC, IB, VA, MP 를 결제모듈에서 정의된 것으로 대체할 수 있으면 좋겠음.
$payment_method = Context::get('payment_method');
switch ($payment_method) {
case "CC":
$payment_method = "100000000000";
break;
case "IB":
$payment_method = "010000000000";
break;
case "VA":
$payment_method = "001000000000";
break;
case "MP":
$payment_method = "000010000000";
break;
default:
$payment_method = "100000000000";
}
Context::set('payment_method', $payment_method);
debugPrint($payment_method);
$this->setTemplateFile('formdata');
}
示例13: dispPaynotyAdminConfig
/**
* @brief insert paynoty configuration info.
**/
function dispPaynotyAdminConfig()
{
$oEditorModel = getModel('editor');
$editor_config = $oEditorModel->getEditorConfig(0);
// set editor options.
$option = new stdClass();
$option->skin = $editor_config->editor_skin;
$option->content_style = $editor_config->content_style;
$option->content_font = $editor_config->content_font;
$option->content_font_size = $editor_config->content_font_size;
$option->colorset = $editor_config->sel_editor_colorset;
$option->allow_fileupload = true;
$option->enable_default_component = true;
$option->enable_component = true;
$option->disable_html = false;
$option->height = 200;
$option->enable_autosave = false;
$option->primary_key_name = 'noti_srl';
$option->content_key_name = 'mail_content';
$editor = $oEditorModel->getEditor(0, $option);
Context::set('editor', $editor);
$member_config = getModel('member')->getMemberConfig();
$variable_name = array();
foreach ($member_config->signupForm as $item) {
if ($item->type == 'tel') {
$variable_name[] = $item->name;
}
}
debugPrint($variable_name);
$config = getModel('paynoty')->getConfig();
if (!$config) {
$config->content = Context::getLang('default_content');
$config->mail_content = Context::getLang('default_mail_content');
}
Context::set('config', $config);
Context::set('variable_name', $variable_name);
}
示例14: mail_get_transport
/**
* Returns a valid transport for Swift_Mailer.
*
* @param mixed[] $snmp_conf Connection parameters.
* An empty array will cause a sendmail transport be returned.
* Params:
* string host Server hostname
* int port Server port
* string proto Connection protocol: ssl, sslv2, sslv3 or tsl. Empty for tcp
* string user Auth username
* string pass Auth password
*
* @return Swift_Transport The mail transport.
*
* @throws Swift_TransportException if the transport can't connect
*/
function mail_get_transport($snmp_conf = array())
{
//~ debugPrint($snmp_conf, true);
if (empty($snmp_conf)) {
// Use the system sendmail
debugPrint('sendmail', true);
return Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -t -bv');
}
if (empty($snmp_conf['host']) || empty($snmp_conf['port'])) {
throw new Exception('Invalid SNMP connection data');
}
//~ debugPrint('smtp', true);
$transport = Swift_SmtpTransport::newInstance();
$transport->setHost($snmp_conf['host']);
$transport->setPort((int) $snmp_conf['port']);
$transport->setUsername($snmp_conf['user']);
$transport->setPassword($snmp_conf['pass']);
if (!empty($snmp_conf['proto'])) {
$transport->setEncryption($snmp_conf['proto']);
}
// Try the connection. Can throw a 'Swift_TransportException'
$transport->start();
return $transport;
}
示例15: procCashpayDoIt
/**
* @brief pay
*/
function procCashpayDoIt()
{
debugPrint('procCashpayDoIt');
$oEpayController =& getController('epay');
$vars = Context::getRequestVars();
$output = $oEpayController->beforePayment($vars);
debugPrint($output);
if (!$output->toBool()) {
return $output;
}
$obj->bank_name = $this->module_info->bank_name;
$obj->account_number = $this->module_info->account_number;
$obj->account_holder = $this->module_info->account_holder;
$output = new Object();
$output->add('transaction_srl', Context::get('transaction_srl'));
$output->add('state', '1');
// not completed
$output->add('payment_method', 'BT');
$output->add('payment_amount', Context::get('price'));
$output->add('result_code', '0');
$output->add('result_message', 'success');
$output->add('pg_tid', $this->keygen());
$output->add('vact_bankname', $obj->bank_name);
$output->add('vact_num', $obj->account_number);
$output->add('vact_name', $obj->account_holder);
$output->add('vact_inputname', context::get('depositor_name'));
// afterPayment will call an after trigger
$output = $oEpayController->afterPayment($output);
if (!$output->toBool()) {
return $output;
}
$return_url = $output->get('return_url');
if ($return_url) {
$this->setRedirectUrl($return_url);
}
}