meanbee/libmageconf
最新稳定版本:1.0.0
Composer 安装命令:
composer require meanbee/libmageconf
包简介
Discover Magento environment and configuration information outside of an application installation.
关键字:
README 文档
README
This library provides a mechanism for discovering a Magento (1.x and 2.x supported) installation, given a starting directory. This is useful for building tools that integrate externally with Magento but still need access to its configuration or certain files, such as magedbm and mageconfigsync.
Installation
composer require meanbee/libmageconf
Usage
Given that I have Magento installed in /home/nrj/magento, I can discover its location with the following code:
$rootDiscovery = new RootDiscovery('/home/nrj');
// Outputs: "Root: /home/nrj/magento"
printf("Root: %s", $rootDiscovery->getRootDirectory());
Given that I know where the Magento installation's local.xml is, I can access the configuration held in that file with
the following code:
$configReader = ConfigReader\MagentoOne("path/to/local.xml");
$databaseName = $configReader->getDatabaseName();
or
$configReader = ConfigReader\MagentoTwo("path/to/env.php");
$databaseName = $configReader->getDatabaseName();
统计信息
- 总下载量: 4.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-07-05