本文整理汇总了PHP中Gekosale\App::getURL方法的典型用法代码示例。如果您正苦于以下问题:PHP App::getURL方法的具体用法?PHP App::getURL怎么用?PHP App::getURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gekosale\App
的用法示例。
在下文中一共展示了App::getURL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: session_write
public function session_write($sessionid, $sessioncontent)
{
$clientid = isset($_SESSION['CurrentState']['Clientid'][0]) && $_SESSION['CurrentState']['Clientid'][0] > 0 ? $_SESSION['CurrentState']['Clientid'][0] : 0;
$cart = isset($_SESSION['CurrentState']['Cart'][0]) ? $_SESSION['CurrentState']['Cart'][0] : NULL;
$viewid = isset($_SESSION['CurrentState']['MainsideViewId'][0]) && $_SESSION['CurrentState']['MainsideViewId'][0] > 0 ? $_SESSION['CurrentState']['MainsideViewId'][0] : 0;
$globalprice = isset($_SESSION['CurrentState']['GlobalPrice'][0]) ? (double) $_SESSION['CurrentState']['GlobalPrice'][0] : 0;
$cartcurrency = isset($_SESSION['CurrentState']['CurrencySymbol'][0]) ? (string) $_SESSION['CurrentState']['CurrencySymbol'][0] : NULL;
$ipaddress = isset($_SERVER['REMOTE_ADDR']) ? substr($_SERVER['REMOTE_ADDR'], 0, 15) : '000.000.000.000';
$browser = isset($_SESSION['CurrentState']['BrowserData'][0]['browser']) && $_SESSION['CurrentState']['BrowserData'][0]['browser'] != '' ? $_SESSION['CurrentState']['BrowserData'][0]['browser'] : NULL;
$platform = isset($_SESSION['CurrentState']['BrowserData'][0]['platform']) && $_SESSION['CurrentState']['BrowserData'][0]['platform'] != '' ? $_SESSION['CurrentState']['BrowserData'][0]['platform'] : NULL;
$ismobile = isset($_SESSION['CurrentState']['BrowserData'][0]['ismobile']) && $_SESSION['CurrentState']['BrowserData'][0]['ismobile'] == 1 ? 1 : 0;
$isbot = isset($_SESSION['CurrentState']['BrowserData'][0]['isbot']) && $_SESSION['CurrentState']['BrowserData'][0]['isbot'] == 1 ? 1 : 0;
if ($this->isMemcache) {
$this->registry->cache->save('session_' . $sessionid, $sessioncontent, $this->__SESSION_LIFETIME);
}
$sql = 'REPLACE INTO sessionhandler(
sessioncontent,
sessionid,
expiredate,
clientid,
globalprice,
cartcurrency,
ipaddress,
browser,
platform,
ismobile,
isbot,
viewid,
url,
cart
)
VALUES (
:sessioncontent,
:sessionid,
:expiredate,
:clientid,
:globalprice,
:cartcurrency,
:ipaddress,
:browser,
:platform,
:ismobile,
:isbot,
:viewid,
:url,
:cart
)';
$stmt = Db::getInstance()->prepare($sql);
$stmt->bindValue('sessioncontent', $this->isMemcache ? '' : $sessioncontent);
$stmt->bindValue('sessionid', $sessionid);
$stmt->bindValue('clientid', $clientid);
$stmt->bindValue('globalprice', $globalprice);
$stmt->bindValue('cartcurrency', $cartcurrency);
$stmt->bindValue('ipaddress', $ipaddress);
$stmt->bindValue('browser', $browser);
$stmt->bindValue('cart', json_encode($cart));
$stmt->bindValue('platform', $platform);
$stmt->bindValue('url', App::getURL());
$stmt->bindValue('ismobile', $ismobile);
$stmt->bindValue('isbot', $isbot);
if ($viewid > 0) {
$stmt->bindValue('viewid', $viewid);
} else {
$stmt->bindValue('viewid', NULL);
}
$stmt->bindValue('expiredate', date('Y-m-d H:i:s', time() + $this->__SESSION_LIFETIME));
try {
return $stmt->execute();
} catch (Exception $e) {
throw new Exception('Session: write broken while query');
}
}