• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Net_UserAgent_Mobile类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: _is_keitai

	/**
	 * Browser detection
	 */
	private function _is_keitai()
	{
        $agent = Net_UserAgent_Mobile::singleton(); 
        switch( true )
        {
          case ($agent->isDoCoMo()):   // DoCoMoかどうか
            return true;
            if( $agent->isFOMA() )
              return true;
            break;
          case ($agent->isVodafone()): // softbankかどうか
            return true;
            if( $agent->isType3GC() )
              return true;
            break;
          case ($agent->isEZweb()):    // ezwebかどうか
            return true;
            if( $agent->isWIN() )
              return true;
            break;
          default:
            return false;
            break;
        }
	}
开发者ID:rindou240,项目名称:Ushahidi_Web,代码行数:28,代码来源:keitai.php


示例2: from_tumblr

function from_tumblr()
{
    global $sessionkey;
    $db = get_db_connectiuon();
    list($sessionkey, $cookies, $u) = get_login_cookie($db);
    $page = getPage();
    $agent = Net_UserAgent_Mobile::singleton();
    // paging a page
    if ($agent->isDoCoMo()) {
        $page = ceil($page / 2);
    }
    //$postid = getPostId();
    $url = 'http://www.tumblr.com/dashboard/';
    if ($page > 1) {
        $url .= $page;
    }
    if ($postid > 1) {
        $url .= "/{$postid}";
    }
    #print "<!--$url-->";
    $retry = 2;
    while ($retry--) {
        $req =& new HTTP_Request($url);
        $req->setMethod(HTTP_REQUEST_METHOD_GET);
        foreach ($cookies as $v) {
            $req->addCookie($v['name'], $v['value']);
        }
        if (PEAR::isError($req->sendRequest())) {
            $err = 1;
        }
        $code = $req->getResponseCode();
        if ($code == 302) {
            $err = true;
            if ($u['email']) {
                list($err, $cookies) = update_cookie_info($u['email'], $u['password'], true, $u['hash']);
            }
            if ($err) {
                $retry = 0;
                break;
            }
        } else {
            if ($code == 200) {
                return $req->getResponseBody();
            } else {
                print '<html><body><pre>x_x';
                print " {$code} ";
                print '</body></html>';
                exit;
            }
        }
    }
    if ($retry == 0) {
        header('Location: /login');
    } else {
        print '<html><body><pre>x_x';
        print '</body></html>';
    }
    exit;
}
开发者ID:ku,项目名称:reblog.ido.nu,代码行数:59,代码来源:dashboard.php


示例3: __construct

 function __construct($content)
 {
     $html = $this->wash($content);
     $dom = new DOMDocument();
     $dom->loadXML($html);
     $this->dom = $dom;
     $this->agent = Net_UserAgent_Mobile::singleton();
 }
开发者ID:ku,项目名称:reblog.ido.nu,代码行数:8,代码来源:Dashboard_Class.php


示例4: __construct

 protected function __construct()
 {
     require_once 'Net/UserAgent/Mobile.php';
     self::$mobile = Net_UserAgent_Mobile::factory();
     if (self::$mobile instanceof Net_UserAgent_Mobile_Error) {
         self::$mobile = new Net_UserAgent_Mobile_NonMobile('');
     }
 }
开发者ID:Kazuhiro-Murota,项目名称:OpenPNE3,代码行数:8,代码来源:opMobileUserAgent.class.php


示例5: smarty_function_emoji

/**
 * Copyright (C) 2012 Vizualizer All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * @author    Naohisa Minagawa <[email protected]>
 * @copyright Copyright (c) 2010, Vizualizer
 * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
 * @since PHP 5.3
 * @version   1.0.0
 */
