SCIF / propel-laravel

Propel 2 integration for Laravel framework
MIT License
4 stars 1 forks source link

php artisan route:list command doesn't work #3

Closed nstojanovickg closed 9 years ago

nstojanovickg commented 9 years ago

When I run 'php artisan route:list' command it show an error 'Driver [propel] not supported.'. I notice in RuntimeServiceProvider your comment: 'skip auth driver adding if running as CLI to avoid auth model not found'. But is this necessary? When I remove '! \App::runningInConsole()' from if condition, route:list command pass correctly.

SCIF commented 9 years ago

I really don't know why, but when i did that — it made sense. Will inspect it again. May be laravel implementation modified and some things works ok which brakes everything ealier.

SCIF commented 9 years ago

Remembered! It's chicken and egg dilema. You need to run model:build to create User model but you can't because task can't start because User model not found and Auth provider can't be registered. WIll find workaround, if currently it not solved truly.

nstojanovickg commented 9 years ago

Great, thanks a lot.

nstojanovickg commented 9 years ago

I'm sorry, but now works only for command line, and for the website does not. ErrorException in ArgvInput.php line 57: Undefined index: argv

nstojanovickg commented 9 years ago

I hope you do not mind if I suggest: if(\App::runningInConsole()){ $input = new ArgvInput(); if ('propel:model:build' == $input->getFirstArgument()){ return; } }

    // skip auth driver adding if running as CLI to avoid auth model not found
    if ('propel' === \Config::get('auth.driver')) {

... } This is my temporary solution till you publish correct one.

SCIF commented 9 years ago

Fixed again :) @nstojanovickg test it please. Thanks for your reports!

SCIF commented 9 years ago

I didn't detect that issue, because my own installation works ok with previous version of fix. It's because i use hhvm and it creates empty array in $_SERVER['argv'] :open_mouth:

nstojanovickg commented 9 years ago

No problem, now it's all right. Thanks a lot.