Skip to content

Commit

Permalink
Config settins
Browse files Browse the repository at this point in the history
  • Loading branch information
Isigar committed Sep 28, 2018
1 parent 260d300 commit c32071d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions di/UploaderExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class UploaderExtension extends CompilerExtension
'wwwDir' => null,
'request' => null,
'linkGenerator' => null,
'sizeConfig' => __DIR__."/size.neon",
'saveConfig' => __DIR__."/save.neon",
'formatConfig' => __DIR__."/format.neon",
'storage' => EntityManager::class
];

Expand Down Expand Up @@ -91,7 +94,7 @@ private function getDefaultClassicOptions()
private function getFormatConfig()
{
try {
$file = FileSystem::read(__DIR__ . "/format.neon");
$file = FileSystem::read($this->config["formatConfig"]);
$neonFormat = Neon::decode($file);
return ArrayHash::from($neonFormat);
} catch (\Exception $e) {
Expand All @@ -102,7 +105,7 @@ private function getFormatConfig()
private function getSizeConfig()
{
try {
$file = FileSystem::read(__DIR__ . "/size.neon");
$file = FileSystem::read($this->config["sizeConfig"]);
$neonFormat = Neon::decode($file);
return ArrayHash::from($neonFormat);
} catch (\Exception $e) {
Expand All @@ -113,7 +116,7 @@ private function getSizeConfig()
private function getSaveConfig()
{
try {
$file = FileSystem::read(__DIR__ . "/save.neon");
$file = FileSystem::read($this->config["saveConfig"]);
$neonFormat = Neon::decode($file);
return ArrayHash::from($neonFormat);
} catch (\Exception $e) {
Expand Down

0 comments on commit c32071d

Please sign in to comment.