git push

# 将本地分支的更新,推送到远程主机
git push <远程主机名> <本地分支名>:<远程分支名>

# 将本地的master分支推送到origin主机的master分支。如果master不存在,则会被新建。
git push origin master

# 如果省略本地分支名,则表示删除指定的远程分支,因为这等同于推送一个空的本地分支到远程分支
git push origin :master
# 等同于
git push origin --delete master

# 将所有本地分支都推送到origin主机
git push --all origin

# git push不会推送标签(tag),除非使用–tags选项
git push origin --tags

# 推送tag
git push origin tag_name

# 删除远程标签
git push origin :tag_name

- 阅读全部 -

简单的给按钮加上确认弹框

下面是删除所有标签按钮例子(附TP5跳转地址):

<a href="javascript:if(confirm('确定删除所有标签?'))location='{:url('Tag/delall')}'">删除所有标签</a>

控制器代码

public function viewbug(){
    $where  = array();
    $name = '';
    if (Request::instance()->isPost()) {
        $name = $_POST['playerName'];
        $where['playerName'] = array('like',"%$name%");
    }
    $count = Db::name('ygo_bug')->where($where)->count();
    $bugs = Db::name('ygo_bug')->where($where)->order('id desc')->paginate(100);
    $this->assign('count',$count);
    $this->assign('name',$name);
    $this->assign('bugs',$bugs);
    return $this->fetch();
}

html代码

<div class="hui-pager hui-pager-center" style="padding:10px 30px;">{$bugs->render()}</div>

css代码

<style>
    .pagination { display: inline-block; padding-left: 0; margin: 20px 0; border-radius: 4px; }
    .pagination li { display: inline; }
    .pagination li a,.pagination li span { position: relative; float: left; padding: 6px 12px; margin-left: -1px; line-height: 1.428571429; text-decoration: none; background-color: #fff; border: 1px solid #ddd; }
    .pagination li:first-child a { margin-left: 0; border-bottom-left-radius: 4px; border-top-left-radius: 4px; }
    .pagination li:last-child a { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
    .pagination li a:hover, .pagination li a:focus { background-color: #eee; }
    .pagination .active span, .pagination .active span:hover, .pagination .active span:focus { z-index: 2; color: #fff; cursor: default; background-color: #428bca; border-color: #428bca; }
    .pagination .disabled span, .pagination .disabled span:hover, .pagination .disabled span:focus { color: #999; cursor: not-allowed; background-color: #fff; border-color: #ddd; }
    .pagination-lg li a { padding: 10px 16px; font-size: 18px; }
    .pagination-sm li a, .pagination-sm li span { padding: 5px 10px; font-size: 12px; }
</style>

默认情况下contos7不带nginx的yum源
可以通过rpm添加yum源

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

yum源添加完成之后就可以使用yum安装nginx了(yum可以自行解决依赖关系安装nginx)

yum -y install nginx

安装完成之后可以通过命令启动nginx和设置开启自动运行

systemctl start nginx
systemctl enable nginx

没有任何报错就说明nginx安装并启动成功
如果有错误,可在nginx错误日志中查看原因

/var/log/nginx/error.log

server {
    listen  80;
    server_name  home.zhouqq.com;
    root /www/zhouqq;
    index  index.html index.htm index.php;
    error_page  404              /404.html;
    location = /404.html {
        return 404 'Sorry, File not Found!';
    }
    error_page  500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html; # windows用户替换这个目录
    }
    location / {
        try_files $uri @rewrite;
    }
    location @rewrite {
        set $static 0;
        if  ($uri ~ \.(css|js|jpg|jpeg|png|gif|ico|woff|eot|svg|css\.map|min\.map)$) {
            set $static 1;
        }
        if ($static = 0) {
            rewrite ^/(.*)$ /index.php?s=/$1;
        }
    }
    location ~ /Uploads/.*\.php$ {
        deny all;
    }
    location ~ \.php/ {
       if ($request_uri ~ ^(.+\.php)(/.+?)($|\?)) { }
       fastcgi_pass 127.0.0.1:9000;
       include fastcgi_params;
       fastcgi_param SCRIPT_NAME     $1;
       fastcgi_param PATH_INFO       $2;
       fastcgi_param SCRIPT_FILENAME $document_root$1;
    }
    location ~ \.php$ {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
    location ~ /\.ht {
        deny  all;
    }
}

#!/bin/sh
rq=`date +%Y%m%d`
# 删除文件夹中一些过期的备份文件
find /back/ -name "*.sql" -mtime +10 |xargs rm -fr
find /back/ -name "*.tar.gz" -mtime +10 |xargs rm -fr
# 备份整个www目录
zip -r /back/wwwback_$rq.tar.gz /apps/www/*
# 备份数据库
mysqldump -uroot -p123456 database > /back/database`date +%Y-%m-%d_%H%M%S`.sql

启动备份只需要使用计划任务执行sh脚本就行,如:

55 23 * * *    /back.sh

function decodeUnicode($str)
{
    return preg_replace_callback('/\\\\u([0-9a-f]{4})/i',
    create_function(
        '$matches',
        'return mb_convert_encoding(pack("H*", $matches[1]), "UTF-8", "UCS-2BE");'
        ),
        $str);
}

var str = "\\u6211\\u662Funicode\\u7F16\\u7801";
// 关于这样的数据转换为中文问题,常用的以下方法。
// 1. eval解析或new Function("'+ str +'")()
str = eval("'" + str + "'"); // "我是unicode编码"
// 2. unescape 解析
str = unescape(str.replace(/\u/g, "%u")); // "我是unicode编码"