Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto binding Artisan commands in packages #65

Closed
onigoetz opened this issue Jan 16, 2013 · 2 comments
Closed

Auto binding Artisan commands in packages #65

onigoetz opened this issue Jan 16, 2013 · 2 comments

Comments

@onigoetz
Copy link
Contributor

Hi,

I created a composer package some time ago, with some symfony command line commands.

Now that i'm implementing L4 on a project that uses this package I wanted to be able to reuse these commands inside Artisan.

so I have two questions :

  • How to auto-bind commands to Artisan with packages ?, a specific file ?, an autoloading file in composer ?
  • Is it possible to use "pure" symfony commands inside Artisan or do I have to wrap my command in a Laravel compatible command ?

Thanks in advance

@jasonlewis
Copy link
Contributor

You need to resolve your command (if it's bound to the application container) or add it. This should be done in app/start/artisan.php.

https://github.com/laravel/framework/blob/master/src/Illuminate/Console/Application.php#L52

I'm going to say yes it's possible to use a raw Symfony command with Artisan. Extending Laravel's Illuminate\Console\Command just gives you access to easier helpers. Have a crack!

@taylorotwell
Copy link
Member

I believe you should be able to use "pure" Symfony commands, yes. Also, you may use the commands method from a service provider to register commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants