rocketeers / rocketeer-slack

Slack notifications for Rocketeer
MIT License
29 stars 8 forks source link

[Develop Branch] Config not loaded from app/config/ and is instead loaded from vendor folder #8

Open arenowebdev opened 10 years ago

arenowebdev commented 10 years ago

Pretty sure it has to do with this line in RocketeerSlack.php:20

<?php
namespace Rocketeer\Plugins\Slack;

use Crummy\Phlack\Phlack;
use Illuminate\Container\Container;
use Rocketeer\Plugins\AbstractNotifier;
use Rocketeer\Plugins\Notifier;

class RocketeerSlack extends AbstractNotifier
{
    /**
     * Setup the plugin
     *
     * @param Container $app
     */
    public function __construct(Container $app)
    {
        parent::__construct($app);

        $this->configurationFolder = __DIR__.'/../config'; // <-- This points to the vendor folder...
    }
Anahkiasen commented 10 years ago

That's normal, that path is used and passed to ServiceProvider::config which then registers the config in the right path.

arenowebdev commented 10 years ago

Hmmm. I'm not seeing that behavior. I have published the slack config to app/config/packages/anahkiasen/rocketeer-slack/config.php and input my username, room and token. When I run I get an error that it was unable to hit http://.slack.{...} which appears to be that it isn't getting the username from that file. The only way I was able to get it to work was to put the same config in the vendor folder...

Will get bash history in a few...

Anahkiasen commented 10 years ago

You need to publish rocketeer/rocketeer-slack. No matter who's the original vendor of a Rocketeer plugin, its configuration is merged under the rocketeer/ vendor, that should work.

arenowebdev commented 10 years ago

When I say publish, I mean I used $ php artisan config:publish anahkiasen/rocketeer-slack as outlined in the README. I will move it after lunch and see if that works and report back.

Anahkiasen commented 10 years ago

Hm yes that's incorrect, it should be rocketeer/rocketeer-slack. Both work because both will technically be registered but the latter is the one Rocketeer will use.

arenowebdev commented 10 years ago

After a composer update to get your recent changes:

$ php artisan config:publish rocketeer/rocketeer-slack

 [InvalidArgumentException]  
 Configuration not found.

config:publish [--path[="..."]] [--force] package
Anahkiasen commented 10 years ago

Hm weird let me check

Anahkiasen commented 10 years ago

Ok no my bad it is the other way around, it should be anahkiasen/rocketeer-slack, but there is a bug in Rocketeer 2 that doesn't read the right entry. What I was talking about was something I tried to do a while back and that ended up backfiring on me. Let me push a fix to R2 and I'll notify you to test again

arenowebdev commented 10 years ago

You are literally the man. :P Thanks so much! By chance will you be at ZendCon so I can buy you a beer?

Anahkiasen commented 10 years ago

I'm afraid not, I'll be at Laracon EU though :d

spiroski commented 10 years ago

Hello. I think I'm having the same issue:

I get:

[Guzzle\Http\Exception\CurlException]
  [curl] 6: Could not resolve host: .slack.com [url] https://.slack.com/services/hook
  s/incoming-webhook?token=

After some investigation I found out that it's not reading the configuration file under app/config/anahklasen/rocketeer-slack/ but is reading the default one in the vender folder.

alisamii commented 10 years ago

Salut @Anahkiasen,

Peux-tu répondre a mon colleague @deemeetar car cette fonctionnalité est indispensable pour nous.

Merci,

Ali

Anahkiasen commented 10 years ago

The configuration needs to be at config/rocketeers/rocketerer-slack. Usually moving the folder is done by the plugin installer when you call artisan deploy:plugin-install anahkiasen/rocketeer-slack