我已經辭職自己升級到Laravel 4.1.x(composer.json
類型的安裝,對我來說,所以我更新了我的控制器別名,如安東尼奧卡洛斯里貝羅提到),但有現在不同的問題:Laravel - 類filter.parser不存在
編輯:最後我做一個全新的安裝作爲亞當河克隆後新Laravel回購後,和現在的工作(複製什麼小公共文件,我不得不結束後)。
[2013-10-11 21:25:58] production.ERROR: exception 'ErrorException' with message 'Attempt to assign property of non-object' in /path/to/laravel/app/controllers/HomeController.php:22
Stack trace:
#0 /path/to/laravel/app/controllers/HomeController.php(22): Illuminate\Exception\Handler->handleError(2, 'Attempt to assi...', '/path/to/laravel...', 22, Array)
#1 [internal function]: HomeController->Index()
#2 /path/to/laravel/bootstrap/compiled.php(5574): call_user_func_array(Array, Array)
#3 /path/to/laravel/bootstrap/compiled.php(5562): Illuminate\Routing\ControllerDispatcher->call(Object(HomeController), Object(Illuminate\Routing\Route), 'Index')
#4 /path/to/laravel/bootstrap/compiled.php(4901): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'HomeController', 'Index')
#5 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#6 /path/to/laravel/bootstrap/compiled.php(5155): call_user_func_array(Object(Closure), Array)
#7 /path/to/laravel/bootstrap/compiled.php(4925): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#8 /path/to/laravel/bootstrap/compiled.php(4914): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#9 /path/to/laravel/bootstrap/compiled.php(548): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#10 /path/to/laravel/bootstrap/compiled.php(532): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#11 /path/to/laravel/public/index.php(49): Illuminate\Foundation\Application->run()
#12 {main} [] []
,其中的代碼是:
<?php
class HomeController extends BaseController {
/*
|--------------------------------------------------------------------------
| Default Home Controller
|--------------------------------------------------------------------------
|
| You may wish to use controllers instead of, or in addition to, Closure
| based routes. That's great! Here is an example controller method to
| get you started. To route to this controller, just add the route:
|
| Route::get('/', '[email protected]');
|
*/
protected $layout = 'layouts.master';
public function Index()
{
$this->layout->content = View::make('home'); //This is line 22
}
}
我BaseController
:
<?php
class BaseController extends Controller {
/**
* Setup the layout used by the controller.
*
* @return void
*/
protected function setupLayout()
{
if (! is_null($this->layout))
{
$this->layout = View::make($this->layout);
}
}
}
我routes.php
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
Route::get('/', '[email protected]');
老問題:
我一直在使用WAMP上的Laravel 4.0.x,並打算將我的站點部署到我的LEMP堆棧。不過,我一直遇到這樣的錯誤:
[2013-10-09 01:20:00] log.ERROR: exception 'ReflectionException' with message 'Class filter.parser does not exist' in /path/to/laravel/bootstrap/compiled.php:165
Stack trace:
#0 /path/to/laravel/bootstrap/compiled.php(165): ReflectionClass->__construct('filter.parser')
#1 /path/to/laravel/bootstrap/compiled.php(142): Illuminate\Container\Container->build('filter.parser', Array)
#2 /path/to/laravel/bootstrap/compiled.php(442): Illuminate\Container\Container->make('filter.parser', Array)
#3 /path/to/laravel/bootstrap/compiled.php(233): Illuminate\Foundation\Application->make('filter.parser')
#4 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Routing/Controllers/Controller.php(104): Illuminate\Container\Container->offsetGet('filter.parser')
#5 /path/to/laravel/bootstrap/compiled.php(4755): Illuminate\Routing\Controllers\Controller->callAction(Object(Illuminate\Foundation\Application), Object(Illuminate\Routing\Router), 'Index', Array)
#6 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#7 /path/to/laravel/bootstrap/compiled.php(7824): call_user_func_array(Object(Closure), Array)
#8 /path/to/laravel/bootstrap/compiled.php(7811): Illuminate\Routing\Route->callCallable()
#9 /path/to/laravel/bootstrap/compiled.php(4766): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#10 /path/to/laravel/bootstrap/compiled.php(481): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#11 /path/to/laravel/bootstrap/compiled.php(470): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#12 /path/to/laravel/public/index.php(49): Illuminate\Foundation\Application->run()
#13 {main} [] []
當我刪除我的路線基本上是
Route::get('/', '[email protected]');
錯誤消息變爲未卻發現。不知道這是否意味着什麼,但我認爲錯誤信息與路由有關。
我能想到的是作曲家包的唯一的區別(我甚至嘗試直接複製的vendor
文件夾)或者PHP版本(5.4.12
上WAMP,5.4.19
上LEMP)。
我嘗試了Google類的名稱,但我只發現了一個封閉的github問題的結果。任何人都可以幫我找出有什麼問題嗎?
僅供參考,我使用Laravel的版本在GitHub上相同的主分支 - https://github.com/laravel/laravel
我的更新錯誤刪除我要做出/path/to/laravel/bootstrap/compiled.php
[2013-10-11 20:12:38] log.ERROR: exception 'ReflectionException' with message 'Class filter.parser does not exist' in /path/to/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php:296
Stack trace:
#0 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(296): ReflectionClass->__construct('filter.parser')
#1 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(238): Illuminate\Container\Container->build('filter.parser', Array)
#2 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(425): Illuminate\Container\Container->make('filter.parser', Array)
#3 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(468): Illuminate\Foundation\Application->make('filter.parser')
#4 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Routing/Controllers/Controller.php(104): Illuminate\Container\Container->offsetGet('filter.parser')
#5 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php(985): Illuminate\Routing\Controllers\Controller->callAction(Object(Illuminate\Foundation\Application), Object(Illuminate\Routing\Router), 'Index', Array)
#6 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#7 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Routing/Route.php(80): call_user_func_array(Object(Closure), Array)
#8 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Routing/Route.php(47): Illuminate\Routing\Route->callCallable()
#9 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1016): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#10 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(522): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#11 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(497): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#12 /path/to/laravel/public/index.php(49): Illuminate\Foundation\Application->run()
#13 {main} [] []
表觀顯着的變化後,我Laravel安裝:
結束時app/start/global.php
-require app_path().'/filters.php';
+require app_path().'/filters.php';
+
+ClassLoader::register(new ClassLoader(array(
+ app_path().'/libraries',
+)));
+
+App::bind('html', function() {
+ return new HTML;
+});
刪除你的文件/path/to/laravel/bootstrap/compiled.php,再試一次,並與替換當前的錯誤信息新的,請。 –
@AntonioCarlosRibeiro完成,該文件的目的只是爲了充當緩存? – xiankai
@xiankai是的,它只是用作緩存 –