本文整理汇总了PHP中Net_URL::addRawQueryString方法的典型用法代码示例。如果您正苦于以下问题:PHP Net_URL::addRawQueryString方法的具体用法?PHP Net_URL::addRawQueryString怎么用?PHP Net_URL::addRawQueryString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Net_URL
的用法示例。
在下文中一共展示了Net_URL::addRawQueryString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstallerPath
/**
* インストーラーの URL を返す
*
* @return string インストーラーの URL
*/
public static function getInstallerPath()
{
$netUrl = new Net_URL();
$installer = 'install/' . DIR_INDEX_PATH;
// XXX メソッド名は add で始まるが、実際には置換を行う
$netUrl->addRawQueryString('');
$current_url = $netUrl->getURL();
$current_url = dirname($current_url) . '/';
// XXX 先頭の / を含まない。
$urlpath = substr($_SERVER['SCRIPT_FILENAME'], strlen(HTML_REALDIR));
// / を 0、/foo/ を 1 としたディレクトリー階層数
$dir_level = substr_count($urlpath, '/');
$installer_url .= str_repeat('../', $dir_level) . $installer;
return $installer_url;
}
示例2: sendRedirect
/**
* アプリケーション内でリダイレクトする
*
* 内部で生成する URL の searchpart は、下記の順で上書きしていく。(後勝ち)
* 1. 引数 $inheritQueryString が true の場合、$_SERVER['QUERY_STRING']
* 2. $location に含まれる searchpart
* 3. 引数 $arrQueryString
* @param string $location 「url-path」「現在のURLからのパス」「URL」のいずれか。「../」の解釈は行なわない。
* @param array $arrQueryString URL に付加する searchpart
* @param bool $inheritQueryString 現在のリクエストの searchpart を継承するか
* @param bool|null $useSsl true:HTTPSを強制, false:HTTPを強制, null:継承
* @return void
* @static
*/
function sendRedirect($location, $arrQueryString = array(), $inheritQueryString = false, $useSsl = null)
{
// ローカルフックポイント処理
$objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg);
$arrBacktrace = debug_backtrace();
if (is_object($arrBacktrace[0]['object']) && method_exists($arrBacktrace[0]['object'], 'getMode')) {
$parent_class_name = get_parent_class($arrBacktrace[0]['object']);
$objPlugin->doAction($parent_class_name . '_action_' . $arrBacktrace[0]['object']->getMode(), array($arrBacktrace[0]['object']));
$class_name = get_class($arrBacktrace[0]['object']);
if ($class_name != $parent_class_name) {
$objPlugin->doAction($class_name . '_action_' . $arrBacktrace[0]['object']->getMode(), array($this));
}
} elseif (is_object($arrBacktrace[0]['object'])) {
$pattern = '/^[a-zA-Z0-9_]+$/';
$mode = null;
if (isset($_GET['mode']) && preg_match($pattern, $_GET['mode'])) {
$mode = $_GET['mode'];
} elseif (isset($_POST['mode']) && preg_match($pattern, $_POST['mode'])) {
$mode = $_POST['mode'];
}
$parent_class_name = get_parent_class($arrBacktrace[0]['object']);
$objPlugin->doAction($parent_class_name . '_action_' . $mode, array($arrBacktrace[0]['object']));
$class_name = get_class($arrBacktrace[0]['object']);
if ($class_name != $parent_class_name) {
$objPlugin->doAction($class_name . '_action_' . $mode, array($this));
}
}
// url-path → URL 変換
if ($location[0] === '/') {
$netUrl = new Net_URL($location);
$location = $netUrl->getUrl();
}
// URL の場合
if (preg_match('/^https?:/', $location)) {
$url = $location;
if (is_bool($useSsl)) {
if ($useSsl) {
$pattern = '/^' . preg_quote(HTTP_URL, '/') . '(.*)/';
$replacement = HTTPS_URL . '\\1';
$url = preg_replace($pattern, $replacement, $url);
} else {
$pattern = '/^' . preg_quote(HTTPS_URL, '/') . '(.*)/';
$replacement = HTTP_URL . '\\1';
$url = preg_replace($pattern, $replacement, $url);
}
}
} else {
if (!is_bool($useSsl)) {
$useSsl = SC_Utils_Ex::sfIsHTTPS();
}
$netUrl = new Net_URL($useSsl ? HTTPS_URL : HTTP_URL);
$netUrl->path = dirname($_SERVER['SCRIPT_NAME']) . '/' . $location;
$url = $netUrl->getUrl();
}
$pattern = '/^(' . preg_quote(HTTP_URL, '/') . '|' . preg_quote(HTTPS_URL, '/') . ')/';
// アプリケーション外へのリダイレクトは扱わない
if (preg_match($pattern, $url) === 0) {
trigger_error('', E_USER_ERROR);
}
$netUrl = new Net_URL($url);
if ($inheritQueryString && !empty($_SERVER['QUERY_STRING'])) {
$arrQueryStringBackup = $netUrl->querystring;
// XXX メソッド名は add で始まるが、実際には置換を行う
$netUrl->addRawQueryString($_SERVER['QUERY_STRING']);
$netUrl->querystring = array_merge($netUrl->querystring, $arrQueryStringBackup);
}
$netUrl->querystring = array_merge($netUrl->querystring, $arrQueryString);
$session = SC_SessionFactory_Ex::getInstance();
if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE || $session->useCookie() == false) {
$netUrl->addQueryString(session_name(), session_id());
}
$netUrl->addQueryString(TRANSACTION_ID_NAME, SC_Helper_Session_Ex::getToken());
$url = $netUrl->getURL();
header("Location: {$url}");
exit;
}
示例3: doCheckBuyAndDownload
function doCheckBuyAndDownload($config)
{
$objFormParam = new SC_FormParam();
$this->lfInitParam($objFormParam);
$objFormParam->setParam($_REQUEST);
$objCustomer = new SC_Customer_Ex();
$objQuery = SC_Query::getSingletonInstance();
$detect = new Mobile_Detect();
$version = $detect->version("iOS", Mobile_Detect::VERSION_TYPE_FLOAT);
$contentid = $this->arrProduct["product_code_min"];
$curl = $this->curl_init(KISEKAE_TOUCH_IPHONE_API01);
$post = $this->getPost($config, array("contentid" => $contentid, "device" => $objFormParam->getValue("device_name", "iPhone6"), "version" => floor($version), "apiversion" => null, "operator" => "au", "lang" => "ja"));
$this->getDs($post, $config);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
GC_Utils_Ex::gfPrintLog(print_r($post, TRUE), DEBUG_LOG_REALFILE);
$result = curl_exec($curl);
$status = SC_XML::xpath($result, "//status/@value");
$vid = SC_XML::xpath($result, "//validation/@id");
switch ($status) {
default:
SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);
case "000":
GC_Utils_Ex::gfDebugLog($result);
$_COOKIE["product_ktc_vid"] = $vid;
break;
}
// API2
$openid = $objCustomer->getValue("au_open_id");
$curl = $this->curl_init(KISEKAE_TOUCH_IPHONE_API02);
$post = $this->getPost($config, array("contentid" => $contentid, "userid" => $openid, "vid" => $vid));
$this->getDs($post, $config);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
GC_Utils_Ex::gfPrintLog(print_r($post, TRUE), DEBUG_LOG_REALFILE);
$result = curl_exec($curl);
$status = SC_XML::xpath($result, "//status/@value");
switch ($status) {
default:
SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);
break;
case "000":
case "010":
// TEST
// /ios/products/detail.php?mode=check_buy_and_download&product_id=13&classcategory_id1=0&classcategory_id2=0&quantity=1&admin=&favorite_product_id=&product_class_id=&device_name=iPhone6Plus&device_height=736&device_width=414&device_rate=3&device_lang=ja&ignore_redownload=1
if ($_GET["ignore_redownload"] == "1") {
$status = "000";
}
break;
}
if ($status == "000") {
// FIXME 課金処理
// API03
$curl = $this->curl_init(KISEKAE_TOUCH_IPHONE_API03);
if ($objCustomer->getValue("buy_to_nopoint") == "1") {
$price = $this->arrProduct["price02_min"];
$settlementtype = "998";
$redownloaddate = date("Ymd");
} else {
$price = $this->arrProduct["price02_min"];
$settlementtype = "001";
$redownloaddate = date("Ymd", strtotime($this->downloadable_days2));
}
$post = $this->getPost($config, array("contentid" => $contentid, "price" => $price, "redownloaddate" => $redownloaddate, "userid" => $openid, "vid" => $vid, "settlementtype" => $settlementtype));
$this->getDs($post, $config);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
GC_Utils_Ex::gfPrintLog(print_r($post, TRUE), DEBUG_LOG_REALFILE);
$result = curl_exec($curl);
$authentication_id = SC_XML::xpath($result, "//authentication/@id");
$objFormParam = new SC_FormParam();
$this->setOrderParam($objFormParam, $vid, $authentication_id);
$objFormParam->convParam();
$message = '';
$arrValBef = array();
$objPurchase = new SC_Helper_Purchase_Ex();
$objPurchase->saveShippingTemp(array());
$order_id = $this->doRegister("", $objPurchase, $objFormParam, $message, $arrValBef);
$customer_id = $objCustomer->getValue("customer_id");
$this->addPointHistory($order_id, $customer_id, $objFormParam, $objQuery);
} else {
$authentication_id = SC_XML::xpath($result, "//authentication/@id");
}
$netUrl = new Net_URL(KISEKAE_TOUCH_IPHONE_CST02);
$netUrl->addQueryString("aid", $authentication_id);
$netUrl->addQueryString("cpid", $config["cpid"]);
$netUrl->addQueryString("siteid", $config["siteid"]);
$netUrl->addQueryString("contentid", $contentid);
$netUrl->addQueryString("ts", date("YmdHis"));
$post2 = $netUrl->querystring;
$this->getDs($post2, $config);
$netUrl->addRawQueryString(http_build_query($post2));
GC_Utils_Ex::gfPrintLog(print_r($post2, TRUE), DEBUG_LOG_REALFILE);
header("Location: " . $netUrl->getURL());
}
示例4: addRawQueryString
/**
* Sets the querystring to literally what you supply
*
* @param string The querystring data. Should be of the format foo=bar&x=y etc
* @param bool Whether data is already urlencoded or not, default = already encoded
* @access public
*/
function addRawQueryString($querystring, $preencoded = true)
{
$this->_url->addRawQueryString($querystring, $preencoded);
}
示例5: sendRedirect
/**
* アプリケーション内でリダイレクトする
*
* 内部で生成する URL の searchpart は、下記の順で上書きしていく。(後勝ち)
* 1. 引数 $inheritQueryString が true の場合、$_SERVER['QUERY_STRING']
* 2. $location に含まれる searchpart
* 3. 引数 $arrQueryString
* @param string $location 「url-path」「現在のURLからのパス」「URL」のいずれか。「../」の解釈は行なわない。
* @param array $arrQueryString URL に付加する searchpart
* @param bool $inheritQueryString 現在のリクエストの searchpart を継承するか
* @param bool|null $useSsl true:HTTPSを強制, false:HTTPを強制, null:継承
* @return void
* @static
*/
function sendRedirect($location, $arrQueryString = array(), $inheritQueryString = false, $useSsl = null)
{
// url-path → URL 変換
if ($location[0] === '/') {
$netUrl = new Net_URL($location);
$location = $netUrl->getUrl();
}
// URL の場合
if (preg_match('/^https?:/', $location)) {
$url = $location;
if (is_bool($useSsl)) {
if ($useSsl) {
$pattern = '/^' . preg_quote(HTTP_URL, '/') . '(.*)/';
$replacement = HTTPS_URL . '\\1';
$url = preg_replace($pattern, $replacement, $url);
} else {
$pattern = '/^' . preg_quote(HTTPS_URL, '/') . '(.*)/';
$replacement = HTTP_URL . '\\1';
$url = preg_replace($pattern, $replacement, $url);
}
}
} else {
if (!is_bool($useSsl)) {
$useSsl = SC_Utils_Ex::sfIsHTTPS();
}
$netUrl = new Net_URL($useSsl ? HTTPS_URL : HTTP_URL);
$netUrl->path = dirname($_SERVER['PHP_SELF']) . '/' . $location;
$url = $netUrl->getUrl();
}
$pattern = '/^(' . preg_quote(HTTP_URL, '/') . '|' . preg_quote(HTTPS_URL, '/') . ')/';
// アプリケーション外へのリダイレクトは扱わない
if (preg_match($pattern, $url) === 0) {
SC_Utils_Ex::sfDispException();
}
$netUrl = new Net_URL($url);
if ($inheritQueryString && !empty($_SERVER['QUERY_STRING'])) {
$arrQueryStringBackup = $netUrl->querystring;
// XXX メソッド名は add で始まるが、実際には置換を行う
$netUrl->addRawQueryString($_SERVER['QUERY_STRING']);
$netUrl->querystring = array_merge($netUrl->querystring, $arrQueryStringBackup);
}
$netUrl->querystring = array_merge($netUrl->querystring, $arrQueryString);
$session = SC_SessionFactory::getInstance();
if (SC_MobileUserAgent_Ex::isMobile() || $session->useCookie() == false) {
$netUrl->addQueryString(session_name(), session_id());
}
$netUrl->addQueryString(TRANSACTION_ID_NAME, SC_Helper_Session_Ex::getToken());
$url = $netUrl->getURL();
header("Location: {$url}");
exit;
}
示例6: sendRedirect
/**
* 指定の URL へリダイレクトする.
*
* リダイレクト先 URL に SITE_URL 及び SSL_URL を含むかチェックし,
* LC_Page::getToken() の値を URLパラメータで自動的に付与する.
*
* @param string $url リダイレクト先 URL
* @param boolean $isMobile モバイル用にセッションIDを付与する場合 true
* @return void|boolean $url に SITE_URL 及び, SSL_URL を含まない場合 false,
* 正常に遷移可能な場合は, $url の ロケーションヘッダを出力する.
* @see Net_URL
*/
function sendRedirect($url, $isMobile = false)
{
if (preg_match("/(" . preg_quote(SITE_URL, '/') . "|" . preg_quote(SSL_URL, '/') . ")/", $url)) {
$netURL = new Net_URL($url);
if (!empty($_SERVER['QUERY_STRING'])) {
$netURL->addRawQueryString($_SERVER['QUERY_STRING']);
}
$session = SC_SessionFactory::getInstance();
if ($isMobile || $session->useCookie() == false) {
$netURL->addQueryString(session_name(), session_id());
}
$netURL->addQueryString(TRANSACTION_ID_NAME, $this->getToken());
header("Location: " . $netURL->getURL());
//return true;
exit;
}
return false;
}
示例7: sendRedirect
/**
* アプリケーション内でリダイレクトする
*
* 内部で生成する URL の searchpart は、下記の順で上書きしていく。(後勝ち)
* 1. 引数 $inheritQueryString が true の場合、$_SERVER['QUERY_STRING']
* 2. $location に含まれる searchpart
* 3. 引数 $arrQueryString
*
* @param string $location
* 「url-path」「現在のURLからのパス」「URL」のいずれか。「../」の解釈は行なわない。
* @param array $arrQueryString
* URL に付加する searchpart
* @param bool $inheritQueryString
* 現在のリクエストの searchpart を継承するか
* @param bool|null $useSsl
* true:HTTPSを強制, false:HTTPを強制, null:継承
* @return void
* @static
*
*/
public function sendRedirect($location, $arrQueryString = array(), $inheritQueryString = false, $useSsl = null)
{
// ローカルフックポイント処理
$objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg);
if (is_object($objPlugin)) {
$arrBacktrace = debug_backtrace();
if (is_object($arrBacktrace[0]['object'])) {
$pattern = '/^[a-zA-Z0-9_]+$/';
if (isset($_REQUEST['mode']) && preg_match($pattern, $_REQUEST['mode'])) {
$mode = $_REQUEST['mode'];
}
$parent_class_name = get_parent_class($arrBacktrace[0]['object']);
$class_name = get_class($arrBacktrace[0]['object']);
}
$objPlugin->doAction($parent_class_name . '_action_' . $mode, array($arrBacktrace[0]['object']));
if ($class_name != $parent_class_name) {
$objPlugin->doAction($class_name . '_action_' . $mode, array($this));
}
}
// url-path → URL 変換
if ($location[0] === '/') {
$netUrl = new Net_URL($location);
$url = $netUrl->getUrl();
} elseif (strpos($location, HTTPS_URL) === 0 || strpos($location, HTTP_URL) === 0) {
$url = $location;
} else {
$netUrl = new Net_URL(HTTP_URL);
$netUrl->path = dirname($_SERVER['SCRIPT_NAME']) . '/' . $location;
$url = $netUrl->getUrl();
}
if (!is_bool($useSsl)) {
$useSsl = SC_Utils_Ex::sfIsHTTPS();
}
if ($useSsl) {
$url = str_replace(HTTP_URL, HTTPS_URL, $url);
} else {
$url = str_replace(HTTPS_URL, HTTP_URL, $url);
}
// アプリケーション外へのリダイレクトは扱わない
if (!SC_Utils_Ex::isAppInnerUrl($url)) {
trigger_error('URL IS APP NOT INNER URL', E_USER_ERROR);
}
$netUrl = new Net_URL($url);
if ($inheritQueryString && !empty($_SERVER['QUERY_STRING'])) {
$arrQueryStringBackup = $netUrl->querystring;
// XXX メソッド名は add で始まるが、実際には置換を行う
$netUrl->addRawQueryString($_SERVER['QUERY_STRING']);
$netUrl->querystring = array_merge($netUrl->querystring, $arrQueryStringBackup);
}
$netUrl->querystring = array_merge($netUrl->querystring, $arrQueryString);
$session = SC_SessionFactory_Ex::getInstance();
if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE || $session->useCookie() == false) {
$netUrl->addQueryString(session_name(), session_id());
}
if (GC_Utils_Ex::isAdminFunction()) {
// 管理画面またはmode指定時は付与
$netUrl->addQueryString(TRANSACTION_ID_NAME, SC_Helper_Session_Ex::getToken());
}
$url = $netUrl->getURL();
header("Location: {$url}");
exit;
}
示例8: doCheckBuyAndDownloadOk
function doCheckBuyAndDownloadOk($config, $re_download = false)
{
$objCustomer = new SC_Customer_Ex();
$objQuery = SC_Query_Ex::getSingletonInstance();
if (empty($_REQUEST["product_ktc_vid"])) {
SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);
}
$vid = $_REQUEST["product_ktc_vid"];
$curl = $this->curl_init(KISEKAE_TOUCH_API02);
$post = $this->getPost($config, array("contentid" => $this->arrProduct["product_code_min"], "vid" => $vid));
$this->getDs($post, $config);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
GC_Utils_Ex::gfPrintLog(print_r($post, TRUE), DEBUG_LOG_REALFILE);
$result = curl_exec($curl);
$status = SC_XML::xpath($result, "//status/@value");
switch ($status) {
default:
SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);
break;
case "000":
case "010":
break;
}
if ($status == "000") {
// FIXME 課金処理
// API03
$curl = $this->curl_init(KISEKAE_TOUCH_API03);
if ($objCustomer->getValue("buy_to_nopoint") == "1") {
$price = $this->arrProduct["price02_min"];
$settlementtype = "998";
$redownloaddate = date("Ymd");
} elseif ($re_download) {
$price = 0;
$settlementtype = "900";
$redownloaddate = date("Ymd");
} else {
$price = $this->arrProduct["price02_min"];
$settlementtype = "001";
$redownloaddate = date("Ymd", strtotime($this->downloadable_days2));
}
$contentid = $this->arrProduct["product_code_min"];
$post = compact("contentid", "price", "redownloaddate", "vid", "settlementtype");
$post = $this->getPost($config, $post);
$this->getDs($post, $config);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
GC_Utils_Ex::gfPrintLog(print_r($post, TRUE), DEBUG_LOG_REALFILE);
$result = curl_exec($curl);
$authentication_id = SC_XML::xpath($result, "//authentication/@id");
$objFormParam = new SC_FormParam();
$this->setOrderParam($objFormParam, $vid, $authentication_id);
$objFormParam->convParam();
$message = '';
$arrValBef = array();
$objPurchase = new SC_Helper_Purchase_Ex();
$objPurchase->saveShippingTemp(array());
$order_id = $this->doRegister("", $objPurchase, $objFormParam, $message, $arrValBef);
$customer_id = $objCustomer->getValue("customer_id");
$this->addPointHistory($order_id, $customer_id, $objFormParam, $objQuery);
} else {
$authentication_id = SC_XML::xpath($result, "//authentication/@id");
}
$netUrl = new Net_URL(KISEKAE_TOUCH_CST02);
$netUrl->addQueryString("aid", $authentication_id);
$netUrl->addQueryString("cpid", $post["cpid"]);
$netUrl->addQueryString("siteid", $post["siteid"]);
$netUrl->addQueryString("contentid", $post["contentid"]);
$netUrl->addQueryString("ts", $post["ts"]);
$post2 = $netUrl->querystring;
$this->getDs($post2, $config);
$netUrl->addRawQueryString(http_build_query($post2));
header("Location: " . $netUrl->getURL());
}