App::environment is now 'local' not 'dev', consistent use of slack queue 'slack'

This commit is contained in:
Deon George 2022-09-04 10:52:55 +10:00
parent ff00e88417
commit 4c7d18c6b0
5 changed files with 10 additions and 5 deletions

View File

@ -399,7 +399,7 @@ final class API
$parameters['token'] = $this->_token->token;
$request = $this->prepareRequest(
$url,
$parameters
json_encode($parameters)
);
// If we are json, then we'll do an application/json post
@ -448,7 +448,7 @@ final class API
throw new SlackChannelNotFoundException('Channel Not Found',curl_getinfo($request,CURLINFO_HTTP_CODE));
case 'hash_conflict':
if (App::environment() == 'dev')
if (App::environment() == 'local')
file_put_contents('/tmp/hash_conflict.'.$method,print_r(json_decode(json_decode($parameters)->view),TRUE));
throw new SlackHashConflictException('Hash Conflict',curl_getinfo($request,CURLINFO_HTTP_CODE));

View File

@ -63,6 +63,11 @@ abstract class Base
return $o->exists ? $o : NULL;
}
/**
* Return the Eneterprise object that a Response is related to
*
* @return Enterprise
*/
final public function enterprise(): Enterprise
{
$class = class_exists(AppEnterprise::class) ? AppEnterprise::class : Enterprise::class;

View File

@ -170,7 +170,7 @@ final class Message extends BlockKit
Log::debug(sprintf('%s:Scheduling Delete of [%s:%s] on [%s]',static::LOGKEY,object_get($this->o,'channel_id',$this->o->id),$response->ts,$delete->format('Y-m-d')),['m'=>__METHOD__]);
// Queue the delete of the message if requested
dispatch((new DeleteChat($this->o,$response->ts))->onQueue('low')->delay($delete));
dispatch((new DeleteChat($this->o,$response->ts))->onQueue('slack')->delay($delete));
}
return $response;

View File

@ -34,7 +34,7 @@ class Factory {
Log::debug(sprintf('%s:Working out Interactive Options Event Class for [%s] as [%s]',static::LOGKEY,$type,$class),['m'=>__METHOD__]);
if (App::environment() == 'local')
file_put_contents('/tmp/option.'.$type,print_r(json_decode($request->input('payload')),TRUE));
file_put_contents('/tmp/option.'.$type,print_r($request,TRUE));
return new $class($request);
}

View File

@ -29,7 +29,7 @@ abstract class Base extends SlackBase implements \JsonSerializable
if (get_class($this) == Base::class) {
Log::debug(sprintf('%s:Slack RESPONSE Initialised [%s]',static::LOGKEY,get_class($this)),['m'=>__METHOD__]);
if (App::environment() == 'dev')
if (App::environment() == 'local')
file_put_contents('/tmp/response',print_r($this,TRUE),FILE_APPEND);
}
}