瀏覽代碼

fixed: 1. mysql方法清理. 2. 清理掉英雄卡牌图鉴字段. 3. 修复了居家办公期间关卡条件条件功能中的bug.

gwang 5 年之前
父節點
當前提交
3e11390133

+ 1 - 1
Gameserver/Amfphp/Services/AppServer.php

@@ -88,7 +88,7 @@ class AppServer {
         } catch (\Exception $ex) {                                              # 异常信息写入日志
             $msg = CommUtil::str2UTF8($ex->getMessage());                       # 异常信息转下码
             CLog::err("$msg\n  " . $ex->getTraceAsString(), "AppServer");       # 日志中追加traceinfo
-            Err(ErrCode::err_unknownn, 'call_user_func got Exception: ' . $msg);  # 返回给客户端
+            Err(ErrCode::err_unknownn, "call_user_func got Exception: $msg");   # 返回给客户端
         }
     }
 

+ 6 - 6
Gameserver/Amfphp/model/User/UserGameModel.php

@@ -148,11 +148,11 @@ class UserGameModel extends Object_ext {
      */
     public $heroTeamConfig;
 
-    /**
-     * 神兽图鉴数据
-     * @var HeroManualModel
-     */
-    public $heroManual;
+//    /**
+//     * 神兽图鉴数据
+//     * @var HeroManualModel
+//     */
+//    public $heroManual;
 
     /**
      * 新手引导
@@ -206,7 +206,7 @@ class UserGameModel extends Object_ext {
             $this->heros = new UserGameHeroModel();                             # 英雄数据
 //            $this->heros->InitializeHero();                                     # 添加初始英雄
             $this->gates = new UserGateDifficulty();                            # 初始化关卡默认数据
-            $this->heroManual = new HeroManualModel();                          # 初始化图鉴数据结构
+//            $this->heroManual = new HeroManualModel();                          # 初始化图鉴数据结构
             $this->NewbieGuide = ObjectInit();                                  # 初始化新手引导结构
             $this->pvp = new UserPVPModel();                                    # 初始化pvp模块
         } else {                                                                # 实参

+ 1 - 1
Gameserver/Amfphp/process/EmailProc.php

@@ -453,7 +453,7 @@ class EmailProc {
             return;                                                             # 系统消息为空
         }
         $key = MemKey_User::Mail_SysRecord_set($zoneid, $uid);                  # memkey
-        $record = $mem->smembers($key);                                         # 系统邮件处理记录,在数据集过大以前, 个人认为全部获取比较高效
+        $record = $mem->smembers($key);                                         # 系统邮件处理记录,在数据集过大以前, 个人认为全部获取比较高效 --王刚,所以系统邮件不能太多呢
         foreach ($sysMailQueue as $sysId => $sysMail) {
             if (!StlUtil::arrayContains($record, $sysId)) {                     # 判断尚未处理此邮件
                 $ts = now();

+ 3 - 4
Gameserver/Amfphp/process/FightProc/SweepGatesProc.php

@@ -303,10 +303,9 @@ class SweepGatesProc {
             $uGate = $diffCult->gates->$gateId;
         }
         $uGate->challengeTimes++;                                               # 当前关卡挑战次数
-
-        if ($uGate->star < $star) {                                             # 当前关卡得分评星
-            $uGate->star = $star;
-        }
+//        if ($uGate->star < $star) {                                             # 当前关卡得分评星
+        $uGate->star |= $star;
+//        }
 //        CLog::err($uGate);
         if (!$uGate->cleared) {
             $uGate->cleared = 1;                                                # 当前关卡是否已通关     

+ 5 - 5
Gameserver/Amfphp/process/GuildProc.php

@@ -225,7 +225,7 @@ class GuildProc {
         $paydb = CPayInit();
 //客户端参数解析
         $keywords = $req->paras[0];                                             // 公会ID
-        $sql = sprintf(SQLSELECTGUILDBYNAME, $req->zoneid, $keywords, '%' . mysql_escape_string($keywords) . '%');
+        $sql = sprintf(SQLSELECTGUILDBYNAME, $req->zoneid, $keywords, '%' . $paydb->escape_string($keywords) . '%');
         $sqlret = $paydb->fetch_array($sql);
         $resp = Resp::ok(array(
                     "guildInfo" => $sqlret,
@@ -297,9 +297,9 @@ class GuildProc {
                             }
 
                             $paydb->query(sprintf(SQLCREATEGUILD, $guildInfo->guildId, // Mysql 插入公会记录
-                                            mysql_escape_string($guildName), $guildInfo->createts,
-                                            mysql_escape_string($declare), count($guildInfo->members), $uid,
-                                            mysql_escape_string($game->name), $guild_img, $zoneid, $score, $guildInfo->enableQuickIn, $guildInfo->condition));
+                                            $paydb->escape_string($guildName), $guildInfo->createts,
+                                            $paydb->escape_string($declare), count($guildInfo->members), $uid,
+                                            $paydb->escape_string($game->name), $guild_img, $zoneid, $score, $guildInfo->enableQuickIn, $guildInfo->condition));
                             self::pushNewJournal($mem, $guildInfo->guildId, GuildJournalModel::CreateJoin($uid, $game->name), $zoneid);
 
                             self::updateUserGuildInfo($mem, $uid, $userGuildInfo, $zoneid); // 回写数据
@@ -487,7 +487,7 @@ class GuildProc {
                     $guildInfo->declare = $declare;
                     #修改公会徽章
                     $guildInfo->guild_img = $guildEmblem == null ? 0 : $guildEmblem;
-                    $dbret = $paydb->query(sprintf(SQLUPDATEGUILDDECLARE, mysql_escape_string($declare), $guildEmblem, $guildInfo->enableQuickIn, $guildInfo->condition, $guildId, $zoneid));
+                    $dbret = $paydb->query(sprintf(SQLUPDATEGUILDDECLARE, $paydb->escape_string($declare), $guildEmblem, $guildInfo->enableQuickIn, $guildInfo->condition, $guildId, $zoneid));
 // 回写用户数据
                     self::updateGuildInfo($mem, $guildId, $guildInfo, $zoneid);
 // 设置成功返回值

+ 15 - 14
Gameserver/Amfphp/process/UserProc.php

@@ -311,19 +311,20 @@ class UserProc {
         return $resp;
     }
 
-    /**
-     * 初始化卡牌图鉴信息
-     * @param UserGameModel $userInfo
-     */
-    private static function _intiHeroManual($userInfo) {
-        if (INIT_TUTORIAL == 1) {                                               # 配合新手引导产生的图鉴数据
-            $userInfo->heroManual = JsonUtil::decode(INIT_GODPETMANUAL);
-        } else {
-            $userInfo->heroManual = new HeroManualModel();
-            $userInfo->heroManual->initInstance();
-        }
-    }
-
+//    /**
+//     * 初始化卡牌图鉴信息
+//     * @param UserGameModel $userInfo
+//     */
+//    private static function _intiHeroManual($userInfo) {
+//        if (INIT_TUTORIAL == 1) {                                               # 配合新手引导产生的图鉴数据
+//            $userInfo->heroManual = JsonUtil::decode(INIT_GODPETMANUAL);
+//        } else {
+//            $userInfo->heroManual = new HeroManualModel();
+//            $userInfo->heroManual->initInstance();
+//        }
+//    }
+//    
+//    
 // <editor-fold defaultstate="collapsed" desc="送审/测试用方法">
 
     /**
@@ -445,7 +446,7 @@ class UserProc {
         $userInfo->game->firstLogin = now();
 //        $userInfo->game->pvp->socre = PVPProc::_getScore_by_uid($req, $req->uid); # 初始化pvp积分
 //        $userInfo->game->NewbieGuideOver = 1;
-        UserProc::_intiHeroManual($userInfo->game);                             # 初始化图鉴
+//        UserProc::_intiHeroManual($userInfo->game);                             # 初始化图鉴
         $userInfo->interact = new UserInteractModel();                          # 初始化交互体数据
 #Ps 6006是没有获得到Userinfo到Req中的
         UserProc::checkContidays($req, 1);                                      # 每日状态检查

+ 11 - 18
Gameserver/Amfphp/service_call/mergemem/MemKeyList.php

@@ -2,6 +2,8 @@
 
 namespace loyalsoft;
 
+DebugHelper::checkkPHPVersion("5.5.0");                                         # 检查PHP版本, yield关键字在5.5以后提供
+
 /**
  * Description of MemKeyList
  * 后台工具, 列出Mem中所有的keys.
@@ -10,13 +12,11 @@ namespace loyalsoft;
  * @author gwang (mail@wanggangzero.cn)
  * @copyright ? 2017-9-11, SJZ LoyalSoft Corporation & gwang. All rights reserved.
  */
-class MemKeyList
-{
+class MemKeyList {
 
 //put your code here
 
-    public static function ItorAllKeys()
-    {
+    public static function ItorAllKeys() {
         foreach (self::ItorRuntimeKeys() as $k) {
             echo $k . PHP_EOL;
         }
@@ -25,8 +25,7 @@ class MemKeyList
         }
     }
 
-    private static function ItorUserKeys()
-    {
+    private static function ItorUserKeys() {
         $dao = daoInst();
         # 遍历玩家分区无关的keys
         $max = $dao->query("select count(distinct userID) from tab_rolename;");
@@ -57,14 +56,12 @@ class MemKeyList
         }
     }
 
-    public static function ItorUserKeys_Union($uid)
-    {
+    public static function ItorUserKeys_Union($uid) {
         yield MemKey_User::Union_PublicState_normal($uid);
         yield MemKey_User::Union_PlayedZoneInfo_normal($uid);
     }
 
-    public static function ItorUserKeys_zoned($zoneid, $uid)
-    {
+    public static function ItorUserKeys_zoned($zoneid, $uid) {
         yield MemKey_User::Info($zoneid, $uid);
         yield MemKey_User::Interact($zoneid, $uid);
         yield MemKey_User::Sig($zoneid, $uid);
@@ -83,8 +80,7 @@ class MemKeyList
         yield MemKey_User::stat_LotteryRecords($zoneid, $uid);
     }
 
-    private static function ItorRuntimeKeys()
-    {
+    private static function ItorRuntimeKeys() {
         foreach (GameConfig::hero() as $heroid => $hero) {
             foreach (self::ItorRuntimekeys_withHeroid($heroId) as $k) {
                 yield $k;
@@ -104,15 +100,13 @@ class MemKeyList
         }
     }
 
-    private static function ItorRuntimekeys_withHeroid($heroId)
-    {
+    private static function ItorRuntimekeys_withHeroid($heroId) {
         yield MemKey_GameRun::HeroDiscusses_item_hash($heroId);
         yield MemKey_GameRun::HeroDiscusses_score_zset($heroId);
         yield MemKey_GameRun::HeroDiscusses_userScore_normal($heroId);
     }
 
-    private static function ItorRuntimekeys_withZoneid($zoneid)
-    {
+    private static function ItorRuntimekeys_withZoneid($zoneid) {
         yield MemKey_GameRun::Game_FightPowerRank_zset($zoneid);
 //      # 这里, pvp更早的数据还要不要? 运行时反正是只有最后两周的有用.
         yield MemKey_GameRun::Game_PVPScoreByZone_zset_curWeek($zoneid);
@@ -121,8 +115,7 @@ class MemKeyList
         yield MemKey_GameRun::Stat_UserCountByZone_int($zoneid);
     }
 
-    private static function ItorRuntimekeys_withZoneidAndtsDay($zoneid, $tsday)
-    {
+    private static function ItorRuntimekeys_withZoneidAndtsDay($zoneid, $tsday) {
         yield MemKey_GameRun::Game_UserRecordByZone($zoneid, $tsday);
     }
 

+ 4 - 0
Gameserver/Amfphp/test.php

@@ -17,3 +17,7 @@ CLog::warn("我们的祖国像花园,花园里花朵真鲜艳.3");
 CLog::warn("我们的祖国像花园,花园里花朵真鲜艳.4");
 CLog::warn("和暖的阳光照耀着我们,每个人的脸上都笑开颜.5");
 
+var_dump(json_decode("{}"));
+
+var_dump(count(new \stdClass()));
+var_dump(count((array) new \stdClass()));

+ 55 - 12
Gameserver/Amfphp/util/CDbUtil.php

@@ -2,13 +2,11 @@
 
 namespace loyalsoft;
 
-// php + mysql fuction class
-//error_reporting(E_ALL & ~ E_NOTICE);
-
 /**
  * CDB工具类[APHP三大操作单元之一]
- * @version 2.0 gwang 升级到mysqli,以便能在PHP7.0以后的环境下继续运行. 约 2017
- *           1.0 jgao create 约 2013
+ * @version 2.0.1 gwang 修补了部分mysqli方法 2020.3.25
+ *           2.0   gwang 升级到mysqli,以便能在PHP7.0以后的环境下继续运行. 约 2017
+ *           1.0   jgao  created 约 2013
  * @author jgao,gwang
  */
 class CDbUtil {
@@ -32,21 +30,41 @@ class CDbUtil {
         }
     }
 
+    /**
+     * 切换db
+     * @param type $dbname
+     */
     public function select_db($dbname) {
         if (!mysqli_select_db($this->conn, $dbname)) {
             $this->halt('Cannot use database');
         }
     }
 
+    /**
+     * 调取服务器信息
+     * @return type
+     */
     public function server_info() {
         return mysqli_get_server_info($this->conn);
     }
 
+    /**
+     * 最后一次执行insert时插入的第一行记录Id,(如果一次插入3条记录,则得到第一条的记录)
+     * 所以,这个如何用要慎重(gwang)
+     * @return type
+     */
     public function insert_id() {
         $arr = $this->fetch_array('SELECT LAST_INSERT_ID() as id');
         return $arr["id"];
     }
 
+    /**
+     * 直接取查询结果的某行某列的数值
+     * @param type $SQL
+     * @param type $offset
+     * @param type $field
+     * @return boolean
+     */
     public function get_value($SQL, $offset = 0, $field = 0) {
         $rt = $this->fetch_result($SQL);
         if (isset($rt[$offset][$field])) {
@@ -74,16 +92,16 @@ class CDbUtil {
      * @return int errno
      */
     public function safeQuery($SQL) {
-        mysql_query('start transaction');
-        mysql_query('SET autocommit=0');
-        $query = mysql_query($SQL, $this->conn);
-        $err = mysql_errno();
+        mysqli_query($this->conn, 'start transaction');
+        mysqli_query($this->conn, 'SET autocommit=0');
+        $query = mysqli_query($this->conn, $SQL);
+        $err = mysqli_errno($this->conn);
         if ($err && !$query) {
-            mysql_query('rollback');
+            mysqli_query($this->conn, 'rollback');
         } else {
-            mysql_query('commit');
+            mysqli_query($this->conn, 'commit');
         }
-        mysql_query('SET autocommit=1');
+        mysqli_query($this->conn, 'SET autocommit=1');
         return $err;
     }
 
@@ -123,6 +141,10 @@ class CDbUtil {
         return $arr;
     }
 
+    /**
+     * 调取查询影响的行数
+     * @return type
+     */
     public function affected_rows() {
         return mysqli_affected_rows($this->conn);
     }
@@ -140,15 +162,28 @@ class CDbUtil {
         return 0;
     }
 
+    /**
+     * 调取结果集中字段数量
+     * @param type $SQL
+     * @return type
+     */
     public function num_fields($SQL) {
         $query = $this->query($SQL);
         return mysqli_num_fields($query);
     }
 
+    /**
+     * 封装SQL字符串中特殊字符,以免SQL语句执行失败.
+     * @param type $str 带有风险字符的SQL语句或者字符串
+     * @return type 处理后的字符串
+     */
     public function escape_string($str) {
         return mysqli_real_escape_string($this->conn, $str);
     }
 
+    /**
+     * 释放SQL查询结果
+     */
     public function free_result() {
         $void = func_get_args();
         foreach ($void as $query) {
@@ -159,11 +194,19 @@ class CDbUtil {
         unset($void);
     }
 
+    /**
+     * 关闭当前实例的连接
+     * @return type
+     */
     public function close() {
         $this->free_result();
         return mysqli_close($this->conn);
     }
 
+    /**
+     * 直接报错退出
+     * @param type $msg
+     */
     public function halt($msg = null) {
         exit($msg . '<br /><br />' . mysqli_error($this->conn));
     }

+ 48 - 85
Gameserver/BackOffice/core.php

@@ -11,8 +11,7 @@
 /**
  * 定义(define)
  */
-class core
-{
+class core {
 
     /**
      * 配置文件或配置数组
@@ -31,8 +30,7 @@ class core
      * @param mixed &$variable
      * @return mixed
      */
-    public static function init($config = null, &$variable = null)
-    {
+    public static function init($config = null, &$variable = null) {
 
         // 引用参数处理
         $self_flag = $variable === null;
@@ -113,8 +111,7 @@ class core
      * @param bool $autoload_prepend
      * @return bool
      */
-    public static function stub($autoload_enable = null, $autoload_path = null, $autoload_extensions = null, $autoload_prepend = null)
-    {
+    public static function stub($autoload_enable = null, $autoload_path = null, $autoload_extensions = null, $autoload_prepend = null) {
 
         // 初始化自动载入功能
         $array = array();
@@ -149,8 +146,7 @@ class core
      * @param string $framework_parameter
      * @return bool
      */
-    public static function main($framework_enable = null, $framework_require = null, $framework_module = null, $framework_action = null, $framework_parameter = null)
-    {
+    public static function main($framework_enable = null, $framework_require = null, $framework_module = null, $framework_action = null, $framework_parameter = null) {
 
         // 一次跳转功能
         $config = self::init(false);
@@ -206,8 +202,7 @@ class core
      * @param string $filetype
      * @return string
      */
-    public static function path($filename, $filetype = null)
-    {
+    public static function path($filename, $filetype = null) {
 
         switch ($filetype) {
             case 'extension' :
@@ -239,8 +234,7 @@ class core
      * @param bool $_view_show
      * @return string
      */
-    public static function view($_view_file_global = null, $_view_vars = null, $_view_type = null, $_view_show = null)
-    {
+    public static function view($_view_file_global = null, $_view_vars = null, $_view_type = null, $_view_show = null) {
 
         // 视图全局参数
         self::_view_variable($_view_file_global);
@@ -308,8 +302,7 @@ class core
      * @param array $info
      * @return $dbh
      */
-    public static function connect($args = null, &$ref = null, $info = null)
-    {
+    public static function connect($args = null, &$ref = null, $info = null) {
 
 
         // 导入配置文件
@@ -523,8 +516,7 @@ class core
      * @param array &$ref
      * @return mixed
      */
-    public static function execute($sql, $param = null, &$ref = null)
-    {
+    public static function execute($sql, $param = null, &$ref = null) {
 
         // 【基础功能】执行语句
         $ref_flag = (func_num_args() > 2);
@@ -572,7 +564,7 @@ class core
                         } elseif (is_int($value) || is_float($value)) {
                             
                         } else {
-                            $value = '\'' . mysqli_real_escape_string((string) $value, $dbh) . '\'';
+                            $value = '\'' . mysqli_real_escape_string($dbh, (string) $value) . '\'';
                         }
                         $varname = $var . ++$key;
                         if ($key === 1) {
@@ -585,7 +577,7 @@ class core
                             $using .= ',' . $varname;
                         }
                     }
-                    mysql_query('PREPARE ' . $stmt . ' FROM \'' . mysqli_real_escape_string($sql, $dbh) . '\'', $dbh);
+                    mysql_query('PREPARE ' . $stmt . ' FROM \'' . mysqli_real_escape_string($dbh, $sql) . '\'', $dbh);
                     if ($sql_set !== '') {
                         mysql_query($sql_set, $dbh);
                     }
@@ -634,8 +626,7 @@ class core
      * @param array $extra
      * @return mixed
      */
-    public static function prepare($sql, $param = null, $format = null, $debug = null, $output = null, $extra = null)
-    {
+    public static function prepare($sql, $param = null, $format = null, $debug = null, $output = null, $extra = null) {
 
         // 【基础功能】准备SQL语句
         $mysql_escape_search = array("\\", "\x00", "\n", "\r", "'", "\"", "\x1a");
@@ -1270,8 +1261,7 @@ class core
      * @param int $start_index
      * @return int
      */
-    public static function sequence($tablename = 'sequence', $start_index = 1)
-    {
+    public static function sequence($tablename = 'sequence', $start_index = 1) {
 
         // 【基础功能】生成自增序列
         $dbh = self::connect(true, $args, array('sequence', $tablename, $start_index));
@@ -1322,8 +1312,7 @@ class core
      * @param mixed $struct
      * @return array
      */
-    public static function structs($array = null, $struct = null)
-    {
+    public static function structs($array = null, $struct = null) {
 
         // 【基础功能】构造对象数组
         // 数组
@@ -1392,7 +1381,7 @@ class core
                     $data_int [$int2] = $data2;
                     $data_all [$key2] = $data2;
                     $data_all [$int2] = $data2;
-                    $int2 ++;
+                    $int2++;
                 }
             }
             $point1 = &$return;
@@ -1468,7 +1457,7 @@ class core
                 case 'class|classtype' :
                     $i = 0;
                     foreach ($data_str as $key => $value) {
-                        if ($i ++ === 0) {
+                        if ($i++ === 0) {
                             if (isset($data_int [0]) && preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $data_int [0]) && class_exists($data_int [0])) {
                                 $point1 = new $data_int [0] ( );
                             } elseif (class_exists($classname)) {
@@ -1516,8 +1505,7 @@ class core
      * @param mixed $struct
      * @return array
      */
-    public static function selects($field_sql = null, $table_param = null, $where_bool = null, $other = null, $struct = null)
-    {
+    public static function selects($field_sql = null, $table_param = null, $where_bool = null, $other = null, $struct = null) {
 
         // 【基础功能】静态选择数据
         $dbh = self::connect(true, $args, array('selects', $field_sql, $table_param, $where_bool, $other, $struct));
@@ -1827,8 +1815,7 @@ class core
      * @param string $class
      * @return int
      */
-    public static function inserts($table_sql = null, $column_set_param = null, $value_bool = null, $other = null, $class = null)
-    {
+    public static function inserts($table_sql = null, $column_set_param = null, $value_bool = null, $other = null, $class = null) {
 
         // 【基础功能】静态插入数据
         $dbh = self::connect(true, $args, array('inserts', $table_sql, $column_set_param, $value_bool, $other, $class));
@@ -1888,8 +1875,7 @@ class core
      * @param string $class
      * @return int
      */
-    public static function updates($table_sql = null, $set_param = null, $where_bool = null, $other = null, $class = null)
-    {
+    public static function updates($table_sql = null, $set_param = null, $where_bool = null, $other = null, $class = null) {
 
         // 【基础功能】静态修改数据
         $dbh = self::connect(true, $args, array('updates', $table_sql, $set_param, $where_bool, $other, $class));
@@ -1949,8 +1935,7 @@ class core
      * @param string $class
      * @return int
      */
-    public static function deletes($field_sql = null, $table_param = null, $where_bool = null, $other = null, $class = null)
-    {
+    public static function deletes($field_sql = null, $table_param = null, $where_bool = null, $other = null, $class = null) {
 
         // 【基础功能】静态删除数据
         $dbh = self::connect(true, $args, array('deletes', $field_sql, $table_param, $where_bool, $other, $class));
@@ -2010,8 +1995,7 @@ class core
      * @param string $class
      * @return int
      */
-    public static function replaces($table_sql = null, $column_set_param = null, $value_bool = null, $other = null, $class = null)
-    {
+    public static function replaces($table_sql = null, $column_set_param = null, $value_bool = null, $other = null, $class = null) {
 
         // 【基础功能】静态更新数据
         $dbh = self::connect(true, $args, array('replaces', $table_sql, $column_set_param, $value_bool, $other, $class));
@@ -2067,8 +2051,7 @@ class core
      * @param mixed $row
      * @return mixed
      */
-    public function struct($row = null)
-    {
+    public function struct($row = null) {
 
         // 验证方法名
         if (!isset($this) || !($this instanceof self)) {
@@ -2088,7 +2071,7 @@ class core
                 if ($row === $i) {
                     return $value;
                 }
-                $i ++;
+                $i++;
             }
             return;
         } elseif (is_string($row)) {
@@ -2115,7 +2098,7 @@ class core
                             $this->$key2 = $value;
                             break;
                         }
-                        $i ++;
+                        $i++;
                     }
                 } elseif ($key !== '') {
                     $this->$key = $value;
@@ -2134,8 +2117,7 @@ class core
      * @param mixed $primary_index
      * @return bool
      */
-    public function select($tablename = '', $primary_index = 0)
-    {
+    public function select($tablename = '', $primary_index = 0) {
 
         // 验证方法名
         if (!isset($this) || !($this instanceof self)) {
@@ -2158,7 +2140,7 @@ class core
         if (is_int($primary_index) && $primary_index >= 0 && $primary_index < count($fieldvars)) {
             $field_index = 0;
             foreach ($fieldvars as $primary_name => $primary_value) {
-                if ($primary_index === $field_index ++) {
+                if ($primary_index === $field_index++) {
                     break;
                 }
             }
@@ -2216,8 +2198,7 @@ class core
      * @param mixed $primary_index
      * @return bool
      */
-    public function insert($tablename = '', $primary_index = 0)
-    {
+    public function insert($tablename = '', $primary_index = 0) {
 
         // 验证方法名
         if (!isset($this) || !($this instanceof self)) {
@@ -2240,7 +2221,7 @@ class core
         if (is_int($primary_index) && $primary_index >= 0 && $primary_index < count($fieldvars)) {
             $field_index = 0;
             foreach ($fieldvars as $primary_name => $primary_value) {
-                if ($primary_index === $field_index ++) {
+                if ($primary_index === $field_index++) {
                     unset($fieldvars [$primary_name]);
                     break;
                 }
@@ -2290,8 +2271,7 @@ class core
      * @param mixed $primary_index
      * @return bool
      */
-    public function update($tablename = '', $primary_index = 0)
-    {
+    public function update($tablename = '', $primary_index = 0) {
 
         // 验证方法名
         if (!isset($this) || !($this instanceof self)) {
@@ -2314,7 +2294,7 @@ class core
         if (is_int($primary_index) && $primary_index >= 0 && $primary_index < count($fieldvars)) {
             $field_index = 0;
             foreach ($fieldvars as $primary_name => $primary_value) {
-                if ($primary_index === $field_index ++) {
+                if ($primary_index === $field_index++) {
                     unset($fieldvars [$primary_name]);
                     break;
                 }
@@ -2370,8 +2350,7 @@ class core
      * @param mixed $primary_index
      * @return bool
      */
-    public function delete($tablename = '', $primary_index = 0)
-    {
+    public function delete($tablename = '', $primary_index = 0) {
 
         // 验证方法名
         if (!isset($this) || !($this instanceof self)) {
@@ -2394,7 +2373,7 @@ class core
         if (is_int($primary_index) && $primary_index >= 0 && $primary_index < count($fieldvars)) {
             $field_index = 0;
             foreach ($fieldvars as $primary_name => $primary_value) {
-                if ($primary_index === $field_index ++) {
+                if ($primary_index === $field_index++) {
                     break;
                 }
             }
@@ -2440,8 +2419,7 @@ class core
      * @param mixed $primary_index
      * @return bool
      */
-    public function replace($tablename = '', $primary_index = 0)
-    {
+    public function replace($tablename = '', $primary_index = 0) {
 
         // 验证方法名
         if (!isset($this) || !($this instanceof self)) {
@@ -2464,7 +2442,7 @@ class core
         if (is_int($primary_index) && $primary_index >= 0 && $primary_index < count($fieldvars)) {
             $field_index = 0;
             foreach ($fieldvars as $primary_name => $primary_value) {
-                if ($primary_index === $field_index ++) {
+                if ($primary_index === $field_index++) {
                     break;
                 }
             }
@@ -2510,8 +2488,7 @@ class core
      * @param string $filename
      * @return array
      */
-    private static function _init_file($filename)
-    {
+    private static function _init_file($filename) {
 
         if (strtolower(strrchr($filename, '.')) === '.php') {
             $filepath = self::_path_config($filename);
@@ -2532,8 +2509,7 @@ class core
      * @param string $varname
      * @return array
      */
-    private static function _init_env($varname)
-    {
+    private static function _init_env($varname) {
 
         //导入配置文件
         static $static_htaccess;
@@ -2573,8 +2549,7 @@ class core
      *
      * @param array $array
      */
-    private static function _init_extension($array)
-    {
+    private static function _init_extension($array) {
 
         // 数组参数处理
         $config = array(
@@ -2634,8 +2609,7 @@ class core
      *
      * @param array $array
      */
-    private static function _init_autoload($array)
-    {
+    private static function _init_autoload($array) {
 
         // 数组参数处理
         $config = array(
@@ -2735,8 +2709,7 @@ class core
      *
      * @param array $array
      */
-    private static function _stub_autoload($array)
-    {
+    private static function _stub_autoload($array) {
 
         static $static_config;
         if ($static_config === null || $array !== array()) {
@@ -2750,8 +2723,7 @@ class core
      *
      * @param array $array
      */
-    private static function _main_hide($array)
-    {
+    private static function _main_hide($array) {
 
         $hide_info = isset($array ['hide_info']) ? $array ['hide_info'] : '';
         $hide_info_cli = isset($array ['hide_info_cli']) ? $array ['hide_info_cli'] : $hide_info;
@@ -2787,8 +2759,7 @@ class core
      * @param array $return_array
      * @return mixed
      */
-    private static function _main_framework($array, $return_array)
-    {
+    private static function _main_framework($array, $return_array) {
         // 1. 设置默认值、替换内置宏
         list ($classname_static, $debug_backtrace_file) = self::_main_framework_first();
         if (empty($array ['framework_require'])) {
@@ -3210,8 +3181,7 @@ class core
      * @param bool $bool
      * @return array
      */
-    private static function _main_framework_first($bool = null)
-    {
+    private static function _main_framework_first($bool = null) {
         static $class = null;
         static $file = null;
         if ($class === null) {
@@ -3237,8 +3207,7 @@ class core
      * @param mixed $prefix
      * @return array
      */
-    private static function _main_framework_resolve($string, $value_array, $flag, $prefix = null)
-    {
+    private static function _main_framework_resolve($string, $value_array, $flag, $prefix = null) {
         $result_array = array();
         $length = strlen($string);
         $last_pos = 0;
@@ -3418,8 +3387,7 @@ class core
      * @param bool $strict
      * @return array
      */
-    private static function _main_framework_replace($string, $value_array, $strict)
-    {
+    private static function _main_framework_replace($string, $value_array, $strict) {
         $result = '';
         $length = strlen($string);
         $last_pos = 0;
@@ -3545,8 +3513,7 @@ class core
      * @param string $filename
      * @return string
      */
-    private static function _path_extension($filename)
-    {
+    private static function _path_extension($filename) {
 
         $filepath = self::_path_file($filename);
         $extension_path = isset(self::$config ['extension_path']) ? self::$config ['extension_path'] : null;
@@ -3568,8 +3535,7 @@ class core
      * @param string $filename
      * @return string
      */
-    private static function _path_template($filename)
-    {
+    private static function _path_template($filename) {
 
         $filepath = self::_path_file($filename);
         $template_path = isset(self::$config ['template_path']) ? self::$config ['template_path'] : null;
@@ -3591,8 +3557,7 @@ class core
      * @param string $filename
      * @return string
      */
-    private static function _path_config($filename)
-    {
+    private static function _path_config($filename) {
 
         $filepath = self::_path_file($filename);
         $config_path = isset(self::$config ['config_path']) ? self::$config ['config_path'] : null;
@@ -3614,8 +3579,7 @@ class core
      * @param string $filename
      * @return string
      */
-    private static function _path_file($filename)
-    {
+    private static function _path_file($filename) {
 
         $first = strlen($filename) > 0 ? $filename[0] : '';
         if ($first === '@') {
@@ -3633,8 +3597,7 @@ class core
      *
      * @param array $global
      */
-    private static function _view_variable($global = null)
-    {
+    private static function _view_variable($global = null) {
 
         $variable = &self::$view;
         if (!is_array($variable)) {