teepluss / laravel-hmvc

HMVC is a tool for making internal request.
76 stars 20 forks source link

[Bug] Error when firing request from artisan command #11

Open ortix opened 9 years ago

ortix commented 9 years ago

I created an artisan command which has to fire some API POST requests. The problem is this block in Hmvc.php

// Masking route to allow testing with PHPUnit.
if ( ! $originalRoute instanceof Route)
{
    $originalRoute = new Route(new \Symfony\Component\HttpFoundation\Request());
}

It throws:

  Missing argument 2 for Illuminate\Routing\Route::__construct(), called in /var/www/animekyun/vendor/teepluss/hmvc/src/Teepluss/Hmvc/Hmvc.php on line 91 and defined 

This is my fire method in the command:

public function fire()
{
    $torrent = $this->argument('torrent');
    $url = $this->argument('url');
    $request = HMVC::post('api/episode', array('filename' => $torrent, 'url' => $url));
    dd($request);
    File::append(base_path() . '/test.txt', basename($torrent) . "\n");
    File::append(base_path() . '/test.txt', $url . "\n\n");
    Log::info('Call from Flexget', ['context' => 'File: ' . $torrent]);
}

For now I have removed that code block

tony-was commented 9 years ago

I am getting the same issue here. is there a fix for this?