проблемы с миграцией в cacke 1.3 - PullRequest
0 голосов
/ 06 июля 2018

Я пытаюсь перенести старое приложение CackePHP (v1.3) с одного хоста на другой. Я скопировал файлы 1: 1 и базу данных, также экспортируя через phpmyadmin.

Старый хост был старым хостом, версия базы данных (MySQL 5.1.33), не проверяла версию PHP, но была ниже 5.6.

После копирования файлов на новый хост кажется, что функция входа в систему перестала работать, появляется экран входа в систему, но данные входа не создаются в сеансе.

Я пытался изменить версию PHP с 5.6 до 5.4, а затем 5.2, но не повезло, я прочитал некоторую информацию в Интернете, чтобы очистить кэш и т. Д., Но не повезло.

Приложение не мое, и я никогда не занимался CackePHP раньше - так что любые советы о том, где искать дальше и какие файлы добавить сюда, будут оценены.

Из того, что я мог сказать до сих пор, я включил здесь код app_conteoller.php.

<?php
/**
 * Short description for file.
 *
 * This file is application-wide controller file. You can put all
 * application-wide controller-related methods here.
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       cake
 * @subpackage    cake.app
 * @since         CakePHP(tm) v 0.2.9
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */

/**
 * Short description for class.
 *
 * Add your application-wide methods in the class below, your controllers
 * will inherit them.
 *
 * @package       cake
 * @subpackage    cake.app
 */
class AppController extends Controller {

var $components = array('Acl','Auth','Session');
var $helpers = array('Form', 'Html', 'Javascript', 'Time','Session');


    function beforeFilter() {
        parent::beforeFilter();
        $this->disableCache();

      var_dump($this->Auth);

        $this->set('pageTitle','Transakcje');
        $this->Auth->authorize = 'crud';
        $this->Auth->allowedActions = array(
         'send',
         'register',
         'login',
         'logout',
         'thanks',
         'forgottenpassword',
         'lol',
         'view'
      );
        $this->Auth->redirect('/users/login');
        $this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'login');
        $this->Auth->loginAction = array('admin' => false, 'controller' => 'users', 'action' => 'login');
        $this->Auth->authError = "Brak dostępu do tej części witryny.";

      $this->Auth->actionMap['admin_display'] = 'update';
        $this->Auth->actionMap['admin_index'] = 'update';
        $this->Auth->actionMap['admin_edit'] = 'update';
        $this->Auth->actionMap['admin_export'] = 'update';
        $this->Auth->actionMap['addgroup'] = 'upddate';
        $this->Auth->actionMap['admin_activate'] = 'update';
        $this->Auth->actionMap['admin_email'] = 'update';
        $this->Auth->actionMap['admin_delete'] = 'delete';
        $this->Auth->actionMap['index'] = 'read';
        $this->Auth->actionMap['contact'] = 'read';
        $this->Auth->actionMap['changepassword'] = 'read';
        $this->set('username', $this->Auth->user('username'));

        if ($this->Auth->user('group_id') == 3) {
            $this->set('is_admin',true);
        }
        else {
            $this->set('is_admin',false);
        }
        define('HEADERS','From: webmaster@example.com' . "\r\n" .
            'Reply-To: webmaster@example.com' . "\r\n" .
            'X-Mailer: PHP/' . phpversion());

    }
}
?>

Я удалил объект Auth после попытки входа в систему и, насколько я могу судить, информации для входа в систему не существует

