本文整理汇总了PHP中AppletInstance::getInstanceId方法的典型用法代码示例。如果您正苦于以下问题:PHP AppletInstance::getInstanceId方法的具体用法?PHP AppletInstance::getInstanceId怎么用?PHP AppletInstance::getInstanceId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppletInstance
的用法示例。
在下文中一共展示了AppletInstance::getInstanceId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($settings = array())
{
$this->response = new TwimlResponse();
$this->cookie_name = 'state-' . AppletInstance::getInstanceId();
$this->version = AppletInstance::getValue('version', null);
$this->callerId = AppletInstance::getValue('callerId', null);
if (empty($this->callerId) && !empty($_REQUEST['From'])) {
$this->callerId = $_REQUEST['From'];
}
/* Get current instance */
$this->dial_whom_selector = AppletInstance::getValue('dial-whom-selector');
$this->dial_whom_user_or_group = AppletInstance::getUserGroupPickerValue('dial-whom-user-or-group');
$this->dial_whom_number = AppletInstance::getValue('dial-whom-number');
$this->no_answer_action = AppletInstance::getValue('no-answer-action', 'hangup');
$this->no_answer_group_voicemail = AppletInstance::getAudioSpeechPickerValue('no-answer-group-voicemail');
$this->no_answer_redirect = AppletInstance::getDropZoneUrl('no-answer-redirect');
$this->no_answer_redirect_number = AppletInstance::getDropZoneUrl('no-answer-redirect-number');
$this->dial_whom_instance = get_class($this->dial_whom_user_or_group);
if (count($settings)) {
foreach ($settings as $setting => $value) {
if (isset($this->{$setting})) {
$this->{$setting} = $value;
}
}
}
}
示例2: __construct
public function __construct()
{
$this->response = new Response();
$this->cookie_name = 'state-' . AppletInstance::getInstanceId();
$this->version = AppletInstance::getValue('version', null);
$this->callerId = AppletInstance::getValue('callerId', null);
if (empty($this->callerId)) {
$this->callerId = $_REQUEST['From'];
}
/* Get current instance */
$this->dial_whom_selector = AppletInstance::getValue('dial-whom-selector');
$this->dial_whom_user_or_group = AppletInstance::getUserGroupPickerValue('dial-whom-user-or-group');
$this->dial_whom_number = AppletInstance::getValue('dial-whom-number');
$this->no_answer_action = AppletInstance::getValue('no-answer-action', 'hangup');
$this->no_answer_group_voicemail = AppletInstance::getAudioSpeechPickerValue('no-answer-group-voicemail');
$this->no_answer_redirect = AppletInstance::getDropZoneUrl('no-answer-redirect');
$this->no_answer_redirect_number = AppletInstance::getDropZoneUrl('no-answer-redirect-number');
}
示例3: define
<?php
include_once 'TwimlDial.php';
define('DIAL_COOKIE', 'state-' . AppletInstance::getInstanceId());
$CI =& get_instance();
$CI->load->library('DialList');
$dialer = new TwimlDial();
$dialer->set_state();
// Respond based on state
switch ($dialer->state) {
case 'hangup':
$dialer->hangup();
break;
case 'new':
if ($dialer->dial_whom_selector === 'user-or-group') {
// create a dial list from the input state
$dial_list = DialList::get($dialer->dial_whom_user_or_group);
$dialed = false;
do {
$to_dial = $dial_list->next();
if ($to_dial instanceof VBX_User || $to_dial instanceof VBX_Device) {
$dialed = $dialer->dial($to_dial);
if ($dialed) {
$dialer->state = $dial_list->get_state();
}
}
} while (!$dialed && ($to_dial instanceof VBX_User || $to_dial instanceof VBX_Device));
if (!$dialed) {
// nobody to call, push directly to voicemail
$dialer->noanswer();
}
示例4: get_instance
<?php
$CI =& get_instance();
$status = @$_REQUEST['status'];
$flow = @AppletInstance::getFlow();
$flow_id = $flow->id;
$instance_id = AppletInstance::getInstanceId();
function zendesk_client($path, $method = 'GET', $xml = '')
{
// {{{
$ch = curl_init();
curl_setopt_array($ch, array(CURLOPT_URL => ZENDESK_URL . $path, CURLOPT_HTTPAUTH => CURLAUTH_BASIC, CURLOPT_HEADER => FALSE, CURLOPT_FOLLOWLOCATION => TRUE, CURLOPT_USERPWD => ZENDESK_EMAIL . ':' . ZENDESK_PASSWORD, CURLOPT_RETURNTRANSFER => TRUE));
switch ($method) {
case 'GET':
curl_setopt($ch, CURLOPT_HTTPGET, TRUE);
break;
case 'POST':
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
break;
case 'PUT':
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
break;
case 'DELETE':
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
break;
default:
return FALSE;
示例5: get_instance
<?php
$ci =& get_instance();
$moderator = AppletInstance::getUserGroupPickerValue('moderator');
$confId = AppletInstance::getValue('conf-id');
$confName = AppletInstance::getInstanceId() . $confId;
$caller = normalize_phone_to_E164(isset($_REQUEST['From']) ? $ci->input->get_post('From') : '');
$isModerator = false;
$defaultWaitUrl = 'http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient';
$waitUrl = AppletInstance::getValue('wait-url', $defaultWaitUrl);
$record = AppletInstance::getValue('record', 'do-not-record');
$hasModerator = false;
if (!is_null($moderator)) {
$hasModerator = true;
switch (get_class($moderator)) {
case 'VBX_User':
foreach ($moderator->devices as $device) {
if ($device->value == $caller) {
$isModerator = true;
}
}
break;
case 'VBX_Group':
foreach ($moderator->users as $user) {
$user = VBX_User::get($user->user_id);
foreach ($user->devices as $device) {
if ($device->value == $caller) {
$isModerator = true;
}
}
}
示例6: array
<?php
$const = array();
$const['STRIPE_ACTION'] = 'stripeAction';
$const['STRIPE_COOKIE'] = 'payment-' . AppletInstance::getInstanceId();
$const['GATHER_CARD'] = 'GatherCard';
$const['GATHER_MONTH'] = 'GatherMonth';
$const['GATHER_YEAR'] = 'GatherYear';
$const['GATHER_CVC'] = 'GatherCvc';
$const['SEND_PAYMENT'] = 'SendPayment';
foreach ($const as $k => $v) {
define($k, $v);
}
$response = new TwimlResponse();
$state = array(STRIPE_ACTION => GATHER_CARD, 'card' => array());
$ci =& get_instance();
$settings = PluginData::get('settings');
$amount = AppletInstance::getValue('amount');
$description = AppletInstance::getValue('description');
$digits = clean_digits($ci->input->get_post('Digits'));
$finishOnKey = '#';
$timeout = 15;
$card_errors = array('invalid_number' => GATHER_CARD, 'incorrect_number' => GATHER_CARD, 'invalid_expiry_month' => GATHER_MONTH, 'invalid_expiry_year' => GATHER_YEAR, 'expired_card' => GATHER_CARD, 'invalid_cvc' => GATHER_CVC, 'incorrect_cvc' => GATHER_CVC);
if (is_object($settings)) {
$settings = get_object_vars($settings);
}
if (isset($_COOKIE[STRIPE_COOKIE])) {
$state = json_decode(str_replace(', $Version=0', '', $_COOKIE[STRIPE_COOKIE]), true);
if (is_object($state)) {
$state = get_object_vars($state);
}
示例7: define
<?php
define('PAYMENT_ACTION', 'paymentAction');
define('PAYMENT_COOKIE', 'payment-' . AppletInstance::getInstanceId());
define('STATE_GATHER_CARD', 'stateGatherCard');
define('STATE_GATHER_MONTH', 'stateGatherMonth');
define('STATE_GATHER_YEAR', 'stateGatherYear');
define('STATE_GATHER_CVC', 'stateGatherCvc');
define('STATE_SEND_PAYMENT', 'stateSendPayment');
$response = new TwimlResponse();
$state = array(PAYMENT_ACTION => STATE_GATHER_CARD, 'card' => array());
$ci =& get_instance();
$settings = PluginData::get('settings');
$amount = AppletInstance::getValue('amount');
$description = AppletInstance::getValue('description');
$digits = clean_digits($ci->input->get_post('Digits'));
$finishOnKey = '#';
$timeout = 15;
$card_errors = array('invalid_number' => STATE_GATHER_CARD, 'incorrect_number' => STATE_GATHER_CARD, 'invalid_expiry_month' => STATE_GATHER_MONTH, 'invalid_expiry_year' => STATE_GATHER_YEAR, 'expired_card' => STATE_GATHER_CARD, 'invalid_cvc' => STATE_GATHER_CVC, 'incorrect_cvc' => STATE_GATHER_CVC);
if (is_object($settings)) {
$settings = get_object_vars($settings);
}
if (isset($_COOKIE[PAYMENT_COOKIE])) {
$state = json_decode(str_replace(', $Version=0', '', $_COOKIE[PAYMENT_COOKIE]), true);
if (is_object($state)) {
$state = get_object_vars($state);
}
}
if ($digits !== false) {
switch ($state[PAYMENT_ACTION]) {
case STATE_GATHER_CARD: