12

Trying to use a non-Laravel package: https://packagist.org/packages/luceos/on-app

Edited composer.json to require it and did the composer install, update, then dump-autoload -o.

This package requires an initialization: vendor/luceos/on-app/src/OnAppInit.php

Which isn't a class and only has the one method. But it doesn't seem to be loaded when I try to bind it in a service provider. The version for the cloud is initiated in the OnAppInit.php but that isn't being done so the "version isn't supported" error comes up of course.

I know that I am missing a small detail but can't find it. Maybe in the service provider??

composer.json

"require": {
    "luceos/on-app": "~3.5"
"autoload": {
    "psr-4": {
        "Luceos\\OnApp\\": "vendor/luceos/on-app/src/"

config/app.php

'providers' => [
    'App\Providers\OnAppServiceProvider',

app/Providers/OnAppServiceProvider.php

public function register()
    {
            $this->app->bind('onapp', function($app)
                {
                    $hostname = 'http://cloud';
                    $username = 'email@foo.com';
                    $password = 'api_key';
                    $factory = new \OnApp_Factory($hostname, $username, $password);
                    $setting = $factory->factory('Settings')->getList();
                    return $setting;
                });
    }

Looks like its there... vendor/composer/autoload_files.php

$vendorDir . '/luceos/on-app/src/OnAppInit.php',

vendor/composer/autoload_psr4.php

'Luceos\\OnApp\\' => array($vendorDir . '/luceos/on-app/src'),
arikin
  • 188
  • 11
  • 1
    Using tinker I found the reason... The OnApp cloud version isn't supported by the wrapper! Found out the cloud is version 2.3.3 and that is EOL according to OnApp. – arikin Apr 30 '15 at 09:04
  • Anybody know how to use Guzzle with Laravel 5? – arikin Apr 30 '15 at 09:05

1 Answers1

3

Regarding the Guzzle question: Just include it in your composer.json file:

"guzzlehttp/guzzle": "~5.0"

And then just use the normal

$client = new GuzzleHttp\Client();

Just don't forget to to composer dump-autoload

Crembo
  • 5,198
  • 3
  • 26
  • 30
  • Thanks for the guzzle hints. Used guzzle in a non-laravel project before so will have to dig up that client definition json again... – arikin May 01 '15 at 02:27
  • composer require "guzzlehttp/guzzle" "~5.0" composer dump-autoload -o – arikin May 01 '15 at 02:32
  • You don't have to use the -o flag for development – it's useful for production as it's shorthand for --optimize – Crembo May 01 '15 at 08:55