function smarty_function_emoji($params, $smarty, $template)
{
    // codeパラメータは必須です。
    if (empty($params['code'])) {
        trigger_error("emoji: missing code parameter", E_USER_WARNING);
        return;
    }
    // パラメータを変数にコピー
    $code = $params['code'];
    if (preg_match("/[0-9]{1,3}/", $code) && is_numeric($code) && 0 < $code && $code < 253) {
        // 変換表を配列に格納
        $emoji_array = array();
        $emoji_array[] = "";
        $contents = @file(dirname(__FILE__) . "/emojix.csv");
        foreach ($contents as $line) {
            $line = rtrim($line);
            $emoji_array[] = explode(",", $line);
        }
        if (Net_UserAgent_Mobile::isMobile()) {
            // モバイルユーザーエージェントのインスタンスを取得
            $agent = Net_UserAgent_Mobile::singleton();
            if ($agent->isDoCoMo()) {
                // DoCoMo
                echo mb_convert_encoding($emoji_array[$code][1], "UTF-8", "SJIS");
            } elseif ($agent->isEZweb()) {
                // au
                if (preg_match("/[^0-9]/", $emoji_array[$code][2])) {
                    echo $emoji_array[$code][2];
                } else {
                    echo "<img localsrc=\"" . $emoji_array[$code][2] . "\" />";
                }
            } elseif ($agent->isSoftbank()) {
                if ($agent->isType3GC()) {
                    // Softbank-UTF8
                    $e = new Emoji();
                    if (preg_match("/^[A-Z]{1}?/", $emoji_array[$code][3])) {
                        echo "\$" . $emoji_array[$code][3] . "";
                    } else {
                        echo $emoji_array[$code][3];
                    }
                } else {
                    // Softbank-SJIS
                    if (preg_match("/^[A-Z]{1}?/", $emoji_array[$code][3])) {
                        echo "\$" . mb_convert_encoding($emoji_array[$code][3], "SJIS", "UTF-8") . "";
                    } else {
                        echo mb_convert_encoding($emoji_array[$code][3], "SJIS", "UTF-8");
                    }
                }
            }
        } else {
            echo "<img src=\"/emoji_images/" . $emoji_array[$code][0] . ".gif\" width=\"12\" height=\"12\" border=\"0\" alt=\"\" />";
        }
    } else {
        // 絵文字のコードが規定値以外
        return "[Error!]\n";
    }
}
开发者ID:naonaox1126,项目名称:vizualizer,代码行数:78,代码来源:function.emoji.php


示例6: detect

 /**
  * detect
  *
  * @param  Symfony\Component\HttpFoundation\Request $request
  *
  * @return string  The type name of the user agent (ex. 'docomo')
  */
 public function detect(Request $request)
 {
     $ua = parent::detect($request);
     if (!$ua) {
         $mobile = \Net_UserAgent_Mobile::factory($request->server->get('HTTP_USER_AGENT'));
         $ua = strtolower($mobile->getCarrierlongName());
     }
     return $ua;
 }
开发者ID:hidenorigoto,项目名称:Dua,代码行数:16,代码来源:NetUserAgentMobileAdapter.php


示例7: execute

 public function execute($filterChain)
 {
     $response = $this->getContext()->getResponse();
     if ($this->isFirstCall()) {
         $agent = Net_UserAgent_Mobile::singleton();
         $this->getContext()->getRequest()->setAttribute("userAgent", $agent);
         $this->getContext()->getResponse()->setSlot("carrier_css", $agent);
     }
     $filterChain->execute();
 }
开发者ID:pontuyo,项目名称:takutomo-mixi-appli,代码行数:10,代码来源:mobileCheckFilter.class.php


