本文整理汇总了PHP中APF类的典型用法代码示例。如果您正苦于以下问题:PHP APF类的具体用法?PHP APF怎么用?PHP APF使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了APF类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_view
public function get_view()
{
$req = APF::get_instance()->get_request();
$data = $req->get_attributes();
$this->assign_data("data", $data);
return "Header";
}
示例2: execute
public function execute()
{
$this->apf = APF::get_instance();
$this->request = $this->apf->get_request();
$this->response = $this->apf->get_response();
$attributes = $this->request->get_attributes();
if (!empty($attributes)) {
foreach ($attributes as $key => $value) {
$this->assign_data($key, $value);
}
}
parent::execute();
}
示例3: handle_request_internal
public function handle_request_internal()
{
// @params proids :房源id 多个id以逗号间隔如22,33,44【必填】
// @params brokerId :经纪人id【必填】
// @params token :token【必填】
// @params from :请求来源【必填】
$paramsApi['from'] = APF::get_instance()->get_config('java_api_from');
$paramsApi['proids'] = $this->_params['propIds'];
$paramsApi['token'] = $this->_params['token'];
$paramsApi['brokerId'] = $this->_params['brokerId'];
$brokerId = $this->_params['brokerId'];
//判断经纪人为ppc经纪人 & 套餐经纪人
//根据不同类型判断调用不同的java接口
if (Bll_Broker_HzBroker::isComboBroker($brokerId)) {
$paramsApi['isComboBroker'] = true;
$api_url = 'sale/properties/deletes?json';
} else {
$paramsApi['isComboBroker'] = false;
$api_url = 'ppc/properties/deletes?json';
}
$data = Util_CallAPI::callJavaInternalApi($api_url, $paramsApi, false);
if ($data['data']['status'] === 'ok') {
$ret = array('status' => 'ok', 'data' => array());
} else {
$errcode = $data['data']['code'];
$translate_errcode = $this->my_err_code($errcode);
return Util_MobileAPI::error($translate_errcode);
}
return $ret;
}
示例4: initEnv
private function initEnv()
{
$this->objAPF = $objAPF = APF::get_instance();
$this->request = $this->objAPF->get_request();
$this->params = $this->request->get_parameters();
$this->debug = isset($_GET['debug']) ? true : false;
}
示例5: handle_request_internal
public function handle_request_internal()
{
$request = APF::get_instance()->get_request();
$brokerId = self::$BrokerInfo['BaseInfo']['BROKERID'];
$cityId = self::$BrokerInfo['BaseInfo']['CITYID'];
try {
$starBll = new Bll_Broker_StarIntermediary($cityId);
$starIsOpen = $starBll->checkCityIfOpen();
if ($starIsOpen) {
$starInfo = $starBll->getBrokerNewestInfo($brokerId);
$brokerScore = $starInfo['broker']['brokerScore'] ?: 0;
$maxScore = $starInfo['city']['cityScore'] ?: 0;
$leftScore = $maxScore - $brokerScore > 0 ? $maxScore - $brokerScore : 0;
$clickScoreRate = sprintf("%.1f", $starInfo['city']['vppvBeishu'] ?: 0);
$isStar = $starInfo['broker']['isMingxing'] ?: 0;
$request->set_attribute('brokerScore', $brokerScore);
$request->set_attribute('maxScore', $maxScore);
$request->set_attribute('leftScore', $leftScore);
$request->set_attribute('clickScoreRate', $clickScoreRate);
$request->set_attribute('isStar', $isStar);
} else {
//todo 产品没有定义错误页面,工期太赶,没有时间处理
return;
}
} catch (Exception $e) {
//todo 不做任何处理
return;
}
return "Broker_StarIntermediary";
}
示例6: get_userinfo_from_ldap
public function get_userinfo_from_ldap($username, $password)
{
$config = @APF::get_instance()->get_config('ldap', 'ldap');
$url = $config['url'];
if ($config['host'] && $config['port']) {
$ldaphost = $config['host'];
$ldapport = $config['port'];
$data = array('u' => $username, 'p' => $password, 'f' => 'getinfo', 'host' => $ldaphost, 'port' => $ldapport);
} else {
$data = array('u' => $username, 'p' => $password, 'f' => 'getinfo');
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
$login = json_decode(curl_exec($ch), true);
curl_close($ch);
$ldap_info = false;
if ($login['result']) {
$info = $login['result'];
for ($i = 0; $i < $info['count']; $i++) {
$ldap_info = new stdClass();
$ldap_info->chinese_name = $info[$i]['displayname'][0];
$ldap_info->english_name = $info[$i]['samaccountname'][0];
$ldap_info->email = $info[$i]['mail'][0];
}
}
return $ldap_info;
}
示例7: handle_request_internal
public function handle_request_internal()
{
$request = APF::get_instance()->get_request();
$response = APF::get_instance()->get_response();
$routeMatches = $request->get_router_matches();
$business = $routeMatches[1];
$response->set_content_type('text/html', 'utf-8');
switch ($business) {
case 'ajk':
return new House_PublishAjkController();
break;
case 'hz':
return new House_PublishHzController();
break;
case 'jpor':
return new House_ORPublishJpController();
break;
case 'jpos':
return new House_OSPublishJpController();
break;
case 'jpsr':
return new House_SRPublishJpController();
break;
case 'jpss':
return new House_SSPublishJpController();
break;
default:
return new House_PublishAjkController();
break;
}
}
示例8: handle_request_internal
public function handle_request_internal()
{
$apf = APF::get_instance();
$request = $apf->get_request();
$act = $request->get_parameters();
//操作类型
$account = $act['ac'];
$acOrderNo = $act['or'];
$sn = $act['sn'];
$amount = $act['am'];
$ack = $act['ack'];
$price = $act['price'];
$userId = $act['userId'];
$reorderId = $act['reorderId'];
$apps = APF::get_instance()->get_config('apps', 'acenter');
$appId = $apps['fyk']['appId'];
$appKey = $apps['fyk']['appKey'];
$myAck = md5("ac=" . $account . "&ap=" . $appId . "&or=" . $acOrderNo . "&sn=" . $sn . "&am=" . $amount . "&appkey=" . $appKey . "");
if (empty($ack)) {
// 判断是callback通知
$callBackUrl = APF::get_instance()->get_config('wabRechargeSuccessUrl');
$this->redirect($callBackUrl . "?amount=" . $price / 100);
} elseif ($myAck == $ack) {
// 判断是notify通知
return $this->isNotify($reorderId, $userId, $account, $price, $amount * 100, $acOrderNo);
}
}
示例9: upLoadQrImage
public function upLoadQrImage($username)
{
//获取 上传
$url = 'http://open.weixin.qq.com/qr/code/?' . http_build_query(array('username' => $username));
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$file = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
if (!in_array($info['content_type'], array('image/jpg', 'image/png', 'image/jpeg'))) {
return false;
} else {
// 上传至 AIS
$upLoadURLPrefixDFS = APF::get_instance()->get_config('ImageUploadURLPrefixDFS', 'image');
$upLoadURLBaseDomainDFS = APF::get_instance()->get_config('ImageUploadURLBaseDomainDFS', 'image');
$upLoad = $upLoadURLPrefixDFS . '.' . $upLoadURLBaseDomainDFS . '/upload';
$bs64 = base64_encode($file);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $upLoad);
// TODO 注意该路径走配置
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('file' => $bs64));
$ret = curl_exec($ch);
curl_close($ch);
$ret = json_decode($ret, true);
if ($ret['status'] != 'ok') {
return false;
}
return $ret;
}
}
示例10: handle_request_internal
public function handle_request_internal()
{
if (!isset($this->_params["propId"])) {
return Util_MobileAPI::error(Const_APIStatus::E_PROP_ID_MISS);
}
$json = $this->_params['imageJson'];
//$json = '[{"type":3,"commPicIds":12345}]';
$imageJson = json_decode($json, true);
if ($imageJson) {
$proid = $this->_params["propId"];
foreach ($imageJson as $img) {
$api_url = 'image/addImg';
$img_params['brokerId'] = $this->_params['brokerId'];
$img_params['propId'] = $proid;
$img_params['imageJson'] = json_encode($img);
$img_params['from'] = APF::get_instance()->get_config('java_api_from');
$img_params["token"] = $this->_params["token"];
//token
ksort($img_params);
$img_params_json = json_encode($img_params);
$img_return = Util_CallAPI::get_data_from_java_v3($api_url, $img_params_json, false);
if ($img_return['data']['status'] != 'ok' && !$img_return['data']['id']) {
return Util_MobileAPI::error(Bll_Prop::changeJavaAPICodeToSelfCode($img_return['data']['code']));
}
}
} else {
return Util_MobileAPI::error(Const_APIStatus::E_PROP_IMAGEJSON_ERROR);
}
$return = array();
$return["status"] = "ok";
$return['data']['id'] = $img_return['data']['id'];
return $return;
}
示例11: handle_request_internal
public function handle_request_internal()
{
if (!Bll_City::isShowCaseCity(static::$intBrokerCityID)) {
$this->outData(array(), 0);
exit;
}
$this->apf = APF::get_instance();
$this->request = $this->apf->get_request();
$this->response = $this->apf->get_response();
$params = $this->request->get_parameters();
//经纪人ID
$this->brokerId = self::$BrokerInfo['BaseInfo']['BROKERID'];
// TODO 替换为其他的方式
//经纪人城市ID
$this->cityId = self::$BrokerInfo['BaseInfo']['CITYID'];
$type = $params['type'];
switch ($type) {
case 'esf':
//二手房房源数据获取
$this->getBrokerEsfPro();
break;
case 'zf':
//租房房源数据获取
$this->getBrokerZfPro();
break;
default:
$this->outData(array(), 0);
break;
}
}
示例12: _checkSave
private function _checkSave()
{
// 验证ip是否合法
$clientIp = APF::get_instance()->get_request()->get_client_ip();
$configIp = APF::get_instance()->get_config('active_coupon_ip', 'customer');
return $clientIp == $configIp ? true : false;
}
示例13: handle_request_internal
public function handle_request_internal()
{
if (!isset($this->_params['cityId'])) {
return Util_MobileAPI::error(Const_APIStatus::E_PARAM_CITYID_MISS);
}
// 房屋类型 junyang
$protype = APF::get_instance()->get_config('housetype', 'zu_house');
$protype = isset($protype[$this->_params['cityId']]) ? $protype[$this->_params['cityId']] : $protype[0];
// 装修类型
$fitments = APF::get_instance()->get_config('ajk_fitment_unify', 'zu_house');
$fitment = $fitments[$this->_params['cityId']];
// 选择朝向
$toward = APF::get_instance()->get_config('toward', 'zu_house');
// 房屋配置
$deployment = APF::get_instance()->get_config('b_deployment', 'zu_house');
// 付款类型
$paytype = APF::get_instance()->get_config('paytype', 'zu_house');
// 合租类型
$sharetype = APF::get_instance()->get_config('sharetype', 'zu_house');
// 合租性别
$sharesex = APF::get_instance()->get_config('sharesex', 'zu_house');
//是否播种城市
$isseed = 0;
$cityTop = Bll_HzFixPlan::get_citytop($this->_params['cityId']);
if (!empty($cityTop)) {
$isseed = 1;
}
$return = array();
$return["status"] = "ok";
$return["data"] = array("protype" => $protype, "fitment" => $fitment, "toward" => $toward, "deployment" => $deployment, "paytype" => $paytype, "sharetype" => $sharetype, "sharesex" => $sharesex, 'isseed' => $isseed);
return $return;
}
示例14: execute
public function execute($input_parameters = NULL)
{
if (APF::get_instance()->is_debug_enabled()) {
APF::get_instance()->debug(__CLASS__ . '[' . $this->pdo->config['dsn'] . '|' . $this->pdo->get_name() . ']' . "->execute: " . $this->queryString);
}
$logger = APF::get_instance()->get_logger();
$logger->debug(__CLASS__, '[' . $this->pdo->get_name() . ']->execute: ', $this->queryString);
APF::get_instance()->pf_benchmark_inc_begin('dbtime');
$start = microtime(true);
$ret = parent::execute($input_parameters);
$end = microtime(true);
APF::get_instance()->pf_benchmark_inc_end('dbtime');
//add by hexin for record SQL execute time
APF::get_instance()->pf_benchmark("sql_time", array($this->i => $end - $start));
// 按照惯用格式记录sql执行时间和占用内存
// added by htlv
$tmp_time = $end - $start;
$tmp_mem = memory_get_usage();
apf_require_class('APF_Performance');
APF::get_instance()->pf_benchmark("sql_time_af", array($this->i => array('sql' => $this->_sql, APF_Performance::MESSAGE_TIME => $tmp_time, APF_Performance::MESSAGE_MEMORY => $tmp_mem)));
if (!$ret) {
$error_info = parent::errorInfo();
/**
* remove duplicated error log
$logger->error(__CLASS__, '['. $this->pdo->get_name() .']->execute: ', $this->queryString);
$_error_info = preg_replace("#[\r\n \t]+#",' ',print_r($error_info,true));
$logger->error(__CLASS__, '['. $this->pdo->get_name() .']->execute: ', $_error_info);
*/
if (parent::errorCode() !== '00000') {
throw new APF_Exception_SqlException($this->pdo->get_name() . ' | ' . $this->pdo->config['dsn'] . ' | ' . $this->queryString . ' | ' . join(' | ', $error_info), parent::errorCode());
}
}
return $ret;
}
示例15: handle_request
public function handle_request()
{
$apf = APF::get_instance();
$request = $apf->get_request();
$params = $request->get_parameters();
$baseDomain = $apf->get_config('base_domain', 'common');
$baseUri = defined('BASE_URI') ? BASE_URI : '';
$showUrl = "http://my.{$baseDomain}{$baseUri}/goodbroker/show";
$win = Model_Goodbroker_Baseinfo::data_access()->filter('is_deem', 1)->filter('top_ten', 1)->limit(10)->find_all();
$gbdao = new Bll_Goodbroker();
$vcrres = $gbdao->getResourceDAO();
$winids = '';
foreach ($win as $row) {
$winids .= $row->broker_id . ',';
}
$winids = substr($winids, 0, -1);
$vcrarr = $vcrres->getVcr($winids);
$varr = array();
foreach ($vcrarr as $row) {
$varr[$row['broker_id']] = $row['resource_url'];
}
$request->set_attribute('win', $win);
$request->set_attribute('varr', $varr);
$request->set_attribute('showUrl', $showUrl);
return 'Goodbroker_Win';
}