Config.php
43 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package SureCartAppCore |
| 4 | * @author SureCart <support@surecart.com> |
| 5 | * @copyright SureCart |
| 6 | * @license https://www.gnu.org/licenses/gpl-2.0.html GPL-2.0 |
| 7 | * @link https://surecart.com |
| 8 | */ |
| 9 | |
| 10 | namespace SureCartAppCore\Config; |
| 11 | |
| 12 | use SureCartCore\Helpers\MixedType; |
| 13 | use SureCartAppCore\Concerns\ReadsJsonTrait; |
| 14 | |
| 15 | class Config { |
| 16 | use ReadsJsonTrait { |
| 17 | load as traitLoad; |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * App root path. |
| 22 | * |
| 23 | * @var string |
| 24 | */ |
| 25 | protected $path = ''; |
| 26 | |
| 27 | /** |
| 28 | * Constructor. |
| 29 | * |
| 30 | * @param string $path |
| 31 | */ |
| 32 | public function __construct( $path ) { |
| 33 | $this->path = $path; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * {@inheritDoc} |
| 38 | */ |
| 39 | protected function getJsonPath() { |
| 40 | return MixedType::normalizePath( $this->path . DIRECTORY_SEPARATOR . 'config.json' ); |
| 41 | } |
| 42 | } |
| 43 |