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


PHP Token::hasValue方法代码示例

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


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

示例1: isSameAs

 /**
  * @param Token $token
  *
  * @return bool
  */
 public function isSameAs(Token $token)
 {
     $hasNumberWildcard = $this->hasNumber() && $token->hasNumber();
     if ($hasNumberWildcard && $this->number !== $token->number) {
         return false;
     }
     $hasValueWildcard = $this->hasValue() && $token->hasValue();
     if ($hasValueWildcard && $this->value !== $token->value) {
         return false;
     }
     $hasLineNumberWildcard = $this->hasLineNumber() && $token->hasLineNumber();
     if ($hasLineNumberWildcard && $this->lineNumber !== $token->lineNumber) {
         return false;
     }
     return true;
 }
开发者ID:lead-worker,项目名称:redaktilo,代码行数:21,代码来源:Token.php

示例2: setToken

 /**
  * Initialise class from a token
  * @access public
  */
 function setToken($tokenstr)
 {
     $ok = false;
     $token = new Token();
     if ($token->parse($tokenstr)) {
         $ok = $token->hasValue("x") && $token->hasValue("y") && $token->hasValue("w") && $token->hasValue("h") && $token->hasValue("s");
         if ($ok) {
             $this->setOrigin($token->getValue("x"), $token->getValue("y"));
             $this->setImageSize($token->getValue("w"), $token->getValue("h"));
             $this->setScale($token->getValue("s"));
             $this->type_or_user = $token->hasValue("t") ? $token->getValue("t") : 0;
             if ($token->hasValue("r")) {
                 $this->reference_index = $token->getValue("r");
             }
             if ($token->hasValue("p")) {
                 $this->setPalette($token->getValue("p"));
             }
         }
     }
     return $ok;
 }
开发者ID:s-a-r-id,项目名称:geograph-project,代码行数:25,代码来源:map.class.php

示例3: setToken

 /**
  * Initialise class from a token
  * @access public
  */
 function setToken($tokenstr, $allowWithoutMosaic = false)
 {
     $ok = false;
     $token = new Token();
     if ($token->parse($tokenstr)) {
         $ok = $token->hasValue("x") && $token->hasValue("y") && $token->hasValue("w") && $token->hasValue("h") && $token->hasValue("s") && ($allowWithoutMosaic || $token->hasValue("f"));
         if ($ok) {
             $this->setOrigin($token->getValue("x"), $token->getValue("y"));
             $this->setMosaicSize($token->getValue("w"), $token->getValue("h"));
             $this->setScale($token->getValue("s"));
             $this->setMosaicFactor($token->hasValue("f") ? $token->getValue("f") : 2);
             $this->type_or_user = $token->hasValue("t") ? $token->getValue("t") : 0;
             $this->palette = $token->hasValue("p") ? $token->getValue("p") : 0;
         } else {
             $info = "";
             foreach ($token->data as $name => $value) {
                 $info .= "{$name}={$value} ";
             }
             $this->_err("setToken: missing elements ({$info})");
         }
     } else {
         $this->_err("setToken: parse failure");
     }
     return $ok;
 }
开发者ID:s-a-r-id,项目名称:geograph-project,代码行数:29,代码来源:mapmosaic.class.php

示例4: setToken

 /**
  * Initialise class from a token
  * @access public
  */
 function setToken($tokenstr)
 {
     $ok = false;
     $token = new Token();
     if ($token->parse($tokenstr)) {
         $ok = $token->hasValue("e") && $token->hasValue("n") && $token->hasValue("s");
         if ($ok) {
             $this->service = $token->getValue("s");
             $this->nateastings = $token->getValue("e") * $this->divisor[$this->service];
             $this->natnorthings = $token->getValue("n") * $this->divisor[$this->service];
             $this->width = $this->tilewidth[$this->service];
             if ($token->hasValue("r")) {
                 $this->epoch = $token->getValue("r");
             }
         }
     }
     return $ok;
 }
开发者ID:s-a-r-id,项目名称:geograph-project,代码行数:22,代码来源:rastermap.class.php

示例5: loadItems

 /**
  * load all change items
  * @access public
  */
 function loadItems()
 {
     $db =& $this->_getDB();
     if ($this->isValid()) {
         $this->changes = $db->GetAll("select * from gridimage_ticket_item where gridimage_ticket_id={$this->gridimage_ticket_id}");
         if (count($this->changes)) {
             $token = new Token();
             foreach ($this->changes as $i => $row) {
                 if (!empty($row['newvalue']) && $row['newvalue'] != -1) {
                     switch ($row['field']) {
                         case 'grid_reference':
                             $token->setValue("g", $row['newvalue']);
                             break;
                         case 'photographer_gridref':
                             $token->setValue("p", $row['newvalue']);
                             break;
                         case 'view_direction':
                             $token->setValue("v", $row['newvalue']);
                             break;
                     }
                 }
             }
             $count = count($token->data);
             if ($count > 0 && !($count == 1 && $token->hasValue('v'))) {
                 $this->reopenmaptoken = $token->getToken();
             }
         }
     }
 }
