rocketeer-slack icon indicating copy to clipboard operation
rocketeer-slack copied to clipboard

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

Open arenowebdev opened this issue 10 years ago • 13 comments

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...
    }

arenowebdev avatar Aug 23 '14 06:08 arenowebdev

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

Anahkiasen avatar Aug 23 '14 11:08 Anahkiasen

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...

arenowebdev avatar Aug 23 '14 20:08 arenowebdev

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.

Anahkiasen avatar Aug 23 '14 20:08 Anahkiasen

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.

arenowebdev avatar Aug 23 '14 20:08 arenowebdev

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.

Anahkiasen avatar Aug 23 '14 20:08 Anahkiasen

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

arenowebdev avatar Aug 23 '14 21:08 arenowebdev

Hm weird let me check

Anahkiasen avatar Aug 23 '14 21:08 Anahkiasen

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

Anahkiasen avatar Aug 23 '14 21:08 Anahkiasen

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

arenowebdev avatar Aug 23 '14 21:08 arenowebdev

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

Anahkiasen avatar Aug 23 '14 21:08 Anahkiasen

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.

spiroski avatar Sep 03 '14 17:09 spiroski

Salut @Anahkiasen,

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

Merci,

Ali

alisamii avatar Sep 04 '14 14:09 alisamii

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

Anahkiasen avatar Sep 05 '14 13:09 Anahkiasen