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

忽略掉警告即可

相关推荐

  1. 升级php8

    2024-03-14 05:50:06       40 阅读
  2. [MTK]8 ADB执行ota升级

    2024-03-14 05:50:06       60 阅读
  3. mysql8升级测试

    2024-03-14 05:50:06       48 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-14 05:50:06       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-14 05:50:06       100 阅读
  3. 在Django里面运行非项目文件

    2024-03-14 05:50:06       82 阅读
  4. Python语言-面向对象

    2024-03-14 05:50:06       91 阅读

热门阅读

  1. 动态规划--砝码称重

    2024-03-14 05:50:06       36 阅读
  2. 力扣70. 爬楼梯(三种解法)

    2024-03-14 05:50:06       40 阅读
  3. 设计模式--享元模式(Flyweight Pattern)

    2024-03-14 05:50:06       41 阅读
  4. ChatGPT-4 VS 文心一言4.0

    2024-03-14 05:50:06       42 阅读
  5. STM32/GD32——CAN协议

    2024-03-14 05:50:06       41 阅读
  6. 安卓基础面试题

    2024-03-14 05:50:06       35 阅读