本文整理汇总了PHP中drop函数的典型用法代码示例。如果您正苦于以下问题:PHP drop函数的具体用法?PHP drop怎么用?PHP drop使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了drop函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('banner', function (Blueprint $table) {
Schema:
drop('banner');
});
}
示例2: log_in
/**
* 生成用于登陆的Cookie
* @param $uid 要生成的Cookie的协会编号
* */
function log_in($uid)
{
//要创建的数据
$data = array();
$data['uid'] = $uid;
$data['date'] = true;
$data['token'] = true;
//检查是否token表中是否有此用户,没有则inset,有则updata
$is_inset = false;
$mo = new TokenModel();
$mo->where(array('uid' => $uid));
if (empty($mo->find())) {
$is_inset = true;
} else {
$is_inset = false;
}
//更新token
$mo->field('uid,date,token');
$mo->create($data) or drop($mo->getError());
//更新token,如果不存在则生成一条新记录
if ($is_inset) {
$mo->add() or drop(CE_3531 . $mo->getError());
} else {
$mo->save() or drop(CE_3532 . $mo->getError());
}
//获取生成的token
$data['token'] = $mo->getToken();
//生成Cookie
cookie('uid', $data['uid']);
cookie('token', $data['token']);
}
示例3: run
/**
* 入口函数。此函数会被自动调用
* */
public function run()
{
//检查验证码
if (!(APP_DEBUG && C('Not_VerifyCode'))) {
check_verify(I('post.verifycode')) or drop(EC_4841);
}
//校验登陆信息
test_token() or drop(EC_4842);
//校验是否需要登记信息
get_state() == '100' or drop(EC_4843);
//获取uid
$_POST['uid'] = cookie('uid');
//尝试创建数据对象
//user_inf表
$uiMo = new UserInfModel();
$uiMo->create(I('post.'), Model::MODEL_INSERT) or drop($uiMo->getError());
//users表
$uMo = new UsersModel();
$uMo->field('uid,state');
$uMo->create(array('uid' => $_POST['uid'], 'state' => 200), Model::MODEL_UPDATE) or drop($uMo->getError());
//注册信息
$uiMo->add() or drop(EC_4861);
$uMo->save() or drop(EC_4862);
//End 注册信息
drop(true);
}
示例4: run
/**
* 入口函数。此函数会被自动调用
* */
public function run()
{
//检查验证码
if (!(APP_DEBUG && C('Not_VerifyCode'))) {
check_verify(I('post.verifycode')) or drop(EC_4741);
}
//尝试创建数据对象
//users表
$usersMo = new UsersModel();
$usersMo->field('qq,password');
$usersMo->create(I('post.'), Model::MODEL_INSERT) or drop($usersMo->getError());
//invite_code表
$icMo = new InviteCodeModel();
$icMo->field('uid,invite_code');
$icMo->create(array('invite_code' => I('post.invite_code'), 'uid' => $usersMo->getUid()), Model::MODEL_INSERT) or drop($icMo->getError());
//数据检查
if (I('post.password') != I('post.re_password')) {
drop(EC_4742);
}
$this->checkInviteCode_0(I('post.invite_code')) or drop(EC_4751);
$this->checkInviteCode_1(I('post.invite_code')) or drop(EC_4752);
//注册信息
$usersMo->add() or drop(EC_4761);
$icMo->save() or drop(EC_4762);
//生成登陆信息
log_in($usersMo->getUid());
//返回成功信息
echo drop('1200,' . $usersMo->getUid(), true);
}
示例5: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('solutions', function (Blueprint $table) {
$table->dropForeign('solutions_result_foreign');
$table->dropColumn('result');
});
drop('solution_results');
}
示例6: createUid
protected function createUid()
{
if (empty(C('WEB_BATCH'))) {
drop(EC_5661);
}
$this->uid = C('WEB_BATCH') . mt_rand(0, 9) . mt_rand(0, 9) . mt_rand(0, 9);
return $this->uid;
}
示例7: deleteat
function deleteat()
{
$args = func_get_args();
$deleteat = function ($n, array $xs) {
if ($n > 0) {
return array_merge(take($n, $xs), drop($n + 1, $xs));
}
return $xs;
};
return call_user_func_array(partial($deleteat), $args);
}
示例8: run
/**
* 入口函数。此函数会被自动调用
* */
public function run()
{
//检查验证码
if (!(APP_DEBUG && C('Not_VerifyCode'))) {
check_verify(I('post.verifycode')) or drop(EC_4541);
}
//检查字段值
preg_match(RegExp_username, I('post.username')) or drop(EC_4531);
//检查用户名是否存在
$this->checkUsername(I('post.username')) or drop(EC_4551);
//检查密码是否正确
$this->checkPassword(I('post.password')) or drop(EC_4552);
//生成登陆信息
log_in($this->uid);
//返回成功
drop(true);
}
示例9: run
/**
* 入口函数。此函数会被自动调用
* */
public function run()
{
//检查验证码
if (!(APP_DEBUG && C('Not_VerifyCode'))) {
check_verify(I('post.verifycode')) or drop(EC_4341);
}
//校验登陆信息
test_token() or drop(EC_4342);
//尝试创建数据对象
$mo = new UsersModel();
$mo->field('uid,password');
$mo->create(array('uid' => cookie('uid'), 'password' => I('post.password')), Model::MODEL_UPDATE) or drop($mo->getError());
//检测字段值
if (I('post.password') != I('post.re_password')) {
drop(EC_4343);
}
//写入数据
$mo->save() or drop(EC_4351 . $mo->getError());
//执行登出操作
R('Service/_empty', 'action=SignOut') or drop(EC_4361);
}
示例10: init
private function init($args, UserInterface $ui)
{
$flags = new Flags();
$displayHelp =& $flags->bool('help', false, 'Display this help message.');
$displayVersion =& $flags->bool('version', false, 'Display this applications version.');
try {
$flags->parse($args);
} catch (\Exception $e) {
$ui->dropError($e->getMessage(), 1, $flags->getDefaults());
drop($e->getMessage(), 1, $flags->getDefaults());
}
switch (true) {
case $displayVersion:
self::versionMarker($ui);
die(0);
break;
case $displayHelp:
case count($flags->args()) > 1:
$ui->dumpOptions($flags->getDefaults());
die(1);
break;
}
return $flags->args() ? current($flags->args()) : self::CONFIG_FILE;
}
示例11: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema:
drop('categories');
}
示例12: scan
//.........这里部分代码省略.........
// process 'implements' keyword
do {
$tokens->next();
$root = $tokens->is(T_NS_SEPARATOR);
$parent = $this->_parseName($tokens);
if ($root) {
// extends from root namespace
$class->addInterface($parent);
} elseif (isset($aliases[$parent])) {
$class->addInterface($aliases[$parent]);
} else {
$class->addInterface($_ns . $parent);
}
} while ($tokens->is(','));
}
$tokens->forwardTo('{')->next();
while ($tokens->forwardTo(T_CONST, T_FUNCTION, '{', '}', T_VARIABLE) && $tokens->valid()) {
switch ($tokens->key()) {
case T_CONST:
$constant = new EntityConstant($class->name . '::' . $tokens->next()->get(T_STRING));
$constant->setValue(constant($constant->name));
$constant->setLine(new Line($this, $tokens->getLine()));
$class->addConstant($constant);
break;
case T_VARIABLE:
$property = new EntityProperty(ltrim($tokens->getAndNext(), '$'));
$ref = new \ReflectionProperty($class->name, $property->name);
$doc = $ref->getDocComment();
if ($doc) {
$property->setDescription(ToolKit::parseDoc($doc)['desc']);
}
if ($ref->isPrivate()) {
$property->addFlag(Flags::IS_PRIVATE);
} elseif ($ref->isProtected()) {
$property->addFlag(Flags::IS_PROTECTED);
} else {
$property->addFlag(Flags::IS_PUBLIC);
}
if ($ref->isStatic()) {
$property->addFlag(Flags::IS_STATIC);
}
if ($ref->isDefault()) {
$property->setValue($ref->getDeclaringClass()->getDefaultProperties()[$property->name]);
}
$class->addProperty($property);
break;
case T_FUNCTION:
$method = new EntityMethod($name . '::' . $tokens->next()->get(T_STRING));
$method->setLine($this->line($tokens->getLine()));
$this->parseCallable($method, $ref = new \ReflectionMethod($class->name, $method->short));
if ($ref->isPrivate()) {
$method->addFlag(Flags::IS_PRIVATE);
} elseif ($ref->isProtected()) {
$method->addFlag(Flags::IS_PROTECTED);
} else {
$method->addFlag(Flags::IS_PUBLIC);
}
if ($ref->isStatic()) {
$method->addFlag(Flags::IS_STATIC);
}
if ($ref->isAbstract()) {
$method->addFlag(Flags::IS_ABSTRACT);
$method->addFlag(Flags::IS_ABSTRACT_IMPLICIT);
} elseif ($ref->isFinal()) {
$method->addFlag(Flags::IS_FINAL);
}
if (isset($method->options['deprecated'])) {
$method->addFlag(Flags::IS_DEPRECATED);
}
$tokens->forwardTo(')')->next();
if ($tokens->is('{')) {
$method_body = $tokens->getScope();
$method->setBody($method_body);
}
$tokens->next();
$class->addMethod($method);
break;
case '{':
// use traits scope
$tokens->forwardTo('}')->next();
break;
case '}':
// end of class
$tokens->next();
$this->classes[$class->name] = $class;
break 2;
}
}
} elseif ($tokens->is('}') && $ns_bracket) {
$tokens->next();
$ns_bracket = false;
} else {
drop($tokens->curr);
if ($tokens->valid()) {
throw new UnexpectedTokenException($tokens);
}
break;
}
}
}
示例13: function
<?php
return function ($di) {
$di->set("log.error.router", function () {
return new \Psr\Log\NullLogger();
});
$di->set("log.error.dispatcher", function () {
return new \Psr\Log\NullLogger();
});
$di->set("log.drop", function () {
return new \Chevron\Loggers\UserFuncLogger(function ($l, $m, $c) {
drop($l, $m, $c);
});
});
};
示例14: time
case "lovkost10":
$add = 10;
$type = 'stat';
$zaman = time() + 6 * 60 * 60;
break;
case "lovkost15":
$add = 15;
$type = 'stat';
$zaman = time() + 6 * 60 * 60;
break;
case "lovkost22":
$add = 22;
$type = 'stat_mf';
$zaman = time() + 2 * 60 * 60;
break;
case "lovkost100":
$add = 100;
$type = 'stat';
$zaman = time() + 6 * 60 * 60;
break;
}
$my_id = $db["id"];
if ($db["battle"]) {
say($login, "¬ы не можете кастовать это закл¤тие наход¤сь в бою!", $login);
} else {
mysql_query("DELETE FROM effects WHERE user_id=" . $my_id . " and type='" . $type . "'");
mysql_query("INSERT INTO effects (user_id,type,elik_id,add_lovkost,end_time) VALUES ('{$my_id}','{$type}','{$elik_id}','{$add}','{$zaman}')");
$_SESSION["message"] = "¬ы удачно прокастовали заклинание <b>«" . $name . "»</b>";
drop($spell, $DATA);
}
echo "<script>location.href='main.php?act=inv&otdel=magic'</script>";
示例15: array
', $spell_cols[2], $item['entry'], $item['entry'], $item['entry']);
if ($rows_cf) {
$item['createdfrom'] = array();
foreach ($rows_cf as $numRow => $row) {
$skillrow = $DB->selectRow('
SELECT skillID, min_value, max_value
FROM ?_udwbase_skill_line_ability
WHERE spellID=?d
LIMIT 1', $row['spellID']);
$item['createdfrom'][] = spellinfo2(array_merge($row, $skillrow));
}
unset($skillrow);
}
unset($rows_cf);
// Ловится в ...
$drops_fi = drop('?_fishing_loot_template', $item['entry']);
if ($drops_fi) {
$item['fishedin'] = array();
foreach ($drops_fi as $lootid => $drop) {
// Обычные локации
$row = $DB->selectRow('
SELECT name_loc' . $_SESSION['locale'] . ' AS name, areatableID as id
FROM ?_udwbase_zones
WHERE
areatableID=?d
AND (x_min!=0 AND x_max!=0 AND y_min!=0 AND y_max!=0)
LIMIT 1
', $lootid);
if ($row) {
$item['fishedin'][] = array_merge($row, $drop);
} else {