-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configurable default options of import types (#57)
* Configure default options of import types through application config * configurable date format of archived files and directory permissions * sources made optional with default classes * updated readme * fixed bool casting * changed permissions to recommended by adobe
- Loading branch information
Showing
5 changed files
with
93 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Jh\Import\Config; | ||
|
||
use Magento\Framework\App\Config\ScopeConfigInterface; | ||
|
||
class AppConfigProvider | ||
{ | ||
private const CONFIG_PATH_PREFIX = 'jh_import/default'; | ||
|
||
protected ScopeConfigInterface $scopeConfig; | ||
|
||
public function __construct(ScopeConfigInterface $scopeConfig) | ||
{ | ||
$this->scopeConfig = $scopeConfig; | ||
} | ||
|
||
public function getImportTypeOptionDefaultValue(string $importType, string $option) | ||
{ | ||
$value = $this->scopeConfig->getValue( | ||
sprintf('%s/%s/%s', self::CONFIG_PATH_PREFIX, $importType, $option), | ||
ScopeConfigInterface::SCOPE_TYPE_DEFAULT, | ||
null | ||
); | ||
|
||
return $value ?: null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters