iron-io / laraworker

Easily add IronWorker to Laravel Applications
BSD 2-Clause "Simplified" License
45 stars 8 forks source link

Composer error with Laravel 4.2 #9

Closed kevinduellman closed 3 years ago

kevinduellman commented 9 years ago

When following instructions for installation, my local Laravel app throws an error saying file_get_contents(composer.json) file ../iron-io/laraworker/LaraWorker.php not found. The file does in fact exist, but the error prevents routes from being executed.

The only way I have found to resolve the issue is commenting out the line:

$vendorDir . '/iron-io/laraworker/LaraWorker.php',

in autoload_files.php, which is obviously not ideal.

Since there is not tag, I am installing via composer using "dev-master".

gg67 commented 9 years ago

Getting the same issue in Laravel 5.1

Update:

Seems to be a php version thing. Upgrading to php 5.6 seems to fix it.

mjmgooch commented 8 years ago

Getting the same issue on Laravel 4.2

Perhaps an alternative to commenting out the line @kduellman suggests is to open LaraWorker.php and altering the get_laravel_version() function to simply return your version of laravel:

function get_laravel_version()
{
    //$composer_content = file_get_contents('composer.json');
    //$content_arr = json_decode($composer_content, true);
    //$version_arr = $content_arr["require"]["laravel/framework"];
    return '4.2';
}

Not ideal but its still included in your autoload this way,

kevinduellman commented 8 years ago

@mjmgooch has better solution, don't have to keep going back to comment out that line on every composer update...

@gg67 on Laravel 4.2, php 5.6, issue has not gone away for me...