xuzhitong2018 发表于 2018-3-16 08:02:56

求助,使用migrate类迁移数据库提示Message: Undefined property: Migrate::$auth

CI version 3.0.3
新搭一台服务器环境,web程序部署完成,准备迁移数据库,按照官方教程在控制器文件夹添加一个迁移控制器,代码如下:
<?php

class Migrate extends CI_Controller
{

    public function index()
    {
      $this->load->library('migration');

      if ($this->migration->current() === FALSE)
      {
            show_error($this->migration->error_string());
      }
    }

}

输入url:http://localhost/migrate/,页面提示错误:
======================>up
A PHP Error was encountered
Severity: Notice

Message: Undefined property: Migrate::$auth

Filename: libraries/Migration.php

Line Number: 443

An uncaught Exception was encountered
Type: Error

Message: Call to a member function table_exists() on null

Filename: /home/xzt/lianchong/Web/MonitorPHP/apps/libraries/Base_Migration.php

Line Number: 92

查看了下系统文件夹下的代码 libraries/Migration.php,类定义中找不到auth这个定义,请教下这个auth属性是哪里定义的?谢谢

Michael锐生 发表于 2018-3-16 14:32:20

你这报错是自定义了 Base_Migration.php 里面的错误,不是用的系统 Migration.php
页: [1]
查看完整版本: 求助,使用migrate类迁移数据库提示Message: Undefined property: Migrate::$auth