安塔利斯升级php8

news/2024/10/29 7:25:28/

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.ppmy.cn/news/1387476.html

相关文章

2024-03-18 作业

作业要求: 1> 将广播发送端和接收端各实现一遍 2> 将组播发送端和接收端各实现一遍 3> 将流式域套接字的服务器端和客户端各实现一遍 1:将广播发送端和接收端各实现一遍 运行代码: 服务端: 客户端: 运行截…

vue-router(v4.0) 基础1

说明 Vue Router 是 Vue.js 的官方路由。它与 Vue.js 核心深度集成,让用 Vue.js 构建单页应用变得轻而易举。功能包括: 嵌套路由映射 动态路由选择 模块化、基于组件的路由配置 路由参数、查询、通配符 展示由 Vue.js 的过渡系统提供的过渡效果 细致…

python 通过 ast 替换代码

导航目录 目录结构要替换的代码替换代码的逻辑新建类,继承 ast运行新建的类最最重要的一步replace_code.py 完整代码 main.py 里面的代码执行结果 最后 目录结构 . ├── hello │ ├── __init__.py │ └── utils.py ├── main.py ├── replace_code…

“灯塔”——一个让人爱不释手的前端监测工具

引言 "灯塔"(fee)作为一个前端监控系统,通常具备捕获浏览器端错误、性能监控、用户行为跟踪等功能。它的主要目的是帮助开发者了解他们的网站或应用在用户端的表现,以及时发现并解决问题。下面是关于这种系统的一些关键…

红与黑(c++题解)

题目描述 有一间长方形的房子,地上铺了红色、黑色两种颜色的正方形瓷砖。你站在其中一块黑色的瓷砖上,只能向相邻的黑色瓷砖移动。请写一个程序,计算你总共能够到达多少块黑色的瓷砖。 输入格式 包括多个数据集合。每个数据集合的第一行是…

JDBC连接数据库小白级教程

虽然MyBatis等ORM(Object-Relational Mapping)框架在Java开发中变得非常流行,并且简化了数据库操作的复杂性,但学习JDBC仍然具有一定的重要性: 基础理解:学习JDBC可以帮助你深入理解数据库连接和操作的底层…

并发编程3大基本特性(有序性、可见性、原子性)

并发编程3大基本特性 一、并发编程的基本特性有3点(这3点需人为来保障)二、思考有序性(算力层优化导致的无序)可见性(存储层优化导致的不可见)原子性(复合操作导致的不原子) 三、并发…

springboot 动漫周边商城的设计与实现

摘 要 二十一世纪我们的社会进入了信息时代,信息管理系统的建立,大大提高了人们信息化水平。传统的管理方式对时间、地点的限制太多,而在线管理系统刚好能满足这些需求,在线管理系统突破了传统管理方式的局限性。于是本文针对这一…