Browse Source

Merge branch 'dev'

# Conflicts:
#	README.md
#	src/Library/Hash.php
Zhu Jinhui 7 years ago
parent
commit
bb3273524c
7 changed files with 149 additions and 7 deletions
  1. 3 0
      .gitignore
  2. 2 6
      README.md
  3. 13 0
      _cli/.htaccess
  4. 101 0
      _cli/app.ini
  5. 24 0
      _cli/db.ini
  6. 5 0
      _cli/router.config.php
  7. 1 1
      src/Library/Hash.php

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+.idea
+/private/tmp
+/demo/private/tmp

+ 2 - 6
README.md

@@ -1,8 +1,5 @@
-# Qii
+# 新版Qii
 
 
-<<<<<<< HEAD
-新版Qii
-=======
 使用方法:
 使用方法:
 
 
 1、创建项目
 1、创建项目
@@ -282,5 +279,4 @@
 			//移除缓存
 			//移除缓存
 			$this->cache->remove($cache_id);
 			$this->cache->remove($cache_id);
 		}
 		}
-	}
->>>>>>> c51722c... 调整文件的目录结构
+	}

+ 13 - 0
_cli/.htaccess

@@ -0,0 +1,13 @@
+##
+#
+#	$Id: .htaccess 268 2009-12-16 06:18:19Z Jinhui.Zhu $
+#
+#	Copyright (C) 2008-2009 www.qiiframework.com. All Rights Reserved.
+#  
+##
+RewriteEngine On
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteCond %{REQUEST_FILENAME} !-f
+
+RewriteCond $1 !^(index.php|images|robots.txt)
+RewriteRule (.*)$ index.php/$1 [L,QSA,PT]

+ 101 - 0
_cli/app.ini

@@ -0,0 +1,101 @@
+;通用配置,如果没有指定环境将使用通用配置,指定了环境,指定环境的配置将覆盖默认配置中的配置信息
+[author]
+name = 朱金辉
+email = jinhui.zhu@live.cn
+qq = 119328118
+
+[common]
+;程序是否使用命名空间
+namespace['use'] = true
+namespace[list.controller] = true
+namespace[list.model] = true
+namespace[list.library] = true
+namespace[list.action] = true
+;rewrite 方法, 此定义不能省略
+rewriteMethod = Short
+;rewrite匹配规则,可选
+rewriteRules = Normal
+;hosts中的属性将会覆盖掉默认的属性,当在不同域名上使用不同配置上很有用处
+;hosts[0.domain] = test.com
+;hosts[0.path] = test
+
+;hosts[1.domain] = admin.test.com
+;hosts[1.path] = admin
+
+;是否开启调试模式,调试模式下,所有的错误都将抛出来,并终止运行
+debug = 1
+;错误页面
+errorPage = Error:Index
+;时间区域
+timezone = Asia/Shanghai
+;文档类型
+contentType = text/html
+;文档编码
+charset = UTF-8
+;模板引擎
+view[engine] = smarty
+view[path] = view
+;smarty 引擎的相关配置
+view[smarty.view] = view
+view[smarty.path] = view
+view[smarty.ldelimiter] = {#
+view[smarty.rdelimiter] = #}
+view[smarty.compile] = tmp/compile
+view[smarty.cache] = tmp/cache
+view[smarty.lifetime] = 300
+;缓存类型
+cache = memcached
+
+;是否开启安全验证,enable:是否开启安全验证;key:POST数据的时候安全字符串加密用到的key
+security[enable] = true
+security[name] = security_sid
+security[expired] = 3600
+security[key] = 4cd780a986d5c30e03bdcb67d16c8320
+
+;memcached配置,多个服务器IP和端口以;隔开
+memcached[servers] = 127.0.0.1
+memcached[ports] = 11211
+;redis配置,多个服务器IP和端口以;隔开
+redis[servers] = 127.0.0.1
+redis[ports] = 6379
+
+;map:为参数的顺序,当启用短URI标签的情况下会按照这个顺序去遍历参数;
+query[] = controller
+query[] = action
+query[] = param
+
+;controller、action配置  name:参数名 ext:后缀;default:默认方法 
+controller[name] = controller
+controller[prefix] = controller
+controller[default] = index
+
+action[name] = action
+action[suffix] = Action
+action[default] = index
+
+;url相关配置,用于生成链接用
+[uri]
+
+;url模式,短链接模式
+mode = short
+controllerName = controller
+actionName = action
+
+normal[mode] = normal
+normal[trim] = 0
+normal[symbol] = "&"
+normal[extenstion] = .html
+
+middle[mode] = middle
+middle[trim] = 1
+middle[symbol] = "/"
+middle[extenstion] = .html
+
+short[mode] = short
+short[trim] = 1
+short[symbol] = "/"
+short[extenstion] = .html
+;以下这种写法将会继承:后边的section,如果是"."开头的话就放在当前key下边
+[dev:common:.uri]
+[product:common:.uri]
+

+ 24 - 0
_cli/db.ini

@@ -0,0 +1,24 @@
+;数据库配置
+[common]
+;是否读写分离
+readOrWriteSeparation = 0
+driver = pdo
+;使用的数据库类型
+use_db_driver = mysql
+master[db] = DB_NAME
+master[host] = DB_HOST
+master[user] = DB_USER
+master[password] = DB_PASSWORD
+
+slave[0.db] = DB_NAME
+slave[0.host] = DB_HOST
+slave[0.user] = DB_USER
+slave[0.password] = DB_PASSWORD
+
+
+slave[1.db] = DB_NAME
+slave[1.host] = DB_HOST
+slave[1.user] = DB_USER
+slave[1.password] = DB_PASSWORD
+
+[product:common]

+ 5 - 0
_cli/router.config.php

@@ -0,0 +1,5 @@
+<?php
+return [
+    //'home:index' => 'index:index',
+    //'manage:*' => 'manage\{1}:*'
+];

+ 1 - 1
src/Library/Hash.php

@@ -139,7 +139,7 @@ class Hash
     public function MD5Hash($str) // 0.050
     public function MD5Hash($str) // 0.050
     {
     {
         $hash = md5($str);
         $hash = md5($str);
-        $hash = $hash[0] | ($hash[1] << 8) | ($hash[2] << 16) | ($hash[3] << 24) | ($hash[4] << 32) | ($hash[5] << 40) | ($hash[6] << 48) | ($hash[7] << 56);
+        $hash = ord($hash[0]) | (ord($hash[1]) << 8) | (ord($hash[2]) << 16) | (ord($hash[3]) << 24) | (ord($hash[4]) << 32) | (ord($hash[5]) << 40) | (ord($hash[6]) << 48) | (ord($hash[7]) << 56);
         return $hash % self::HASH_MODE;
         return $hash % self::HASH_MODE;
     }
     }
 }
 }