示例8: __construct

 protected function __construct()
 {
     require_once 'Net/UserAgent/Mobile.php';
     require_once 'Net/UserAgent/Mobile/NonMobile.php';
     // ignore `Non-static method Net_UserAgent_Mobile::factory()' error
     $oldErrorLevel = error_reporting(error_reporting() & ~E_STRICT);
     self::$mobile = Net_UserAgent_Mobile::factory();
     error_reporting($oldErrorLevel);
     if (self::$mobile instanceof Net_UserAgent_Mobile_Error) {
         self::$mobile = new Net_UserAgent_Mobile_NonMobile('');
     }
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:12,代码来源:opMobileUserAgent.class.php


示例9: initialize

 public function initialize($context, $parameters = null)
 {
     parent::initialize($context, $parameters);
     // UserAgent取得
     $agent = new Net_UserAgent_Mobile();
     //$agent = $this->getContext()->getRequest()->getAttribute('userAgent');
     if ($agent->isDoCoMo()) {
         ini_set("session.use_trans_sid", 1);
         ini_set("session.use_cookies", 0);
     } else {
         if ($agent->isSoftBank()) {
             ini_set("session.use_trans_sid", 0);
             ini_set("session.use_cookies", 1);
         } else {
             if ($agent->isEZweb()) {
                 ini_set("session.use_trans_sid", 0);
                 ini_set("session.use_cookies", 1);
             }
         }
     }
 }
开发者ID:pontuyo,项目名称:takutomo-mixi-appli,代码行数:21,代码来源:mobileSessionStorage.class.php


示例10: after

function after($output)
{
    require_once 'Net/UserAgent/Mobile.php';
    if (Net_UserAgent_Mobile::factory()->isDoCoMo()) {
        $output = after_render_docomo($output);
    } elseif (Net_UserAgent_Mobile::factory()->isSoftBank()) {
        $output = after_render_softbank($output);
    } elseif (Net_UserAgent_Mobile::factory()->isEZweb()) {
        $output = after_render_au($output);
    } else {
        $output = after_render_pc($output);
    }
    return $output;
}
开发者ID:sanemat,项目名称:ktsukishima,代码行数:14,代码来源:index.php


示例11: __construct

 public function __construct()
 {
     $uri = Mage::app()->getRequest();
     if (preg_match("/extensions_(custom|local)/i", $uri->getRequestUri())) {
         $this->_isAdmin = true;
     }
     if (!$this->_isAdmin) {
         $error = error_reporting(E_ALL);
         $include_path = get_include_path();
         set_include_path($include_path . PS . BP . DS . 'lib/PEAR');
         require_once 'Net/UserAgent/Mobile.php';
         $this->_agent = Net_UserAgent_Mobile::singleton();
     }
 }
开发者ID:vuhung,项目名称:Magento-Rack-Ketai,代码行数:14,代码来源:Agent.php


示例12: factory

 /**
  * ファクトリー
  *
  * @return Net_UserAgent_Mobile
  */
 public function factory()
 {
     $userAgent = $this->_config['user_agent'];
     $netUserAgentMobile = Net_UserAgent_Mobile::factory($userAgent);
     if (PEAR::isError($netUserAgentMobile)) {
         switch (true) {
             case strstr($userAgent, 'DoCoMo'):
                 $botAgent = BEAR_Agent::BOT_DOCOMO;
                 break;
             case strstr($userAgent, 'KDDI-'):
                 $botAgent = BEAR_Agent::BOT_AU;
                 break;
             case preg_match('/(SoftBank|Vodafone|J-PHONE|MOT-)/', $userAgent):
                 $botAgent = BEAR_Agent::BOT_SOFTBANK;
                 break;
             default:
                 $botAgent = '';
         }
         $netUserAgentMobile = Net_UserAgent_Mobile::factory($botAgent);
     }
     return $netUserAgentMobile;
 }
开发者ID:ryo88c,项目名称:BEAR.Saturday,代码行数:27,代码来源:Mobile.php


示例13: getInstance

 /**
  * パラメーター管理で設定したセッション維持設定に従って適切なオブジェクトを返す.
  *
  * @return SC_SessionFactory
  */
 function getInstance()
 {
     $type = defined('SESSION_KEEP_METHOD') ? SESSION_KEEP_METHOD : '';
     switch ($type) {
         // セッションの維持にリクエストパラメーターを使用する
         case 'useRequest':
             $session = new SC_SessionFactory_UseRequest();
             SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE ? $session->setState('mobile') : $session->setState('pc');
             break;
             // クッキーを使用する
         // クッキーを使用する
         case 'useCookie':
             // モバイルの場合はSC_SessionFactory_UseRequestを使用する
             if (Net_UserAgent_Mobile::isMobile() === true) {
                 $session = new SC_SessionFactory_UseRequest();
                 $session->setState('mobile');
                 break;
             }
         default:
             $session = new SC_SessionFactory_UseCookie();
             break;
     }
     return $session;
 }
开发者ID:nanasess,项目名称:ec-azure,代码行数:29,代码来源:SC_SessionFactory.php


示例14: isMobile

 /**
  * Checks whether or not the user agent is mobile by a given user agent string.
  *
  * @param string $userAgent
  * @return boolean
  * @since Method available since Release 0.31.0
  */
 function isMobile($userAgent = null)
 {
     if (Net_UserAgent_Mobile::isDoCoMo($userAgent)) {
         return true;
     } elseif (Net_UserAgent_Mobile::isEZweb($userAgent)) {
         return true;
     } elseif (Net_UserAgent_Mobile::isSoftBank($userAgent)) {
         return true;
     } elseif (Net_UserAgent_Mobile::isWillcom($userAgent)) {
         return true;
     }
     return false;
 }
开发者ID:casan,项目名称:eccube-2_13,代码行数:20,代码来源:Mobile.php


示例15: ic2_display

function ic2_display($path, $params)
{
    global $_conf, $ini, $thumb, $dpr, $redirect, $id, $uri, $file, $thumbnailer;
    if (P2_OS_WINDOWS) {
        $path = str_replace('\\', '/', $path);
    }
    if (strncmp($path, '/', 1) == 0) {
        $s = empty($_SERVER['HTTPS']) ? '' : 's';
        $to = 'http' . $s . '://' . $_SERVER['HTTP_HOST'] . $path;
    } else {
        $dir = dirname(P2Util::getMyUrl());
        if (strncasecmp($path, './', 2) == 0) {
            $to = $dir . substr($path, 1);
        } elseif (strncasecmp($path, '../', 3) == 0) {
            $to = dirname($dir) . substr($path, 2);
        } else {
            $to = $dir . '/' . $path;
        }
    }
    $name = basename($path);
    $ext = strrchr($name, '.');
    switch ($redirect) {
        case 1:
            header("Location: {$to}");
            exit;
        case 2:
            switch ($ext) {
                case '.jpg':
                    header("Content-Type: image/jpeg; name=\"{$name}\"");
                    break;
                case '.png':
                    header("Content-Type: image/png; name=\"{$name}\"");
                    break;
                case '.gif':
                    header("Content-Type: image/gif; name=\"{$name}\"");
                    break;
                default:
                    if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false) {
                        header("Content-Type: application/octetstream; name=\"{$name}\"");
                    } else {
                        header("Content-Type: application/octet-stream; name=\"{$name}\"");
                    }
            }
            header("Content-Disposition: inline; filename=\"{$name}\"");
            header('Content-Length: ' . filesize($path));
            readfile($path);
            exit;
        default:
            if (!class_exists('HTML_Template_Flexy', false)) {
                require 'HTML/Template/Flexy.php';
            }
            if (!class_exists('HTML_QuickForm', false)) {
                require 'HTML/QuickForm.php';
            }
            if (!class_exists('HTML_QuickForm_Renderer_ObjectFlexy', false)) {
                require 'HTML/QuickForm/Renderer/ObjectFlexy.php';
            }
            if (isset($uri)) {
                $img_o = 'uri';
                $img_p = $uri;
            } elseif (isset($id)) {
                $img_o = 'id';
                $img_p = $id;
            } else {
                $img_o = 'file';
                $img_p = $file;
            }
            $img_q = $img_o . '=' . rawurlencode($img_p);
            // QuickFormの初期化
            $_size = explode('x', $thumbnailer->calc($params['width'], $params['height']));
            $_constants = array('o' => sprintf('原寸 (%dx%d)', $params['width'], $params['height']), 's' => '作成', 't' => $thumb, 'd' => $dpr, 'u' => $img_p, 'v' => $img_o, 'x' => $_size[0], 'y' => $_size[1]);
            $_defaults = array('q' => $ini["Thumb{$thumb}"]['quality'], 'r' => '0');
            $mobile = Net_UserAgent_Mobile::singleton();
            $qa = 'size=3 maxlength=3';
            if ($mobile->isDoCoMo()) {
                $qa .= ' istyle=4';
            } elseif ($mobile->isEZweb()) {
                $qa .= ' format=*N';
            } elseif ($mobile->isSoftBank()) {
                $qa .= ' mode=numeric';
            }
            $_presets = array('' => 'サイズ・品質');
            foreach ($ini['Dynamic']['presets'] as $_preset_name => $_preset_params) {
                $_presets[$_preset_name] = $_preset_name;
            }
            $qf = new HTML_QuickForm('imgmaker', 'get', 'ic2_mkthumb.php');
            $qf->setConstants($_constants);
            $qf->setDefaults($_defaults);
            $qf->addElement('hidden', 't');
            $qf->addElement('hidden', 'u');
            $qf->addElement('hidden', 'v');
            $qf->addElement('text', 'x', '高さ', $qa);
            $qf->addElement('text', 'y', '横幅', $qa);
            $qf->addElement('text', 'q', '品質', $qa);
            $qf->addElement('select', 'p', 'プリセット', $_presets);
            $qf->addElement('select', 'r', '回転', array('0' => 'なし', '90' => '右に90°', '270' => '左に90°', '180' => '180°'));
            $qf->addElement('checkbox', 'w', 'トリム');
            $qf->addElement('checkbox', 'z', 'DL');
            $qf->addElement('submit', 's');
            $qf->addElement('submit', 'o');
//.........这里部分代码省略.........
开发者ID:nyarla,项目名称:fluxflex-rep2ex,代码行数:101,代码来源:ic2.php


示例16: sfSendOrderMail

 function sfSendOrderMail($order_id, $template_id, $subject = "", $header = "", $footer = "", $send = true)
 {
     $arrTplVar = new stdClass();
     $arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
     $arrTplVar->arrInfo = $arrInfo;
     $objQuery = new SC_Query_Ex();
     if ($subject == "" && $header == "" && $footer == "") {
         // メールテンプレート情報の取得
         $where = "template_id = ?";
         $arrRet = $objQuery->select("subject, header, footer", "dtb_mailtemplate", $where, array($template_id));
         $arrTplVar->tpl_header = $arrRet[0]['header'];
         $arrTplVar->tpl_footer = $arrRet[0]['footer'];
         $tmp_subject = $arrRet[0]['subject'];
     } else {
         $arrTplVar->tpl_header = $header;
         $arrTplVar->tpl_footer = $footer;
         $tmp_subject = $subject;
     }
     // 受注情報の取得
     $where = "order_id = ?";
     $arrRet = $objQuery->select("*", "dtb_order", $where, array($order_id));
     $arrOrder = $arrRet[0];
     $objQuery->setOrder('order_detail_id');
     $arrTplVar->arrOrderDetail = $objQuery->select("*", "dtb_order_detail", $where, array($order_id));
     $objProduct = new SC_Product_Ex();
     $objQuery->setOrder('shipping_id');
     $arrRet = $objQuery->select("*", "dtb_shipping", "order_id = ?", array($order_id));
     foreach (array_keys($arrRet) as $key) {
         $objQuery->setOrder('shipping_id');
         $arrItems = $objQuery->select("*", "dtb_shipment_item", "order_id = ? AND shipping_id = ?", array($order_id, $arrRet[$key]['shipping_id']));
         foreach ($arrItems as $itemKey => $arrDetail) {
             foreach ($arrDetail as $detailKey => $detailVal) {
                 $arrRet[$key]['shipment_item'][$arrDetail['product_class_id']][$detailKey] = $detailVal;
             }
             $arrRet[$key]['shipment_item'][$arrDetail['product_class_id']]['productsClass'] =& $objProduct->getDetailAndProductsClass($arrDetail['product_class_id']);
         }
     }
     $arrTplVar->arrShipping = $arrRet;
     $arrTplVar->Message_tmp = $arrOrder['message'];
     // 会員情報の取得
     $customer_id = $arrOrder['customer_id'];
     $objQuery->setOrder('customer_id');
     $arrRet = $objQuery->select('point', "dtb_customer", "customer_id = ?", array($customer_id));
     $arrCustomer = isset($arrRet[0]) ? $arrRet[0] : "";
     $arrTplVar->arrCustomer = $arrCustomer;
     $arrTplVar->arrOrder = $arrOrder;
     //その他決済情報
     if ($arrOrder['memo02'] != "") {
         $arrOther = unserialize($arrOrder['memo02']);
         foreach ($arrOther as $other_key => $other_val) {
             if (SC_Utils_Ex::sfTrim($other_val['value']) == "") {
                 $arrOther[$other_key]['value'] = "";
             }
         }
         $arrTplVar->arrOther = $arrOther;
     }
     // 都道府県変換
     $arrTplVar->arrPref = $this->arrPref;
     $objCustomer = new SC_Customer_Ex();
     $arrTplVar->tpl_user_point = $objCustomer->getValue('point');
     if (Net_UserAgent_Mobile::isMobile() === true) {
         $objMailView = new SC_MobileView_Ex();
     } else {
         $objMailView = new SC_SiteView_Ex();
     }
     // メール本文の取得
     $objMailView->assignobj($arrTplVar);
     $body = $objMailView->fetch($this->arrMAILTPLPATH[$template_id]);
     // メール送信処理
     $objSendMail = new SC_SendMail_Ex();
     $bcc = $arrInfo['email01'];
     $from = $arrInfo['email03'];
     $error = $arrInfo['email04'];
     $tosubject = $this->sfMakeSubject($tmp_subject, $objMailView);
     $objSendMail->setItem('', $tosubject, $body, $from, $arrInfo['shop_name'], $from, $error, $error, $bcc);
     $objSendMail->setTo($arrOrder["order_email"], $arrOrder["order_name01"] . " " . $arrOrder["order_name02"] . " 様");
     // 送信フラグ:trueの場合は、送信する。
     if ($send) {
         if ($objSendMail->sendMail()) {
             $this->sfSaveMailHistory($order_id, $template_id, $tosubject, $body);
         }
     }
     return $objSendMail;
 }
开发者ID:nanasess,项目名称:ec-azure,代码行数:84,代码来源:SC_Helper_Mail.php


示例17: p2die

        // ファイルがなければ生成
        $fp = @fopen($_conf['auth_user_file'], 'wb');
        if (!$fp) {
            p2die("{$_conf['auth_user_file']} を保存できませんでした。認証ユーザ登録失敗。");
        }
        flock($fp, LOCK_EX);
        fputs($fp, $auth_user_cont);
        flock($fp, LOCK_UN);
        fclose($fp);
        P2Util::pushInfoHtml('<p>○認証パスワードを変更登録しました</p>');
    }
}
//====================================================
// 補助認証
//====================================================
$mobile = Net_UserAgent_Mobile::singleton();
$p_htm['auth_ctl'] = '';
// docomo認証
if ($mobile->isDoCoMo()) {
    if (file_exists($_conf['auth_imodeid_file'])) {
        $p_htm['auth_ctl'] .= <<<EOP
iモードID認証登録済[<a href="{$_SERVER['SCRIPT_NAME']}?ctl_regist_imodeid=1{$_conf['k_at_a']}">解除</a>]<br>
EOP;
    }
    if (file_exists($_conf['auth_docomo_file'])) {
        $p_htm['auth_ctl'] .= <<<EOP
端末ID認証登録済[<a href="{$_SERVER['SCRIPT_NAME']}?ctl_regist_docomo=1{$_conf['k_at_a']}">解除</a>]<br>
EOP;
    }
    if ($p_htm['auth_ctl'] == '' && $_login->pass_x) {
        if (empty($_SERVER['HTTPS'])) {
开发者ID:unpush,项目名称:p2-php,代码行数:31,代码来源:login.php


示例18: parse

 /**
  * Parses HTTP_USER_AGENT string.
  *
  * @param string $userAgent User-Agent string
  * @throws Net_UserAgent_Mobile_Error
  */
 function parse($userAgent)
 {
     $agent = explode(' ', $userAgent);
     preg_match('!^(?:(SoftBank|Semulator|Vodafone|Vemulator|J-PHONE|J-EMULATOR)/\\d\\.\\d|MOT-|MOTEMULATOR)!', $agent[0], $matches);
     if (count($matches) > 1) {
         $carrier = $matches[1];
     } else {
         $carrier = 'Motorola';
     }
     switch ($carrier) {
         case 'SoftBank':
         case 'Semulator':
         case 'Vodafone':
         case 'Vemulator':
             $result = $this->_parseVodafone($agent);
             break;
         case 'J-PHONE':
         case 'J-EMULATOR':
             $result = $this->_parseJphone($agent);
             break;
         case 'Motorola':
         case 'MOTEMULATOR':
             $result = $this->_parseMotorola($agent);
             break;
     }
     if (Net_UserAgent_Mobile::isError($result)) {
         return $result;
     }
     $this->_msname = $this->getHeader('X-JPHONE-MSNAME');
 }
开发者ID:rateon,项目名称:twhk-ec,代码行数:36,代码来源:SoftBank.php


示例19: register

 /**
  * Registers services on the given app.
  *
  * This method should only be used to configure services and parameters.
  * It should not get services.
  *
  * @param BaseApplication $app An Application instance
  */
 public function register(BaseApplication $app)
 {
     // PEAR
     $app['smarty'] = function () {
         return new \Smarty();
     };
     $app['mobile.detect'] = function () {
         return new \Mobile_Detect();
     };
     $app['pear.archive.tar'] = $app->protect(function ($p_tarname, $p_compress = null) {
         return new \Archive_Tar($p_tarname, $p_compress);
     });
     $app['pear.cache.lite'] = $app->protect(function ($options = array()) {
         return new \Cache_Lite($options);
     });
     $app['pear.calendar.month.weekdays'] = $app->protect(function ($y, $m, $firstDay = null) {
         return new \Calendar_Month_Weekdays($y, $m, $firstDay);
     });
     $app['pear.http.request'] = $app->protect(function ($url = '', $params = array()) {
         return new \HTTP_Request($url, $params);
     });
     $app['pear.mail'] = $app->protect(function ($driver, $params = array()) {
         return \Mail::factory($driver, $params);
     });
     $app['pear.net.user_agent.mobile'] = $app->protect(function ($userAgent = null) {
         return \Net_UserAgent_Mobile::singleton($userAgent);
     });
     $app['pear.net.url'] = $app->protect(function ($url = null, $useBrackets = true) {
         return new \Net_URL($url, $useBrackets);
     });
     $app['pear.services.json'] = $app->protect(function ($use = 0) {
         return new \Services_JSON($use);
     });
     $app['pear.text.password'] = $app->protect(function ($length = 10, $type = 'pronounceable', $chars = '') {
         return \Text_Password::create($length, $type, $chars);
     });
     $app['pear.xml.serializer'] = $app->protect(function ($options = null) {
         return new \XML_Serializer($options);
     });
     // framework
     $app['eccube.cart_session'] = $app->protect(function ($cartKey = 'cart') {
         return new \Eccube\Framework\CartSession($cartKey);
     });
     $app['eccube.customer'] = function () {
         return new \Eccube\Framework\Customer();
     };
     $app['eccube.customer_list'] = $app->protect(function ($array, $mode = '') {
         return new \Eccube\Framework\CustomerList($array, $mode);
     });
     $app['eccube.cookie'] = $app->protect(function ($day = COOKIE_EXPIRE) {
         return new \Eccube\Framework\Cookie($day);
     });
     $app['eccube.check_error'] = $app->protect(function ($array = '') {
         return new \Eccube\Framework\CheckError($array);
     });
     $app['eccube.date'] = $app->protect(function ($start_year = '', $end_year = '') {
         return new \Eccube\Framework\Date($start_year, $end_year);
     });
     $app['eccube.display'] = $app->protect(function ($hasPrevURL = true) {
         return new \Eccube\Framework\Display($hasPrevURL);
     });
     $app['eccube.form_param'] = function () {
         return new \Eccube\Framework\FormParam();
     };
     $app['eccube.page_navi'] = $app->protect(function ($now_page, $all_row, $page_row, $func_name, $navi_max = NAVI_PMAX, $urlParam = '', $display_number = true) {
         return new \Eccube\Framework\PageNavi($now_page, $all_row, $page_row, $func_name, $navi_max, $urlParam, $display_number);
     });
     $app['eccube.product'] = $app->protect(function () {
         return new \Eccube\Framework\Product();
     });
     $app['eccube.response'] = $app->protect(function () {
         return new \Eccube\Framework\Response();
     });
     $app['eccube.query'] = $app->protect(function ($dsn = '', $force_run = false, $new = false) {
         return \Eccube\Framework\Query::getSingletonInstance($dsn, $force_run, $new);
     });
     $app['eccube.site_session'] = $app->share(function () {
         return new \Eccube\Framework\SiteSession();
     });
     $app['eccube.sendmail'] = $app->protect(function () {
         return new \Eccube\Framework\Sendmail();
     });
     // db
     $app['eccube.db.factory'] = $app->protect(function ($db_type = DB_TYPE) {
         return \Eccube\Framework\DB\DBFactory::getInstance($db_type);
     });
     $app['eccube.db.master_data'] = $app->share(function () {
         return new \Eccube\Framework\DB\MasterData();
     });
     // graph
     $app['eccube.graph.bar'] = $app->protect(function ($bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = LINE_LEFT, $top = LINE_TOP, $area_width = LINE_AREA_WIDTH, $area_height = LINE_AREA_HEIGHT) {
         return new \Eccube\Framework\Graph\BarGraph($bgw, $bgh, $left, $top, $area_width, $area_height);
//.........这里部分代码省略.........
开发者ID:ChigusaYasoda,项目名称:ec-cube,代码行数:101,代码来源:EccubeServiceProvider.php


示例20: isMobile

 /**
  * EC-CUBE がサポートする携帯キャリアかどうかを判別する。 
  * 
  * ※一部モジュールで使用。ただし、本メソッドは将来的に削除しますので新規ご利用は控えてください。
  * 
  * @return boolean サポートしている場合は true、それ以外の場合は false を返す。 
  */
 function isMobile()
 {
     $objAgent =& Net_UserAgent_Mobile::singleton();
     if (Net_UserAgent_Mobile::isError($objAgent)) {
         return false;
     } else {
         return $objAgent->isDoCoMo() || $objAgent->isEZweb() || $objAgent->isVodafone();
     }
 }
开发者ID:Rise-Up-Cambodia,项目名称:Rise-Up,代码行数:16,代码来源:SC_MobileUserAgent.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Network类代码示例发布时间:2022-05-23
下一篇:
PHP Net_URL2类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap