我决定在网站的数据库中使用变形关系,我需要租用laravel 4.1版本。 (现在我有4.0.11) 但我自己无法做到这一点: 1)首先我按照下面的说明(官方文件) http://laravel.com/docs/5.0/upgrade#upgrade-4.1(git的一半引用已经死了) 但是没有去,因为它说Application_的__construct应该得到Request对象(而不是字符串)
2)我在这里创建了另一种创建更新命令的方法http://laravel-tricks.com/tricks/artisan-command-to-upgrade-to-41
输入“php artisan upgrade 4.1”后(没有选项,它注意到4.0是我的最后一个版本)而且似乎更新已成功完成。但它指出了同样的问题:
PHP Catchable fatal error: Argument 1 passed to Illuminate\Foundation\Application::__construct() must be an instance of Illuminate\Http\Request, string given, called in /home/roman/cblog/bootstrap/app.php on line 14 and defined in /home/roman/cblog/vendor/laravel/framework/src/Illuminate/Foundation/Application.php on line 99
我确实认识到问题是由于在app.php中创建Application istance引起的异常:
$app = new Illuminate\Foundation\Application(realpath(__DIR__.'/../'));
收到String请求的字符串。如果我们在Application.php中看到:
public function __construct(Request $request = null)
{
$this['request'] = $this->createRequest($request);
$this->registerBaseServiceProviders();
}
此版本仍然陈旧:
/**
* The Laravel framework version.
* @var string
*/
const VERSION = '4.0.11';
也许有人可以给我一些暗示我在升级时遗漏的内容。或者也许我最好升级到更新的版本?