安塔利斯升级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

忽略掉警告即可

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值