object(AuthComponent)#38 (26) {
  ["_loggedIn"]=>
  bool(false)
  ["components"]=>
  array(2) {
    [0]=>
    string(7) "Session"
    [1]=>
    string(14) "RequestHandler"
  }
  ["authenticate"]=>
  NULL
  ["authorize"]=>
  bool(false)
  ["ajaxLogin"]=>
  NULL
  ["flashElement"]=>
  string(7) "default"
  ["userModel"]=>
  string(4) "User"
  ["userScope"]=>
  array(0) {
  }
  ["fields"]=>
  array(2) {
    ["username"]=>
    string(8) "username"
    ["password"]=>
    string(8) "password"
  }
  ["sessionKey"]=>
  NULL
  ["actionPath"]=>
  NULL
  ["loginAction"]=>
  NULL
  ["loginRedirect"]=>
  NULL
  ["logoutRedirect"]=>
  NULL
  ["object"]=>
  NULL
  ["loginError"]=>
  NULL
  ["authError"]=>
  NULL
  ["autoRedirect"]=>
  bool(true)
  ["allowedActions"]=>
  array(0) {
  }
  ["actionMap"]=>
  array(18) {
    ["index"]=>
    string(4) "read"
    ["add"]=>
    string(6) "create"
    ["edit"]=>
    string(6) "update"
    ["view"]=>
    string(4) "read"
    ["remove"]=>
    string(6) "delete"
    ["create"]=>
    string(6) "create"
    ["read"]=>
    string(4) "read"
    ["update"]=>
    string(6) "update"
    ["delete"]=>
    string(6) "delete"
    ["admin_index"]=>
    string(4) "read"
    ["admin_add"]=>
    string(6) "create"
    ["admin_edit"]=>
    string(6) "update"
    ["admin_view"]=>
    string(4) "read"
    ["admin_remove"]=>
    string(6) "delete"
    ["admin_create"]=>
    string(6) "create"
    ["admin_read"]=>
    string(4) "read"
    ["admin_update"]=>
    string(6) "update"
    ["admin_delete"]=>
    string(6) "delete"
  }
  ["data"]=>
  array(0) {
  }
  ["params"]=>
  array(9) {
    ["controller"]=>
    string(5) "users"
    ["action"]=>
    &string(10) "admin_view"
    ["named"]=>
    array(0) {
    }
    ["pass"]=>
    array(1) {
      [0]=>
      string(2) "88"
    }
    ["prefix"]=>
    string(5) "admin"
    ["admin"]=>
    bool(true)
    ["plugin"]=>
    NULL
    ["form"]=>
    array(0) {
    }
    ["url"]=>
    array(1) {
      ["url"]=>
      string(19) "admin/users/view/88"
    }
  }
  ["_methods"]=>
  array(14) {
    [0]=>
    string(9) "admin_add"
    [1]=>
    string(10) "admin_edit"
    [2]=>
    string(12) "admin_delete"
    [3]=>
    string(5) "login"
    [4]=>
    string(6) "logout"
    [5]=>
    string(11) "admin_index"
    [6]=>
    string(10) "admin_view"
    [7]=>
    string(8) "register"
    [8]=>
    string(6) "thanks"
    [9]=>
    string(14) "admin_activate"
    [10]=>
    string(17) "forgottenpassword"
    [11]=>
    string(14) "changepassword"
    [12]=>
    string(7) "contact"
    [13]=>
    string(11) "admin_email"
  }
  ["enabled"]=>
  bool(true)
  ["Session"]=>
  &object(SessionComponent)#39 (15) {
    ["__active"]=>
    bool(true)
    ["__bare"]=>
    int(0)
    ["valid"]=>
    bool(false)
    ["error"]=>
    bool(false)
    ["_userAgent"]=>
    string(32) "926c6c491cb815708e7614617a013876"
    ["path"]=>
    string(1) "/"
    ["lastError"]=>
    NULL
    ["security"]=>
    string(6) "medium"
    ["time"]=>
    int(1530884153)
    ["sessionTime"]=>
    int(1530896153)
    ["watchKeys"]=>
    array(0) {
    }
    ["id"]=>
    NULL
    ["_started"]=>
    bool(false)
    ["host"]=>
    string(30) "i removed the address from here"
    ["enabled"]=>
    bool(true)
  }
  ["RequestHandler"]=>
  &object(RequestHandlerComponent)#40 (10) {
    ["ajaxLayout"]=>
    string(4) "ajax"
    ["enabled"]=>
    bool(true)
    ["__responseTypeSet"]=>
    NULL
    ["params"]=>
    array(0) {
    }
    ["__requestContent"]=>
    array(23) {
      ["javascript"]=>
      string(15) "text/javascript"
      ["js"]=>
      string(15) "text/javascript"
      ["json"]=>
      string(16) "application/json"
      ["css"]=>
      string(8) "text/css"
      ["html"]=>
      array(2) {
        [0]=>
        string(9) "text/html"
        [1]=>
        string(3) "*/*"
      }
      ["text"]=>
      string(10) "text/plain"
      ["txt"]=>
      string(10) "text/plain"
      ["csv"]=>
      array(2) {
        [0]=>
        string(24) "application/vnd.ms-excel"
        [1]=>
        string(10) "text/plain"
      }
      ["form"]=>
      string(33) "application/x-www-form-urlencoded"
      ["file"]=>
      string(19) "multipart/form-data"
      ["xhtml"]=>
      array(3) {
        [0]=>
        string(21) "application/xhtml+xml"
        [1]=>
        string(17) "application/xhtml"
        [2]=>
        string(10) "text/xhtml"
      }
      ["xhtml-mobile"]=>
      string(29) "application/vnd.wap.xhtml+xml"
      ["xml"]=>
      array(2) {
        [0]=>
        string(15) "application/xml"
        [1]=>
        string(8) "text/xml"
      }
      ["rss"]=>
      string(19) "application/rss+xml"
      ["atom"]=>
      string(20) "application/atom+xml"
      ["amf"]=>
      string(17) "application/x-amf"
      ["wap"]=>
      array(3) {
        [0]=>
        string(16) "text/vnd.wap.wml"
        [1]=>
        string(22) "text/vnd.wap.wmlscript"
        [2]=>
        string(18) "image/vnd.wap.wbmp"
      }
      ["wml"]=>
      string(16) "text/vnd.wap.wml"
      ["wmlscript"]=>
      string(22) "text/vnd.wap.wmlscript"
      ["wbmp"]=>
      string(18) "image/vnd.wap.wbmp"
      ["pdf"]=>
      string(15) "application/pdf"
      ["zip"]=>
      string(17) "application/x-zip"
      ["tar"]=>
      string(17) "application/x-tar"
    }
    ["mobileUA"]=>
    array(22) {
      [0]=>
      string(7) "Android"
      [1]=>
      string(7) "AvantGo"
      [2]=>
      string(10) "BlackBerry"
      [3]=>
      string(6) "DoCoMo"
      [4]=>
      string(4) "iPod"
      [5]=>
      string(6) "iPhone"
      [6]=>
      string(4) "J2ME"
      [7]=>
      string(4) "MIDP"
      [8]=>
      string(8) "NetFront"
      [9]=>
      string(5) "Nokia"
      [10]=>
      string(10) "Opera Mini"
      [11]=>
      string(6) "PalmOS"
      [12]=>
      string(10) "PalmSource"
      [13]=>
      string(9) "portalmmm"
      [14]=>
      string(7) "Plucker"
      [15]=>
      string(14) "ReqwirelessWeb"
      [16]=>
      string(12) "SonyEricsson"
      [17]=>
      string(7) "Symbian"
      [18]=>
      string(11) "UP\.Browser"
      [19]=>
      string(5) "webOS"
      [20]=>
      string(10) "Windows CE"
      [21]=>
      string(5) "Xiino"
    }
    ["__acceptTypes"]=>
    array(6) {
      [0]=>
      string(9) "text/html"
      [1]=>
      string(21) "application/xhtml+xml"
      [2]=>
      string(15) "application/xml"
      [3]=>
      string(10) "image/webp"
      [4]=>
      string(10) "image/apng"
      [5]=>
      string(3) "*/*"
    }
    ["__renderType"]=>
    NULL
    ["ext"]=>
    NULL
    ["__typesInitialized"]=>
    bool(false)
  }
}

Я отключил опцию отладки в CackePHP, но она не сильно помогла. Я могу отправить ссылку на приложение через личное сообщение.

...