phptek / silverstripe-sentry

Flexible Sentry compatible bug aggregation client for Silverstripe applications.
BSD 3-Clause "New" or "Revised" License
12 stars 22 forks source link

Feature request: ability to init sentry via envs #35

Closed phyzical closed 4 years ago

phyzical commented 4 years ago

Currently i use a botched setup to inst sentry envs Config::inst()->set("PhpTek\Sentry\Adaptor\SentryClientAdaptor", "opts", array ("dsn" => "https://$sentryDSN@xxx.com.au/$projectID"));

prefer the ability to have silverstripe-sentry check for envs in the current environment if possible for the system to rely on

phyzical commented 4 years ago

proposed

  protected function getOpts(string $opt = '')
    {
        $dsn = Environment::getEnv('SENTRY_DSN');
        if ($dsn)
        {
            Config::inst()->set(get_called_class(), 'opts', ['dsn' => $dsn]);
        }
phyzical commented 4 years ago

Confirmed as working, will make a pr later today (if you dont beat me to it) @phptek

phptek commented 4 years ago

Implemented in 3.0.0-beta5 - have a quiz and let me know if you have any problems. Apart from failing tests (which I'll get to) I'm pretty happy this can be stabilized at 3.0.0

phyzical commented 4 years ago

3.0.0-beta5 using SENTRY_DSN works well thanks!

phptek commented 4 years ago

FYI You can now use 3.0.1 :-)

phyzical commented 4 years ago

Perfecto 3.0.1 runs like a dream via envs thanks again!

phptek commented 4 years ago

No, thank you :-)