当前位置: 首页 > news >正文

安塔利斯升级php8

1、includes/classes/class.Database.php 255行

multi_query方法加返回类型  :bool

query方法加返回类型:: mysqli_result|bool

2、includes/classes/class.Session.php on line 91

Optional parameter $planetID declared before required parameter $dpath is implicitly treated as a required parameter

$planetID = 0 这个参数必须放在参数列表的最后

3、includes/classes/Language.class.php:150 

During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Language::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice 

还是需要增加函数的返回类型

/** ArrayAccess Functions **/

    public function offsetSet($offset, $value) : void {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    public function offsetExists($offset) : bool {
        return isset($this->container[$offset]);
    }

    public function offsetUnset($offset) : void{
        unset($this->container[$offset]);
    }

    public function offsetGet($offset) : string|array {

        error_log(json_encode($this->container[$offset]));
        
        return isset($this->container[$offset]) ? $this->container[$offset] : $offset;
    }

替换原有的4个方法

4、includes/classes/PlayerUtil.class.php on line  88

Optional parameter $UserLang declared before required parameter $planetNames is implicitly treated as a required parameter in 

还是又默认值得参数必须放在最后

5、includes/classes/class.theme.php

 Creation of dynamic property Theme::$skininfo is deprecated

不能在类得方法中,动态定义参数,必须在类得属性中先声明属性,方法中才能赋值

声明以下属性

public $skininfo; // 预先声明属性
public $skin; // 预先声明属性
public $customtpls;

6、includes/libs/Smarty/   整个替换smarty包

7、includes/classes/class.template.php

Undefined constant Smarty::PHP_REMOVE

注释掉这行

8、includes/libs/Smarty/sysplugins/smarty_internal_compile_private_modifier.php 112

注释掉出错代码

9、Undefined array key "page"  

删掉头文件中 id = page 的代码

10、includes/classes/class.PlanetRessUpdate.php  33

 Creation of dynamic property ResourceUpdate::$Builded is deprecated

还是动态属性问题,加入需要的属性即可

public $Builded;
    public $Build;
    public $Tech;
    public $USER;
    public $PLANET;
    public $GLOBALS;
    public $TIME;
    public $CONF;
    public $ProductionTime;
    public $HASH;

11、includes/pages/game/class.AbstractPage.php  132

 Trying to access array offset on value of type null

忽略掉警告即可

http://www.lryc.cn/news/317408.html

相关文章:

  • Clickhouse MergeTree 原理(一)
  • 【C语言】字符串函数上
  • Java集合基础知识总结(绝对经典)
  • Linux:导出环境变量命令export
  • 案例--某站视频爬取
  • 清华把大模型用于城市规划,回龙观和大红门地区成研究对象
  • Vue+SpringBoot打造创意工坊双创管理系统
  • Web框架开发-Django简介
  • VB播放器(动态服务器获取歌词)-183-(代码+说明)
  • java-可变参数
  • 嵌入式学习day37 数据结构
  • 嵌入式学习39-程序创建数据库及查找
  • 科研三维模型高精度三维扫描服务3d逆向测绘建模工业产品抄数设计
  • 【LeetCode热题100】141. 环形链表(链表)
  • express+mysql+vue,从零搭建一个商城管理系统11--使用Sequelize
  • 霹雳学习笔记——6.1 ResNet网络结构、BN以及迁移学习
  • Gitee的注册和代码提交(附有下载链接)
  • 机器学习是什么?
  • 复盘-PPT
  • springcloud gateway网关动态配置限流
  • 在Linux/Ubuntu/Debian中使用windows应用程序/软件
  • idea Springboot 组卷管理系统LayUI框架开发mysql数据库web结构java编程计算机网页
  • wordpress主题批量修改历史文章标题,文章内容
  • Unity2019.2.x 导出apk 安装到安卓Android12+及以上的系统版本 安装出现-108 安装包似乎无效的解决办法
  • 创建SpringCloudGateWay
  • 鸿蒙Harmony应用开发—ArkTS声明式开发(基础手势:StepperItem)
  • 游戏盾SDK是如何实现智能加速的?
  • 西井科技参与IATA全球货运大会 以AI绿动能引领智慧空港新未来
  • RPC通信原理(二)
  • Redis 淘汰策略