开发者ID:s-a-r-id,项目名称:geograph-project,代码行数:33,代码来源:gridimagetroubleticket.class.php

示例6: inEmptyRequestInt

 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
require_once 'geograph/global.inc.php';
require_once 'geograph/gridimage.class.php';
require_once 'geograph/gridsquare.class.php';
require_once 'geograph/searchcriteria.class.php';
init_session();
$rater = inEmptyRequestInt('rater', 0);
$i = inEmptyRequestInt('i', 0);
$l = inEmptyRequestInt('l', 0);
if (isset($_REQUEST['t'])) {
    $ok = false;
    $token = new Token();
    if ($token->parse($_REQUEST['t'])) {
        if ($token->hasValue("i")) {
            $i = $token->getValue("i");
        }
        if ($token->hasValue("p")) {
            $_GET['page'] = $token->getValue("p");
        }
    }
}
if (isset($_REQUEST['debug']) && $USER->hasPerm("admin")) {
    $token = new Token();
    $token->setValue("i", $i);
    if (!empty($_GET['page'])) {
        $token->setValue("p", $_GET['page']);
    }
    print $token->getToken();
}
开发者ID:s-a-r-id,项目名称:geograph-project,代码行数:31,代码来源:markit.php

示例7: GeographPage

require_once 'geograph/gridsquare.class.php';
require_once 'geograph/token.class.php';
require_once 'geograph/gazetteer.class.php';
init_session();
$smarty = new GeographPage();
$template = 'submit_popup.tpl';
$cacheid = '';
$square = new GridSquare();
if (!$USER->hasPerm("basic") || empty($_GET['t'])) {
    $smarty->assign('error', "unable to access page");
    $smarty->display($template, $cacheid);
    exit;
}
$token = new Token();
if ($token->parse($_GET['t'])) {
    if ($token->hasValue("g")) {
        $gridref = $token->getValue("g");
    }
    if ($token->hasValue("p")) {
        $photographer_gridref = $token->getValue("p");
    }
    if ($token->hasValue("v")) {
        $view_direction = $token->getValue("v");
    }
}
$grid_given = false;
$grid_ok = false;
$pgrid_given = false;
$pgrid_ok = false;
if (!empty($gridref)) {
    $grid_given = true;
开发者ID:s-a-r-id,项目名称:geograph-project,代码行数:31,代码来源:submit_popup.php

示例8: GeographPage

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
require_once 'geograph/global.inc.php';
require_once 'geograph/imagelist.class.php';
init_session();
$smarty = new GeographPage();
customGZipHandlerStart();
$USER->mustHavePerm("basic");
$template = 'submissions.tpl';
$max_gridimage_id = 0;
$count = 0;
if (!empty($_GET['next'])) {
    $token = new Token();
    if ($token->parse($_GET['next']) && $token->hasValue("id")) {
        $max_gridimage_id = intval($token->getValue("id"));
        $count = intval($token->getValue("c"));
    } else {
        die("invalid token");
    }
}
$ab = floor($USER->user_id / 10000);
$cacheid = "user{$ab}|{$USER->user_id}|{$max_gridimage_id}";
//what style should we use?
$style = $USER->getStyle();
if ($smarty->caching) {
    $smarty->caching = 2;
    // lifetime is per cache
    $smarty->cache_lifetime = 300;
    customExpiresHeader(300, false, true);
开发者ID:s-a-r-id,项目名称:geograph-project,代码行数:31,代码来源:submissions.php

示例9: Token

$token = new Token();
if (isset($_GET['a']) && $token->parse($_GET['a']) && $token->hasValue('i')) {
    $id = $token->getValue('i');
    $db = NewADOConnection($GLOBALS['DSN']);
    if (!$db) {
        die('Database connection failed');
    }
    if (!($apikey = $db->GetOne("select apikey from apikeys where enabled = 1 and id = " . $db->Quote($id)))) {
        die("invalid 'API Key', if you are not the developer you should contact them to correct this");
    }
} else {
    die("invalid 'Access Key', if you are not the developer you should contact them to correct this");
}
$token = new Token();
$token->magic = md5($CONF['token_secret'] . $apikey);
if (isset($_GET['t']) && $token->parse($_GET['t']) && $token->hasValue('callback')) {
    $callback = $token->getValue('callback');
    $action = $token->getValue('action');
    $smarty->assign('callback', $callback);
    $smarty->assign('action', $action);
    $token = new Token();
    $token->magic = md5($CONF['token_secret'] . $apikey);
    $token->setValue("k", $apikey);
    //just to prove to THEM we know who they are
    $token->setValue("user_id", $USER->user_id);
    $token->setValue("realname", $USER->realname);
    if (!empty($USER->nickname)) {
        $token->setValue("nickname", $USER->nickname);
    }
    $final_url = "{$callback}?t=" . $token->getToken();
    $smarty->assign('final_url', $final_url);
开发者ID:s-a-r-id,项目名称:geograph-project,代码行数:31,代码来源:auth.php


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