Page MenuHomeDevCentral

D157.diff
No OneTemporary

D157.diff

diff --git a/app/Analyzers/GitHubPayloadAnalyzer.php b/app/Analyzers/GitHubPayloadAnalyzer.php
--- a/app/Analyzers/GitHubPayloadAnalyzer.php
+++ b/app/Analyzers/GitHubPayloadAnalyzer.php
@@ -3,6 +3,7 @@
namespace Nasqueron\Notifications\Analyzers;
use Config;
+use Storage;
class GitHubPayloadAnalyzer {
///
@@ -63,7 +64,7 @@
$dir = Config::get('services.github.analyzer.configDir');
$filename = $dir . '/' . $this->project . '.json';
- if (!file_exists($filename)) {
+ if (!Storage::has($filename)) {
return $dir . '/' . static::CONFIG_DEFAULT_FILE;
}
@@ -74,7 +75,7 @@
$fileName = $this->getConfigurationFileName();
$mapper = new \JsonMapper();
$this->configuration = $mapper->map(
- json_decode(file_get_contents($fileName)),
+ json_decode(Storage::get($fileName)),
new GitHubPayloadAnalyzerConfiguration()
);
}
diff --git a/app/Analyzers/PhabricatorPayloadAnalyzer.php b/app/Analyzers/PhabricatorPayloadAnalyzer.php
--- a/app/Analyzers/PhabricatorPayloadAnalyzer.php
+++ b/app/Analyzers/PhabricatorPayloadAnalyzer.php
@@ -5,6 +5,7 @@
use Nasqueron\Notifications\Phabricator\PhabricatorStory;
use Config;
+use Storage;
class PhabricatorPayloadAnalyzer {
///
@@ -57,7 +58,7 @@
$dir = Config::get('services.phabricator.analyzer.configDir');
$filename = $dir . '/' . $this->project . '.json';
- if (!file_exists($filename)) {
+ if (!Storage::has($filename)) {
return $dir . '/' . static::CONFIG_DEFAULT_FILE;
}
@@ -69,7 +70,7 @@
$mapper = new \JsonMapper();
$this->configuration = $mapper->map(
- json_decode(file_get_contents($fileName)),
+ json_decode(Storage::get($fileName)),
new PhabricatorPayloadAnalyzerConfiguration()
);
}
diff --git a/app/Console/Commands/PhabricatorGetProjectsMap.php b/app/Console/Commands/PhabricatorGetProjectsMap.php
--- a/app/Console/Commands/PhabricatorGetProjectsMap.php
+++ b/app/Console/Commands/PhabricatorGetProjectsMap.php
@@ -3,6 +3,7 @@
namespace Nasqueron\Notifications\Console\Commands;
use Illuminate\Console\Command;
+use Storage;
use Nasqueron\Notifications\Phabricator\ProjectsMap;
@@ -56,7 +57,7 @@
*/
protected function getServicesCredentials () {
$path = config('services.gate.credentials');
- $data = json_decode(file_get_contents($path));
+ $data = json_decode(Storage::get($path));
return $data->services;
}
}
diff --git a/app/Http/Controllers/Gate/GateController.php b/app/Http/Controllers/Gate/GateController.php
--- a/app/Http/Controllers/Gate/GateController.php
+++ b/app/Http/Controllers/Gate/GateController.php
@@ -6,6 +6,7 @@
use Nasqueron\Notifications\Http\Controllers\Controller;
use Report;
+use Storage;
/**
* Represents a controller handling an entry-point for API payloads
@@ -80,7 +81,7 @@
*/
protected function getServicesCredentials () {
$path = config('services.gate.credentials');
- $data = json_decode(file_get_contents($path));
+ $data = json_decode(Storage::get($path));
return $data->services;
}
diff --git a/app/Phabricator/PhabricatorAPI.php b/app/Phabricator/PhabricatorAPI.php
--- a/app/Phabricator/PhabricatorAPI.php
+++ b/app/Phabricator/PhabricatorAPI.php
@@ -2,6 +2,8 @@
namespace Nasqueron\Notifications\Phabricator;
+use Storage;
+
class PhabricatorAPI {
///
@@ -67,7 +69,7 @@
private static function getServices () {
$path = config('services.gate.credentials');
- $data = json_decode(file_get_contents($path));
+ $data = json_decode(Storage::get($path));
return $data->services;
}
diff --git a/config/services.php b/config/services.php
--- a/config/services.php
+++ b/config/services.php
@@ -37,18 +37,18 @@
'github' => [
'analyzer' => [
- 'configDir' => storage_path(env('GITHUB_ANALYZER_CONFIG_DIR', 'app/GitHubPayloadAnalyzer'))
+ 'configDir' => env('GITHUB_ANALYZER_CONFIG_DIR', 'GitHubPayloadAnalyzer')
]
],
'phabricator' => [
'analyzer' => [
- 'configDir' => storage_path(env('PHABRICATOR_ANALYZER_CONFIG_DIR', 'app/PhabricatorPayloadAnalyzer'))
+ 'configDir' => env('PHABRICATOR_ANALYZER_CONFIG_DIR', 'PhabricatorPayloadAnalyzer')
]
],
'gate' => [
- 'credentials' => storage_path(env('CREDENTIALS', 'app/credentials.json')),
+ 'credentials' => env('CREDENTIALS', 'credentials.json'),
]
];

File Metadata

Mime Type
text/plain
Expires
Mon, Feb 3, 22:11 (18 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2393497
Default Alt Text
D157.diff (4 KB)

Event Timeline