/home/sharedstore/public_html/prestashop.sharedstore.ma/src/Adapter/Shop
Edit: /home/sharedstore/public_html/prestashop.sharedstore.ma/src/Adapter/Shop/ShopInformation.php (2193B)
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
namespace PrestaShop\PrestaShop\Adapter\Shop;
use PrestaShop\PrestaShop\Adapter\LegacyContext;
use PrestaShop\PrestaShop\Core\Version;
use Tools;
/**
* Retrieve common information from a the actual Shop.
*
* Depends on Context, avoid re-use of this class
*/
class ShopInformation
{
/**
* @var \Context
*/
private $context;
/**
* @param LegacyContext $legacyContext
*/
public function __construct(LegacyContext $legacyContext)
{
$this->context = $legacyContext->getContext();
}
/**
* @return array
*/
public function getShopInformation()
{
return [
'version' => Version::VERSION,
'url' => $this->context->shop->getBaseURL(),
'path' => _PS_ROOT_DIR_,
'theme' => $this->context->shop->theme->getName(),
];
}
/**
* @return array
*/
public function getOverridesList(): array
{
return array_filter(Tools::scandir(_PS_OVERRIDE_DIR_, 'php', '', true), function ($file) {
return basename($file) != 'index.php';
});
}
}