当前位置: 首页>>代码示例>>PHP>>正文


PHP CASHSystem::getCurrentIP方法代码示例

本文整理汇总了PHP中CASHSystem::getCurrentIP方法的典型用法代码示例。如果您正苦于以下问题:PHP CASHSystem::getCurrentIP方法的具体用法?PHP CASHSystem::getCurrentIP怎么用?PHP CASHSystem::getCurrentIP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CASHSystem的用法示例。


在下文中一共展示了CASHSystem::getCurrentIP方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: time

	/**
	 * Records the basic access data to the assets analytics table
	 *
	 * @return boolean
	 */protected function recordAnalytics($asset_id,$element_id=0) {
		$ip_and_proxy = CASHSystem::getCurrentIP();
		$result = $this->db->setData(
			'assets_analytics',
			array(
				'asset_id' => $asset_id,
				'element_id' => $element_id,
				'access_time' => time(),
				'client_ip' => $ip_and_proxy['ip'],
				'client_proxy' => $ip_and_proxy['proxy'],
				'cash_session_id' => $this->getCASHSessionID()
			)
		);
		return $result;
	}
开发者ID:GabeGibitz,项目名称:DIY,代码行数:19,代码来源:AssetPlant.php

示例2: array

	/**
	 * Records the basic access data to the elements analytics table
	 *
	 * @return boolean
	 */protected function recordAnalytics($element_id,$access_method,$access_action='getmarkup',$access_data='') {
		$ip_and_proxy = CASHSystem::getCurrentIP();
		$already_recorded = false;
		// first check and see if we've recorded this session and circumstance yet
		// only do this for empty lock_method_table queries so we don't repeat
		// unnecessary rows and overwhelm the table
		if ($access_action == 'getmarkup') {
			$already_recorded = $this->db->getData(
				'elements_analytics',
				'id',
				array(
					"element_id" => array(
						"condition" => "=",
						"value" => $element_id
					),
					"access_method" => array(
						"condition" => "=",
						"value" => $access_method
					),
					"access_location" => array(
						"condition" => "=",
						"value" => CASHSystem::getCurrentURL()
					),
					"cash_session_id" => array(
						"condition" => "=",
						"value" => $this->getCASHSessionID()
					),
					"client_ip" => array(
						"condition" => "=",
						"value" => $ip_and_proxy['ip']
					),
					"client_proxy" => array(
						"condition" => "=",
						"value" => $ip_and_proxy['proxy']
					)
				)
			);
		}
		if (!$already_recorded) {
			$result = $this->db->setData(
				'elements_analytics',
				array(
					'element_id' => $element_id,
					'access_method' => $access_method,
					'access_location' => CASHSystem::getCurrentURL(),
					'access_action' => $access_action,
					'access_data' => $access_data,
					'access_time' => time(),
					'client_ip' => $ip_and_proxy['ip'],
					'client_proxy' => $ip_and_proxy['proxy'],
					'cash_session_id' => $this->getCASHSessionID()
				)
			);
			return $result;
		} else {
			return true;
		}
	}
开发者ID:GabeGibitz,项目名称:DIY,代码行数:62,代码来源:ElementPlant.php


注:本文中的CASHSystem::getCurrentIP方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。