本文整理汇总了PHP中Zend_Debug::dump方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Debug::dump方法的具体用法?PHP Zend_Debug::dump怎么用?PHP Zend_Debug::dump使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Debug
的用法示例。
在下文中一共展示了Zend_Debug::dump方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isValid
/**
* Vaidate the file MIME type.
*
* @param string $file
* @return bool
*/
public function isValid($file)
{
$this->_file = $file;
// Detect the definitive MIME type.
$detect = new Omeka_File_MimeType_Detect($this->_file);
$this->_mimeType = $detect->detect();
// Set the relevant MIME type whitelist.
if ($this->_customWhitelist) {
$whitelist = $this->_customWhitelist;
} else {
$whitelist = self::DEFAULT_WHITELIST;
}
// Validate the MIME type against the whitelist.
if (in_array($this->_mimeType, explode(',', $whitelist))) {
// Valid MIME type. Set the MIME type to the ingest class so that it
// can assign it to the File record. Doing this avoids more than one
// call to the MIME type detection class.
Omeka_File_Ingest_AbstractIngest::$mimeType = $this->_mimeType;
return true;
} else {
// Invalid MIME type.
Zend_Debug::dump(explode(',', $whitelist));
$this->_error(self::INVALID_TYPE);
return false;
}
}
示例2: postProcess
public function postProcess(Axis_Sales_Model_Order_Row $order)
{
$this->saveCreditCard($order);
$cc = $this->getCreditCard();
$options = $this->getLineItemDetails();
$billing = $order->getBilling();
$optionsAll = array_merge($options, array('STREET' => $billing->getStreetAddress(), 'ZIP' => $billing->getPostcode(), 'BUTTONSOURCE' => $this->_buttonSourceDP, 'CURRENCY' => $this->getBaseCurrencyCode(), 'IPADDRESS' => $_SERVER['REMOTE_ADDR']));
if ($cc->getCcIssueMonth() && $cc->getCcIssueYear()) {
$optionsAll['CARDSTART'] = $cc->getCcIssueMonth() . substr($cc->getCcIssueYear(), -2);
}
$optionsNVP = array('CITY' => $billing->getCity(), 'STATE' => $billing->getZone()->getCode() ? $billing->getZone()->getCode() : $billing->getCity(), 'COUNTRYCODE' => $billing->getCountry()->getIsoCode2(), 'EXPDATE' => $cc->getCcExpiresMonth() . $cc->getCcExpiresYear(), 'PAYMENTACTION' => $this->_config->paymentAction == 'Authorization' ? 'Authorization' : 'Sale');
$delivery = $order->getDelivery();
$optionsShip = array('SHIPTONAME' => $delivery->getFirstname() . ' ' . $delivery->getLastname(), 'SHIPTOSTREET' => $delivery->getStreetAddress(), 'SHIPTOSTREET2' => $delivery->getSuburb(), 'SHIPTOCITY' => $delivery->getCity(), 'SHIPTOZIP' => $delivery->getPostcode(), 'SHIPTOSTATE' => $delivery->getZone()->getCode() ? $delivery->getZone()->getCode() : $delivery->getCity(), 'SHIPTOCOUNTRYCODE' => $delivery->getCountry()->getIsoCode2());
// if these optional parameters are blank, remove them from transaction
if (isset($optionsShip['SHIPTOSTREET2']) && empty($optionsShip['SHIPTOSTREET2'])) {
unset($optionsShip['SHIPTOSTREET2']);
}
$response = $this->getApi()->DoDirectPayment(sprintf('%.2f', $this->getAmountInBaseCurrency($order->order_total)), $cc->getCcNumber(), $cc->getCcCvv(), $cc->getCcExpiresMonth() . $cc->getCcExpiresYear(), $billing->getFirstname(), $billing->getLastname(), $cc->getCcType(), $optionsAll, array_merge($optionsNVP, $optionsShip));
if ($response['ACK'] != 'Success') {
$this->log("Response : " . Zend_Debug::dump($response, null, false));
foreach ($this->getMessages($response) as $severity => $messages) {
Axis::message()->batchAdd($messages, $severity);
}
throw new Axis_Exception('DoDirectPayment Failure');
}
}
示例3: _afterSave
protected function _afterSave()
{
$payment = $this->getPayment();
if ($payment->getStatus() == 3) {
if ($payment->getPaymentMethod() == 'bank') {
$verify = Mage::getModel('affiliateplus/payment_verify')->loadExist($payment->getAccountId(), $this->getBankaccountId(), 'bank');
if (!$verify->isVerified()) {
try {
$verify->setVerified(1)->save();
} catch (Exception $e) {
}
}
}
} elseif ($payment->getStatus() == 1) {
if ($payment->getPaymentMethod() == 'bank') {
$verify = Mage::getModel('affiliateplus/payment_verify')->loadExist($payment->getAccountId(), 0, 'bank');
if ($verify->getId()) {
try {
$verify->setData('field', $this->getBankaccountId())->save();
} catch (Exception $e) {
Zend_Debug::dump($e->getMessage());
}
}
}
}
}
示例4: debug
protected function debug()
{
$vars = func_get_args();
foreach ($vars as $var) {
Zend_Debug::dump($var);
}
}
示例5: smsLinkAction
public function smsLinkAction()
{
$ObtenerNumero = new Core_Utils_Utils();
$telefono = $ObtenerNumero->obtenerNumero();
if ($this->_request->isGet()) {
$codigo = $this->_getParam('i', '');
try {
if (isset($codigo) && $codigo != '' && $telefono != '') {
$resultSms = $this->_GetResultSoap->_obtenerSMSLinkEnFulltracks($codigo);
Zend_Debug::dump($resultSms);
$responseSmnLinkFt = $resultSms->obtenerSMSLinkEnFulltracksResult;
if ($responseSmnLinkFt->esValido == true && $responseSmnLinkFt->numuser == $telefono) {
$this->_redirect('/pe/fulltracks');
} else {
$this->_redirect('http://m.entretenimiento.entel.pe');
}
} else {
$this->_redirect('http://m.entretenimiento.entel.pe');
}
} catch (Exception $e) {
$this->_redirect('http://m.entretenimiento.entel.pe');
}
} else {
$this->_redirect('http://m.entretenimiento.entel.pe');
}
}
示例6: authenticate
public function authenticate()
{
$consumer = new Zend_Oauth2_Consumer($this->_config);
try {
if (isset($_GET['code']) && !empty($_GET['code'])) {
$options = array('client_id' => $this->_config['consumerId'], 'redirect_uri' => $this->_config['callbackUrl'], 'client_secret' => $this->_config['consumerSecret'], 'code' => trim($_GET['code']), 'grant_type' => 'authorization_code');
$accessTokenInfo = $consumer->getAccessToken($options);
Zend_Debug::dump($accessTokenInfo);
$accessToken = $accessTokenInfo['access_token'];
$options = array('app_id' => $this->_config['consumerId'], 'method' => 'users.getInfo', 'secure' => 1, 'session_key' => $accessToken);
$sign = $this->getSign($options, $accessToken);
$options['sig'] = $sign;
$identity = $consumer->getIdentity($options, 'POST');
$identity = reset($identity);
$identity['CONSUMER_ID'] = $this->_consumerId;
return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, (object) $identity);
} elseif (!isset($_GET['error'])) {
$consumer->redirect(array('client_id' => $this->_config['consumerId'], 'redirect_uri' => $this->_config['callbackUrl'], 'response_type' => 'code'));
} else {
throw new Exception($_GET['error']);
}
} catch (Exception $e) {
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE, false, array($e->getMessage()));
}
}
示例7: getblockAction
public function getblockAction()
{
$param = Mage::app()->getFrontController()->getRequest()->getParams();
if ($param["create"] !== "false") {
$this->loadLayout();
if ($item_block = $this->getLayout()->getBlock($param["name"])) {
if ($param["template"]) {
$item_block->setTemplate($param["template"]);
}
}
} else {
$item_layout = Mage::getSingleton('core/layout');
if ($item_block = $item_layout->createBlock($param["class_name"], $param["name"])) {
if ($param["template"]) {
$item_block->setTemplate($param["template"]);
}
} else {
echo "not exist this class " . $param["class_name"];
die;
}
}
if ($param["onlychild"] == "true") {
Zend_Debug::dump($item_block->getChild());
} else {
echo $item_block->renderView();
}
exit;
}
示例8: errorAction
public function errorAction()
{
$errors = $this->_getParam('error_handler');
Zend_Debug::dump($errors);
exit;
switch ($errors->type) {
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
// 404 error -- controller or action not found
$this->getResponse()->setHttpResponseCode(404);
$this->view->message = 'Page not found';
break;
default:
// application error
$this->getResponse()->setHttpResponseCode(500);
$this->view->message = 'Application error';
break;
}
// Log exception, if logger available
if ($log = $this->getLog()) {
$log->crit($this->view->message, $errors->exception);
}
// conditionally display exceptions
if ($this->getInvokeArg('displayExceptions') == true) {
$this->view->exception = $errors->exception;
}
$this->view->request = $errors->request;
//$this->view->layout()->disableLayout();
}
示例9: _updateUserDb
private function _updateUserDb()
{
$fb_users = HTS_Util::getDbTable('users');
$fb_user = $fb_users->findOneByIdSocial($this->_id_social);
if (empty($fb_user)) {
$user_profile = $this->_social->api('/me');
if (FB_DEBUG) {
Zend_Debug::dump($user_profile);
}
$fb_user = HTS_Util::getDbRow('users');
$birthday = new Zend_Date(@$user_profile['Birthday'], 'dd/MM/yyyy');
$updated_time = new Zend_Date(@$user_profile['Updated_time']);
//TODO some values are null -> undefined index warning
$fb_user->id_social = $user_profile['Id'];
$fb_user->name = $user_profile['Name'];
$fb_user->first_name = @$user_profile['First_name'];
$fb_user->middle_name = @$user_profile['Middle_name'];
$fb_user->last_name = @$user_profile['Last_name'];
$fb_user->link = $user_profile['Link'];
$fb_user->birthday = @$birthday->toString('yyyy/MM/dd');
$fb_user->gender = $user_profile['Gender'];
$fb_user->timezone = @$user_profile['Timezone'];
$fb_user->locale = @$user_profile['Locale'];
$fb_user->time_created = time();
$fb_user->time_modified = time();
$fb_user->time_social_modified = $updated_time->toValue();
$this->_id_user = $fb_user->save();
}
$this->_user = $fb_user;
$this->_id_user = $fb_user->id;
}
示例10: getSingle
public function getSingle($text)
{
$args = array('appid' => $this->_appid, 'documentContent' => urlencode($text . ' ' . $this->_suffix), 'documentType' => 'text/plain', 'outputType' => 'xml');
$response = $this->curl($text, $args);
// Now parse the response using PHP SimpleXML
$xml = simplexml_load_string($response);
Zend_Debug::dump($xml);
$place = new Place();
if (isset($xml->results->place->name)) {
$place->name = $xml->results->place->name;
}
if (isset($xml->results->place->centroid->longitude)) {
$place->longitude = $xml->results->place->centroid->longitude;
}
if (isset($xml->results->place->centroid->latitude)) {
$place->latitude = $xml->results->place->centroid->latitude;
}
if (isset($xml->results->place->woeid)) {
$place->woeid = $xml->results->place->woeid;
}
if (isset($xml->results->place->placeTypeName)) {
$place->type = $xml->results->place->placeTypeName;
}
if (isset($xml->results->place->postal)) {
$place->postal = $xml->results->place->postal;
}
return $place;
}
示例11: copyFrom
public static function copyFrom(Twig_Node_Expression_GetAttr $node)
{
Zend_Debug::dump($node->__toString());
$node = new Zwig_Node_Expression_GetAttr($node->node, $node->attribute, $node->arguments, $node['type'], $node->lineno);
Zend_Debug::dump($node->__toString());
return $node;
}
示例12: loginAction
public function loginAction()
{
//$this->_helper->layout()->disableLayout();
$formAuthLogin = new Form_Auth_Login();
$this->view->form = $formAuthLogin;
if ($this->getRequest()->isPost()) {
if ($formAuthLogin->isValid($this->getRequest()->getPost())) {
$dadosAutenticacao = $formAuthLogin->getValues();
$db = Zend_Registry::get('db');
$authAdapter = new Zend_Auth_Adapter_DbTable($db);
try {
$authAdapter->setTableName('administrador')->setIdentityColumn('administrador_email')->setCredentialColumn('administrador_senha')->setIdentity($dadosAutenticacao['administrador_email'])->setCredential(md5($dadosAutenticacao['administrador_senha']));
$authAdapter->getDbSelect()->where("administrador_ativo = ?", 1);
$auth = Zend_Auth::getInstance();
$result = $auth->authenticate($authAdapter);
if ($result->isValid()) {
$dadosAdministrador = array();
Zend_Auth::getInstance()->getStorage()->write($dadosAdministrador);
$this->_redirect("index/");
} else {
$this->_helper->flashMessenger->addMessage(array('class' => 'alert alert-danger', 'message' => 'Usuário e/ou senha inválidos!'));
Zend_Debug::dump($result);
die;
$this->_redirect("admin/autenticacao/login");
}
} catch (Exception $e) {
$this->_helper->flashMessenger->addMessage(array('class' => 'alert alert-danger', 'message' => 'Houve um erro na autenticação - ' . $e->getMessage()));
$this->_redirect("auth/login");
}
}
}
}
示例13: process
public function process(Zend_Controller_Request_Abstract $request)
{
$this->customSetParam = $request->getParam('attributeSet');
//Zend_Debug::dump($this->customSetParam);
//Zend_Debug::dump($_FILES['customAttributeDetailImage']);
foreach ($this->customSetParam as $k => $v) {
$this->customSetName[] = $k;
}
Zend_Debug::dump($this->customSetName[0]);
foreach ($this->customSetParam[$this->customSetName[0]]['name'] as $k => $v) {
$this->customSetKey[] = $k;
}
Zend_Debug::dump($this->customSetKey);
$this->customSet->name_of_set = $this->customSetName[0];
$this->customSet->uploader_id = $this->userID;
//echo $this->table;
//echo $this->userID;
//echo $this->customSetName[0];
if (!DatabaseObject_Helper_ManageAttribute::confirmattributenamewithuploader($this->db, $this->table, $this->userID, $this->customSetName[0])) {
$this->customSet->save();
$this->attributeID = $this->customSet->getId();
//echo 'here at no error';
return true;
} else {
//echo 'here at errors';
echo 'duplicate, there is an error';
$this->addError('duplicate', 'this is a duplicate');
return !$this->hasError();
}
//return true if no errors have occurred
}
示例14: hasReceivedThisMessage
public function hasReceivedThisMessage($device_id, $message_id)
{
$select = $this->_db->select()->from(array('pm' => 'push_messages'), array())->join(array('pdm' => 'push_delivered_message'), 'pdm.app_id = pm.app_id', array('pm.message_id'))->where('pm.message_id = ?', $message_id)->where('pdm.device_type = ?', Push_Model_Iphone_Device::DEVICE_TYPE);
Zend_Debug::dump($this->_db->fetchOne($select));
die;
return $this->_db->fetchOne($select);
}
示例15: upsertAddress
function upsertAddress($data)
{
$websiteId = Mage::app()->getWebsite()->getId();
$store = Mage::app()->getStore();
$customer = Mage::getModel("customer/customer");
$customer->setWebsiteId($websiteId);
$customer->setStore($store);
$customer->loadByEmail($data['email']);
if ($customer->getId()) {
$address = Mage::getModel("customer/address");
$address->setCustomerId($customer->getId())->setFirstname($data['first_name'])->setLastname($data['last_name'])->setCompant($data['company'])->setTelephone($data['phone'])->setStreetFull(array($data['street_1'], $data['street_2']))->setCity($data['city'])->setCountryId($data['country'])->setPostcode($data['zip_code']);
$region = Mage::getModel('directory/region')->loadByCode($data['state_iso2'], $data['country']);
$state_id = $region->getId();
if ($region->getId()) {
$address->setRegionId($state_id);
} else {
if ($data['state'] !== '') {
$address->setRegion($data['state']);
}
}
$address->setIsDefaultBilling('1')->setIsDefaultShipping('1')->setSaveInAddressBook('1');
try {
$address->save();
} catch (Exception $e) {
Zend_Debug::dump($e->getMessage());
}
}
}